🦄 refactor:订单详情对接修改地址
This commit is contained in:
@@ -83,7 +83,9 @@ export default memo((props: prosObj) => {
|
||||
showTake && <View className={styles.tuikuan} onClick={() => handSureGoods?.()}>确认收货</View>
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
!showTuihuo && !showTuikuan && !showTake && <View className={styles.title} >暂无更多</View>
|
||||
}
|
||||
</>
|
||||
)
|
||||
})
|
||||
@@ -41,6 +41,8 @@
|
||||
/*这里设置几行*/
|
||||
overflow: hidden;
|
||||
margin-right: 41px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.icon_more {
|
||||
|
||||
@@ -6,14 +6,16 @@ import styles from './index.module.scss'
|
||||
interface propsObj {
|
||||
receivingStatus: Number | null,
|
||||
onReceivingStatus?: (any, Number) => void,
|
||||
obj: any
|
||||
obj: any,
|
||||
navSelect?: (any) => void
|
||||
}
|
||||
export default memo((props: propsObj) => {
|
||||
|
||||
const {
|
||||
receivingStatus = 2,
|
||||
onReceivingStatus,
|
||||
obj = {}
|
||||
obj = {},
|
||||
navSelect
|
||||
} = props
|
||||
const addressInfo = useMemo(() => {
|
||||
if (receivingStatus == 1) {
|
||||
@@ -21,37 +23,39 @@ export default memo((props: propsObj) => {
|
||||
} else {
|
||||
return obj.province_name + obj.city_name + obj.district_name
|
||||
}
|
||||
}, [receivingStatus])
|
||||
}, [obj, receivingStatus])
|
||||
|
||||
const addressPone = useMemo(() => {
|
||||
if (receivingStatus == 1) {
|
||||
return 13242128982
|
||||
} else {
|
||||
return obj.purchaser_phone
|
||||
}
|
||||
}, [receivingStatus])
|
||||
// const addressPone = useMemo(() => {
|
||||
// if (receivingStatus == 1) {
|
||||
// return 13242128982
|
||||
// } else {
|
||||
// return obj.purchaser_phone
|
||||
// }
|
||||
// }, [obj,receivingStatus])
|
||||
|
||||
const addressUser = useMemo(() => {
|
||||
if (receivingStatus == 1) {
|
||||
return '谭先生'
|
||||
} else {
|
||||
return obj.target_user_name
|
||||
}
|
||||
}, [receivingStatus])
|
||||
// const addressUser = useMemo(() => {
|
||||
// if (receivingStatus == 1) {
|
||||
// return '谭先生'
|
||||
// } else {
|
||||
// return obj.target_user_name
|
||||
// }
|
||||
// }, [obj,receivingStatus])
|
||||
|
||||
return (
|
||||
<View className={styles.addressBox}>
|
||||
<View className={styles.topBox}>
|
||||
<View className={styles.topBox} onClick={() => navSelect?.(obj)}>
|
||||
<View className={styles.cirle}>
|
||||
<View className={classnames('iconfont', 'icon-dingwei', styles.dingwei)}></View>
|
||||
</View>
|
||||
<View className={styles.address}>{addressInfo}</View>
|
||||
<View className={classnames('iconfont', 'icon-chakanquanbukehu', styles.icon_more)}></View>
|
||||
{
|
||||
receivingStatus !== 1 && <View className={classnames('iconfont', 'icon-chakanquanbukehu', styles.icon_more)}></View>
|
||||
}
|
||||
</View>
|
||||
<View className={styles.line}></View>
|
||||
<View className={styles.bottom}>
|
||||
<View className={styles.name}>{addressUser}</View>
|
||||
<View className={styles.phone}>{addressPone}</View>
|
||||
<View className={styles.name}>{receivingStatus === 1 ? '谭先生' : obj.target_user_name}</View>
|
||||
<View className={styles.phone}>{receivingStatus === 1 ? 13242128982 : obj.purchaser_phone}</View>
|
||||
<View className={styles.reatBox}>
|
||||
<View className={styles.updateBtn}>
|
||||
<View className={styles.updateBtn_list}>
|
||||
|
||||
@@ -29,14 +29,30 @@ import PayPopup from '../order/components/PayPopup'
|
||||
|
||||
export default () => {
|
||||
const router = useRouter()
|
||||
useEffect(() => {
|
||||
// useEffect(() => {
|
||||
// getDetail()
|
||||
// }, [])
|
||||
useDidShow(() => {
|
||||
getDetail()
|
||||
}, [])
|
||||
|
||||
})
|
||||
//页面下拉刷新
|
||||
usePullDownRefresh(() => {
|
||||
getDetail()
|
||||
})
|
||||
|
||||
|
||||
//收货方法,1:自提,2物流
|
||||
const [receivingStatus, setReceivingStatus] = useState(null)
|
||||
//切换自提或者物流
|
||||
const onReceivingStatus = debounce((e, value) => {
|
||||
if (infoObj.status === 8 || infoObj.status === 9 || infoObj.status === 4 || infoObj.status === 5) {
|
||||
alert.error('不允许更改')
|
||||
return false
|
||||
}
|
||||
e.stopPropagation()
|
||||
setReceivingStatus(value)
|
||||
}, 300)
|
||||
|
||||
const { fetchData: infoFetch } = mpsaleOrder()
|
||||
const [infoObj, setInfoObj] = useState<any>({})
|
||||
//获取订单详情
|
||||
@@ -73,14 +89,9 @@ export default () => {
|
||||
})
|
||||
}
|
||||
|
||||
//收货方法,1:自提,2物流
|
||||
const [receivingStatus, setReceivingStatus] = useState(null)
|
||||
//切换自提或者物流
|
||||
const onReceivingStatus = debounce((e, value) => {
|
||||
e.stopPropagation()
|
||||
setReceivingStatus(value)
|
||||
}, 300)
|
||||
|
||||
// useEffect(() => {
|
||||
// setReceivingStatus(receivingStatus)
|
||||
// }, [receivingStatus])
|
||||
//订单信息文字数组
|
||||
const [orderMsg, setOrderMsg] = useState<any[]>([
|
||||
{
|
||||
@@ -459,6 +470,16 @@ export default () => {
|
||||
const [showPay, setShowPay] = useState(false)
|
||||
//显示线下汇款
|
||||
const [showOffline, setShowOffine] = useState(false)
|
||||
//选择地址
|
||||
const handSelect = (obj) => {
|
||||
if (receivingStatus === 1 || (infoObj.status === 8 || infoObj.status === 9 || infoObj.status === 4 || infoObj.status === 5)) {
|
||||
alert.error('不允许更改')
|
||||
return false
|
||||
}
|
||||
Taro.navigateTo({
|
||||
url: '/pages/addressManager/index?orderId=' + obj.id + '&purchaser_id=' + obj.purchaser_id
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<View className={styles.mainBox}>
|
||||
@@ -466,7 +487,12 @@ export default () => {
|
||||
{
|
||||
infoObj.status === 10 && <AdvanceOrderState orderInfo={infoObj} onRefresh={() => refresh()} />
|
||||
}
|
||||
<AddressDetailBox obj={infoObj} receivingStatus={receivingStatus} onReceivingStatus={(e, value) => onReceivingStatus(e, value)}></AddressDetailBox>
|
||||
<AddressDetailBox
|
||||
navSelect={(obj) => handSelect(obj)}
|
||||
obj={infoObj}
|
||||
receivingStatus={receivingStatus}
|
||||
onReceivingStatus={(e, value) => onReceivingStatus(e, value)}
|
||||
></AddressDetailBox>
|
||||
<DefaultBox
|
||||
showMode={true}
|
||||
title={'客户信息'}
|
||||
@@ -474,7 +500,7 @@ export default () => {
|
||||
>
|
||||
<View className={styles.pussBox}>
|
||||
<View className={styles.pussName}>{infoObj.purchaser_name}</View>
|
||||
<View className={styles.pussPhone}>{1310154151}</View>
|
||||
<View className={styles.pussPhone}>{infoObj.purchaser_phone}</View>
|
||||
</View>
|
||||
</DefaultBox>
|
||||
<View className={styles.total}> {infoObj.total_fabrics} 种面料,{infoObj.total_colors} 个颜色,共 {infoObj.sale_mode === 0 ? infoObj.total_number : infoObj.total_number / 100} {infoObj.sale_mode === 0 ? '条' : 'm'}</View>
|
||||
|
||||
Reference in New Issue
Block a user