'优化取消订单的bug'
This commit is contained in:
@@ -351,25 +351,33 @@ export default {
|
||||
// console.error('BuyerCancelOrder', e)
|
||||
// throw e
|
||||
// }
|
||||
if(store.getters['indexPage/isMaterial']){
|
||||
logInfo({
|
||||
rootUrl:'https://wx.jxc4.com/',
|
||||
url: 'v2/order/CancelOrder',
|
||||
params: json,
|
||||
// time: endTime - startTime,
|
||||
token:uni.getStorageSync('token') ? uni.getStorageSync('token') : '',
|
||||
// data: JSON.stringify(json)
|
||||
data: order ? JSON.stringify(order) : '',
|
||||
status:'被阻止调用了'
|
||||
})
|
||||
return
|
||||
}
|
||||
// if(store.getters['indexPage/isMaterial']){
|
||||
// logInfo({
|
||||
// rootUrl:'https://wx.jxc4.com/',
|
||||
// url: 'v2/order/CancelOrder',
|
||||
// params: json,
|
||||
// // time: endTime - startTime,
|
||||
// token:uni.getStorageSync('token') ? uni.getStorageSync('token') : '',
|
||||
// // data: JSON.stringify(json)
|
||||
// data: order ? JSON.stringify(order) : '',
|
||||
// status:'被阻止调用了'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
try {
|
||||
let res = await api('v2/order/CancelOrder', {
|
||||
method: 'PUT',
|
||||
data: json
|
||||
})
|
||||
return res
|
||||
// 取消前先查看订单的状态
|
||||
let res = await api('v2/jxorder/GetMyOrders', {data: {vendorOrderID:json.vendorOrderID}})
|
||||
if(res.data.length === 1 && res.data[0].vendorOrderID === json.vendorOrderID){
|
||||
// console.log('取消前先查看订单的状态',res.data[0].status)
|
||||
if(res.data[0].status === 2){
|
||||
let res = await api('v2/order/CancelOrder', {
|
||||
method: 'PUT',
|
||||
data: json
|
||||
})
|
||||
return res
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('buyerCancelOrder', e)
|
||||
throw (e)
|
||||
|
||||
@@ -179,6 +179,7 @@ export default {
|
||||
async refreshPage() {
|
||||
try {
|
||||
this.showLoad()
|
||||
this.orderList = []
|
||||
// 请求订单数量
|
||||
await this.handleGetOrderCount()
|
||||
// 请求订单
|
||||
@@ -291,7 +292,7 @@ export default {
|
||||
payInfo.prepayID,
|
||||
JSON.parse(payInfo.codeURL),
|
||||
payInfo,
|
||||
{merCupNo:this.storeLklMerchant.merchantNo2 || ""}
|
||||
{merCupNo:this.storeLklMerchant ? this.storeLklMerchant.merchantNo2 || "" : ''}
|
||||
)
|
||||
// #endif
|
||||
|
||||
|
||||
@@ -104,6 +104,7 @@ export default {
|
||||
})
|
||||
// 取消完订单后通知父组件刷新页面
|
||||
this.$emit('refreshPage')
|
||||
if(this.timer) clearInterval(this.timer)
|
||||
}
|
||||
return '已超时'
|
||||
} else {
|
||||
|
||||
@@ -70,7 +70,7 @@ export default {
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
// 存储来自哪的信息
|
||||
if (res && res.stores.length !== 0) {
|
||||
if (res && res.stores && res.stores.length !== 0) {
|
||||
let obj = {
|
||||
...state.materialInfo,
|
||||
fromStoreInfo: res.stores[0] // 来自哪里的信息
|
||||
|
||||
Reference in New Issue
Block a user