'优化取消订单的bug'

This commit is contained in:
wtq
2026-02-28 09:39:47 +08:00
parent 7e09df72c1
commit 1fad8d3f81
4 changed files with 30 additions and 20 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -104,6 +104,7 @@ export default {
})
// 取消完订单后通知父组件刷新页面
this.$emit('refreshPage')
if(this.timer) clearInterval(this.timer)
}
return '已超时'
} else {

View File

@@ -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] // 来自哪里的信息