|
|
@@ -21,7 +21,9 @@ export default function Index() { |
|
|
|
discountInfo: [] //优惠信息 |
|
|
|
}); |
|
|
|
|
|
|
|
const [orderStatus, setOrderStatus] = useState(true); |
|
|
|
const [orderStatus, setOrderStatus] = useState({ |
|
|
|
isTrue: true |
|
|
|
}); |
|
|
|
|
|
|
|
const onQueryOrderDetail = async () => { |
|
|
|
if (orderNumber) { |
|
|
@@ -36,22 +38,35 @@ export default function Index() { |
|
|
|
} |
|
|
|
|
|
|
|
const orderIsNormal = (order) => { |
|
|
|
let isNormal = true; |
|
|
|
if (!(order.payMoneyEx === '正常' && |
|
|
|
order.payOrderTimeEx === '正常' && |
|
|
|
order.payOrderEx === '正常') |
|
|
|
) { |
|
|
|
isNormal = false; |
|
|
|
let isNormal = { |
|
|
|
isTrue: true, |
|
|
|
msg: '正常订单' |
|
|
|
}; |
|
|
|
if (!(order.payMoneyEx === '正常')) { |
|
|
|
isNormal.isTrue = false; |
|
|
|
isNormal.msg = '订单支付金额异常'; |
|
|
|
} |
|
|
|
else if (!(order.payOrderTimeEx === '正常')) { |
|
|
|
isNormal.isTrue = false; |
|
|
|
isNormal.msg = '订单支付时间异常'; |
|
|
|
} |
|
|
|
else if (!(order.payOrderEx === '正常')) { |
|
|
|
isNormal.isTrue = false; |
|
|
|
isNormal.msg = '订单支付异常'; |
|
|
|
} |
|
|
|
if (!(order.refundMoneyEx === '正常' || order.refundMoneyEx === '' || order.refundMoneyEx === null)) { |
|
|
|
isNormal = false; |
|
|
|
else if (!(order.refundMoneyEx === '正常' || order.refundMoneyEx === '' || order.refundMoneyEx === null)) { |
|
|
|
isNormal.isTrue = false; |
|
|
|
isNormal.msg = '订单退款金额异常'; |
|
|
|
} |
|
|
|
if (!(order.refundOrderTimeEx === '正常' || order.refundOrderTimeEx === '' || order.refundOrderTimeEx === null)) { |
|
|
|
isNormal = false; |
|
|
|
else if (!(order.refundOrderTimeEx === '正常' || order.refundOrderTimeEx === '' || order.refundOrderTimeEx === null)) { |
|
|
|
isNormal.isTrue = false; |
|
|
|
isNormal.msg = '订单退款时间异常'; |
|
|
|
} |
|
|
|
if (!(order.refundOrderEx === '正常' || order.refundOrderEx === '' || order.refundOrderEx === null)) { |
|
|
|
isNormal = false; |
|
|
|
else if (!(order.refundOrderEx === '正常' || order.refundOrderEx === '' || order.refundOrderEx === null)) { |
|
|
|
isNormal.isTrue = false; |
|
|
|
isNormal.msg = '订单退款异常'; |
|
|
|
} |
|
|
|
console.log('isNormal', isNormal); |
|
|
|
setOrderStatus(isNormal); |
|
|
|
} |
|
|
|
|
|
|
@@ -70,7 +85,7 @@ export default function Index() { |
|
|
|
</div> |
|
|
|
<div className={styles['order-cook-state']}> |
|
|
|
{ |
|
|
|
orderStatus ? <div className={styles['order-status-true']}>正常订单</div> : <div className={styles['order-status-false']}>异常订单</div> |
|
|
|
orderStatus.isTrue ? <div className={styles['order-status-true']}>正常订单</div> : <div className={styles['order-status-false']}>{orderStatus.msg}</div> |
|
|
|
} |
|
|
|
</div> |
|
|
|
<div className={styles['order-cook-date']}> |
|
|
|