|
|
@@ -21,9 +21,7 @@ export default function Index() { |
|
|
|
discountInfo: [] //优惠信息 |
|
|
|
}); |
|
|
|
|
|
|
|
const [orderStatus, setOrderStatus] = useState({ |
|
|
|
isTrue: true |
|
|
|
}); |
|
|
|
const [orderStatus, setOrderStatus] = useState(''); |
|
|
|
|
|
|
|
const onQueryOrderDetail = async () => { |
|
|
|
if (orderNumber) { |
|
|
@@ -38,36 +36,31 @@ export default function Index() { |
|
|
|
} |
|
|
|
|
|
|
|
const orderIsNormal = (order) => { |
|
|
|
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 = '订单支付异常'; |
|
|
|
} |
|
|
|
else if (!(order.refundMoneyEx === '正常' || order.refundMoneyEx === '' || order.refundMoneyEx === null)) { |
|
|
|
isNormal.isTrue = false; |
|
|
|
isNormal.msg = '订单退款金额异常'; |
|
|
|
let orderStatus = ''; |
|
|
|
switch (order.orderStatus) { |
|
|
|
case 0: |
|
|
|
orderStatus = '未付款'; |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
orderStatus = '已付款'; |
|
|
|
break; |
|
|
|
case -1: |
|
|
|
orderStatus = '退单申请'; |
|
|
|
break; |
|
|
|
case -2: |
|
|
|
orderStatus = '退单中'; |
|
|
|
break; |
|
|
|
case -3: |
|
|
|
orderStatus = '已退单'; |
|
|
|
break; |
|
|
|
case -4: |
|
|
|
orderStatus = '取消交易'; |
|
|
|
break; |
|
|
|
case -5: |
|
|
|
orderStatus = '撤销申请'; |
|
|
|
break; |
|
|
|
} |
|
|
|
else if (!(order.refundOrderTimeEx === '正常' || order.refundOrderTimeEx === '' || order.refundOrderTimeEx === null)) { |
|
|
|
isNormal.isTrue = false; |
|
|
|
isNormal.msg = '订单退款时间异常'; |
|
|
|
} |
|
|
|
else if (!(order.refundOrderEx === '正常' || order.refundOrderEx === '' || order.refundOrderEx === null)) { |
|
|
|
isNormal.isTrue = false; |
|
|
|
isNormal.msg = '订单退款异常'; |
|
|
|
} |
|
|
|
console.log('isNormal', isNormal); |
|
|
|
setOrderStatus(isNormal); |
|
|
|
setOrderStatus(orderStatus); |
|
|
|
} |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
@@ -84,9 +77,7 @@ export default function Index() { |
|
|
|
#{orderInfo.sortId} |
|
|
|
</div> |
|
|
|
<div className={styles['order-cook-state']}> |
|
|
|
{ |
|
|
|
orderStatus.isTrue ? <div className={styles['order-status-true']}>正常订单</div> : <div className={styles['order-status-false']}>{orderStatus.msg}</div> |
|
|
|
} |
|
|
|
<div className={styles['order-status-true']}>{orderStatus}</div> |
|
|
|
</div> |
|
|
|
<div className={styles['order-cook-date']}> |
|
|
|
{orderInfo.createdAt} |
|
|
|