|
|
|
@ -62,11 +62,11 @@ |
|
|
|
查看订单 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="btn" :class="{'btn-disabled': submitLoading}" @tap="returnAmountAllow(item,0)" style="background: rgba(0, 35, 28, 1);color: rgba(166, 255, 234, 1);"> |
|
|
|
{{submitLoading ? '处理中' : '不同意'}} |
|
|
|
<view class="btn" :class="{'btn-disabled': isSubmittingRefund(item)}" @tap="returnAmountAllow(item,0)" style="background: rgba(0, 35, 28, 1);color: rgba(166, 255, 234, 1);"> |
|
|
|
{{isSubmittingRefund(item) ? '处理中' : '不同意'}} |
|
|
|
</view> |
|
|
|
<view class="btn" :class="{'btn-disabled': submitLoading}" @tap="returnAmountAllow(item,1)" style="margin-left: 10px;"> |
|
|
|
{{submitLoading ? '处理中' : '同意'}} |
|
|
|
<view class="btn" :class="{'btn-disabled': isSubmittingRefund(item)}" @tap="returnAmountAllow(item,1)" style="margin-left: 10px;"> |
|
|
|
{{isSubmittingRefund(item) ? '处理中' : '同意'}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -213,6 +213,7 @@ |
|
|
|
returnData:[], |
|
|
|
returnCount:0, |
|
|
|
submitLoading:false, |
|
|
|
submitRefundId:'', |
|
|
|
contactItem:{} |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -315,6 +316,26 @@ |
|
|
|
} |
|
|
|
return String(pictures).split(',').map(item => item.trim()).filter(item => item !== ''); |
|
|
|
}, |
|
|
|
isSubmittingRefund(item) { |
|
|
|
return this.submitLoading && item && this.submitRefundId === item.id; |
|
|
|
}, |
|
|
|
getRequestErrorMessage(error) { |
|
|
|
if (typeof error === 'string' && error !== '') { |
|
|
|
return error; |
|
|
|
} |
|
|
|
if (error && error.message) { |
|
|
|
return error.message; |
|
|
|
} |
|
|
|
if (error && error.errMsg) { |
|
|
|
return error.errMsg; |
|
|
|
} |
|
|
|
return '操作失败,请稍后再试'; |
|
|
|
}, |
|
|
|
resetSubmitState() { |
|
|
|
this.submitLoading = false; |
|
|
|
this.submitRefundId = ''; |
|
|
|
uni.hideLoading(); |
|
|
|
}, |
|
|
|
previewRefundImage(pictures, index) { |
|
|
|
const urls = this.getPictureList(pictures); |
|
|
|
if (urls.length === 0) return; |
|
|
|
@ -346,6 +367,7 @@ |
|
|
|
success: (res) => { |
|
|
|
if (res.confirm) { |
|
|
|
this.submitLoading = true; |
|
|
|
this.submitRefundId = item.id; |
|
|
|
uni.showLoading({ |
|
|
|
title: '处理中', |
|
|
|
mask: true |
|
|
|
@ -359,13 +381,17 @@ |
|
|
|
requestList.push(this.processReturn(item, status)); |
|
|
|
} |
|
|
|
Promise.all(requestList).then((messageList) => { |
|
|
|
this.tui.toast(messageList[0] || '操作成功'); |
|
|
|
return this.getReturnCount(); |
|
|
|
const successMessage = messageList[0] || '操作成功'; |
|
|
|
return this.getReturnCount().then(() => { |
|
|
|
this.resetSubmitState(); |
|
|
|
this.tui.toast(successMessage, 2000, true); |
|
|
|
}).catch(() => { |
|
|
|
this.resetSubmitState(); |
|
|
|
this.tui.toast(successMessage, 2000, true); |
|
|
|
}); |
|
|
|
}).catch((message) => { |
|
|
|
this.tui.toast(message || '操作失败'); |
|
|
|
}).then(() => { |
|
|
|
this.submitLoading = false; |
|
|
|
uni.hideLoading(); |
|
|
|
this.resetSubmitState(); |
|
|
|
this.tui.toast(this.getRequestErrorMessage(message), 2000); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -402,10 +428,10 @@ |
|
|
|
if (res.code == 200) { |
|
|
|
return res.message; |
|
|
|
} else { |
|
|
|
return Promise.reject(res.message); |
|
|
|
return Promise.reject(res && res.message ? res.message : '操作失败,请稍后再试'); |
|
|
|
} |
|
|
|
}).catch((res) => { |
|
|
|
return Promise.reject(res && res.message ? res.message : res); |
|
|
|
return Promise.reject(this.getRequestErrorMessage(res)); |
|
|
|
}); |
|
|
|
}, |
|
|
|
back() { |
|
|
|
|