订单按钮优化完成
This commit is contained in:
@@ -19,6 +19,7 @@ type Param = {
|
||||
wait_pay_amount: number, //待付金额
|
||||
sale_mode: number, //订单类型
|
||||
av_return_roll?: number, //可退数量
|
||||
is_return?: true|false, //是否申请了售后
|
||||
|
||||
},
|
||||
onClick?: (val: number) => void //点击后触发的事件,返回订单状态
|
||||
@@ -67,38 +68,6 @@ export default memo(({orderInfo, onClick}:Param) => {
|
||||
return orderInfo.actual_amount == 0 && orderStatus.includes(orderInfo.status)
|
||||
}
|
||||
},
|
||||
{
|
||||
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,
|
||||
]
|
||||
return orderInfo&&orderStatus.includes(orderInfo.status)
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
label: '确认收货',
|
||||
validatarFunc: (orderInfo) => {
|
||||
let orderStatus = [
|
||||
SaleOrderStatusWaitingReceipt.value
|
||||
]
|
||||
return orderStatus.includes(orderInfo.status)
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
label: '再次购买',
|
||||
@@ -121,10 +90,39 @@ export default memo(({orderInfo, onClick}:Param) => {
|
||||
id: 9,
|
||||
label: '售后记录',
|
||||
validatarFunc: (orderInfo) => {
|
||||
return orderInfo.is_return
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
label: '申请退款',
|
||||
validatarFunc: (orderInfo) => {
|
||||
//大货在待发货付过款
|
||||
let orderStatus = [
|
||||
SaleOrderStatusRefund.value
|
||||
SaleOrderStatusWaitingDelivery.value,
|
||||
SaleOrderStatusTaking.value
|
||||
]
|
||||
return orderInfo&&orderStatus.includes(orderInfo.status)
|
||||
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,
|
||||
]
|
||||
return orderStatus.includes(orderInfo.status)
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
label: '确认收货',
|
||||
validatarFunc: (orderInfo) => {
|
||||
let orderStatus = [
|
||||
SaleOrderStatusWaitingReceipt.value
|
||||
]
|
||||
return orderStatus.includes(orderInfo.status)
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -153,7 +151,7 @@ export default memo(({orderInfo, onClick}:Param) => {
|
||||
})
|
||||
}, [orderInfo])
|
||||
|
||||
//订阅消息
|
||||
//小程序订阅
|
||||
const {ApplyGoods} = SUBSCRIPTION_MESSAGE_SCENE
|
||||
const {openSubscriptionMessage} = UseSubscriptionMessage()
|
||||
|
||||
@@ -236,7 +234,6 @@ export default memo(({orderInfo, onClick}:Param) => {
|
||||
//退款
|
||||
const {fetchData: fetchDataApplyRefund} = ApplyRefundApi()
|
||||
const applyRefund = async () => {
|
||||
// if(!orderInfo?.av_return_roll) return alert.none('该订单没有可退条数')
|
||||
Taro.showModal({
|
||||
title: '确定退款?',
|
||||
success: async function async (res) {
|
||||
|
||||
Reference in New Issue
Block a user