电子商城测试版v3
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { CancelOrderApi, ReceiveOrderApi } from "@/api/order"
|
||||
import { alert, goLink } from "@/common/common"
|
||||
import { ORDER_STATUS, SALE_MODE } from "@/common/enum"
|
||||
import { ORDER_STATUS, SALE_MODE, SUBSCRIPTION_MESSAGE_SCENE } from "@/common/enum"
|
||||
import {Text, View } from "@tarojs/components"
|
||||
import Taro from "@tarojs/taro"
|
||||
import {useRef, memo, useState, useMemo } from "react"
|
||||
@@ -8,6 +8,7 @@ import classnames from "classnames";
|
||||
import styles from './index.module.scss'
|
||||
import { AddShoppingCartApi } from "@/api/shopCart"
|
||||
import { ApplyRefundApi } from "@/api/salesAfterOrder"
|
||||
import { UseSubscriptionMessage } from "@/use/useCommonData"
|
||||
|
||||
type Param = {
|
||||
orderInfo: {
|
||||
@@ -126,22 +127,29 @@ export default memo(({orderInfo, onClick}:Param) => {
|
||||
})
|
||||
}, [orderInfo])
|
||||
|
||||
|
||||
//订阅消息
|
||||
const {ApplyGoods} = SUBSCRIPTION_MESSAGE_SCENE
|
||||
const {openSubscriptionMessage} = UseSubscriptionMessage()
|
||||
|
||||
//点击按钮操作
|
||||
const submitBtns = (val, index) => {
|
||||
const submitBtns = async (val, index) => {
|
||||
if (val == 1) {
|
||||
cancelOrder()
|
||||
} else if (val == 6) {
|
||||
receiveOrder()
|
||||
} else if(val == 5) {
|
||||
if(!orderInfo?.av_return_roll) return alert.none('该订单没有可退条数')
|
||||
goLink('/pages/applyAfterSales/index',{id:orderInfo?.orderId})
|
||||
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)
|
||||
} else if(val == 8) {
|
||||
applyRefund()
|
||||
} else {
|
||||
onClick?.(val)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//取消订单
|
||||
@@ -194,6 +202,7 @@ export default memo(({orderInfo, onClick}:Param) => {
|
||||
title: '确定退款?',
|
||||
success: async function async (res) {
|
||||
if(res.confirm) {
|
||||
await openSubscriptionMessage({orderId: orderInfo?.orderId, scenes: ApplyGoods.value})
|
||||
let res = await fetchDataApplyRefund({sale_order_id: orderInfo?.orderId})
|
||||
if(res.success) {
|
||||
alert.success('申请成功')
|
||||
|
||||
@@ -13,7 +13,7 @@ import { formatHashTag, formatImgUrl, formatPriceDiv } from "@/common/fotmat";
|
||||
import { setParam } from "@/common/system";
|
||||
import { debounce } from "@/common/util";
|
||||
import Counter from "../counter";
|
||||
import { ApplyOrderAccessApi, GetAdminUserInfoApi } from "@/api/user";
|
||||
import { ApplyOrderAccessApi, GetAdminUserInfoApi, SubscriptionMessageApi } from "@/api/user";
|
||||
|
||||
type param = {
|
||||
show?: true|false,
|
||||
@@ -213,9 +213,11 @@ export default ({show = false, onClose}: param) => {
|
||||
|
||||
//去结算
|
||||
const {fetchData: useFetchData} = GetAdminUserInfoApi()
|
||||
const {fetchData: applyOrderAccessFetchData} = ApplyOrderAccessApi()
|
||||
const orderDetail = debounce( async () => {
|
||||
let res = await useFetchData()
|
||||
if(res.data.order_access_status !== 3) {
|
||||
if(res.data.order_access_status == 1) applyOrderAccessFetchData()
|
||||
Taro.showModal({
|
||||
title: '提示',
|
||||
content: '暂未开通下单权限功能,稍后有客服联系您,请注意接受电话。',
|
||||
@@ -223,7 +225,6 @@ export default ({show = false, onClose}: param) => {
|
||||
confirmText: '我知道',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
@@ -256,7 +257,7 @@ export default ({show = false, onClose}: param) => {
|
||||
getShoppingCart()
|
||||
}
|
||||
}, 300)
|
||||
|
||||
|
||||
return (
|
||||
<View className={styles.shop_cart_main}>
|
||||
<Popup showTitle={false} show={showPopup} onClose={() => closePopup()} >
|
||||
|
||||
Reference in New Issue
Block a user