Merge branch 'feat/liujie'
This commit is contained in:
@@ -57,7 +57,7 @@ npm run build:alipay # 支付宝小程序
|
|||||||
|
|
||||||
## 页面路由
|
## 页面路由
|
||||||
|
|
||||||
- `/pages/list/index` - 首页
|
- `/game_pages/list/index` - 首页
|
||||||
- `/pages/publish/publish` - 原发布页面
|
- `/pages/publish/publish` - 原发布页面
|
||||||
- `/pages/publishBall/publishBall` - 新的约球发布页面 ⭐
|
- `/pages/publishBall/publishBall` - 新的约球发布页面 ⭐
|
||||||
- `/pages/dynamicFormDemo/dynamicFormDemo` - 动态表单演示页面 ⭐
|
- `/pages/dynamicFormDemo/dynamicFormDemo` - 动态表单演示页面 ⭐
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default {
|
|||||||
// .plugin('prerender')
|
// .plugin('prerender')
|
||||||
// .use(new Prerender({
|
// .use(new Prerender({
|
||||||
// staticDir,
|
// staticDir,
|
||||||
// routes: [ '/pages/list/index' ],
|
// routes: [ '/game_pages/list/index' ],
|
||||||
// postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') })
|
// postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') })
|
||||||
// }))
|
// }))
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -1,14 +1,9 @@
|
|||||||
export default defineAppConfig({
|
export default defineAppConfig({
|
||||||
pages: [
|
pages: [
|
||||||
"pages/home/index", //中转页
|
"pages/home/index", //中转页
|
||||||
|
|
||||||
"pages/login/index/index",
|
"pages/login/index/index",
|
||||||
"pages/login/verification/index",
|
"pages/login/verification/index",
|
||||||
"pages/login/terms/index",
|
"pages/login/terms/index",
|
||||||
|
|
||||||
"pages/list/index", // 列表页
|
|
||||||
"pages/search/index", // 搜索页
|
|
||||||
"pages/searchResult/index", // 搜索结果页面
|
|
||||||
"pages/publishBall/index",
|
"pages/publishBall/index",
|
||||||
],
|
],
|
||||||
subPackages: [
|
subPackages: [
|
||||||
@@ -17,14 +12,32 @@ export default defineAppConfig({
|
|||||||
pages: [
|
pages: [
|
||||||
"pages/myself/index", // 个人中心
|
"pages/myself/index", // 个人中心
|
||||||
"pages/edit/index", // 个人中心
|
"pages/edit/index", // 个人中心
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
root: 'game_pages',
|
||||||
|
pages: [
|
||||||
|
"list/index", // 列表页
|
||||||
|
"search/index", // 搜索页
|
||||||
|
"searchResult/index", // 搜索结果页面
|
||||||
"detail/index", // 球局详情页
|
"detail/index", // 球局详情页
|
||||||
"message/index", // 消息页
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
root: 'order_pages',
|
||||||
|
pages: [
|
||||||
"orderList/index", // 订单列表页
|
"orderList/index", // 订单列表页
|
||||||
"orderDetail/index", // 订单详情页
|
"orderDetail/index", // 订单详情页
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
root: 'other_pages',
|
||||||
|
pages: [
|
||||||
|
"message/index", // 消息页
|
||||||
"favorites/index", // 收藏页
|
"favorites/index", // 收藏页
|
||||||
"ntrp-evaluate/index", // NTRP评估页
|
"ntrp-evaluate/index", // NTRP评估页
|
||||||
],
|
],
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
window: {
|
window: {
|
||||||
|
|||||||
@@ -40,7 +40,10 @@ const GuideBar = (props) => {
|
|||||||
url = "/mod_user/pages/myself/index";
|
url = "/mod_user/pages/myself/index";
|
||||||
}
|
}
|
||||||
if (code === "message") {
|
if (code === "message") {
|
||||||
url = "/mod_user/message/index";
|
url = "/other_pages/message/index";
|
||||||
|
}
|
||||||
|
if (code === "list") {
|
||||||
|
url = "/game_pages/list/index"
|
||||||
}
|
}
|
||||||
Taro.redirectTo({
|
Taro.redirectTo({
|
||||||
url: url,
|
url: url,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const ListCard: React.FC<ListCardProps> = ({
|
|||||||
const handleViewDetail = () => {
|
const handleViewDetail = () => {
|
||||||
console.log("id", id);
|
console.log("id", id);
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/mod_user/detail/index?id=${id || 1}&from=list`,
|
url: `/game_pages/detail/index?id=${id || 1}&from=list`,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const NTRPEvaluatePopup = (props: NTRPEvaluatePopupProps, ref) => {
|
|||||||
setVisible(false);
|
setVisible(false);
|
||||||
// TODO: 实现NTRP评估逻辑
|
// TODO: 实现NTRP评估逻辑
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/mod_user/ntrp-evaluate/index?redirect=${encodeURIComponent(getCurrentFullPath())}`,
|
url: `/other_pages/ntrp-evaluate/index?redirect=${encodeURIComponent(getCurrentFullPath())}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const ListHeader = (props: IProps) => {
|
|||||||
|
|
||||||
const handleInputClick = () => {
|
const handleInputClick = () => {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: "/pages/search/index",
|
url: "/game_pages/search/index",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,11 +44,11 @@ const ListHeader = (props: IProps) => {
|
|||||||
const pages = Taro.getCurrentPages();
|
const pages = Taro.getCurrentPages();
|
||||||
const currentPage = pages[pages.length - 1];
|
const currentPage = pages[pages.length - 1];
|
||||||
const currentPagePath = currentPage.route;
|
const currentPagePath = currentPage.route;
|
||||||
if (currentPagePath === "pages/searchResult/index") {
|
if (currentPagePath === "game_pages/searchResult/index") {
|
||||||
Taro.navigateBack();
|
Taro.navigateBack();
|
||||||
} else {
|
} else {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: "/pages/search/index",
|
url: "/game_pages/search/index",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -56,7 +56,7 @@ const ListHeader = (props: IProps) => {
|
|||||||
// 点击logo
|
// 点击logo
|
||||||
const handleLogoClick = () => {
|
const handleLogoClick = () => {
|
||||||
Taro.redirectTo({
|
Taro.redirectTo({
|
||||||
url: "pages/list/index", // 列表页
|
url: "game_pages/list/index", // 列表页
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ const SharePopup = forwardRef(
|
|||||||
// useShareAppMessage(() => {
|
// useShareAppMessage(() => {
|
||||||
// return {
|
// return {
|
||||||
// title: '分享',
|
// 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(() => {
|
// useShareTimeline(() => {
|
||||||
// return {
|
// return {
|
||||||
// title: '分享',
|
// 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 {
|
return {
|
||||||
text: "球局已结束,查看其他球局",
|
text: "球局已结束,查看其他球局",
|
||||||
action: navto.bind(null, "/pages/list/index"),
|
action: navto.bind(null, "/game_pages/list/index"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (waiting_start) {
|
if (waiting_start) {
|
||||||
return {
|
return {
|
||||||
text: "等待开始, 查看更多球局",
|
text: "等待开始, 查看更多球局",
|
||||||
action: navto.bind(null, "/pages/list/index"),
|
action: navto.bind(null, "/game_pages/list/index"),
|
||||||
};
|
};
|
||||||
} else if (is_substituting) {
|
} else if (is_substituting) {
|
||||||
return {
|
return {
|
||||||
text: "候补中,查看其他球局",
|
text: "候补中,查看其他球局",
|
||||||
action: navto.bind(null, "/pages/list/index"),
|
action: navto.bind(null, "/game_pages/list/index"),
|
||||||
};
|
};
|
||||||
} else if (can_pay) {
|
} else if (can_pay) {
|
||||||
return {
|
return {
|
||||||
@@ -279,7 +279,7 @@ function StickyButton(props) {
|
|||||||
const res = await OrderService.getUnpaidOrder(id);
|
const res = await OrderService.getUnpaidOrder(id);
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
Taro.navigateTo({
|
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 = () => {
|
const handleJoinGame = () => {
|
||||||
Taro.navigateTo({
|
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();
|
const pages = Taro.getCurrentPages();
|
||||||
if (pages.length <= 1) {
|
if (pages.length <= 1) {
|
||||||
Taro.redirectTo({
|
Taro.redirectTo({
|
||||||
url: "/pages/list/index",
|
url: "/game_pages/list/index",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Taro.navigateBack();
|
Taro.navigateBack();
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import SearchBar from "../../components/SearchBar";
|
import SearchBar from "@/components/SearchBar";
|
||||||
import FilterPopup from "@/components/FilterPopup";
|
import FilterPopup from "@/components/FilterPopup";
|
||||||
import styles from "./index.module.scss";
|
import styles from "./index.module.scss";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
@@ -159,7 +159,7 @@ const ListPage = () => {
|
|||||||
|
|
||||||
const handleSearchClick = () => {
|
const handleSearchClick = () => {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: "/pages/search/index",
|
url: "/game_pages/search/index",
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ const ListSearch = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/pages/searchResult/index`,
|
url: `/game_pages/searchResult/index`,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -130,14 +130,14 @@ const MyselfPage: React.FC = () => {
|
|||||||
// 处理球局订单
|
// 处理球局订单
|
||||||
const handle_game_orders = () => {
|
const handle_game_orders = () => {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: "/mod_user/orderList/index",
|
url: "/order_pages/orderList/index",
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 处理收藏
|
// 处理收藏
|
||||||
const handle_favorites = () => {
|
const handle_favorites = () => {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: "/mod_user/favorites/index",
|
url: "/other_pages/favorites/index",
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ const OtherUserPage: React.FC = () => {
|
|||||||
// 处理球局详情
|
// 处理球局详情
|
||||||
const handle_game_detail = (game_id: string) => {
|
const handle_game_detail = (game_id: string) => {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/mod_user/detail/index?id=${game_id}&from=personal`,
|
url: `/game_pages/detail/index?id=${game_id}&from=personal`,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ const OrderCheck = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="warn"
|
type="warn"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
Taro.redirectTo({ url: "/pages/list/index" });
|
Taro.redirectTo({ url: "/game_pages/list/index" });
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
回到首页
|
回到首页
|
||||||
@@ -144,7 +144,7 @@ const OrderList = () => {
|
|||||||
|
|
||||||
function handleViewOrderDetail(orderId) {
|
function handleViewOrderDetail(orderId) {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/mod_user/orderDetail/index?id=${orderId}`,
|
url: `/order_pages/orderDetail/index?id=${orderId}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ const HomePage: React.FC = () => {
|
|||||||
// 先获取用户信息
|
// 先获取用户信息
|
||||||
await fetchUserInfo();
|
await fetchUserInfo();
|
||||||
// 用户信息获取成功后跳转到列表页
|
// 用户信息获取成功后跳转到列表页
|
||||||
Taro.redirectTo({ url: '/pages/list/index' });
|
Taro.redirectTo({ url: '/game_pages/list/index' });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取用户信息失败:', error);
|
console.error('获取用户信息失败:', error);
|
||||||
// 如果获取用户信息失败,跳转到登录页
|
// 如果获取用户信息失败,跳转到登录页
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ const LoginPage: React.FC = () => {
|
|||||||
if (redirect) {
|
if (redirect) {
|
||||||
Taro.redirectTo({ url: decodeURIComponent(redirect) });
|
Taro.redirectTo({ url: decodeURIComponent(redirect) });
|
||||||
} else {
|
} else {
|
||||||
Taro.redirectTo({ url: '/pages/list/index' });
|
Taro.redirectTo({ url: '/game_pages/list/index' });
|
||||||
}
|
}
|
||||||
}, 10);
|
}, 10);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ const VerificationPage: React.FC = () => {
|
|||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Taro.redirectTo({
|
Taro.redirectTo({
|
||||||
url: "/pages/list/index",
|
url: "/game_pages/list/index",
|
||||||
});
|
});
|
||||||
}, 200);
|
}, 200);
|
||||||
} else {
|
} else {
|
||||||
@@ -182,7 +182,7 @@ const VerificationPage: React.FC = () => {
|
|||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Taro.redirectTo({
|
Taro.redirectTo({
|
||||||
url: "/pages/list/index",
|
url: "/game_pages/list/index",
|
||||||
});
|
});
|
||||||
}, 200);
|
}, 200);
|
||||||
} else {
|
} else {
|
||||||
@@ -353,7 +353,7 @@ const VerificationPage: React.FC = () => {
|
|||||||
className="cancel_button"
|
className="cancel_button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
Taro.redirectTo({
|
Taro.redirectTo({
|
||||||
url: "/pages/list/index",
|
url: "/game_pages/list/index",
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ const PublishBall: React.FC = () => {
|
|||||||
// 如果是畅打,则跳转第一个球局详情页,并自动分享 @刘杰
|
// 如果是畅打,则跳转第一个球局详情页,并自动分享 @刘杰
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
// @ts-expect-error: id
|
// @ts-expect-error: id
|
||||||
url: `/mod_user/detail/index?id=${res.data.id || 1}&from=publish`,
|
url: `/game_pages/detail/index?id=${res.data.id || 1}&from=publish`,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
@@ -361,7 +361,7 @@ const PublishBall: React.FC = () => {
|
|||||||
// 如果是畅打,则跳转第一个球局详情页,并自动分享 @刘杰
|
// 如果是畅打,则跳转第一个球局详情页,并自动分享 @刘杰
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
// @ts-expect-error: id
|
// @ts-expect-error: id
|
||||||
url: `/mod_user/detail/index?id=${res.data?.[0].id || 1}&from=publish`,
|
url: `/game_pages/detail/index?id=${res.data?.[0].id || 1}&from=publish`,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ interface UserStats {
|
|||||||
|
|
||||||
## 使用示例
|
## 使用示例
|
||||||
|
|
||||||
查看 `src/pages/list/index.tsx` 获取完整的使用示例,包括:
|
查看 `src/game_pages/list/index.tsx` 获取完整的使用示例,包括:
|
||||||
|
|
||||||
- 用户信息展示
|
- 用户信息展示
|
||||||
- 统计数据实时更新
|
- 统计数据实时更新
|
||||||
|
|||||||
Reference in New Issue
Block a user