'优化取消订单的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) // console.error('BuyerCancelOrder', e)
// throw e // throw e
// } // }
if(store.getters['indexPage/isMaterial']){ // if(store.getters['indexPage/isMaterial']){
logInfo({ // logInfo({
rootUrl:'https://wx.jxc4.com/', // rootUrl:'https://wx.jxc4.com/',
url: 'v2/order/CancelOrder', // url: 'v2/order/CancelOrder',
params: json, // params: json,
// time: endTime - startTime, // // time: endTime - startTime,
token:uni.getStorageSync('token') ? uni.getStorageSync('token') : '', // token:uni.getStorageSync('token') ? uni.getStorageSync('token') : '',
// data: JSON.stringify(json) // // data: JSON.stringify(json)
data: order ? JSON.stringify(order) : '', // data: order ? JSON.stringify(order) : '',
status:'被阻止调用了' // status:'被阻止调用了'
}) // })
return // return
} // }
try { try {
let res = await api('v2/order/CancelOrder', { // 取消前先查看订单的状态
method: 'PUT', let res = await api('v2/jxorder/GetMyOrders', {data: {vendorOrderID:json.vendorOrderID}})
data: json if(res.data.length === 1 && res.data[0].vendorOrderID === json.vendorOrderID){
}) // console.log('取消前先查看订单的状态',res.data[0].status)
return res if(res.data[0].status === 2){
let res = await api('v2/order/CancelOrder', {
method: 'PUT',
data: json
})
return res
}
}
} catch (e) { } catch (e) {
console.error('buyerCancelOrder', e) console.error('buyerCancelOrder', e)
throw (e) throw (e)

View File

@@ -179,6 +179,7 @@ export default {
async refreshPage() { async refreshPage() {
try { try {
this.showLoad() this.showLoad()
this.orderList = []
// 请求订单数量 // 请求订单数量
await this.handleGetOrderCount() await this.handleGetOrderCount()
// 请求订单 // 请求订单
@@ -291,7 +292,7 @@ export default {
payInfo.prepayID, payInfo.prepayID,
JSON.parse(payInfo.codeURL), JSON.parse(payInfo.codeURL),
payInfo, payInfo,
{merCupNo:this.storeLklMerchant.merchantNo2 || ""} {merCupNo:this.storeLklMerchant ? this.storeLklMerchant.merchantNo2 || "" : ''}
) )
// #endif // #endif

View File

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

View File

@@ -70,7 +70,7 @@ export default {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// 存储来自哪的信息 // 存储来自哪的信息
if (res && res.stores.length !== 0) { if (res && res.stores && res.stores.length !== 0) {
let obj = { let obj = {
...state.materialInfo, ...state.materialInfo,
fromStoreInfo: res.stores[0] // 来自哪里的信息 fromStoreInfo: res.stores[0] // 来自哪里的信息