feat: 客服接入 订单问题修改
This commit is contained in:
@@ -5,10 +5,17 @@ import { Avatar, Dialog } from "@nutui/nutui-react-taro";
|
||||
import dayjs from "dayjs";
|
||||
import "dayjs/locale/zh-cn";
|
||||
import classnames from "classnames";
|
||||
import orderService, { OrderStatus, CancelType, refundTextMap } from "@/services/orderService";
|
||||
import orderService, {
|
||||
OrderStatus,
|
||||
CancelType,
|
||||
refundTextMap,
|
||||
} from "@/services/orderService";
|
||||
import { getStorage, removeStorage, setStorage } from "@/store/storage";
|
||||
import { handleCustomerService } from "@/services/userService";
|
||||
import { withAuth, RefundPopup } from "@/components";
|
||||
import { payOrder, generateOrderActions } from "@/utils";
|
||||
import emptyContent from "@/static/emptyStatus/publish-empty.png";
|
||||
import CustomerIcon from "@/static/order/customer.svg";
|
||||
import styles from "./index.module.scss";
|
||||
|
||||
dayjs.locale("zh-cn");
|
||||
@@ -69,6 +76,14 @@ const OrderList = () => {
|
||||
getOrders(1);
|
||||
}, []);
|
||||
|
||||
useDidShow(() => {
|
||||
const targetPage = getStorage("list_reload_page_number");
|
||||
if (targetPage) {
|
||||
removeStorage("list_reload_page_number");
|
||||
getOrders(Number(targetPage));
|
||||
}
|
||||
});
|
||||
|
||||
function addPageInfo(arr, page) {
|
||||
return arr.map((item) => ({ ...item, page }));
|
||||
}
|
||||
@@ -236,13 +251,14 @@ const OrderList = () => {
|
||||
}
|
||||
}
|
||||
|
||||
function handleViewOrderDetail(orderId) {
|
||||
function handleViewOrderDetail({ page, id: orderId }) {
|
||||
setStorage("list_reload_page_number", page);
|
||||
Taro.navigateTo({
|
||||
url: `/order_pages/orderDetail/index?id=${orderId}`,
|
||||
});
|
||||
}
|
||||
|
||||
const flatList = list.flat()
|
||||
const flatList = list.flat();
|
||||
|
||||
return (
|
||||
<View className={styles.container}>
|
||||
@@ -277,7 +293,7 @@ const OrderList = () => {
|
||||
<View key={item.id} className={styles.orderItem}>
|
||||
<View
|
||||
className={styles.gameInfo}
|
||||
onClick={handleViewOrderDetail.bind(null, item.id)}
|
||||
onClick={() => handleViewOrderDetail(item)}
|
||||
>
|
||||
<View className={styles.gameTitle}>
|
||||
<View className={styles.title}>{item?.game_info?.title}</View>
|
||||
@@ -287,8 +303,10 @@ const OrderList = () => {
|
||||
styles[unPay ? "pending" : "paid"]
|
||||
)}
|
||||
>
|
||||
<Text>{unPay ? "待支付" : refundTextMap.get(item.refund_status)}</Text> ¥{" "}
|
||||
<Text>{item.amount}</Text>
|
||||
<Text>
|
||||
{unPay ? "待支付" : refundTextMap.get(item.refund_status)}
|
||||
</Text>{" "}
|
||||
¥ <Text>{item.amount}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.gameTime}>
|
||||
@@ -304,40 +322,19 @@ const OrderList = () => {
|
||||
<View className={styles.gameOtherInfo}>
|
||||
{participants?.length >= 0 ? (
|
||||
<View className={styles.avatarCards}>
|
||||
{
|
||||
/* participants */ [
|
||||
{
|
||||
user: {
|
||||
avatar_url: "https://img.yzcdn.cn/vant/cat.jpeg",
|
||||
id: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
user: {
|
||||
avatar_url: "https://img.yzcdn.cn/vant/cat.jpeg",
|
||||
id: 2,
|
||||
},
|
||||
},
|
||||
{
|
||||
user: {
|
||||
avatar_url: "https://img.yzcdn.cn/vant/cat.jpeg",
|
||||
id: 3,
|
||||
},
|
||||
},
|
||||
].map((participant) => {
|
||||
const {
|
||||
user: { avatar_url, id },
|
||||
} = participant;
|
||||
return (
|
||||
<Image
|
||||
className={styles.avatar}
|
||||
mode="aspectFill"
|
||||
key={id}
|
||||
src={avatar_url}
|
||||
/>
|
||||
);
|
||||
})
|
||||
}
|
||||
{participants.map((participant) => {
|
||||
const {
|
||||
user: { avatar_url, id },
|
||||
} = participant;
|
||||
return (
|
||||
<Image
|
||||
className={styles.avatar}
|
||||
mode="aspectFill"
|
||||
key={id}
|
||||
src={avatar_url}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
) : (
|
||||
""
|
||||
@@ -360,7 +357,15 @@ const OrderList = () => {
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.orderActions}>
|
||||
<View className={styles.extraActions}></View>
|
||||
<View className={styles.extraActions}>
|
||||
<View
|
||||
className={styles.customer}
|
||||
onClick={handleCustomerService}
|
||||
>
|
||||
<Image className={styles.customerIcon} src={CustomerIcon} />
|
||||
<Text>客服</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.mainActions}>
|
||||
{generateOrderActions(
|
||||
item,
|
||||
|
||||
Reference in New Issue
Block a user