优化登录

This commit is contained in:
2022-06-27 20:32:59 +08:00
parent 3d349d405a
commit ba8d57c0e3
15 changed files with 241 additions and 33 deletions
+7 -3
View File
@@ -15,7 +15,9 @@ type Param = {
orderId: number, //订单id
actual_amount: number, //实付金额
wait_pay_amount: number, //待付金额
sale_mode: number //订单类型
sale_mode: number, //订单类型
av_return_roll?: number, //可退数量
}|null,
onClick?: (val: number) => void //点击后触发的事件,返回订单状态
}
@@ -104,7 +106,7 @@ export default memo(({orderInfo, onClick}:Param) => {
return( orderInfo.wait_pay_amount != 0 && item.value.includes(orderInfo.status)) //只要没有付完款就显示
} else if(item.id == 3 ) {
//申请退款, 只有大货才有
return (orderInfo.sale_mode == SaLeModeBulk.value && orderInfo.actual_amount != 0 && item.value.includes(orderInfo.status)) //大货在待发货付过款
return (orderInfo.sale_mode == SaLeModeBulk.value && orderInfo.actual_amount != 0 && item.value.includes(orderInfo.status)) //大货在待发货付过款
} else if( item.id == 8) {
//退款按钮(直接退款不用申请), 只有散剪和剪板有
return (orderInfo.sale_mode != SaLeModeBulk.value && orderInfo.actual_amount != 0 && item.value.includes(orderInfo.status)) //散剪和剪板在待接单时付过款
@@ -133,7 +135,8 @@ export default memo(({orderInfo, onClick}:Param) => {
} else if (val == 6) {
receiveOrder()
} else if(val == 5) {
goLink('/pages/applyAfterSales/index',{id:orderInfo?.orderId})
if(!orderInfo?.av_return_roll) return alert.none('该订单没有可退条数')
goLink('/pages/applyAfterSales/index',{id:orderInfo?.orderId})
} else if(val == 8) {
applyRefund()
} else {
@@ -187,6 +190,7 @@ 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) {