合并代码

This commit is contained in:
sx 2025-01-23 22:26:04 +08:00
parent 9b9b2a568d
commit 9fbf092756
2 changed files with 80 additions and 31 deletions

View File

@ -5,6 +5,7 @@
reactive, reactive,
getCurrentInstance, getCurrentInstance,
defineExpose, defineExpose,
onMounted
} from 'vue' } from 'vue'
// //
import util from '@/common/js/util'; import util from '@/common/js/util';
@ -20,6 +21,15 @@
// //
trackingNumber: '', trackingNumber: '',
}) })
//
const expressList = reactive([])
//
const expressIndex = ref('')
onMounted(() => {
//
getExpressList()
})
// //
function getExpressList() { function getExpressList() {
@ -27,6 +37,7 @@
path: ['express_company'], path: ['express_company'],
}).then(rs => { }).then(rs => {
if (rs.code == 200) { if (rs.code == 200) {
Object.assign(expressList, rs.data)
return return
} }
util.alert({ util.alert({
@ -36,6 +47,18 @@
}) })
} }
/**
* 选择物流公司
* @param {Object} ev
*/
function handleExpressIndex(ev) {
console.log('ev', ev)
const index = ev.detail.value
if(expressIndex.value === index) return
expressIndex.index = index
form.expressName = expressList[index].dictLabel
}
// //
function open() { function open() {
proxy.$refs.express.open() proxy.$refs.express.open()
@ -44,6 +67,12 @@
// //
function close() { function close() {
proxy.$refs.express.close() proxy.$refs.express.close()
//
setTimeout(() => {
form.expressName = ''
form.trackingNumber = ''
})
} }
defineExpose({ defineExpose({
@ -54,23 +83,29 @@
<template> <template>
<uni-popup ref="express" type="center"> <uni-popup ref="express" type="center">
<view class="expressAlt"> <view class="expressAlt popMid bfff">
<view class="header rows"> <view class="header rows ptb20 plr20">
<view>填写快递单号</view> <view>填写快递单号</view>
<uni-icons type="closeempty" /> <uni-icons type="closeempty" @click="close" />
</view> </view>
<view class="form"> <view class="form ooh mtb30 plr30 c333 f30">
<view class="line df aic"> <view class="line mtb30">
<view class="">快递公司</view> <picker :range="expressList" range-key="dictLabel" @change="handleExpressIndex">
<input type="text" placeholder="输入快递公司" /> <view class="rows">
<view class="mr20">快递公司</view>
<input type="text" placeholder="输入快递公司" />
</view>
</picker>
</view> </view>
<view class="line df aic"> <view class="line df aic">
<view class="">快递单号</view> <view class="mr20">快递单号</view>
<input type="text" placeholder="输入快递公司" /> <input type="text" placeholder="输入快递公司" />
</view> </view>
</view> </view>
<view class="btn warm mtb30 mlr30">保存</view>
</view> </view>
</uni-popup> </uni-popup>
</template> </template>

View File

@ -71,6 +71,8 @@
}) })
// //
const apexBgColor = ref('#ffffff00') const apexBgColor = ref('#ffffff00')
//
const orderDetail = reactive({})
onLoad((options) => { onLoad((options) => {
// this.params.currentTab = options.currentTab / 1 // this.params.currentTab = options.currentTab / 1
@ -216,9 +218,16 @@
refreshList() refreshList()
}) })
} }
// 退
function handleExpress(item) {
Object.assign(orderDetail, {}, item)
proxy.$refs.expressRef.open()
}
</script> </script>
<template> <template>
<!-- 顶部导航栏 -->
<apex :bgColor="apexBgColor" mode="flex"> <apex :bgColor="apexBgColor" mode="flex">
<template #content> <template #content>
<view class="search rows f1 mr30 plr20 bf8f8f8 br10"> <view class="search rows f1 mr30 plr20 bf8f8f8 br10">
@ -228,30 +237,33 @@
</template> </template>
</apex> </apex>
<!-- 页面框架 -->
<view class="app"> <view class="app">
<view class="shopHeaderBg bgColor"></view> <view class="shopHeaderBg bgColor"></view>
<!-- tab选项卡 -->
<view class="f1 pr"> <view class="f1 pr">
<JyShopNavigation :list="tabs" @tabItemClick="itemClick" /> <JyShopNavigation :list="tabs" @tabItemClick="itemClick" />
</view> </view>
<view class="product mlr20 pr"> <!-- 订单列表 -->
<!-- 订单列表 --> <view class="order mlr20 pr">
<view class="order"> <template v-for="(item,index) in list.data" :key="index">
<template v-for="(item,index) in list.data" :key="index"> <view class="mtb30">
<view class="mtb30"> <orderItem :item="item" mode="mine" @item="handleItem">
<orderItem :item="item" mode="mine" @item="handleItem"> <!-- 操作按钮 -->
<!-- 操作按钮 --> <template #menu="scope">
<template #menu="scope"> <view class="menu ptb20 df jcr" v-if="[0,1,4,5,6].includes(scope.item.status)">
<view class="menu ptb20 df jcr" v-if="[0,1,4,5,6].includes(scope.item.status)"> <template v-if="scope.item.refundStatus == 1">
<template v-if="scope.item.refundStatus == 1"> <view class="btn bar warmHollow plr30" @click.stop="handleExpress(scope.item)">
<view class="btn bar warmHollow plr30" @click.stop="handleCancel(scope.item)"> 填写退货物流信息</view>
填写退货物流信息</view> </template>
</template> <template v-else>
<template v-else-if="scope.item.status == 0"> <template v-if="scope.item.status == 0">
<view class="btn bar closeHollow plr30" @click.stop="handleCancel(scope.item)"> <view class="btn bar closeHollow plr30" @click.stop="handleCancel(scope.item)">
取消订单</view> 取消订单</view>
<view class="btn bar warmHollow plr30" @click.stop="order.orderPay(item)">继续付款 <view class="btn bar warmHollow plr30" @click.stop="order.orderPay(item)">
继续付款
</view> </view>
</template> </template>
<template v-else-if="scope.item.status == 1"> <template v-else-if="scope.item.status == 1">
@ -262,9 +274,11 @@
<template v-else-if="scope.item.status == 4"> <template v-else-if="scope.item.status == 4">
<view class="btn bar closeHollow plr30" <view class="btn bar closeHollow plr30"
@click.stop="order.orderAfterSales(item)">申请退款</view> @click.stop="order.orderAfterSales(item)">申请退款</view>
<view class="btn bar closeHollow plr30" @click.stop="order.logistics(item)">查看物流 <view class="btn bar closeHollow plr30" @click.stop="order.logistics(item)">
查看物流
</view> </view>
<view class="btn bar warmHollow plr30" @click.stop="handleReceived(item)">确认收货 <view class="btn bar warmHollow plr30" @click.stop="handleReceived(item)">
确认收货
</view> </view>
</template> </template>
<template v-else-if="scope.item.status == 5"> <template v-else-if="scope.item.status == 5">
@ -277,12 +291,12 @@
<view class="btn bar closeHollow plr30">钱款去向</view> <view class="btn bar closeHollow plr30">钱款去向</view>
<view class="btn bar warmHollow plr30">平台介入</view> <view class="btn bar warmHollow plr30">平台介入</view>
</template> </template>
</view> </template>
</template> </view>
</orderItem> </template>
</view> </orderItem>
</template> </view>
</view> </template>
</view> </view>
</view> </view>