商城测试版v7
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
position: absolute;
|
||||
background-color: #fff;
|
||||
width: 226px;
|
||||
box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.06);
|
||||
box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.3);
|
||||
border-radius: 10px;
|
||||
padding: 0 20px;
|
||||
box-sizing: border-box;
|
||||
|
||||
@@ -49,12 +49,13 @@ export default memo(({orderInfo, showStatus = 'detail', onClick}:Param) => {
|
||||
SaLeModeWeightCut,
|
||||
} = SALE_MODE
|
||||
|
||||
//注册按钮
|
||||
type orderBtnsListParams = {id: number, label: string, validatarFunc: (val: typeof orderInfo) => any}
|
||||
//注册按钮, id:按钮id唯一,label:按钮名称,sort:排序数字越大越靠后,validatarFunc:验证
|
||||
type orderBtnsListParams = {id: number, label: string, sort: number, validatarFunc: (val: typeof orderInfo) => any}
|
||||
const orderBtnsList = useRef<orderBtnsListParams[]>([
|
||||
{
|
||||
id: 1,
|
||||
label: '取消订单',
|
||||
sort: 1,
|
||||
validatarFunc: (orderInfo) => {
|
||||
//在待发货之前没有付过款
|
||||
let orderStatus = [
|
||||
@@ -69,74 +70,10 @@ export default memo(({orderInfo, showStatus = 'detail', onClick}:Param) => {
|
||||
return orderInfo.actual_amount == 0 && orderStatus.includes(orderInfo.status)
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
label: '再次购买',
|
||||
validatarFunc: () => {
|
||||
return true
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
label: '退款',
|
||||
validatarFunc: (orderInfo) => {
|
||||
//散剪和剪板在待接单时付过款
|
||||
let orderStatus = [
|
||||
SaleOrderStatusBooking.value
|
||||
]
|
||||
return orderInfo.sale_mode != SaLeModeBulk.value && orderInfo.actual_amount != 0 && orderStatus.includes(orderInfo.status)
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
label: '售后记录',
|
||||
validatarFunc: (orderInfo) => {
|
||||
return orderInfo.is_return
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
label: '申请退款',
|
||||
validatarFunc: (orderInfo) => {
|
||||
//大货在待发货付过款
|
||||
let orderStatus = [
|
||||
SaleOrderStatusWaitingDelivery.value,
|
||||
SaleOrderStatusTaking.value
|
||||
]
|
||||
return orderInfo.sale_mode == SaLeModeBulk.value && orderInfo.actual_amount != 0 && orderInfo.av_return_roll && orderStatus.includes(orderInfo.status)
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
label: '申请退货',
|
||||
validatarFunc: (orderInfo) => {
|
||||
let orderStatus = [
|
||||
SaleOrderStatusAlreadyReceipt.value,
|
||||
SaleOrderStatusRefund.value
|
||||
]
|
||||
return orderInfo.av_return_roll&& orderStatus.includes(orderInfo.status)
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
label: '确认收货',
|
||||
validatarFunc: (orderInfo) => {
|
||||
let orderStatus = [
|
||||
SaleOrderStatusWaitingReceipt.value
|
||||
]
|
||||
return orderStatus.includes(orderInfo.status)
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
label: '销售码单',
|
||||
validatarFunc: (orderInfo) => {
|
||||
return orderInfo.actual_amount > 0 && orderInfo.wait_pay_amount == 0 && showStatus == 'detail'
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
label: '去付款',
|
||||
sort: 100,
|
||||
validatarFunc: (orderInfo) => {
|
||||
//只要没有付完款就显示
|
||||
let orderStatus = [
|
||||
@@ -150,15 +87,87 @@ export default memo(({orderInfo, showStatus = 'detail', onClick}:Param) => {
|
||||
]
|
||||
return orderInfo.wait_pay_amount != 0 && orderStatus.includes(orderInfo.status)
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
label: '申请退款',
|
||||
sort: 5,
|
||||
validatarFunc: (orderInfo) => {
|
||||
//大货在待发货付过款
|
||||
let orderStatus = [
|
||||
SaleOrderStatusWaitingDelivery.value,
|
||||
SaleOrderStatusTaking.value
|
||||
]
|
||||
return orderInfo.sale_mode == SaLeModeBulk.value && orderInfo.actual_amount != 0 && orderInfo.av_return_roll && orderStatus.includes(orderInfo.status)
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
label: '申请退货',
|
||||
sort: 5,
|
||||
validatarFunc: (orderInfo) => {
|
||||
let orderStatus = [
|
||||
SaleOrderStatusAlreadyReceipt.value,
|
||||
SaleOrderStatusRefund.value
|
||||
]
|
||||
return orderInfo.av_return_roll&& orderStatus.includes(orderInfo.status)
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
label: '确认收货',
|
||||
sort: 10,
|
||||
validatarFunc: (orderInfo) => {
|
||||
let orderStatus = [
|
||||
SaleOrderStatusWaitingReceipt.value
|
||||
]
|
||||
return orderStatus.includes(orderInfo.status)
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
label: '再次购买',
|
||||
sort: 6,
|
||||
validatarFunc: () => {
|
||||
return true
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
label: '退款',
|
||||
sort: 5,
|
||||
validatarFunc: (orderInfo) => {
|
||||
//散剪和剪板在待接单时付过款
|
||||
let orderStatus = [
|
||||
SaleOrderStatusBooking.value
|
||||
]
|
||||
return orderInfo.sale_mode != SaLeModeBulk.value && orderInfo.actual_amount != 0 && orderStatus.includes(orderInfo.status)
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
label: '售后记录',
|
||||
sort: 6,
|
||||
validatarFunc: (orderInfo) => {
|
||||
return orderInfo.is_return
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
label: '销售码单',
|
||||
sort: 9,
|
||||
validatarFunc: (orderInfo) => {
|
||||
return orderInfo.actual_amount > 0 && orderInfo.wait_pay_amount == 0 && showStatus == 'detail'
|
||||
}
|
||||
},
|
||||
])
|
||||
|
||||
//显示的按钮数组
|
||||
const orderBtnsShowList: orderBtnsListParams[] = useMemo(() => {
|
||||
return orderBtnsList.current.filter(item => {
|
||||
let list = orderBtnsList.current.filter(item => {
|
||||
return item.validatarFunc(orderInfo)
|
||||
})
|
||||
return list.sort((a, b) => a.sort - b.sort)
|
||||
}, [orderInfo])
|
||||
|
||||
//小程序订阅
|
||||
@@ -278,7 +287,7 @@ export default memo(({orderInfo, showStatus = 'detail', onClick}:Param) => {
|
||||
{showMore&&<View className={styles.more_con}>
|
||||
<View className={styles.more_list} style={styleTop}>
|
||||
{orderBtnsShowList.map((item, index) => {
|
||||
return ((index >= 3) &&<View className={styles.more_item} key={item.id} onClick={() => submitBtns(item.id, index)}>{item.label}</View>)
|
||||
return ((index < (orderBtnsShowList.length - 3)) &&<View className={styles.more_item} key={item.id} onClick={() => submitBtns(item.id, index)}>{item.label}</View>)
|
||||
})}
|
||||
</View>
|
||||
<View className={styles.more_bg} catchMove onClick={() => setShowMore(false)}></View>
|
||||
@@ -287,7 +296,7 @@ export default memo(({orderInfo, showStatus = 'detail', onClick}:Param) => {
|
||||
|
||||
<View className={styles.list_scroll}>
|
||||
{orderBtnsShowList.map((item, index) =>
|
||||
(index < 3)&&<View key={item.id} className={classnames(styles.btns_item)} onClick={() => submitBtns(item.id, index)}>{item.label}</View>
|
||||
((orderBtnsShowList.length - 3) <= index)&&<View key={item.id} className={classnames(styles.btns_item)} onClick={() => submitBtns(item.id, index)}>{item.label}</View>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user