电子商城测试版v4
This commit is contained in:
@@ -9,6 +9,7 @@ import styles from './index.module.scss'
|
||||
import { AddShoppingCartApi } from "@/api/shopCart"
|
||||
import { ApplyRefundApi } from "@/api/salesAfterOrder"
|
||||
import { UseSubscriptionMessage } from "@/use/useCommonData"
|
||||
import { throttle } from "@/common/util"
|
||||
|
||||
type Param = {
|
||||
orderInfo: {
|
||||
@@ -132,7 +133,7 @@ export default memo(({orderInfo, onClick}:Param) => {
|
||||
const {openSubscriptionMessage} = UseSubscriptionMessage()
|
||||
|
||||
//点击按钮操作
|
||||
const submitBtns = async (val, index) => {
|
||||
const submitBtns = throttle(async (val, index) => {
|
||||
if (val == 1) {
|
||||
cancelOrder()
|
||||
} else if (val == 6) {
|
||||
@@ -142,14 +143,27 @@ export default memo(({orderInfo, onClick}:Param) => {
|
||||
await openSubscriptionMessage({orderId: orderInfo?.orderId, scenes: ApplyGoods.value})
|
||||
goLink('/pages/applyAfterSales/index',{id:orderInfo?.orderId})
|
||||
} else if (val == 3) {
|
||||
await openSubscriptionMessage({orderId: orderInfo?.orderId, scenes: ApplyGoods.value})
|
||||
onClick?.(val)
|
||||
bigApplyRefurn()
|
||||
} else if(val == 8) {
|
||||
applyRefund()
|
||||
} else {
|
||||
onClick?.(val)
|
||||
}
|
||||
|
||||
}, 600)
|
||||
|
||||
//大货申请退款
|
||||
const bigApplyRefurn = () => {
|
||||
Taro.showModal({
|
||||
title: '要申请退款吗?',
|
||||
success: async function (res) {
|
||||
if(res.confirm) {
|
||||
await openSubscriptionMessage({orderId: orderInfo?.orderId, scenes: ApplyGoods.value})
|
||||
onClick?.(3)
|
||||
} else {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//取消订单
|
||||
|
||||
Reference in New Issue
Block a user