修复部分bug

This commit is contained in:
2022-07-07 15:14:46 +08:00
parent ddda63c1b0
commit e3a950481c
9 changed files with 104 additions and 34 deletions
@@ -1,16 +1,21 @@
import { AFTER_ORDER_STATUS } from "@/common/enum";
import { AFTER_ORDER_STATUS, REFUND_STATUS_ORDER } from "@/common/enum";
import { Text, View } from "@tarojs/components"
import classnames from "classnames";
import {memo, useMemo} from "react";
import styles from './index.module.scss'
type Param = {
return_address?:string,
return_phone?: string,
onLogistics?: (val: 1|2) => void, //1 上传物流 2 查看物流
stage?: number,
orderInfo: {
return_user_name?:string,
return_user_phone?: string,
stage?: number,
sale_mode?: 0|1|2, //0 大货 1剪板 2散剪
type?: number, //申请单退款状态
}
}
export default memo(({return_address = '', return_phone = '', onLogistics, stage}:Param) => {
export default memo(({orderInfo, onLogistics}:Param) => {
const {
ReturnStageApplying,
ReturnStageWaitCheck,
@@ -22,15 +27,30 @@ export default memo(({return_address = '', return_phone = '', onLogistics, stage
ReturnStageRejected
} = AFTER_ORDER_STATUS
const {
ReturnApplyOrderTypeAdvanceReceiptRefund, // 预收退款
ReturnApplyOrderTypeReturnForRefund, // 退货退款
ReturnApplyOrderTypeSalesRefund, // 销售退款
} = REFUND_STATUS_ORDER
//是否显示地址
const showAddress = useMemo(() => {
return stage != ReturnStageApplying.value
}, [stage])
let after_list = [
ReturnStageApplying.value,
ReturnStageCancel.value,
ReturnStageRejected.value
]
let refurn_list = [
ReturnApplyOrderTypeSalesRefund.value,
ReturnApplyOrderTypeAdvanceReceiptRefund.value
]
return (!after_list.includes(orderInfo?.stage!)) && (orderInfo?.sale_mode != 1) && (!refurn_list.includes(orderInfo?.type!))
}, [orderInfo])
//上传物流
const upLogistics = useMemo(() => {
return stage == ReturnStageWaitCheck.value
}, [stage])
return orderInfo?.stage == ReturnStageWaitCheck.value
}, [orderInfo])
return (
@@ -44,11 +64,11 @@ export default memo(({return_address = '', return_phone = '', onLogistics, stage
<View className={classnames(styles.order_address_icon, 'iconfont','icon-fahuo')}></View>
<View className={styles.order_address_text_con}>
<View className={styles.order_address_text_title}>
<Text className={classnames(styles.address_text, styles.address_text_no)}>{return_address}</Text>
<Text className={classnames(styles.address_text, styles.address_text_no)}>{orderInfo?.return_user_name}</Text>
</View>
<View className={styles.order_address_text_name}>
<Text>管理员</Text>
<Text>{return_phone}</Text>
<Text>{orderInfo?.return_user_phone}</Text>
{upLogistics&&<View className={styles.updateBtn} onClick={() => onLogistics?.(1)}>
上传物流
</View>
+1 -2
View File
@@ -137,11 +137,10 @@ import styles from './index.module.scss'
//显示记录
const [applyRecord, setApplyRecord] = useState(false)
return (
<View className={styles.order_main}>
<OrderState orderInfo={orderDetail}/>
<AddressInfoDetail return_address={orderDetail?.return_user_name} return_phone={orderDetail?.return_user_phone} stage={orderDetail?.stage} onLogistics={onShowLogistics}/>
<AddressInfoDetail orderInfo={orderDetail} onLogistics={onShowLogistics}/>
<KindList order={formatPreViewOrderMemo}/>
<OrderDes orderInfo={orderDetail}/>
<AfterOrderBtns orderInfo={orderInfo} onClick={orderStateClick}/>