完善订单管理,新增物流查询,删除,取消,支付等

This commit is contained in:
唐明明
2022-01-13 15:00:02 +08:00
parent 1968ae15bb
commit f4229dbe22
11 changed files with 340 additions and 6 deletions

View File

@@ -54,6 +54,14 @@
page : 1
};
},
onShow() {
if(this.$store.getters.getRefresh == 1) {
this.$store.commit('setRefresh', 0)
this.array = []
this.page = 1
this.getOrder()
}
},
mounted() {
this.getOrder()
},
@@ -87,8 +95,65 @@
this.getOrder()
},
onType(e){
console.log(e)
console.log(e.type)
let orderNo = e.order.no
let onFount
switch (e.type){
case 'delete':
onFount = del(orderNo)
break;
case 'cancel':
onFount = cancel(orderNo)
break;
case 'logistic':
this.$Router.push({
name: 'OrderLogistics',
params: {
orderNo
},
})
break;
case 'pay':
this.$Router.push({
name: 'Pay',
params: {
orderNo : orderNo,
price : e.order.price,
oepnType: 'order'
}
})
break;
case 'sign':
onFount = sign(orderNo)
break;
}
if(!onFount) return
onFount.then(res =>{
let orderIndex = this.array.findIndex(val => val.no === e.order.no)
if(e.type === 'delete' || e.type === 'sign'){
this.array.splice(orderIndex, 1)
return
}
if(e.type === 'cancel'){
this.array.splice(orderIndex, 1, {
no : res.order_no,
cover : res.items[0].sku.cover,
name : res.items[0].sku.goods_name,
price : res.items[0].price,
sum : res.items[0].qty,
stateText : res.state,
cans : res.can
})
return
}
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
},
onReachBottom() {

38
pages/order/logistics.vue Normal file
View File

@@ -0,0 +1,38 @@
<template>
<view>
<oct-logistics
:info="info"
:logs="logs"
/>
</view>
</template>
<script>
import { logistic } from '@/apis/interfaces/order'
export default {
data() {
return {
info: {},
logs: []
};
},
mounted() {
logistic(this.$Route.query.orderNo).then(res =>{
console.log(res)
this.info = {
logo : res.orderExpress.logistic_cover,
no : res.orderExpress.express_no,
company : res.orderExpress.logistic_name
}
this.logs = res.logistics
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
};
</script>
<style></style>

View File

@@ -69,12 +69,16 @@
orderInfo,
success: payRes => {
console.log(payRes)
uni.showModal({
title: '支付成功',
content: '订单已支付,我们将尽快为您安排发货,可在订单管理查询订单动态',
showCancel:false,
success:onRes => {
if(onRes.confirm){
if(this.$Route.query.oepnType === 'order'){
this.$store.commit('setRefresh', 1)
}
this.$Router.back()
}
}