This commit is contained in:
张成
2025-09-12 22:34:12 +08:00
parent 471244ee5d
commit 30d16946d2
30 changed files with 104 additions and 65 deletions

View File

@@ -19,6 +19,38 @@ module.exports = {
"camel2DashComponentName": false "camel2DashComponentName": false
}, },
'nutui-react-taro' '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',
],
],
],
} }

View File

@@ -1,16 +1,16 @@
export default defineAppConfig({ export default defineAppConfig({
pages: [ 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: [ subPackages: [
{
root: 'login_pages',
pages: [
"login/index/index",
"login/verification/index",
"login/terms/index",
],
},
{ {
root: 'publish_pages', root: 'publish_pages',
pages: [ pages: [
@@ -18,38 +18,44 @@ export default defineAppConfig({
], ],
}, },
{ {
root: "mod_user", root: "user_pages",
pages: [ pages: [
"pages/myself/index", // 个人中心 "myself/index", // 个人中心
"pages/edit/index", // 个人中心 "edit/index", // 个人中心
],
},
{
root: 'game_pages',
pages: [
"list/index", // 列表页
"search/index", // 搜索页
"searchResult/index", // 搜索结果页面
"detail/index", // 球局详情页
], ],
}, },
// {
// root: 'game_pages',
// pages: [
// // 列表页
// ],
// },
{ {
root: 'order_pages', root: 'order_pages',
pages: [ pages: [
"orderList/index", // 订单列表页 "orderList/index", // 订单列表页
"orderDetail/index", // 订单详情页 "orderDetail/index", // 订单详情页
], ],
}, },
{ {
root: 'other_pages', root: 'other_pages',
pages: [ pages: [
"message/index", // 消息页 "message/index",
"favorites/index", // 收藏页 "favorites/index", // 收藏页
"ntrp-evaluate/index", // NTRP评估页 "ntrp-evaluate/index", // NTRP评估页
], ],
} }
], ],
"preloadRule": {
"home_pages/index": {
"packages": ["publish_pages", 'order_pages', 'user_pages', 'other_pages'],
"network": "all" // wifi/all
}
},
window: { window: {
backgroundTextStyle: "light", backgroundTextStyle: "light",
navigationBarBackgroundColor: "#fff", navigationBarBackgroundColor: "#fff",

View File

@@ -1,5 +1,5 @@
import { Component, ReactNode } from "react"; import { Component, ReactNode } from "react";
import "./nutui-theme.scss"; import "./nutui-theme.scss";
import "./app.scss"; import "./app.scss";
import "qweather-icons/font/qweather-icons.css"; import "qweather-icons/font/qweather-icons.css";
import { useDictionaryStore } from "./store/dictionaryStore"; import { useDictionaryStore } from "./store/dictionaryStore";

View File

@@ -33,7 +33,7 @@ export default function withAuth<P extends object>(
// if (!is_login) { // if (!is_login) {
// const currentPage = getCurrentFullPath(); // const currentPage = getCurrentFullPath();
// Taro.redirectTo({ // Taro.redirectTo({
// url: `/login_pages/login/index/index${ // url: `/login_pages/index/index${
// currentPage ? `?redirect=${encodeURIComponent(currentPage)}` : "" // currentPage ? `?redirect=${encodeURIComponent(currentPage)}` : ""
// }`, // }`,
// }); // });

View File

@@ -37,7 +37,7 @@ const GuideBar = (props) => {
let url = `/pages/${code}/index`; let url = `/pages/${code}/index`;
if (code === "personal") { if (code === "personal") {
url = "/mod_user/pages/myself/index"; url = "/user_pages/myself/index";
} }
if (code === "message") { if (code === "message") {
url = "/other_pages/message/index"; url = "/other_pages/message/index";

View File

@@ -41,7 +41,7 @@ interface UserInfoCardProps {
// 处理编辑用户信息 // 处理编辑用户信息
const on_edit = () => { const on_edit = () => {
Taro.navigateTo({ Taro.navigateTo({
url: '/mod_user/pages/edit/index' url: '/user_pages/edit/index'
}); });
}; };
// 用户信息卡片组件 // 用户信息卡片组件

View File

@@ -20,10 +20,10 @@ const HomePage: React.FC = () => {
} catch (error) { } catch (error) {
console.error('获取用户信息失败:', error); console.error('获取用户信息失败:', error);
// 如果获取用户信息失败,跳转到登录页 // 如果获取用户信息失败,跳转到登录页
Taro.redirectTo({ url: '/login_pages/login/index/index' }); Taro.redirectTo({ url: '/login_pages/index/index' });
} }
} else { } 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 ( return (
<View className="home_page"> <View className="home_page">
<View>...</View>
</View> </View>
); );
} }

View File

@@ -130,14 +130,14 @@
margin-bottom: 44px; margin-bottom: 44px;
height: 58px; height: 58px;
width: 252px; 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; background-size: contain;
} }
.slogan_container { .slogan_container {
margin-bottom: 51px; 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; background-size: contain;
width: 100%; width: 100%;
height: 114px; height: 114px;

View File

@@ -82,7 +82,7 @@ const LoginPage: React.FC = () => {
// 跳转到验证码页面 // 跳转到验证码页面
Taro.navigateTo({ 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') => { const handle_view_terms = (type: string = 'terms') => {
Taro.navigateTo({ 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 = () => {
<View className="background_image"> <View className="background_image">
<Image <Image
className="bg_img" className="bg_img"
src={require('../../../static/login/login_bg.jpg')} src={require('@/static/login/login_bg.jpg')}
mode="aspectFill" mode="aspectFill"
/> />
<View className="bg_overlay"></View> <View className="bg_overlay"></View>
@@ -148,7 +148,7 @@ const LoginPage: React.FC = () => {
disabled={is_loading} disabled={is_loading}
> >
<View className="wechat_icon"> <View className="wechat_icon">
<Image className="wechat_logo" src={require('../../../static/login/wechat_icon.svg')} /> <Image className="wechat_logo" src={require('@/static/login/wechat_icon.svg')} />
</View> </View>
<Text className="button_text"> <Text className="button_text">
{is_loading ? '登录中...' : '微信快捷登录'} {is_loading ? '登录中...' : '微信快捷登录'}
@@ -161,7 +161,7 @@ const LoginPage: React.FC = () => {
onClick={handle_phone_login} onClick={handle_phone_login}
> >
<View className="phone_icon"> <View className="phone_icon">
<Image className="phone_logo" src={require('../../../static/login/phone_icon.svg')} /> <Image className="phone_logo" src={require('@/static/login/phone_icon.svg')} />
</View> </View>
<Text className="button_text"></Text> <Text className="button_text"></Text>
</Button> </Button>

View File

@@ -3,7 +3,8 @@
// ========================================== // ==========================================
// 引入NutUI原始样式如果需要 // 引入NutUI原始样式如果需要
@import '@nutui/nutui-react-taro/dist/style.css'; // @import '@nutui/nutui-react-taro/dist/style.css';
// 全局主题变量覆盖 // 全局主题变量覆盖
$nut-primary-color: #000000 !important; $nut-primary-color: #000000 !important;

View File

@@ -224,10 +224,10 @@ class HttpService {
// 显示加载提示 // 显示加载提示
if (showLoading) { if (showLoading) {
Taro.showLoading({ // Taro.showLoading({
title: loadingText, // title: loadingText,
mask: true // mask: true
}) // })
} }
try { try {

View File

@@ -13,7 +13,7 @@ const EditProfilePage: React.FC = () => {
const [user_info, setUserInfo] = useState<UserInfo>({ const [user_info, setUserInfo] = useState<UserInfo>({
id: '1', id: '1',
nickname: '加载中...', nickname: '加载中...',
avatar: require('../../../static/userInfo/default_avatar.svg'), avatar: require('@/static/userInfo/default_avatar.svg'),
join_date: '加载中...', join_date: '加载中...',
stats: { stats: {
following: 0, following: 0,
@@ -239,7 +239,7 @@ const EditProfilePage: React.FC = () => {
clear_login_state(); clear_login_state();
Taro.reLaunch({ Taro.reLaunch({
url: '/login_pages/login/index/index' url: '/login_pages/index/index'
}); });
} }
} }
@@ -265,7 +265,7 @@ const EditProfilePage: React.FC = () => {
<View className="avatar_overlay"> <View className="avatar_overlay">
<Image <Image
className="upload_icon" className="upload_icon"
src={require('../../../static/userInfo/edit2.svg')} src={require('@/static/userInfo/edit2.svg')}
/> />
</View> </View>
</View> </View>
@@ -279,12 +279,12 @@ const EditProfilePage: React.FC = () => {
<View className="form_group"> <View className="form_group">
<View className="form_item" onClick={() => handle_open_edit_modal('nickname')}> <View className="form_item" onClick={() => handle_open_edit_modal('nickname')}>
<View className="item_left"> <View className="item_left">
<Image className="item_icon" src={require('../../../static/userInfo/user1.svg')} /> <Image className="item_icon" src={require('@/static/userInfo/user1.svg')} />
<Text className="item_label"></Text> <Text className="item_label"></Text>
</View> </View>
<View className="item_right"> <View className="item_right">
<Text className="item_value">{form_data.nickname || '188的王晨'}</Text> <Text className="item_value">{form_data.nickname || '188的王晨'}</Text>
<Image className="arrow_icon" src={require('../../../static/list/icon-list-right-arrow.svg')} /> <Image className="arrow_icon" src={require('@/static/list/icon-list-right-arrow.svg')} />
</View> </View>
</View> </View>
<View className="divider"></View> <View className="divider"></View>
@@ -300,14 +300,14 @@ const EditProfilePage: React.FC = () => {
> >
<View className="form_item"> <View className="form_item">
<View className="item_left"> <View className="item_left">
<Image className="item_icon" src={require('../../../static/userInfo/user2.svg')} /> <Image className="item_icon" src={require('@/static/userInfo/user2.svg')} />
<Text className="item_label"></Text> <Text className="item_label"></Text>
</View> </View>
<View className="item_right"> <View className="item_right">
<Text className="item_value"> <Text className="item_value">
{convert_db_gender_to_display(form_data.gender)} {convert_db_gender_to_display(form_data.gender)}
</Text> </Text>
<Image className="arrow_icon" src={require('../../../static/list/icon-list-right-arrow.svg')} /> <Image className="arrow_icon" src={require('@/static/list/icon-list-right-arrow.svg')} />
</View> </View>
</View> </View>
</Picker> </Picker>
@@ -323,12 +323,12 @@ const EditProfilePage: React.FC = () => {
> >
<View className="form_item"> <View className="form_item">
<View className="item_left"> <View className="item_left">
<Image className="item_icon" src={require('../../../static/userInfo/tennis.svg')} /> <Image className="item_icon" src={require('@/static/userInfo/tennis.svg')} />
<Text className="item_label"></Text> <Text className="item_label"></Text>
</View> </View>
<View className="item_right"> <View className="item_right">
<Text className="item_value">{form_data.birthday}</Text> <Text className="item_value">{form_data.birthday}</Text>
<Image className="arrow_icon" src={require('../../../static/list/icon-list-right-arrow.svg')} /> <Image className="arrow_icon" src={require('@/static/list/icon-list-right-arrow.svg')} />
</View> </View>
</View> </View>
</Picker> </Picker>
@@ -340,14 +340,14 @@ const EditProfilePage: React.FC = () => {
<View className="form_group"> <View className="form_group">
<View className="form_item" onClick={() => handle_open_edit_modal('personal_profile')}> <View className="form_item" onClick={() => handle_open_edit_modal('personal_profile')}>
<View className="item_left"> <View className="item_left">
<Image className="item_icon" src={require('../../../static/userInfo/message.svg')} /> <Image className="item_icon" src={require('@/static/userInfo/message.svg')} />
<Text className="item_label"></Text> <Text className="item_label"></Text>
</View> </View>
<View className="item_right"> <View className="item_right">
<Text className="item_value"> <Text className="item_value">
{form_data.personal_profile || '介绍一下自己'} {form_data.personal_profile || '介绍一下自己'}
</Text> </Text>
<Image className="arrow_icon" src={require('../../../static/list/icon-list-right-arrow.svg')} /> <Image className="arrow_icon" src={require('@/static/list/icon-list-right-arrow.svg')} />
</View> </View>
</View> </View>
</View> </View>
@@ -359,7 +359,7 @@ const EditProfilePage: React.FC = () => {
{/* 地区 */} {/* 地区 */}
<View className="form_item"> <View className="form_item">
<View className="item_left"> <View className="item_left">
<Image className="item_icon" src={require('../../../static/userInfo/location.svg')} /> <Image className="item_icon" src={require('@/static/userInfo/location.svg')} />
<Text className="item_label"></Text> <Text className="item_label"></Text>
</View> </View>
<View className="item_right"> <View className="item_right">
@@ -377,12 +377,12 @@ const EditProfilePage: React.FC = () => {
{/* NTRP水平 */} {/* NTRP水平 */}
<View className="form_item"> <View className="form_item">
<View className="item_left"> <View className="item_left">
<Image className="item_icon" src={require('../../../static/userInfo/tennis.svg')} /> <Image className="item_icon" src={require('@/static/userInfo/tennis.svg')} />
<Text className="item_label">NTRP </Text> <Text className="item_label">NTRP </Text>
</View> </View>
<View className="item_right"> <View className="item_right">
<Text className="item_value">{form_data.ntrp_level}</Text> <Text className="item_value">{form_data.ntrp_level}</Text>
<Image className="arrow_icon" src={require('../../../static/list/icon-list-right-arrow.svg')} /> <Image className="arrow_icon" src={require('@/static/list/icon-list-right-arrow.svg')} />
</View> </View>
</View> </View>
<View className="divider"></View> <View className="divider"></View>
@@ -390,7 +390,7 @@ const EditProfilePage: React.FC = () => {
{/* 职业 */} {/* 职业 */}
<View className="form_item"> <View className="form_item">
<View className="item_left"> <View className="item_left">
<Image className="item_icon" src={require('../../../static/userInfo/sc.svg')} /> <Image className="item_icon" src={require('@/static/userInfo/sc.svg')} />
<Text className="item_label"></Text> <Text className="item_label"></Text>
</View> </View>
<View className="item_right"> <View className="item_right">
@@ -411,7 +411,7 @@ const EditProfilePage: React.FC = () => {
<View className="form_group"> <View className="form_group">
<View className="form_item"> <View className="form_item">
<View className="item_left"> <View className="item_left">
<Image className="item_icon" src={require('../../../static/userInfo/message.svg')} /> <Image className="item_icon" src={require('@/static/userInfo/message.svg')} />
<Text className="item_label"></Text> <Text className="item_label"></Text>
</View> </View>
<View className="item_right"> <View className="item_right">

View File

@@ -1,4 +1,4 @@
@use '../../../scss/common.scss' as *; @use '../../scss/common.scss' as *;
// 个人页面样式 // 个人页面样式
.myself_page { .myself_page {

View File

@@ -6,7 +6,7 @@ import GuideBar from "@/components/GuideBar";
import { UserInfoCard, UserInfo } from "@/components/UserInfo/index"; import { UserInfoCard, UserInfo } from "@/components/UserInfo/index";
import { UserService } from "@/services/userService"; import { UserService } from "@/services/userService";
import ListContainer from "@/container/listContainer"; import ListContainer from "@/container/listContainer";
import { TennisMatch } from "../../../../types/list/types"; import { TennisMatch } from "@/../types/list/types";
import { withAuth } from "@/components"; import { withAuth } from "@/components";
const MyselfPage: React.FC = () => { const MyselfPage: React.FC = () => {
@@ -21,7 +21,7 @@ const MyselfPage: React.FC = () => {
const [user_info, set_user_info] = useState<UserInfo>({ const [user_info, set_user_info] = useState<UserInfo>({
id: "1", id: "1",
nickname: "加载中...", nickname: "加载中...",
avatar: require("../../../static/userInfo/default_avatar.svg"), avatar: require("@/static/userInfo/default_avatar.svg"),
join_date: "加载中...", join_date: "加载中...",
stats: { stats: {
following: 0, following: 0,
@@ -165,7 +165,7 @@ const MyselfPage: React.FC = () => {
<View className="action_content" onClick={handle_game_orders}> <View className="action_content" onClick={handle_game_orders}>
<Image <Image
className="action_icon" className="action_icon"
src={require("../../../static/userInfo/order_btn.svg")} src={require("@/static/userInfo/order_btn.svg")}
/> />
<Text className="action_text"></Text> <Text className="action_text"></Text>
</View> </View>
@@ -173,7 +173,7 @@ const MyselfPage: React.FC = () => {
<View className="action_content" onClick={handle_favorites}> <View className="action_content" onClick={handle_favorites}>
<Image <Image
className="action_icon" className="action_icon"
src={require("../../../static/userInfo/sc.svg")} src={require("@/static/userInfo/sc.svg")}
/> />
<Text className="action_text"></Text> <Text className="action_text"></Text>
</View> </View>

View File

@@ -21,7 +21,7 @@ const OtherUserPage: React.FC = () => {
const [user_info, setUserInfo] = useState<UserInfo>({ const [user_info, setUserInfo] = useState<UserInfo>({
id: user_id || "1", id: user_id || "1",
nickname: "网球爱好者", nickname: "网球爱好者",
avatar: require("../../../static/userInfo/default_avatar.svg"), avatar: require("@/static/userInfo/default_avatar.svg"),
join_date: "2024年3月加入", join_date: "2024年3月加入",
stats: { stats: {
following: 89, following: 89,