Browse Source

显示详细异常信息

tags/小炒逻辑变更前
yangwenhua 2 years ago
parent
commit
da4edd44f9
1 changed files with 29 additions and 14 deletions
  1. +29
    -14
      src/pages/order/order-report-detail/index.jsx

+ 29
- 14
src/pages/order/order-report-detail/index.jsx View File

@@ -21,7 +21,9 @@ export default function Index() {
discountInfo: [] //优惠信息 discountInfo: [] //优惠信息
}); });


const [orderStatus, setOrderStatus] = useState(true);
const [orderStatus, setOrderStatus] = useState({
isTrue: true
});


const onQueryOrderDetail = async () => { const onQueryOrderDetail = async () => {
if (orderNumber) { if (orderNumber) {
@@ -36,22 +38,35 @@ export default function Index() {
} }


const orderIsNormal = (order) => { 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); setOrderStatus(isNormal);
} }


@@ -70,7 +85,7 @@ export default function Index() {
</div> </div>
<div className={styles['order-cook-state']}> <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>
<div className={styles['order-cook-date']}> <div className={styles['order-cook-date']}>


Loading…
Cancel
Save