diff --git a/babel.config.js b/babel.config.js
index 30e4f9b..a5e466f 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -19,6 +19,38 @@ module.exports = {
"camel2DashComponentName": false
},
'nutui-react-taro'
- ]
- ]
+ ],
+ [
+ 'import',
+ {
+ libraryName: '@nutui/nutui-react-taro',
+ camel2DashComponentName: false,
+ customName: (name, file) => {
+ return `@nutui/nutui-react-taro/dist/es/packages/${name.toLowerCase()}`
+ },
+ // 自动加载 scss 样式文件
+ customStyleName: (name) =>
+ `@nutui/nutui-react-taro/dist/es/packages/${name.toLowerCase()}/style`,
+ // 自动加载 css 样式文件
+ // customStyleName: (name) => `@nutui/nutui-react-taro/dist/es/packages/${name.toLowerCase()}/style/css`
+
+ // JMAPP 主题
+ // 自动加载 scss 样式文件
+ // customStyleName: (name) => `@nutui/nutui-react-taro/dist/es/packages/${name.toLowerCase()}/style-jmapp`,
+ // 自动加载 css 样式文件
+ // customStyleName: (name) => `@nutui/nutui-react-taro/dist/es/packages/${name.toLowerCase()}/style-jmapp/css`
+
+ // jrkf 端主题
+ // 自动加载 scss 样式文件
+ // customStyleName: (name) => `@nutui/nutui-react-taro/dist/es/packages/${name.toLowerCase()}/style-jrkf`,
+ // 自动加载 css 样式文件
+ // customStyleName: (name) => `@nutui/nutui-react-taro/dist/es/packages/${name.toLowerCase()}/style-jrkf/css`
+ },
+ 'nutui-react',
+ ],
+ ],
+
+
+ ],
+
}
diff --git a/src/app.config.ts b/src/app.config.ts
index 8b0ab6a..17fe620 100644
--- a/src/app.config.ts
+++ b/src/app.config.ts
@@ -1,16 +1,16 @@
export default defineAppConfig({
pages: [
- "pages/home/index", //中转页
+ "home_pages/index", //中转页
+ "login_pages/index/index",
+ "login_pages/verification/index",
+ "login_pages/terms/index",
+ "game_pages/list/index",
+ "game_pages/search/index", // 搜索页
+ "game_pages/searchResult/index", // 搜索结果页面
+ "game_pages/detail/index", // 球局详情页
],
subPackages: [
- {
- root: 'login_pages',
- pages: [
- "login/index/index",
- "login/verification/index",
- "login/terms/index",
- ],
- },
+
{
root: 'publish_pages',
pages: [
@@ -18,38 +18,44 @@ export default defineAppConfig({
],
},
{
- root: "mod_user",
+ root: "user_pages",
pages: [
- "pages/myself/index", // 个人中心
- "pages/edit/index", // 个人中心
- ],
- },
- {
- root: 'game_pages',
- pages: [
- "list/index", // 列表页
- "search/index", // 搜索页
- "searchResult/index", // 搜索结果页面
- "detail/index", // 球局详情页
+ "myself/index", // 个人中心
+ "edit/index", // 个人中心
],
},
+ // {
+ // root: 'game_pages',
+ // pages: [
+ // // 列表页
+
+ // ],
+ // },
{
root: 'order_pages',
pages: [
"orderList/index", // 订单列表页
"orderDetail/index", // 订单详情页
+
],
},
{
root: 'other_pages',
pages: [
- "message/index", // 消息页
+ "message/index",
"favorites/index", // 收藏页
"ntrp-evaluate/index", // NTRP评估页
],
}
],
+ "preloadRule": {
+ "home_pages/index": {
+ "packages": ["publish_pages", 'order_pages', 'user_pages', 'other_pages'],
+ "network": "all" // wifi/all
+ }
+ },
+
window: {
backgroundTextStyle: "light",
navigationBarBackgroundColor: "#fff",
diff --git a/src/app.ts b/src/app.ts
index 21683d7..98ec3fe 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -1,5 +1,5 @@
import { Component, ReactNode } from "react";
-import "./nutui-theme.scss";
+ import "./nutui-theme.scss";
import "./app.scss";
import "qweather-icons/font/qweather-icons.css";
import { useDictionaryStore } from "./store/dictionaryStore";
diff --git a/src/components/Auth/index.tsx b/src/components/Auth/index.tsx
index 5ce1aea..9044f41 100644
--- a/src/components/Auth/index.tsx
+++ b/src/components/Auth/index.tsx
@@ -33,7 +33,7 @@ export default function withAuth
(
// if (!is_login) {
// const currentPage = getCurrentFullPath();
// Taro.redirectTo({
- // url: `/login_pages/login/index/index${
+ // url: `/login_pages/index/index${
// currentPage ? `?redirect=${encodeURIComponent(currentPage)}` : ""
// }`,
// });
diff --git a/src/components/GuideBar/index.tsx b/src/components/GuideBar/index.tsx
index a80ee9c..57c884a 100644
--- a/src/components/GuideBar/index.tsx
+++ b/src/components/GuideBar/index.tsx
@@ -37,7 +37,7 @@ const GuideBar = (props) => {
let url = `/pages/${code}/index`;
if (code === "personal") {
- url = "/mod_user/pages/myself/index";
+ url = "/user_pages/myself/index";
}
if (code === "message") {
url = "/other_pages/message/index";
diff --git a/src/components/UserInfo/index.tsx b/src/components/UserInfo/index.tsx
index 1a9625e..2cc71f1 100644
--- a/src/components/UserInfo/index.tsx
+++ b/src/components/UserInfo/index.tsx
@@ -41,7 +41,7 @@ interface UserInfoCardProps {
// 处理编辑用户信息
const on_edit = () => {
Taro.navigateTo({
- url: '/mod_user/pages/edit/index'
+ url: '/user_pages/edit/index'
});
};
// 用户信息卡片组件
diff --git a/src/pages/home/index.config.ts b/src/home_pages/index.config.ts
similarity index 100%
rename from src/pages/home/index.config.ts
rename to src/home_pages/index.config.ts
diff --git a/src/pages/home/index.tsx b/src/home_pages/index.tsx
similarity index 85%
rename from src/pages/home/index.tsx
rename to src/home_pages/index.tsx
index 68e011a..29b5fe7 100644
--- a/src/pages/home/index.tsx
+++ b/src/home_pages/index.tsx
@@ -20,10 +20,10 @@ const HomePage: React.FC = () => {
} catch (error) {
console.error('获取用户信息失败:', error);
// 如果获取用户信息失败,跳转到登录页
- Taro.redirectTo({ url: '/login_pages/login/index/index' });
+ Taro.redirectTo({ url: '/login_pages/index/index' });
}
} else {
- Taro.redirectTo({ url: '/login_pages/login/index/index' });
+ Taro.redirectTo({ url: '/login_pages/index/index' });
}
};
@@ -32,7 +32,7 @@ const HomePage: React.FC = () => {
return (
- 加载中...
+
);
}
diff --git a/src/login_pages/login/index/index.config.ts b/src/login_pages/index/index.config.ts
similarity index 100%
rename from src/login_pages/login/index/index.config.ts
rename to src/login_pages/index/index.config.ts
diff --git a/src/login_pages/login/index/index.scss b/src/login_pages/index/index.scss
similarity index 98%
rename from src/login_pages/login/index/index.scss
rename to src/login_pages/index/index.scss
index 421457d..d1b23a7 100644
--- a/src/login_pages/login/index/index.scss
+++ b/src/login_pages/index/index.scss
@@ -130,14 +130,14 @@
margin-bottom: 44px;
height: 58px;
width: 252px;
- background: url('../../../static/login/yc.svg') no-repeat left top;
+ background: url('../../static/login/yc.svg') no-repeat left top;
background-size: contain;
}
.slogan_container {
margin-bottom: 51px;
- background: url('../../../static/login/bro.svg') no-repeat left top;
+ background: url('../../static/login/bro.svg') no-repeat left top;
background-size: contain;
width: 100%;
height: 114px;
diff --git a/src/login_pages/login/index/index.tsx b/src/login_pages/index/index.tsx
similarity index 94%
rename from src/login_pages/login/index/index.tsx
rename to src/login_pages/index/index.tsx
index 671d259..233ad6a 100644
--- a/src/login_pages/login/index/index.tsx
+++ b/src/login_pages/index/index.tsx
@@ -82,7 +82,7 @@ const LoginPage: React.FC = () => {
// 跳转到验证码页面
Taro.navigateTo({
- url: `/login_pages/login/verification/index?redirect=${redirect}`
+ url: `/login_pages/verification/index?redirect=${redirect}`
});
};
@@ -100,7 +100,7 @@ const LoginPage: React.FC = () => {
// 查看协议
const handle_view_terms = (type: string = 'terms') => {
Taro.navigateTo({
- url: `/login_pages/login/terms/index?type=${type}`
+ url: `/login_pages/terms/index?type=${type}`
});
};
@@ -119,7 +119,7 @@ const LoginPage: React.FC = () => {
@@ -148,7 +148,7 @@ const LoginPage: React.FC = () => {
disabled={is_loading}
>
-
+
{is_loading ? '登录中...' : '微信快捷登录'}
@@ -161,7 +161,7 @@ const LoginPage: React.FC = () => {
onClick={handle_phone_login}
>
-
+
手机号验证码登录
diff --git a/src/login_pages/login/terms/README.md b/src/login_pages/terms/README.md
similarity index 100%
rename from src/login_pages/login/terms/README.md
rename to src/login_pages/terms/README.md
diff --git a/src/login_pages/login/terms/index.config.ts b/src/login_pages/terms/index.config.ts
similarity index 100%
rename from src/login_pages/login/terms/index.config.ts
rename to src/login_pages/terms/index.config.ts
diff --git a/src/login_pages/login/terms/index.scss b/src/login_pages/terms/index.scss
similarity index 100%
rename from src/login_pages/login/terms/index.scss
rename to src/login_pages/terms/index.scss
diff --git a/src/login_pages/login/terms/index.tsx b/src/login_pages/terms/index.tsx
similarity index 100%
rename from src/login_pages/login/terms/index.tsx
rename to src/login_pages/terms/index.tsx
diff --git a/src/login_pages/login/verification/README.md b/src/login_pages/verification/README.md
similarity index 100%
rename from src/login_pages/login/verification/README.md
rename to src/login_pages/verification/README.md
diff --git a/src/login_pages/login/verification/index.config.ts b/src/login_pages/verification/index.config.ts
similarity index 100%
rename from src/login_pages/login/verification/index.config.ts
rename to src/login_pages/verification/index.config.ts
diff --git a/src/login_pages/login/verification/index.scss b/src/login_pages/verification/index.scss
similarity index 100%
rename from src/login_pages/login/verification/index.scss
rename to src/login_pages/verification/index.scss
diff --git a/src/login_pages/login/verification/index.tsx b/src/login_pages/verification/index.tsx
similarity index 100%
rename from src/login_pages/login/verification/index.tsx
rename to src/login_pages/verification/index.tsx
diff --git a/src/nutui-theme.scss b/src/nutui-theme.scss
index f6cd5b2..36189c7 100644
--- a/src/nutui-theme.scss
+++ b/src/nutui-theme.scss
@@ -3,7 +3,8 @@
// ==========================================
// 引入NutUI原始样式(如果需要)
-@import '@nutui/nutui-react-taro/dist/style.css';
+// @import '@nutui/nutui-react-taro/dist/style.css';
+
// 全局主题变量覆盖
$nut-primary-color: #000000 !important;
diff --git a/src/services/httpService.ts b/src/services/httpService.ts
index 19c1c4a..cb309c0 100644
--- a/src/services/httpService.ts
+++ b/src/services/httpService.ts
@@ -224,10 +224,10 @@ class HttpService {
// 显示加载提示
if (showLoading) {
- Taro.showLoading({
- title: loadingText,
- mask: true
- })
+ // Taro.showLoading({
+ // title: loadingText,
+ // mask: true
+ // })
}
try {
diff --git a/src/mod_user/pages/edit/index.config.ts b/src/user_pages/edit/index.config.ts
similarity index 100%
rename from src/mod_user/pages/edit/index.config.ts
rename to src/user_pages/edit/index.config.ts
diff --git a/src/mod_user/pages/edit/index.scss b/src/user_pages/edit/index.scss
similarity index 100%
rename from src/mod_user/pages/edit/index.scss
rename to src/user_pages/edit/index.scss
diff --git a/src/mod_user/pages/edit/index.tsx b/src/user_pages/edit/index.tsx
similarity index 92%
rename from src/mod_user/pages/edit/index.tsx
rename to src/user_pages/edit/index.tsx
index b3c83f5..5916367 100644
--- a/src/mod_user/pages/edit/index.tsx
+++ b/src/user_pages/edit/index.tsx
@@ -13,7 +13,7 @@ const EditProfilePage: React.FC = () => {
const [user_info, setUserInfo] = useState({
id: '1',
nickname: '加载中...',
- avatar: require('../../../static/userInfo/default_avatar.svg'),
+ avatar: require('@/static/userInfo/default_avatar.svg'),
join_date: '加载中...',
stats: {
following: 0,
@@ -239,7 +239,7 @@ const EditProfilePage: React.FC = () => {
clear_login_state();
Taro.reLaunch({
- url: '/login_pages/login/index/index'
+ url: '/login_pages/index/index'
});
}
}
@@ -265,7 +265,7 @@ const EditProfilePage: React.FC = () => {
@@ -279,12 +279,12 @@ const EditProfilePage: React.FC = () => {
handle_open_edit_modal('nickname')}>
-
+
名字
{form_data.nickname || '188的王晨'}
-
+
@@ -300,14 +300,14 @@ const EditProfilePage: React.FC = () => {
>
-
+
性别
{convert_db_gender_to_display(form_data.gender)}
-
+
@@ -323,12 +323,12 @@ const EditProfilePage: React.FC = () => {
>
-
+
生日
{form_data.birthday}
-
+
@@ -340,14 +340,14 @@ const EditProfilePage: React.FC = () => {
handle_open_edit_modal('personal_profile')}>
-
+
简介
{form_data.personal_profile || '介绍一下自己'}
-
+
@@ -359,7 +359,7 @@ const EditProfilePage: React.FC = () => {
{/* 地区 */}
-
+
地区
@@ -377,12 +377,12 @@ const EditProfilePage: React.FC = () => {
{/* NTRP水平 */}
-
+
NTRP 水平
{form_data.ntrp_level}
-
+
@@ -390,7 +390,7 @@ const EditProfilePage: React.FC = () => {
{/* 职业 */}
-
+
职业
@@ -411,7 +411,7 @@ const EditProfilePage: React.FC = () => {
-
+
手机
diff --git a/src/mod_user/pages/myself/index.config.ts b/src/user_pages/myself/index.config.ts
similarity index 100%
rename from src/mod_user/pages/myself/index.config.ts
rename to src/user_pages/myself/index.config.ts
diff --git a/src/mod_user/pages/myself/index.scss b/src/user_pages/myself/index.scss
similarity index 99%
rename from src/mod_user/pages/myself/index.scss
rename to src/user_pages/myself/index.scss
index 488ee52..2b585e2 100644
--- a/src/mod_user/pages/myself/index.scss
+++ b/src/user_pages/myself/index.scss
@@ -1,4 +1,4 @@
-@use '../../../scss/common.scss' as *;
+@use '../../scss/common.scss' as *;
// 个人页面样式
.myself_page {
diff --git a/src/mod_user/pages/myself/index.tsx b/src/user_pages/myself/index.tsx
similarity index 95%
rename from src/mod_user/pages/myself/index.tsx
rename to src/user_pages/myself/index.tsx
index 7534305..b392c3f 100644
--- a/src/mod_user/pages/myself/index.tsx
+++ b/src/user_pages/myself/index.tsx
@@ -6,7 +6,7 @@ import GuideBar from "@/components/GuideBar";
import { UserInfoCard, UserInfo } from "@/components/UserInfo/index";
import { UserService } from "@/services/userService";
import ListContainer from "@/container/listContainer";
-import { TennisMatch } from "../../../../types/list/types";
+import { TennisMatch } from "@/../types/list/types";
import { withAuth } from "@/components";
const MyselfPage: React.FC = () => {
@@ -21,7 +21,7 @@ const MyselfPage: React.FC = () => {
const [user_info, set_user_info] = useState({
id: "1",
nickname: "加载中...",
- avatar: require("../../../static/userInfo/default_avatar.svg"),
+ avatar: require("@/static/userInfo/default_avatar.svg"),
join_date: "加载中...",
stats: {
following: 0,
@@ -165,7 +165,7 @@ const MyselfPage: React.FC = () => {
我的订单
@@ -173,7 +173,7 @@ const MyselfPage: React.FC = () => {
收藏
diff --git a/src/mod_user/pages/other/index.config.ts b/src/user_pages/other/index.config.ts
similarity index 100%
rename from src/mod_user/pages/other/index.config.ts
rename to src/user_pages/other/index.config.ts
diff --git a/src/mod_user/pages/other/index.scss b/src/user_pages/other/index.scss
similarity index 100%
rename from src/mod_user/pages/other/index.scss
rename to src/user_pages/other/index.scss
diff --git a/src/mod_user/pages/other/index.tsx b/src/user_pages/other/index.tsx
similarity index 98%
rename from src/mod_user/pages/other/index.tsx
rename to src/user_pages/other/index.tsx
index 9d0e646..63222a5 100644
--- a/src/mod_user/pages/other/index.tsx
+++ b/src/user_pages/other/index.tsx
@@ -21,7 +21,7 @@ const OtherUserPage: React.FC = () => {
const [user_info, setUserInfo] = useState({
id: user_id || "1",
nickname: "网球爱好者",
- avatar: require("../../../static/userInfo/default_avatar.svg"),
+ avatar: require("@/static/userInfo/default_avatar.svg"),
join_date: "2024年3月加入",
stats: {
following: 89,