From 515c480749afc5285f3d25e50ea6d5512b3a07a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=9D=B0?= Date: Fri, 14 Nov 2025 22:19:34 +0800 Subject: [PATCH 1/4] =?UTF-8?q?style:=20=E6=A0=B7=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/order_pages/orderDetail/index.module.scss | 4 ++++ src/order_pages/orderList/index.module.scss | 4 ++++ src/order_pages/orderList/index.tsx | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/order_pages/orderDetail/index.module.scss b/src/order_pages/orderDetail/index.module.scss index c5ec571..5f13806 100644 --- a/src/order_pages/orderDetail/index.module.scss +++ b/src/order_pages/orderDetail/index.module.scss @@ -24,6 +24,10 @@ padding: 20px; box-sizing: border-box; background-color: #fafafa; + + .titleClassName { + color: #000; + } } .gameInfoContainer { diff --git a/src/order_pages/orderList/index.module.scss b/src/order_pages/orderList/index.module.scss index 98099a5..1a4d4f0 100644 --- a/src/order_pages/orderList/index.module.scss +++ b/src/order_pages/orderList/index.module.scss @@ -16,6 +16,10 @@ width: 100%; box-sizing: border-box; + .titleClassName { + color: #000; + } + .list { height: 100%; width: 100%; diff --git a/src/order_pages/orderList/index.tsx b/src/order_pages/orderList/index.tsx index ba22c7e..ca6b15d 100644 --- a/src/order_pages/orderList/index.tsx +++ b/src/order_pages/orderList/index.tsx @@ -266,7 +266,7 @@ const OrderList = () => { style={{ paddingTop: `${totalHeight + 8}px` }} > Date: Fri, 14 Nov 2025 22:33:12 +0800 Subject: [PATCH 2/4] feat: debug scan --- src/game_pages/detail/utils/helper.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/game_pages/detail/utils/helper.ts b/src/game_pages/detail/utils/helper.ts index 8a53ffd..873eefa 100644 --- a/src/game_pages/detail/utils/helper.ts +++ b/src/game_pages/detail/utils/helper.ts @@ -34,6 +34,8 @@ export const useSceneRedirect = (defaultPage: string) => { .map(([k, v]) => `${k}=${encodeURIComponent(v)}`) .join("&"); + console.log('scan query', query) + Taro.redirectTo({ url: query ? `/${defaultPage}?${query}` : `/${defaultPage}`, }); From 7221a86214656f063a2fa6568cfd0c47e36d7761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=9D=B0?= Date: Sat, 15 Nov 2025 10:39:36 +0800 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=E6=89=AB=E7=A0=81=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.ts | 3 ++- src/game_pages/detail/index.tsx | 8 +++---- src/game_pages/detail/utils/helper.ts | 32 +-------------------------- src/utils/helper.ts | 27 ++++++++++++++++++++++ 4 files changed, 34 insertions(+), 36 deletions(-) create mode 100644 src/utils/helper.ts diff --git a/src/app.ts b/src/app.ts index 4388db6..3ed1d93 100644 --- a/src/app.ts +++ b/src/app.ts @@ -5,6 +5,7 @@ import "./app.scss"; import "./scss/qweather-icons/qweather-icons.css"; import { useGlobalStore } from "./store/global"; import { removeStorage } from "./store/storage"; +import { sceneRedirectLogic } from './utils/helper' interface AppProps { children: ReactNode; @@ -17,7 +18,6 @@ function clearSpecStorage() { class App extends Component { onLaunch(options) { - console.log('launch options: ', options) console.log("小程序启动,初始化逻辑写这里"); clearSpecStorage() Taro.onNeedPrivacyAuthorization((resolve) => { @@ -36,6 +36,7 @@ class App extends Component { // console.error('字体加载失败', err); // } // }) + sceneRedirectLogic(options.query, options.path); } componentDidMount() { diff --git a/src/game_pages/detail/index.tsx b/src/game_pages/detail/index.tsx index 77d3557..ffd13b1 100644 --- a/src/game_pages/detail/index.tsx +++ b/src/game_pages/detail/index.tsx @@ -18,7 +18,7 @@ import Participants from "./components/Participants"; import SupplementalNotes from "./components/SupplementalNotes"; import OrganizerInfo from "./components/OrganizerInfo"; import SharePopup from "./components/SharePopup"; -import { navto, toast, useSceneRedirect } from "./utils/helper"; +import { navto, toast } from "./utils/helper"; import ArrowLeft from "@/static/detail/icon-arrow-left.svg"; import Logo from "@/static/detail/icon-logo-go.svg"; import styles from "./index.module.scss"; @@ -37,8 +37,6 @@ function Index() { const { statusNavbarHeightInfo } = useGlobalState(); const { statusBarHeight, navBarHeight } = statusNavbarHeightInfo; - useSceneRedirect("game_pages/detail/index"); - const isMyOwn = userInfo.id === myInfo.id; const sharePopupRef = useRef(null); @@ -254,4 +252,6 @@ function Index() { ); } -export default withAuth(Index); +// export default withAuth(Index); +const ExportPage = withAuth(Index); +export default ExportPage; diff --git a/src/game_pages/detail/utils/helper.ts b/src/game_pages/detail/utils/helper.ts index 873eefa..cf7998e 100644 --- a/src/game_pages/detail/utils/helper.ts +++ b/src/game_pages/detail/utils/helper.ts @@ -1,6 +1,4 @@ -import Taro, { - useLoad, -} from "@tarojs/taro"; +import Taro from "@tarojs/taro"; export function navto(url) { Taro.navigateTo({ @@ -18,34 +16,6 @@ export function insertDotInTags(tags: string[]) { return tags.join("-·-").split("-"); } -export const useSceneRedirect = (defaultPage: string) => { - useLoad((options) => { - if (options.scene) { - try { - const decoded = decodeURIComponent(options.scene || ""); - const params: Record = {}; - decoded.split("&").forEach((pair) => { - const [key, value] = pair.split("="); - if (key) params[key] = value ? decodeURIComponent(value) : ""; - }); - - // 拼接成 URL query - const query = Object.entries(params) - .map(([k, v]) => `${k}=${encodeURIComponent(v)}`) - .join("&"); - - console.log('scan query', query) - - Taro.redirectTo({ - url: query ? `/${defaultPage}?${query}` : `/${defaultPage}`, - }); - } catch (err) { - console.error("scene 解析失败:", err); - } - } - }); -}; - export function genNTRPRequirementText(min, max) { if (min && max && min !== max) { return `${min} - ${max} 之间`; diff --git a/src/utils/helper.ts b/src/utils/helper.ts new file mode 100644 index 0000000..e48b0d3 --- /dev/null +++ b/src/utils/helper.ts @@ -0,0 +1,27 @@ +import Taro from "@tarojs/taro"; + +// 普通函数,不调用 useLoad +export const sceneRedirectLogic = (options, defaultPage: string) => { + console.log(options, 12345) + if (!options.scene) return; + + try { + const decoded = decodeURIComponent(options.scene || ""); + const params: Record = {}; + + decoded.split("&").forEach((pair) => { + const [key, value] = pair.split("="); + if (key) params[key] = value ? decodeURIComponent(value) : ""; + }); + + const query = Object.entries(params) + .map(([k, v]) => `${k}=${encodeURIComponent(v)}`) + .join("&"); + + Taro.redirectTo({ + url: query ? `/${defaultPage}?${query}` : `/${defaultPage}`, + }); + } catch (e) { + console.error(e); + } +}; \ No newline at end of file From 86274c1a23a09edcb22461eb4497e3e402b07c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=9D=B0?= Date: Sat, 15 Nov 2025 11:35:06 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=AB=E7=A0=81?= =?UTF-8?q?=E8=BF=9B=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/app.ts | 17 +++-------------- src/utils/helper.ts | 1 - 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/app.ts b/src/app.ts index 3ed1d93..c197c67 100644 --- a/src/app.ts +++ b/src/app.ts @@ -24,19 +24,6 @@ class App extends Component { // 这里可以自定义弹窗(或直接默认同意) resolve({ event: 'agree' }); // 同意隐私协议 }); - - // Taro.loadFontFace({ - // family: 'Quicksand', - // source: 'url("https://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/other/57dc951f-f10e-45b7-9157-0b1e468187fd.ttf")', - // global: true, // 全局生效 - // success(res) { - // console.log('字体加载成功', res); - // }, - // fail(err) { - // console.error('字体加载失败', err); - // } - // }) - sceneRedirectLogic(options.query, options.path); } componentDidMount() { @@ -45,7 +32,9 @@ class App extends Component { // this.getLocation() } - componentDidShow() { } + componentDidShow(options) { + sceneRedirectLogic(options.query, options.path); + } componentDidHide() { } diff --git a/src/utils/helper.ts b/src/utils/helper.ts index e48b0d3..a223ad3 100644 --- a/src/utils/helper.ts +++ b/src/utils/helper.ts @@ -2,7 +2,6 @@ import Taro from "@tarojs/taro"; // 普通函数,不调用 useLoad export const sceneRedirectLogic = (options, defaultPage: string) => { - console.log(options, 12345) if (!options.scene) return; try {