diff --git a/README.md b/README.md index 1f3c764..b98f64d 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ npm run build:alipay # 支付宝小程序 ## 页面路由 -- `/pages/list/index` - 首页 +- `/game_pages/list/index` - 首页 - `/pages/publish/publish` - 原发布页面 - `/pages/publishBall/publishBall` - 新的约球发布页面 ⭐ - `/pages/dynamicFormDemo/dynamicFormDemo` - 动态表单演示页面 ⭐ @@ -148,4 +148,4 @@ src/ ## License -MIT \ No newline at end of file +MIT \ No newline at end of file diff --git a/config/prod.ts b/config/prod.ts index 7c7ba5f..4fa33e2 100644 --- a/config/prod.ts +++ b/config/prod.ts @@ -24,7 +24,7 @@ export default { // .plugin('prerender') // .use(new Prerender({ // staticDir, - // routes: [ '/pages/list/index' ], + // routes: [ '/game_pages/list/index' ], // postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') }) // })) // } diff --git a/src/app.config.ts b/src/app.config.ts index 0ded27a..c6e6c12 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -1,14 +1,9 @@ export default defineAppConfig({ pages: [ "pages/home/index", //中转页 - "pages/login/index/index", "pages/login/verification/index", "pages/login/terms/index", - - "pages/list/index", // 列表页 - "pages/search/index", // 搜索页 - "pages/searchResult/index", // 搜索结果页面 "pages/publishBall/index", ], subPackages: [ @@ -17,14 +12,32 @@ export default defineAppConfig({ pages: [ "pages/myself/index", // 个人中心 "pages/edit/index", // 个人中心 + ], + }, + { + root: 'game_pages', + pages: [ + "list/index", // 列表页 + "search/index", // 搜索页 + "searchResult/index", // 搜索结果页面 "detail/index", // 球局详情页 - "message/index", // 消息页 + ], + }, + { + root: 'order_pages', + pages: [ "orderList/index", // 订单列表页 "orderDetail/index", // 订单详情页 + ], + }, + { + root: 'other_pages', + pages: [ + "message/index", // 消息页 "favorites/index", // 收藏页 "ntrp-evaluate/index", // NTRP评估页 ], - }, + } ], window: { diff --git a/src/components/GuideBar/index.tsx b/src/components/GuideBar/index.tsx index f8183d7..5d51ae8 100644 --- a/src/components/GuideBar/index.tsx +++ b/src/components/GuideBar/index.tsx @@ -40,7 +40,10 @@ const GuideBar = (props) => { url = "/mod_user/pages/myself/index"; } if (code === "message") { - url = "/mod_user/message/index"; + url = "/other_pages/message/index"; + } + if (code === "list") { + url = "/game_pages/list/index" } Taro.redirectTo({ url: url, diff --git a/src/components/ListCard/index.tsx b/src/components/ListCard/index.tsx index b9600a5..166f9ca 100644 --- a/src/components/ListCard/index.tsx +++ b/src/components/ListCard/index.tsx @@ -34,7 +34,7 @@ const ListCard: React.FC = ({ const handleViewDetail = () => { console.log("id", id); Taro.navigateTo({ - url: `/mod_user/detail/index?id=${id || 1}&from=list`, + url: `/game_pages/detail/index?id=${id || 1}&from=list`, }); }; diff --git a/src/components/NTRPEvaluatePopup/index.tsx b/src/components/NTRPEvaluatePopup/index.tsx index aec7ede..724f678 100644 --- a/src/components/NTRPEvaluatePopup/index.tsx +++ b/src/components/NTRPEvaluatePopup/index.tsx @@ -61,7 +61,7 @@ const NTRPEvaluatePopup = (props: NTRPEvaluatePopupProps, ref) => { setVisible(false); // TODO: 实现NTRP评估逻辑 Taro.navigateTo({ - url: `/mod_user/ntrp-evaluate/index?redirect=${encodeURIComponent(getCurrentFullPath())}`, + url: `/other_pages/ntrp-evaluate/index?redirect=${encodeURIComponent(getCurrentFullPath())}`, }); } diff --git a/src/container/inputCustomerNavbar/index.tsx b/src/container/inputCustomerNavbar/index.tsx index 1b3b242..1690be3 100644 --- a/src/container/inputCustomerNavbar/index.tsx +++ b/src/container/inputCustomerNavbar/index.tsx @@ -37,7 +37,7 @@ const ListHeader = (props: IProps) => { const handleInputClick = () => { Taro.navigateTo({ - url: "/pages/search/index", + url: "/game_pages/search/index", }); } diff --git a/src/container/listCustomNavbar/index.tsx b/src/container/listCustomNavbar/index.tsx index 279f363..9d4e8da 100644 --- a/src/container/listCustomNavbar/index.tsx +++ b/src/container/listCustomNavbar/index.tsx @@ -44,11 +44,11 @@ const ListHeader = (props: IProps) => { const pages = Taro.getCurrentPages(); const currentPage = pages[pages.length - 1]; const currentPagePath = currentPage.route; - if (currentPagePath === "pages/searchResult/index") { + if (currentPagePath === "game_pages/searchResult/index") { Taro.navigateBack(); } else { Taro.navigateTo({ - url: "/pages/search/index", + url: "/game_pages/search/index", }); } }; @@ -56,7 +56,7 @@ const ListHeader = (props: IProps) => { // 点击logo const handleLogoClick = () => { Taro.redirectTo({ - url: "pages/list/index", // 列表页 + url: "game_pages/list/index", // 列表页 }); }; diff --git a/src/mod_user/detail/index.config.ts b/src/game_pages/detail/index.config.ts similarity index 100% rename from src/mod_user/detail/index.config.ts rename to src/game_pages/detail/index.config.ts diff --git a/src/mod_user/detail/index.scss b/src/game_pages/detail/index.scss similarity index 100% rename from src/mod_user/detail/index.scss rename to src/game_pages/detail/index.scss diff --git a/src/mod_user/detail/index.tsx b/src/game_pages/detail/index.tsx similarity index 98% rename from src/mod_user/detail/index.tsx rename to src/game_pages/detail/index.tsx index 29ee08e..e3c929f 100644 --- a/src/mod_user/detail/index.tsx +++ b/src/game_pages/detail/index.tsx @@ -167,7 +167,7 @@ const SharePopup = forwardRef( // useShareAppMessage(() => { // return { // title: '分享', - // path: `/mod_user/detail/index?id=${id}&from=share`, + // path: `/game_pages/detail/index?id=${id}&from=share`, // } // }) // } @@ -176,7 +176,7 @@ const SharePopup = forwardRef( // useShareTimeline(() => { // return { // title: '分享', - // path: `/mod_user/detail/index?id=${id}&from=share`, + // path: `/game_pages/detail/index?id=${id}&from=share`, // } // }) // } @@ -259,18 +259,18 @@ function StickyButton(props) { ) { return { text: "球局已结束,查看其他球局", - action: navto.bind(null, "/pages/list/index"), + action: navto.bind(null, "/game_pages/list/index"), }; } if (waiting_start) { return { text: "等待开始, 查看更多球局", - action: navto.bind(null, "/pages/list/index"), + action: navto.bind(null, "/game_pages/list/index"), }; } else if (is_substituting) { return { text: "候补中,查看其他球局", - action: navto.bind(null, "/pages/list/index"), + action: navto.bind(null, "/game_pages/list/index"), }; } else if (can_pay) { return { @@ -279,7 +279,7 @@ function StickyButton(props) { const res = await OrderService.getUnpaidOrder(id); if (res.code === 0) { Taro.navigateTo({ - url: `/mod_user/orderDetail/index?id=${res.data.order_info.order_id}`, + url: `/order_pages/orderDetail/index?id=${res.data.order_info.order_id}`, }); } }, @@ -1028,7 +1028,7 @@ function Index() { const handleJoinGame = () => { Taro.navigateTo({ - url: `/mod_user/orderDetail/index?gameId=${id}`, + url: `/order_pages/orderDetail/index?gameId=${id}`, }); }; @@ -1036,7 +1036,7 @@ function Index() { const pages = Taro.getCurrentPages(); if (pages.length <= 1) { Taro.redirectTo({ - url: "/pages/list/index", + url: "/game_pages/list/index", }); } else { Taro.navigateBack(); diff --git a/src/pages/list/index.config.ts b/src/game_pages/list/index.config.ts similarity index 100% rename from src/pages/list/index.config.ts rename to src/game_pages/list/index.config.ts diff --git a/src/pages/list/index.module.scss b/src/game_pages/list/index.module.scss similarity index 100% rename from src/pages/list/index.module.scss rename to src/game_pages/list/index.module.scss diff --git a/src/pages/list/index.tsx b/src/game_pages/list/index.tsx similarity index 98% rename from src/pages/list/index.tsx rename to src/game_pages/list/index.tsx index cb53331..6a8fe2e 100644 --- a/src/pages/list/index.tsx +++ b/src/game_pages/list/index.tsx @@ -1,4 +1,4 @@ -import SearchBar from "../../components/SearchBar"; +import SearchBar from "@/components/SearchBar"; import FilterPopup from "@/components/FilterPopup"; import styles from "./index.module.scss"; import { useEffect } from "react"; @@ -89,7 +89,7 @@ const ListPage = () => { console.error('更新用户位置失败:', error); } } - + // 页面加载时获取数据 getMatchesData(); return location; @@ -159,7 +159,7 @@ const ListPage = () => { const handleSearchClick = () => { Taro.navigateTo({ - url: "/pages/search/index", + url: "/game_pages/search/index", }); }; diff --git a/src/pages/search/index.config.ts b/src/game_pages/search/index.config.ts similarity index 100% rename from src/pages/search/index.config.ts rename to src/game_pages/search/index.config.ts diff --git a/src/pages/search/index.scss b/src/game_pages/search/index.scss similarity index 100% rename from src/pages/search/index.scss rename to src/game_pages/search/index.scss diff --git a/src/pages/search/index.tsx b/src/game_pages/search/index.tsx similarity index 99% rename from src/pages/search/index.tsx rename to src/game_pages/search/index.tsx index a44c9f0..c96e757 100644 --- a/src/pages/search/index.tsx +++ b/src/game_pages/search/index.tsx @@ -101,7 +101,7 @@ const ListSearch = () => { return; } Taro.navigateTo({ - url: `/pages/searchResult/index`, + url: `/game_pages/searchResult/index`, }); }; diff --git a/src/pages/searchResult/index.config.ts b/src/game_pages/searchResult/index.config.ts similarity index 100% rename from src/pages/searchResult/index.config.ts rename to src/game_pages/searchResult/index.config.ts diff --git a/src/pages/searchResult/index.scss b/src/game_pages/searchResult/index.scss similarity index 100% rename from src/pages/searchResult/index.scss rename to src/game_pages/searchResult/index.scss diff --git a/src/pages/searchResult/index.tsx b/src/game_pages/searchResult/index.tsx similarity index 100% rename from src/pages/searchResult/index.tsx rename to src/game_pages/searchResult/index.tsx diff --git a/src/mod_user/pages/myself/index.tsx b/src/mod_user/pages/myself/index.tsx index e038315..7534305 100644 --- a/src/mod_user/pages/myself/index.tsx +++ b/src/mod_user/pages/myself/index.tsx @@ -130,14 +130,14 @@ const MyselfPage: React.FC = () => { // 处理球局订单 const handle_game_orders = () => { Taro.navigateTo({ - url: "/mod_user/orderList/index", + url: "/order_pages/orderList/index", }); }; // 处理收藏 const handle_favorites = () => { Taro.navigateTo({ - url: "/mod_user/favorites/index", + url: "/other_pages/favorites/index", }); }; diff --git a/src/mod_user/pages/other/index.tsx b/src/mod_user/pages/other/index.tsx index 9f4b97a..9d0e646 100644 --- a/src/mod_user/pages/other/index.tsx +++ b/src/mod_user/pages/other/index.tsx @@ -105,7 +105,7 @@ const OtherUserPage: React.FC = () => { // 处理球局详情 const handle_game_detail = (game_id: string) => { Taro.navigateTo({ - url: `/mod_user/detail/index?id=${game_id}&from=personal`, + url: `/game_pages/detail/index?id=${game_id}&from=personal`, }); }; diff --git a/src/mod_user/orderDetail/config.ts b/src/order_pages/orderDetail/config.ts similarity index 100% rename from src/mod_user/orderDetail/config.ts rename to src/order_pages/orderDetail/config.ts diff --git a/src/mod_user/orderDetail/index.config.ts b/src/order_pages/orderDetail/index.config.ts similarity index 100% rename from src/mod_user/orderDetail/index.config.ts rename to src/order_pages/orderDetail/index.config.ts diff --git a/src/mod_user/orderDetail/index.module.scss b/src/order_pages/orderDetail/index.module.scss similarity index 100% rename from src/mod_user/orderDetail/index.module.scss rename to src/order_pages/orderDetail/index.module.scss diff --git a/src/mod_user/orderDetail/index.tsx b/src/order_pages/orderDetail/index.tsx similarity index 99% rename from src/mod_user/orderDetail/index.tsx rename to src/order_pages/orderDetail/index.tsx index 0423eae..340b3ec 100644 --- a/src/mod_user/orderDetail/index.tsx +++ b/src/order_pages/orderDetail/index.tsx @@ -324,7 +324,7 @@ const OrderCheck = () => { @@ -80,17 +80,17 @@ import { useUserActions } from '../store/userStore' function MyComponent() { const { incrementRequestCount } = useUserActions() const [loading, setLoading] = useState(false) - + const handleSendRequest = async () => { setLoading(true) - + try { // 模拟网络延迟 await new Promise(resolve => setTimeout(resolve, 1000)) - + // 更新请求计数 incrementRequestCount() - + console.log('请求成功!') } catch (error) { console.error('请求失败:', error) @@ -98,7 +98,7 @@ function MyComponent() { setLoading(false) } } - + return (