Compare commits
2 Commits
c280d65a7a
...
1ff0ee1ed0
Author | SHA1 | Date | |
---|---|---|---|
1ff0ee1ed0 | |||
c8018ceb97 |
4
App.vue
4
App.vue
@ -58,6 +58,10 @@
|
||||
.pr{
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.pa{
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.fc {
|
||||
text-align: center;
|
||||
|
@ -12,7 +12,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex1 flex column md">
|
||||
<view class="fz28 fb fcm l-h-18">{{order.shipment_status}}</view>
|
||||
<view class="fz28 fb fcm l-h-18">{{ orderStatusDisplay }}</view>
|
||||
<view class="priceBox fz36 fb">
|
||||
¥{{Number(order.transport_price) + Number(order.pack_price) + Number(order.total_price) | formatPrice}}
|
||||
</view>
|
||||
@ -20,12 +20,18 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-t-24 flex mr">
|
||||
<view class="numberBut bg-m fci rad8 fz28 fb flex mac mc" :key="foodSn">
|
||||
<view v-if="showPayButton" class="nullBut bg-m fci rad8 fz28 flex mac mc m-l-24">
|
||||
立即支付
|
||||
</view>
|
||||
<view v-if="showPickupNumber" class="numberBut bg-m fci rad8 fz28 fb flex mac mc m-l-24">
|
||||
{{ foodSn }}
|
||||
</view>
|
||||
<view class="nullBut border fcb rad8 fz28 flex mac mc m-l-24" style="">
|
||||
<view v-if="showAfterSaleButton" class="nullBut border fcb rad8 fz28 flex mac mc m-l-24">
|
||||
申请售后
|
||||
</view>
|
||||
<view v-if="showRefundDetailsButton" class="nullBut border fcb rad8 fz28 flex mac mc m-l-24">
|
||||
退款详情
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -43,7 +49,7 @@
|
||||
intervalId: null, // 存储定时器ID,用于清除定时器
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
created() {
|
||||
this.intervalId = setInterval(() => {
|
||||
this.foodSn = this.foodSn === '取餐号' ? this.order.food_sn : '取餐号'
|
||||
}, 1200)
|
||||
@ -52,6 +58,60 @@
|
||||
// 清除定时器,避免内存泄漏
|
||||
clearInterval(this.intervalId);
|
||||
},
|
||||
computed: {
|
||||
// 计算属性:是否显示 "立即支付" 按钮
|
||||
showPayButton() {
|
||||
return this.order.main_status === '未付款';
|
||||
},
|
||||
// 计算属性:是否显示 "取餐号"
|
||||
showPickupNumber() {
|
||||
return this.order.main_status === '已付款' && this.order.refund_status === '未申请';
|
||||
},
|
||||
// 计算属性:是否显示 "申请售后" 按钮
|
||||
showAfterSaleButton() {
|
||||
return this.order.main_status === '已付款' && this.order.refund_status === '未申请';
|
||||
},
|
||||
// 计算属性:是否显示 "退款详情" 按钮
|
||||
showRefundDetailsButton() {
|
||||
return this.order.refund_status !== '未申请' && this.order.main_status !== '已完成';
|
||||
},
|
||||
// 计算属性:显示订单状态
|
||||
orderStatusDisplay() {
|
||||
if (this.order.main_status === '未付款') {
|
||||
return '待支付';
|
||||
}
|
||||
if (this.order.main_status === '已付款' && this.order.refund_status === '未申请') {
|
||||
return this.order.shipment_status;
|
||||
}
|
||||
switch (this.order.refund_status) {
|
||||
case '申请中':
|
||||
return '申请中';
|
||||
case '已同意':
|
||||
return '商家同意退款';
|
||||
case '主动退':
|
||||
return '商家退单';
|
||||
case '拒绝退':
|
||||
return '商家拒绝退款';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
},
|
||||
// 计算属性:显示退款状态
|
||||
refundStatusDisplay() {
|
||||
switch (this.order.refund_status) {
|
||||
case '申请中':
|
||||
return '申请中';
|
||||
case '已同意':
|
||||
return '商家同意退款';
|
||||
case '主动退':
|
||||
return '商家退单';
|
||||
case '拒绝退':
|
||||
return '商家拒绝退款';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
},
|
||||
},
|
||||
props: {
|
||||
order: {
|
||||
type: Object,
|
||||
|
@ -47,8 +47,7 @@
|
||||
|
||||
<script>
|
||||
import {
|
||||
checkUserInfo,
|
||||
wxLogin
|
||||
checkUserInfo
|
||||
} from '@/utils/index.js'
|
||||
|
||||
export default {
|
||||
@ -69,7 +68,7 @@
|
||||
return this.$store.state.orderList.filter(item => item.main_status === '已付款')
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
created() {
|
||||
//检查token 没有则进行无感登录
|
||||
this.checkUserInfo()
|
||||
// 当页面显示时,设置tabber的激活项
|
||||
@ -77,9 +76,7 @@
|
||||
},
|
||||
methods: {
|
||||
// 检查用户信息
|
||||
checkUserInfo() {
|
||||
return checkUserInfo(this.$store)
|
||||
}
|
||||
checkUserInfo,
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -71,12 +71,13 @@
|
||||
orderList_unpaid() {
|
||||
return this.$store.state.orderList.filter(item => item.main_status === '未付款')
|
||||
},
|
||||
//已付款 并且没有申请退款的订单
|
||||
//已付款 已完成 并且没有申请退款的订单
|
||||
orderList_paid() {
|
||||
return this.$store.state.orderList.filter(item => item.main_status === '已付款' && item.refund_status ===
|
||||
'未申请')
|
||||
return this.$store.state.orderList.filter(item => {
|
||||
return item.main_status === '已付款' && item.refund_status === '未申请';
|
||||
})
|
||||
},
|
||||
//申请中 已同意 主动退 等退款的订单
|
||||
//申请中 已同意 主动退 拒绝退 等退款相关的订单
|
||||
orderList_refund() {
|
||||
return this.$store.state.orderList.filter(item => item.refund_status !== '未申请')
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user