|
|
@@ -338,6 +338,11 @@ export default {
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
+ // 只用支付时间;无支付时间不能售后
|
|
|
+ if (!this.hasValidPayTime()) {
|
|
|
+ uni.showToast({ title: '订单无支付时间,不能售后', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
this._pendingRefundParams = {
|
|
|
id:this.option.id,
|
|
|
product:JSON.stringify(product),
|
|
|
@@ -374,12 +379,20 @@ export default {
|
|
|
that.submitRefund(that._pendingRefundParams)
|
|
|
})
|
|
|
},
|
|
|
+ /** 是否有有效支付时间(与后端 hasValidPayTime 一致) */
|
|
|
+ hasValidPayTime() {
|
|
|
+ const payTime = (this.orderInfo && this.orderInfo.payTime) || ''
|
|
|
+ return !!payTime && payTime !== '0000-00-00 00:00:00'
|
|
|
+ },
|
|
|
/**
|
|
|
* 本地判断是否必须隔天售后:非当天支付 / 已结账单 / 挂账已结清
|
|
|
- * 与后端 NextDayRefundService::mustUseNextDay 对齐,预检接口失败时仍能拦住
|
|
|
+ * 仅用 payTime;无支付时间由 hasValidPayTime 先行拦截
|
|
|
*/
|
|
|
isMustNextDayOrder() {
|
|
|
const info = this.orderInfo || {}
|
|
|
+ if (!this.hasValidPayTime()) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
if (Number(info.clearId) > 0) {
|
|
|
return true
|
|
|
}
|
|
|
@@ -388,11 +401,7 @@ export default {
|
|
|
if (debtPrice > 0 && remainDebt === 0) {
|
|
|
return true
|
|
|
}
|
|
|
- const payTime = info.payTime || info.addTime || ''
|
|
|
- if (!payTime || payTime === '0000-00-00 00:00:00') {
|
|
|
- return false
|
|
|
- }
|
|
|
- const payDay = String(payTime).substr(0, 10)
|
|
|
+ const payDay = String(info.payTime).substr(0, 10)
|
|
|
const now = new Date()
|
|
|
const m = now.getMonth() + 1
|
|
|
const d = now.getDate()
|