🐳 chore(eslint): 修正所有文件的eslint 错误❌
This commit is contained in:
@@ -25,8 +25,7 @@ interface Param {
|
||||
showStatus?: 'detail' | 'list' // 订单详情,订单列表
|
||||
onClick?: (val: number) => void // 点击后触发的事件,返回订单状态
|
||||
}
|
||||
|
||||
export default memo(({ orderInfo, showStatus = 'detail', onClick }: Param) => {
|
||||
const OrderBtns = ({ orderInfo, showStatus = 'detail', onClick }: Param) => {
|
||||
// 订单状态枚举
|
||||
const {
|
||||
SaleOrderStatusBooking,
|
||||
@@ -161,28 +160,6 @@ export default memo(({ orderInfo, showStatus = 'detail', onClick }: Param) => {
|
||||
const { ApplyGoods } = SUBSCRIPTION_MESSAGE_SCENE
|
||||
const { openSubscriptionMessage } = UseSubscriptionMessage()
|
||||
|
||||
// 点击按钮操作
|
||||
const submitBtns = throttle(async(val, index) => {
|
||||
if (val == 1) {
|
||||
cancelOrder()
|
||||
}
|
||||
else if (val == 6) {
|
||||
receiveOrder()
|
||||
}
|
||||
else if (val == 5) {
|
||||
applyProduct()
|
||||
}
|
||||
else if (val == 3) {
|
||||
bigApplyRefurn()
|
||||
}
|
||||
else if (val == 8) {
|
||||
applyRefund()
|
||||
}
|
||||
else {
|
||||
onClick?.(val)
|
||||
}
|
||||
}, 800)
|
||||
|
||||
// 大货申请退款
|
||||
const bigApplyRefurn = () => {
|
||||
Taro.showModal({
|
||||
@@ -191,7 +168,7 @@ export default memo(({ orderInfo, showStatus = 'detail', onClick }: Param) => {
|
||||
if (res.confirm) {
|
||||
await openSubscriptionMessage({ orderId: orderInfo?.orderId, scenes: ApplyGoods.value })
|
||||
onClick?.(3)
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
@@ -210,11 +187,11 @@ export default memo(({ orderInfo, showStatus = 'detail', onClick }: Param) => {
|
||||
if (res.success) {
|
||||
alert.success('取消成功')
|
||||
onClick?.(1)
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert.none(res.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
@@ -234,12 +211,12 @@ export default memo(({ orderInfo, showStatus = 'detail', onClick }: Param) => {
|
||||
if (res.success) {
|
||||
onClick?.(6)
|
||||
alert.success('收货成功')
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert.error('收货失败')
|
||||
}
|
||||
alert.hideLoading()
|
||||
}
|
||||
}
|
||||
else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
@@ -259,13 +236,13 @@ export default memo(({ orderInfo, showStatus = 'detail', onClick }: Param) => {
|
||||
const res = await fetchDataApplyRefund({ sale_order_id: orderInfo?.orderId })
|
||||
if (res.success) {
|
||||
alert.success('申请成功')
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert.error('申请失败')
|
||||
}
|
||||
alert.hideLoading()
|
||||
onClick?.(8)
|
||||
}
|
||||
}
|
||||
else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
@@ -286,6 +263,28 @@ export default memo(({ orderInfo, showStatus = 'detail', onClick }: Param) => {
|
||||
return { top: `-${(orderBtnsShowList.length - 3) * 70 + 10}rpx`, left: `-${10}rpx` }
|
||||
}, [orderBtnsShowList])
|
||||
|
||||
// 点击按钮操作
|
||||
const submitBtns = throttle(async(val, index) => {
|
||||
if (val == 1) {
|
||||
cancelOrder()
|
||||
}
|
||||
else if (val == 6) {
|
||||
receiveOrder()
|
||||
}
|
||||
else if (val == 5) {
|
||||
applyProduct()
|
||||
}
|
||||
else if (val == 3) {
|
||||
bigApplyRefurn()
|
||||
}
|
||||
else if (val == 8) {
|
||||
applyRefund()
|
||||
}
|
||||
else {
|
||||
onClick?.(val)
|
||||
}
|
||||
}, 800)
|
||||
|
||||
return (
|
||||
<View className={styles.btns_list}>
|
||||
{orderBtnsShowList.length > 3 && (
|
||||
@@ -321,4 +320,5 @@ export default memo(({ orderInfo, showStatus = 'detail', onClick }: Param) => {
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
export default memo(OrderBtns)
|
||||
|
||||
Reference in New Issue
Block a user