From 0efcd36aa792043a61a19c04d23cb399d2549a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=9D=B0?= Date: Wed, 1 Oct 2025 11:21:58 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E5=AE=A2=E6=9C=8D=E6=8E=A5?= =?UTF-8?q?=E5=85=A5=20=E8=AE=A2=E5=8D=95=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.ts | 13 ++- src/game_pages/detail/index.tsx | 25 +++++- src/order_pages/orderDetail/index.module.scss | 89 +++++++++---------- src/order_pages/orderDetail/index.tsx | 69 +++++++++----- src/order_pages/orderList/index.module.scss | 55 ++++++++---- src/order_pages/orderList/index.tsx | 87 +++++++++--------- src/services/detailService.ts | 2 +- src/services/loginService.ts | 4 +- src/static/order/customer.svg | 12 +++ 9 files changed, 217 insertions(+), 139 deletions(-) create mode 100644 src/static/order/customer.svg diff --git a/src/app.ts b/src/app.ts index bf0017c..be50fa9 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,17 +1,24 @@ import { Component, ReactNode } from "react"; - import "./nutui-theme.scss"; +import "./nutui-theme.scss"; import "./app.scss"; import "./scss/qweather-icons/qweather-icons.css"; import { useGlobalStore } from "./store/global"; +import { removeStorage } from "./store/storage"; interface AppProps { children: ReactNode; } +function clearSpecStorage() { + removeStorage('list_reload_page_number') + removeStorage('backFlag') +} + class App extends Component { onLaunch(options) { console.log('launch options: ', options) console.log("小程序启动,初始化逻辑写这里"); + clearSpecStorage() } componentDidMount() { @@ -20,9 +27,9 @@ class App extends Component { // this.getLocation() } - componentDidShow() {} + componentDidShow() { } - componentDidHide() {} + componentDidHide() { } diff --git a/src/game_pages/detail/index.tsx b/src/game_pages/detail/index.tsx index 637e69b..1375ae3 100644 --- a/src/game_pages/detail/index.tsx +++ b/src/game_pages/detail/index.tsx @@ -144,6 +144,14 @@ function Coursel(props) { getImagesMsg(image_list || []); }, [image_list]); + function previewImage(current_url) { + // console.log(image_list, "image_list"); + Taro.previewImage({ + current: current_url, + urls: list?.length > 0 ? list.map((c) => c.url) : [], + }); + } + return ( {list.map((item, index) => { return ( - + previewImage(item.url)} + > (null); const commentRef = useRef(); + useEffect(() => { + updateLocation(); + fetchUserInfo(); + }, []); + useDidShow(async () => { - await updateLocation(); - await fetchUserInfo(); - // await fetchDetail(); + // await updateLocation(); + // await fetchUserInfo(); + await fetchDetail(); }); const updateLocation = async () => { diff --git a/src/order_pages/orderDetail/index.module.scss b/src/order_pages/orderDetail/index.module.scss index 136ae97..5ed3868 100644 --- a/src/order_pages/orderDetail/index.module.scss +++ b/src/order_pages/orderDetail/index.module.scss @@ -27,9 +27,7 @@ border-bottom: 0.5px solid rgba(0, 0, 0, 0.06); padding: 8px 12px; color: #000; - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 14px; font-style: normal; @@ -46,9 +44,7 @@ align-items: flex-start; color: rgba(60, 60, 67, 0.6); - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 12px; font-style: normal; @@ -136,9 +132,7 @@ .date { color: #000; - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 16px; font-style: normal; @@ -148,9 +142,7 @@ .venueTime { color: rgba(0, 0, 0, 0.8); - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 12px; font-style: normal; @@ -177,9 +169,7 @@ align-items: center; gap: 12px; color: rgba(0, 0, 0, 0.8); - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 12px; font-style: normal; @@ -223,9 +213,7 @@ gap: 4px; color: #000; text-align: center; - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 16px; font-style: normal; @@ -241,9 +229,7 @@ &Address { color: rgba(0, 0, 0, 0.8); text-align: center; - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 12px; font-style: normal; @@ -255,6 +241,26 @@ } } + .customer { + margin-left: auto; + display: flex; + align-items: center; + justify-content: flex-start; + gap: 4px; + color: var(--Labels-Secondary, rgba(60, 60, 67, 0.6)); + font-feature-settings: "liga" off, "clig" off; + font-family: "PingFang SC"; + font-size: 12px; + font-style: normal; + font-weight: 600; + line-height: 16px; + + .customerIcon { + width: 16px; + height: 16px; + } + } + .gameInfoActions { min-height: 12px; padding: 0 12px; @@ -298,9 +304,7 @@ align-items: center; align-self: stretch; color: #000; - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 14px; font-style: normal; @@ -326,9 +330,7 @@ width: 120px; display: inline-block; color: rgba(60, 60, 67, 0.6); - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 14px; font-style: normal; @@ -338,9 +340,7 @@ .content { color: #000; - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 14px; font-style: normal; @@ -362,7 +362,7 @@ gap: 8px; .copy { - color: #007AFF; + color: #007aff; } } } @@ -378,9 +378,7 @@ align-items: center; align-self: stretch; color: #000; - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 14px; font-style: normal; @@ -401,9 +399,7 @@ align-items: center; color: #000; text-align: center; - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 12px; font-style: normal; @@ -414,9 +410,7 @@ &:nth-child(1) { color: #000; text-align: center; - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 14px; font-style: normal; @@ -451,9 +445,7 @@ align-items: center; align-self: stretch; color: #000; - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 14px; font-style: normal; @@ -489,9 +481,7 @@ background: #000; box-shadow: 0 8px 64px 0 rgba(0, 0, 0, 0.1); backdrop-filter: blur(16px); - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 16px; font-style: normal; @@ -516,7 +506,8 @@ border-bottom-right-radius: 16px; overflow: hidden; - & > .cancel, & > .confirm { + & > .cancel, + & > .confirm { padding: 12px 10px; height: 44px; width: 50%; @@ -545,9 +536,9 @@ .cancelTip { padding: 12px 15px; - color: rgba(60, 60, 67, 0.60); + color: rgba(60, 60, 67, 0.6); text-align: center; - font-feature-settings: 'liga' off, 'clig' off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 16px; font-style: normal; diff --git a/src/order_pages/orderDetail/index.tsx b/src/order_pages/orderDetail/index.tsx index 63c1d94..8416380 100644 --- a/src/order_pages/orderDetail/index.tsx +++ b/src/order_pages/orderDetail/index.tsx @@ -19,9 +19,12 @@ import { getOrderStatus, generateOrderActions, } from "@/utils"; +import { getStorage, setStorage } from "@/store/storage"; import detailService, { GameData } from "@/services/detailService"; import { withAuth, RefundPopup } from "@/components"; import img from "@/config/images"; +import CustomerIcon from "@/static/order/customer.svg"; +import { handleCustomerService } from "@/services/userService"; import { DECLAIMER } from "./config"; import styles from "./index.module.scss"; @@ -65,8 +68,15 @@ function genGameNotice(order_status, start_time) { function GameInfo(props) { const { detail, currentLocation, orderDetail, init } = props; const { order_status, refund_status, amount } = orderDetail; - const { latitude, longitude, location, location_name, start_time, end_time, weather } = - detail || {}; + const { + latitude, + longitude, + location, + location_name, + start_time, + end_time, + weather, + } = detail || {}; const [{ iconDay, tempMax, tempMin }] = weather || [{}]; @@ -306,8 +316,9 @@ function GameInfo(props) { {/* Action bar */} - {orderDetail.order_id - ? generateOrderActions( + {orderDetail.order_id ? ( + <> + {generateOrderActions( orderDetail, { handleDeleteOrder, @@ -324,8 +335,15 @@ function GameInfo(props) { > {obj.text} - )) - : ""} + ))} + + + 客服 + + + ) : ( + "" + )} @@ -353,10 +371,7 @@ function OrderMsg(props) { const { order_info: { registrant_phone } = {} } = checkOrderInfo; const startTime = dayjs(start_time); const endTime = dayjs(end_time); - const startYear = startTime.format("YYYY"); - const startMonth = startTime.format("M"); - const startDay = startTime.format("D"); - const startDate = `${startYear}年${startMonth}月${startDay}日`; + const startDate = startTime.format("YYYY年M月D日"); const gameRange = `${startTime.format("HH:mm")} - ${endTime.format("HH:mm")}`; const summary = [ { @@ -485,9 +500,10 @@ const OrderCheck = () => { const [location, setLocation] = useState([0, 0]); const [checkOrderInfo, setCheckOrderInfo] = useState({}); const [orderDetail, setOrderDetail] = useState({}); + const [paying, setPaying] = useState(false); useDidShow(() => { - init() + init(); }); async function init() { @@ -535,20 +551,32 @@ const OrderCheck = () => { //TODO: get order msg from id const handlePay = async () => { + setPaying(true); Taro.showLoading({ title: "支付中...", mask: true, }); - let payment_params = {} + let payment_params = {}; try { payment_params = await getPaymentParams(); + if (!id) { + setStorage("backFlag", "1"); + Taro.redirectTo({ + url: `/order_pages/orderDetail/index?id=${payment_params.order_id}`, + }); + } await payOrder(payment_params); Taro.hideLoading(); Taro.showToast({ title: "支付成功", icon: "success", }); + const backFlag = getStorage("backFlag"); + if (backFlag === "1") { + setStorage("backFlag", "0"); + Taro.navigateBack(); + } // Taro.navigateBack({ // delta: 1, // }); @@ -559,14 +587,9 @@ const OrderCheck = () => { icon: "none", }); } finally { - await delay(1000); - if (!id) { - Taro.redirectTo({ - url: `/order_pages/orderDetail/index?id=${payment_params.order_id}`, - }); - } else { - init() - } + setStorage("backFlag", "0"); + init(); + setPaying(false); } }; if (!id && !gameId) { @@ -609,7 +632,11 @@ const OrderCheck = () => { {(!id || (order_status === OrderStatus.PENDING && cancel_type === CancelType.NONE)) && ( - diff --git a/src/order_pages/orderList/index.module.scss b/src/order_pages/orderList/index.module.scss index a863198..69263e8 100644 --- a/src/order_pages/orderList/index.module.scss +++ b/src/order_pages/orderList/index.module.scss @@ -29,9 +29,7 @@ align-items: center; justify-content: center; color: rgba(0, 0, 0, 0.8); - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 12px; font-style: normal; @@ -146,7 +144,7 @@ .title { overflow: hidden; color: #000; - font-feature-settings: 'liga' off, 'clig' off; + font-feature-settings: "liga" off, "clig" off; text-overflow: ellipsis; font-family: "PingFang SC"; font-size: 16px; @@ -156,9 +154,7 @@ } .payNum { - font-feature-settings: - "liga" off, - "clig" off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 12px; font-style: normal; @@ -180,8 +176,8 @@ align-items: center; justify-content: flex-start; gap: 8px; - color: rgba(60, 60, 67, 0.60); - font-feature-settings: 'liga' off, 'clig' off; + color: rgba(60, 60, 67, 0.6); + font-feature-settings: "liga" off, "clig" off; text-overflow: ellipsis; font-family: "PingFang SC"; font-size: 12px; @@ -197,8 +193,8 @@ justify-content: flex-start; gap: 4px; - color: rgba(60, 60, 67, 0.60); - font-feature-settings: 'liga' off, 'clig' off; + color: rgba(60, 60, 67, 0.6); + font-feature-settings: "liga" off, "clig" off; text-overflow: ellipsis; font-family: "PingFang SC"; font-size: 12px; @@ -226,13 +222,15 @@ height: 20px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.06); - &+.avatar { + & + .avatar { margin-left: -10px; } } } - .participantProgress, .levelReq, .playType { + .participantProgress, + .levelReq, + .playType { display: flex; height: 20px; padding: 0px 8px; @@ -240,9 +238,9 @@ gap: 4px; border-radius: 999px; border: 0.5px solid rgba(0, 0, 0, 0.16); - background: #FFF; + background: #fff; color: #000; - font-feature-settings: 'liga' off, 'clig' off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 11px; font-style: normal; @@ -271,6 +269,24 @@ justify-content: space-between; .extraActions { + .customer { + display: flex; + align-items: center; + justify-content: flex-start; + gap: 4px; + color: var(--Labels-Secondary, rgba(60, 60, 67, 0.6)); + font-feature-settings: "liga" off, "clig" off; + font-family: "PingFang SC"; + font-size: 12px; + font-style: normal; + font-weight: 600; + line-height: 16px; + + .customerIcon { + width: 16px; + height: 16px; + } + } } .mainActions { @@ -328,7 +344,8 @@ border-bottom-right-radius: 16px; overflow: hidden; - & > .cancel, & > .confirm { + & > .cancel, + & > .confirm { padding: 12px 10px; height: 44px; width: 50%; @@ -357,9 +374,9 @@ .cancelTip { padding: 12px 15px; - color: rgba(60, 60, 67, 0.60); + color: rgba(60, 60, 67, 0.6); text-align: center; - font-feature-settings: 'liga' off, 'clig' off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 16px; font-style: normal; @@ -377,7 +394,7 @@ .emptyTip { color: rgba(0, 0, 0, 0.85); - font-feature-settings: 'liga' off, 'clig' off; + font-feature-settings: "liga" off, "clig" off; font-family: "PingFang SC"; font-size: 14px; font-style: normal; diff --git a/src/order_pages/orderList/index.tsx b/src/order_pages/orderList/index.tsx index df326c9..d84d896 100644 --- a/src/order_pages/orderList/index.tsx +++ b/src/order_pages/orderList/index.tsx @@ -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 ( @@ -277,7 +293,7 @@ const OrderList = () => { handleViewOrderDetail(item)} > {item?.game_info?.title} @@ -287,8 +303,10 @@ const OrderList = () => { styles[unPay ? "pending" : "paid"] )} > - {unPay ? "待支付" : refundTextMap.get(item.refund_status)} ¥{" "} - {item.amount} + + {unPay ? "待支付" : refundTextMap.get(item.refund_status)} + {" "} + ¥ {item.amount} @@ -304,40 +322,19 @@ const OrderList = () => { {participants?.length >= 0 ? ( - { - /* 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 ( - - ); - }) - } + {participants.map((participant) => { + const { + user: { avatar_url, id }, + } = participant; + return ( + + ); + })} ) : ( "" @@ -360,7 +357,15 @@ const OrderList = () => { - + + + + 客服 + + {generateOrderActions( item, diff --git a/src/services/detailService.ts b/src/services/detailService.ts index 954c92a..9b3d221 100644 --- a/src/services/detailService.ts +++ b/src/services/detailService.ts @@ -116,7 +116,7 @@ class GameDetailService { longitude: number; }): Promise> { return httpService.post("/user/update_location", location, { - showLoading: true, + showLoading: false, }); } diff --git a/src/services/loginService.ts b/src/services/loginService.ts index a0027f6..5236b00 100644 --- a/src/services/loginService.ts +++ b/src/services/loginService.ts @@ -414,7 +414,9 @@ export const updateUserPhone = async (payload: ChangePhoneParams) => { // 获取指定用户信息 export const getUserInfoById = async (id) => { try { - const response = await httpService.post("/user/detail_by_id", { id }); + const response = await httpService.post("/user/detail_by_id", { id }, { + showLoading: false, + },); return response; } catch (error) { console.error("获取用户信息失败:", error); diff --git a/src/static/order/customer.svg b/src/static/order/customer.svg new file mode 100644 index 0000000..568a6c7 --- /dev/null +++ b/src/static/order/customer.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file From e729ee6ac5d40f54d28389bd362b6cb209c4a5b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=9D=B0?= Date: Wed, 1 Oct 2025 16:54:04 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20=E5=8E=BB=E9=99=A4=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/game_pages/detail/index.tsx | 39 ++++++++++++++------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/src/game_pages/detail/index.tsx b/src/game_pages/detail/index.tsx index 1375ae3..dc11271 100644 --- a/src/game_pages/detail/index.tsx +++ b/src/game_pages/detail/index.tsx @@ -24,11 +24,6 @@ import { GameManagePopup, Comments, } from "@/components"; -// import { -// EvaluateType, -// SceneType, -// DisplayConditionType, -// } from "@/components/NTRPEvaluatePopup"; import DetailService, { MATCH_STATUS, IsSubstituteSupported, @@ -36,7 +31,6 @@ import DetailService, { import * as LoginService from "@/services/loginService"; import OrderService from "@/services/orderService"; import { getCurrentLocation, calculateDistance } from "@/utils/locationUtils"; -// import { getCurrentFullPath } from "@/utils"; import { useUserInfo, useUserActions } from "@/store/userStore"; import { EvaluateCallback, EvaluateScene } from "@/store/evaluateStore"; import img from "@/config/images"; @@ -55,22 +49,22 @@ function GameTags(props) { const { userInfo, handleViewUserInfo } = props; const { avatar_url, id } = userInfo; const tags = [ - { - name: "🕙 急招", - icon: "", - }, - { - name: "🔥 本周热门", - icon: "", - }, - { - name: "🎉 新活动", - icon: "", - }, - { - name: "官方组织", - icon: "", - }, + // { + // name: "🕙 急招", + // icon: "", + // }, + // { + // name: "🔥 本周热门", + // icon: "", + // }, + // { + // name: "🎉 新活动", + // icon: "", + // }, + // { + // name: "官方组织", + // icon: "", + // }, ]; return ( @@ -145,7 +139,6 @@ function Coursel(props) { }, [image_list]); function previewImage(current_url) { - // console.log(image_list, "image_list"); Taro.previewImage({ current: current_url, urls: list?.length > 0 ? list.map((c) => c.url) : [], From d30909e55962e2aa9f2ac6381e6e979cc7cade26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=9D=B0?= Date: Wed, 1 Oct 2025 17:06:40 +0800 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=A0=B7=E5=BC=8F=E4=B8=BAaspectFill?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NTRPPopupGuide/index.tsx | 2 +- src/components/NTRPTestEntryCard/index.tsx | 4 +-- src/components/UserInfo/index.tsx | 37 +++++++++++++++++----- src/other_pages/ntrp-evaluate/index.tsx | 2 +- src/user_pages/edit/index.tsx | 14 +++++--- 5 files changed, 43 insertions(+), 16 deletions(-) diff --git a/src/components/NTRPPopupGuide/index.tsx b/src/components/NTRPPopupGuide/index.tsx index 426aade..84b71cc 100644 --- a/src/components/NTRPPopupGuide/index.tsx +++ b/src/components/NTRPPopupGuide/index.tsx @@ -40,7 +40,7 @@ function NtrpPopupGuide(props: { {/* avatar side */} diff --git a/src/components/NTRPTestEntryCard/index.tsx b/src/components/NTRPTestEntryCard/index.tsx index 879e112..fcdca0b 100644 --- a/src/components/NTRPTestEntryCard/index.tsx +++ b/src/components/NTRPTestEntryCard/index.tsx @@ -90,7 +90,7 @@ function NTRPTestEntryCard(props: { {/* avatar side */} @@ -119,7 +119,7 @@ function NTRPTestEntryCard(props: { {/* avatar side */} diff --git a/src/components/UserInfo/index.tsx b/src/components/UserInfo/index.tsx index 6e5f69f..0fa731e 100644 --- a/src/components/UserInfo/index.tsx +++ b/src/components/UserInfo/index.tsx @@ -231,7 +231,7 @@ export const UserInfoCard: React.FC = ({ {/* 头像和基本信息 */} - + {user_info.nickname} @@ -331,7 +331,12 @@ export const UserInfoCard: React.FC = ({ )} ) : is_current_user && user_info.gender !== "2" ? ( - { handle_open_edit_modal('gender') }}> + { + handle_open_edit_modal("gender"); + }} + > 选择性别 ) : null} @@ -340,16 +345,28 @@ export const UserInfoCard: React.FC = ({ {`NTRP ${user_info.ntrp_level}`} ) : is_current_user ? ( - { handle_open_edit_modal('ntrp_level') }}> + { + handle_open_edit_modal("ntrp_level"); + }} + > 测测你的NTRP水平 ) : null} {user_info.occupation ? ( - {user_info.occupation.split(" ")[1]} + + {user_info.occupation.split(" ")[1]} + ) : is_current_user ? ( - { handle_open_edit_modal('occupation') }}> + { + handle_open_edit_modal("occupation"); + }} + > 选择职业 ) : null} @@ -358,7 +375,10 @@ export const UserInfoCard: React.FC = ({ {`${user_info.province}${user_info.city}`} ) : is_current_user ? ( - handle_open_edit_modal('location')}> + handle_open_edit_modal("location")} + > 选择地区 ) : null} @@ -601,8 +621,9 @@ export const GameTabs: React.FC = ({ {hosted_text} on_tab_change("participated")} > {participated_text} diff --git a/src/other_pages/ntrp-evaluate/index.tsx b/src/other_pages/ntrp-evaluate/index.tsx index 38bb760..2fc86fc 100644 --- a/src/other_pages/ntrp-evaluate/index.tsx +++ b/src/other_pages/ntrp-evaluate/index.tsx @@ -176,7 +176,7 @@ function Intro() { {/* avatar side */} diff --git a/src/user_pages/edit/index.tsx b/src/user_pages/edit/index.tsx index a4e43bb..988258a 100644 --- a/src/user_pages/edit/index.tsx +++ b/src/user_pages/edit/index.tsx @@ -9,7 +9,7 @@ import { clear_login_state } from "@/services/loginService"; import { convert_db_gender_to_display } from "@/utils/genderUtils"; import { EditModal } from "@/components"; import img from "@/config/images"; -import CommonDialog from '@/components/CommonDialog' +import CommonDialog from "@/components/CommonDialog"; const EditProfilePage: React.FC = () => { // 用户信息状态 @@ -309,7 +309,7 @@ const EditProfilePage: React.FC = () => { // 注销账户 const handle_close_account = () => { setShowLogoutDialog(true); - } + }; const onGetPhoneNumber = async (e) => { if (!e.detail || !e.detail.code) { @@ -362,7 +362,11 @@ const EditProfilePage: React.FC = () => { {/* 头像编辑区域 */} - + { visible={showLogoutDialog} cancelText="确定注销" confirmText="再想想" - onCancel={() => {UserService.logout()}} + onCancel={() => { + UserService.logout(); + }} onConfirm={() => setShowLogoutDialog(false)} contentTitle="确定要注销账号吗?" contentDesc="你的账号将会彻底删除,该操作不可恢复。" From 9cdbfa42ad07c87f06fdc3c3340628b594225927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=9D=B0?= Date: Wed, 1 Oct 2025 17:26:29 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat:=20=E8=AE=A2=E5=8D=95=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=90=83=E5=B1=80=E5=BC=80=E5=B1=80=E5=90=8E=E5=8F=AF?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/game_pages/detail/index.tsx | 5 ++++- src/order_pages/orderList/index.tsx | 27 ++++++++++++++++----------- src/utils/orderActions.ts | 6 ++++-- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/game_pages/detail/index.tsx b/src/game_pages/detail/index.tsx index dc11271..f8fa49e 100644 --- a/src/game_pages/detail/index.tsx +++ b/src/game_pages/detail/index.tsx @@ -793,13 +793,16 @@ function Participants(props) { participant_count, max_participants, user_action_status = {}, + start_time, } = detail; const { can_join, can_pay, can_substitute, is_substituting, waiting_start } = user_action_status; const showApplicationEntry = [can_pay, can_substitute, is_substituting, waiting_start].every( (item) => !item - ) && can_join; + ) && + can_join && + dayjs(start_time).isAfter(dayjs()); const leftCount = max_participants - participant_count; return ( diff --git a/src/order_pages/orderList/index.tsx b/src/order_pages/orderList/index.tsx index d84d896..7872d25 100644 --- a/src/order_pages/orderList/index.tsx +++ b/src/order_pages/orderList/index.tsx @@ -276,6 +276,7 @@ const OrderList = () => { const unPay = item.order_status === OrderStatus.PENDING && item.cancel_type === CancelType.NONE; + const timeout = item.cancel_type === CancelType.TIMEOUT; const { game_info } = item; const { @@ -297,17 +298,21 @@ const OrderList = () => { > {item?.game_info?.title} - - - {unPay ? "待支付" : refundTextMap.get(item.refund_status)} - {" "} - ¥ {item.amount} - + {!timeout && ( + + + {unPay + ? "待支付" + : refundTextMap.get(item.refund_status)} + {" "} + ¥ {item.amount} + + )} {generateTimeMsg(item.game_info || {})} diff --git a/src/utils/orderActions.ts b/src/utils/orderActions.ts index 2367a23..dc53dbf 100644 --- a/src/utils/orderActions.ts +++ b/src/utils/orderActions.ts @@ -5,13 +5,13 @@ export function getOrderStatus(orderData) { if (!order_no) { return 'none' } - const unPay = order_status === OrderStatus.PENDING && cancel_type === CancelType.NONE; + const unPay = order_status === OrderStatus.PENDING && ([CancelType.NONE].includes(cancel_type)); const refund = [RefundStatus.PENDING, RefundStatus.SUCCESS].includes(refund_status); const expired = order_status === OrderStatus.FINISHED || [CancelType.TIMEOUT, CancelType.USER].includes(cancel_type); - return unPay ? 'unpay' : refund ? 'refund' : expired ? 'expired' : 'progress' + return unPay ? 'unpay' : refund ? 'refund' : expired ? cancel_type === CancelType.TIMEOUT ? 'timeout' : 'expired' : 'progress' } // scene: list、detail @@ -54,6 +54,7 @@ export function generateOrderActions(orderData, actions, scene) { if (scene === 'list') { const actionMap = new Map([ + ['timeout', [deleteOrder, gameDetail]], ['expired', [deleteOrder, gameDetail]], ['progress', [quitGame, gameDetail]], ['refund', [deleteOrder, gameDetail]], @@ -64,6 +65,7 @@ export function generateOrderActions(orderData, actions, scene) { if (scene === 'detail') { const actionMap = new Map([ + ['timeout', [deleteOrder, gameDetail]], ['expired', [gameDetail, deleteOrder]], ['progress', [gameDetail, quitGame]], ['refund', [deleteOrder, gameDetail]],