diff --git a/docs/PublishBall使用说明.md b/docs/PublishBall使用说明.md index 2ac3239..a687f42 100644 --- a/docs/PublishBall使用说明.md +++ b/docs/PublishBall使用说明.md @@ -60,7 +60,7 @@ src/ ```typescript // 跳转到发布页面 Taro.navigateTo({ - url: '/pages/publishBall/index' + url: '/publish_pages/publishBall/index' }) ``` @@ -175,4 +175,4 @@ rules: [ --- -*此功能已完全按照设计稿实现,包括颜色、间距、样式等所有细节。* \ No newline at end of file +*此功能已完全按照设计稿实现,包括颜色、间距、样式等所有细节。* \ No newline at end of file diff --git a/src/app.config.ts b/src/app.config.ts index c6e6c12..8b0ab6a 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -1,12 +1,22 @@ export default defineAppConfig({ pages: [ "pages/home/index", //中转页 - "pages/login/index/index", - "pages/login/verification/index", - "pages/login/terms/index", - "pages/publishBall/index", ], subPackages: [ + { + root: 'login_pages', + pages: [ + "login/index/index", + "login/verification/index", + "login/terms/index", + ], + }, + { + root: 'publish_pages', + pages: [ + "publishBall/index", + ], + }, { root: "mod_user", pages: [ diff --git a/src/app.ts b/src/app.ts index 93ee401..21683d7 100644 --- a/src/app.ts +++ b/src/app.ts @@ -12,7 +12,8 @@ interface AppProps { } class App extends Component { - onLaunch() { + onLaunch(options) { + console.log('launch options: ', options) console.log("小程序启动,初始化逻辑写这里"); } diff --git a/src/components/Auth/index.tsx b/src/components/Auth/index.tsx index c7e08e4..5ce1aea 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: `/pages/login/index/index${ + // url: `/login_pages/login/index/index${ // currentPage ? `?redirect=${encodeURIComponent(currentPage)}` : "" // }`, // }); diff --git a/src/components/GuideBar/index.tsx b/src/components/GuideBar/index.tsx index 5d51ae8..a80ee9c 100644 --- a/src/components/GuideBar/index.tsx +++ b/src/components/GuideBar/index.tsx @@ -26,7 +26,7 @@ const GuideBar = (props) => { const handlePublish = () => { Taro.navigateTo({ - url: "/pages/publishBall/index", + url: "/publish_pages/publishBall/index", }); }; diff --git a/src/components/PublishMenu/PublishMenu.tsx b/src/components/PublishMenu/PublishMenu.tsx index 869dabf..e4a1cb0 100644 --- a/src/components/PublishMenu/PublishMenu.tsx +++ b/src/components/PublishMenu/PublishMenu.tsx @@ -20,7 +20,7 @@ const PublishMenu: React.FC = () => { // 跳转到publishBall页面并传递type参数 console.log(type, 'type'); Taro.navigateTo({ - url: `/pages/publishBall/index?type=${type}` + url: `/publish_pages/publishBall/index?type=${type}` }) setIsVisible(false) } @@ -29,11 +29,11 @@ const PublishMenu: React.FC = () => { return ( - + {/* 菜单选项 */} {isVisible && ( - handleMenuItemClick('individual')} > @@ -48,8 +48,8 @@ const PublishMenu: React.FC = () => { - - handleMenuItemClick('group')} > @@ -66,9 +66,9 @@ const PublishMenu: React.FC = () => { )} - + {/* 绿色圆形按钮 */} - diff --git a/src/pages/login/index/index.config.ts b/src/login_pages/login/index/index.config.ts similarity index 100% rename from src/pages/login/index/index.config.ts rename to src/login_pages/login/index/index.config.ts diff --git a/src/pages/login/index/index.scss b/src/login_pages/login/index/index.scss similarity index 100% rename from src/pages/login/index/index.scss rename to src/login_pages/login/index/index.scss diff --git a/src/pages/login/index/index.tsx b/src/login_pages/login/index/index.tsx similarity index 97% rename from src/pages/login/index/index.tsx rename to src/login_pages/login/index/index.tsx index 4d360db..671d259 100644 --- a/src/pages/login/index/index.tsx +++ b/src/login_pages/login/index/index.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { View, Text, Button, Image } from '@tarojs/components'; import Taro, { useRouter } from '@tarojs/taro'; -import { wechat_auth_login, save_login_state, check_login_status } from '../../../services/loginService'; +import { wechat_auth_login, save_login_state, check_login_status } from '@/services/loginService'; import './index.scss'; const LoginPage: React.FC = () => { @@ -82,7 +82,7 @@ const LoginPage: React.FC = () => { // 跳转到验证码页面 Taro.navigateTo({ - url: `/pages/login/verification/index?redirect=${redirect}` + url: `/login_pages/login/verification/index?redirect=${redirect}` }); }; @@ -100,7 +100,7 @@ const LoginPage: React.FC = () => { // 查看协议 const handle_view_terms = (type: string = 'terms') => { Taro.navigateTo({ - url: `/pages/login/terms/index?type=${type}` + url: `/login_pages/login/terms/index?type=${type}` }); }; diff --git a/src/pages/login/terms/README.md b/src/login_pages/login/terms/README.md similarity index 100% rename from src/pages/login/terms/README.md rename to src/login_pages/login/terms/README.md diff --git a/src/pages/login/terms/index.config.ts b/src/login_pages/login/terms/index.config.ts similarity index 100% rename from src/pages/login/terms/index.config.ts rename to src/login_pages/login/terms/index.config.ts diff --git a/src/pages/login/terms/index.scss b/src/login_pages/login/terms/index.scss similarity index 100% rename from src/pages/login/terms/index.scss rename to src/login_pages/login/terms/index.scss diff --git a/src/pages/login/terms/index.tsx b/src/login_pages/login/terms/index.tsx similarity index 100% rename from src/pages/login/terms/index.tsx rename to src/login_pages/login/terms/index.tsx diff --git a/src/pages/login/verification/README.md b/src/login_pages/login/verification/README.md similarity index 100% rename from src/pages/login/verification/README.md rename to src/login_pages/login/verification/README.md diff --git a/src/pages/login/verification/index.config.ts b/src/login_pages/login/verification/index.config.ts similarity index 100% rename from src/pages/login/verification/index.config.ts rename to src/login_pages/login/verification/index.config.ts diff --git a/src/pages/login/verification/index.scss b/src/login_pages/login/verification/index.scss similarity index 100% rename from src/pages/login/verification/index.scss rename to src/login_pages/login/verification/index.scss diff --git a/src/pages/login/verification/index.tsx b/src/login_pages/login/verification/index.tsx similarity index 99% rename from src/pages/login/verification/index.tsx rename to src/login_pages/login/verification/index.tsx index 3f69ad0..fa89165 100644 --- a/src/pages/login/verification/index.tsx +++ b/src/login_pages/login/verification/index.tsx @@ -6,7 +6,7 @@ import { send_sms_code, save_login_state, updateUserPhone, -} from "../../../services/loginService"; +} from "@/services/loginService"; import "./index.scss"; const VerificationPage: React.FC = () => { diff --git a/src/mod_user/pages/edit/index.tsx b/src/mod_user/pages/edit/index.tsx index 6256785..b3c83f5 100644 --- a/src/mod_user/pages/edit/index.tsx +++ b/src/mod_user/pages/edit/index.tsx @@ -239,7 +239,7 @@ const EditProfilePage: React.FC = () => { clear_login_state(); Taro.reLaunch({ - url: '/pages/login/index/index' + url: '/login_pages/login/index/index' }); } } diff --git a/src/pages/home/index.tsx b/src/pages/home/index.tsx index 750683e..68e011a 100644 --- a/src/pages/home/index.tsx +++ b/src/pages/home/index.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; import { View, } from '@tarojs/components'; -import { check_login_status } from '../../services/loginService'; +import { check_login_status } from '@/services/loginService'; import { useUserActions } from '@/store/userStore'; import Taro from '@tarojs/taro'; @@ -20,10 +20,10 @@ const HomePage: React.FC = () => { } catch (error) { console.error('获取用户信息失败:', error); // 如果获取用户信息失败,跳转到登录页 - Taro.redirectTo({ url: '/pages/login/index/index' }); + Taro.redirectTo({ url: '/login_pages/login/index/index' }); } } else { - Taro.redirectTo({ url: '/pages/login/index/index' }); + Taro.redirectTo({ url: '/login_pages/login/index/index' }); } }; diff --git a/src/pages/publishBall/components/FormBasicInfo/FormBasicInfo.scss b/src/publish_pages/publishBall/components/FormBasicInfo/FormBasicInfo.scss similarity index 100% rename from src/pages/publishBall/components/FormBasicInfo/FormBasicInfo.scss rename to src/publish_pages/publishBall/components/FormBasicInfo/FormBasicInfo.scss diff --git a/src/pages/publishBall/components/FormBasicInfo/FormBasicInfo.tsx b/src/publish_pages/publishBall/components/FormBasicInfo/FormBasicInfo.tsx similarity index 100% rename from src/pages/publishBall/components/FormBasicInfo/FormBasicInfo.tsx rename to src/publish_pages/publishBall/components/FormBasicInfo/FormBasicInfo.tsx diff --git a/src/pages/publishBall/components/FormBasicInfo/index.ts b/src/publish_pages/publishBall/components/FormBasicInfo/index.ts similarity index 100% rename from src/pages/publishBall/components/FormBasicInfo/index.ts rename to src/publish_pages/publishBall/components/FormBasicInfo/index.ts diff --git a/src/pages/publishBall/components/PopupGameplay/PopupGameplay.module.scss b/src/publish_pages/publishBall/components/PopupGameplay/PopupGameplay.module.scss similarity index 100% rename from src/pages/publishBall/components/PopupGameplay/PopupGameplay.module.scss rename to src/publish_pages/publishBall/components/PopupGameplay/PopupGameplay.module.scss diff --git a/src/pages/publishBall/components/PopupGameplay/PopupGameplay.tsx b/src/publish_pages/publishBall/components/PopupGameplay/PopupGameplay.tsx similarity index 93% rename from src/pages/publishBall/components/PopupGameplay/PopupGameplay.tsx rename to src/publish_pages/publishBall/components/PopupGameplay/PopupGameplay.tsx index 7e482d2..e72f342 100644 --- a/src/pages/publishBall/components/PopupGameplay/PopupGameplay.tsx +++ b/src/publish_pages/publishBall/components/PopupGameplay/PopupGameplay.tsx @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react' import { View, Text } from '@tarojs/components' -import { CommonPopup } from '../../../../components' +import { CommonPopup } from '@/components' import styles from './PopupGameplay.module.scss' interface PopupGameplayProps { @@ -13,28 +13,28 @@ interface PopupGameplayProps { export default function PopupGameplay({ visible, onClose, onConfirm, value = '不限', options = [] }: PopupGameplayProps) { const [selectedOption, setSelectedOption] = useState(value) - - + + useEffect(() => { if (visible && value) { setSelectedOption(value) } }, [visible, value]) - + const handleOptionSelect = (option: string) => { setSelectedOption(option) } - + const handleClose = () => { onClose() } - + const handleConfirm = () => { onConfirm(selectedOption) } - + return ( - handleOptionSelect(option.value)} diff --git a/src/pages/publishBall/components/PopupGameplay/index.ts b/src/publish_pages/publishBall/components/PopupGameplay/index.ts similarity index 100% rename from src/pages/publishBall/components/PopupGameplay/index.ts rename to src/publish_pages/publishBall/components/PopupGameplay/index.ts diff --git a/src/pages/publishBall/components/SelectStadium/FLOW.md b/src/publish_pages/publishBall/components/SelectStadium/FLOW.md similarity index 100% rename from src/pages/publishBall/components/SelectStadium/FLOW.md rename to src/publish_pages/publishBall/components/SelectStadium/FLOW.md diff --git a/src/pages/publishBall/components/SelectStadium/README.md b/src/publish_pages/publishBall/components/SelectStadium/README.md similarity index 100% rename from src/pages/publishBall/components/SelectStadium/README.md rename to src/publish_pages/publishBall/components/SelectStadium/README.md diff --git a/src/pages/publishBall/components/SelectStadium/SelectStadium.scss b/src/publish_pages/publishBall/components/SelectStadium/SelectStadium.scss similarity index 100% rename from src/pages/publishBall/components/SelectStadium/SelectStadium.scss rename to src/publish_pages/publishBall/components/SelectStadium/SelectStadium.scss diff --git a/src/pages/publishBall/components/SelectStadium/SelectStadium.tsx b/src/publish_pages/publishBall/components/SelectStadium/SelectStadium.tsx similarity index 94% rename from src/pages/publishBall/components/SelectStadium/SelectStadium.tsx rename to src/publish_pages/publishBall/components/SelectStadium/SelectStadium.tsx index db4ed2c..7baa9df 100644 --- a/src/pages/publishBall/components/SelectStadium/SelectStadium.tsx +++ b/src/publish_pages/publishBall/components/SelectStadium/SelectStadium.tsx @@ -3,7 +3,7 @@ import { View, Text, Input, ScrollView, Image } from '@tarojs/components' import Taro from '@tarojs/taro' import { Loading } from '@nutui/nutui-react-taro' import StadiumDetail, { StadiumDetailRef } from './StadiumDetail' -import { CommonPopup } from '../../../../components' +import { CommonPopup } from '@/components' import { getLocation } from '@/utils/locationUtils' import PublishService from '@/services/publishService' import images from '@/config/images' @@ -57,7 +57,7 @@ const SelectStadium: React.FC = ({ setLoading(false) } } - + useEffect(() => { if (visible) { @@ -157,8 +157,8 @@ const SelectStadium: React.FC = ({ ) } - - + + // 如果显示详情页面 if (showDetail && selectedStadium) { @@ -194,7 +194,7 @@ const SelectStadium: React.FC = ({ position="bottom" round > - + {/* 搜索框 */} @@ -255,20 +255,20 @@ const SelectStadium: React.FC = ({ - { - e.stopPropagation() - handleItemLocation(stadium) + onClick={(e) => { + e.stopPropagation() + handleItemLocation(stadium) }} > - {calculateDistance(stadium)} · + {calculateDistance(stadium)} · - { - e.stopPropagation() - handleItemLocation(stadium) + onClick={(e) => { + e.stopPropagation() + handleItemLocation(stadium) }} > {stadium.address} @@ -276,7 +276,7 @@ const SelectStadium: React.FC = ({ - + ))} {searchValue && ( @@ -297,10 +297,10 @@ const SelectStadium: React.FC = ({ ) } {/* 场馆列表 */} - + ) } -export default SelectStadium \ No newline at end of file +export default SelectStadium \ No newline at end of file diff --git a/src/pages/publishBall/components/SelectStadium/StadiumDetail.scss b/src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.scss similarity index 100% rename from src/pages/publishBall/components/SelectStadium/StadiumDetail.scss rename to src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.scss diff --git a/src/pages/publishBall/components/SelectStadium/StadiumDetail.tsx b/src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.tsx similarity index 100% rename from src/pages/publishBall/components/SelectStadium/StadiumDetail.tsx rename to src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.tsx diff --git a/src/pages/publishBall/components/SelectStadium/index.ts b/src/publish_pages/publishBall/components/SelectStadium/index.ts similarity index 100% rename from src/pages/publishBall/components/SelectStadium/index.ts rename to src/publish_pages/publishBall/components/SelectStadium/index.ts diff --git a/src/pages/publishBall/components/WechatSwitch/WechatSwitch.tsx b/src/publish_pages/publishBall/components/WechatSwitch/WechatSwitch.tsx similarity index 100% rename from src/pages/publishBall/components/WechatSwitch/WechatSwitch.tsx rename to src/publish_pages/publishBall/components/WechatSwitch/WechatSwitch.tsx diff --git a/src/pages/publishBall/components/WechatSwitch/index.module.scss b/src/publish_pages/publishBall/components/WechatSwitch/index.module.scss similarity index 100% rename from src/pages/publishBall/components/WechatSwitch/index.module.scss rename to src/publish_pages/publishBall/components/WechatSwitch/index.module.scss diff --git a/src/pages/publishBall/components/WechatSwitch/index.ts b/src/publish_pages/publishBall/components/WechatSwitch/index.ts similarity index 100% rename from src/pages/publishBall/components/WechatSwitch/index.ts rename to src/publish_pages/publishBall/components/WechatSwitch/index.ts diff --git a/src/pages/publishBall/index.config.ts b/src/publish_pages/publishBall/index.config.ts similarity index 100% rename from src/pages/publishBall/index.config.ts rename to src/publish_pages/publishBall/index.config.ts diff --git a/src/pages/publishBall/index.module.scss b/src/publish_pages/publishBall/index.module.scss similarity index 100% rename from src/pages/publishBall/index.module.scss rename to src/publish_pages/publishBall/index.module.scss diff --git a/src/pages/publishBall/index.tsx b/src/publish_pages/publishBall/index.tsx similarity index 98% rename from src/pages/publishBall/index.tsx rename to src/publish_pages/publishBall/index.tsx index 7542962..04b434e 100644 --- a/src/pages/publishBall/index.tsx +++ b/src/publish_pages/publishBall/index.tsx @@ -2,14 +2,14 @@ import React, { useState, useEffect } from "react"; import { View, Text, Button, Image } from "@tarojs/components"; import { Checkbox } from "@nutui/nutui-react-taro"; import Taro from "@tarojs/taro"; -import { type ActivityType } from "../../components/ActivityTypeSwitch"; -import CommonDialog from "../../components/CommonDialog"; +import { type ActivityType } from "@/components/ActivityTypeSwitch"; +import CommonDialog from "@/components/CommonDialog"; import { withAuth } from "@/components"; import PublishForm from "./publishForm"; import { FormFieldConfig, publishBallFormSchema, -} from "../../config/formSchema/publishBallFormSchema"; +} from "@/config/formSchema/publishBallFormSchema"; import { PublishBallFormData } from "../../../types/publishBall"; import PublishService from "@/services/publishService"; import { getNextHourTime, getEndTime, delay } from "@/utils"; diff --git a/src/pages/publishBall/publishForm.tsx b/src/publish_pages/publishBall/publishForm.tsx similarity index 96% rename from src/pages/publishBall/publishForm.tsx rename to src/publish_pages/publishBall/publishForm.tsx index 5c59563..de61049 100644 --- a/src/pages/publishBall/publishForm.tsx +++ b/src/publish_pages/publishBall/publishForm.tsx @@ -1,13 +1,13 @@ import React, { useState, useEffect } from 'react' import { View, Text } from '@tarojs/components' -import { ImageUpload, Range, TimeSelector, TextareaTag, NumberInterval, TitleTextarea, FormSwitch, UploadCover } from '../../components' +import { ImageUpload, Range, TimeSelector, TextareaTag, NumberInterval, TitleTextarea, FormSwitch, UploadCover } from '@/components' import FormBasicInfo from './components/FormBasicInfo' -import { type CoverImage } from '../../components/index.types' -import { FormFieldConfig, FieldType } from '../../config/formSchema/publishBallFormSchema' +import { type CoverImage } from '@/components/index.types' +import { FormFieldConfig, FieldType } from '@/config/formSchema/publishBallFormSchema' import { PublishBallFormData } from '../../../types/publishBall'; import WechatSwitch from './components/WechatSwitch/WechatSwitch' import styles from './index.module.scss' -import { useDictionaryActions } from '../../store/dictionaryStore' +import { useDictionaryActions } from '@/store/dictionaryStore' // 组件映射器 const componentMap = { @@ -97,15 +97,15 @@ const PublishForm: React.FC<{ console.warn('getNTRPText: ntrp 不是有效的数组格式:', ntrp); return '未设置'; } - + const [min, max] = ntrp; - + // 检查 min 和 max 是否为有效数字 if (typeof min !== 'number' || typeof max !== 'number') { console.warn('getNTRPText: min 或 max 不是有效数字:', { min, max }); return '未设置'; } - + if (min === 1.0 && max === 5.0) { return '不限' } @@ -124,7 +124,7 @@ const PublishForm: React.FC<{ if (min > 1.0 && max < 5.0) { return `${min.toFixed(1)} - ${max.toFixed(1)}之间` } - + return ''; } @@ -134,15 +134,15 @@ const PublishForm: React.FC<{ console.warn('getPlayersText: players 不是有效的数组格式:', players); return '未设置'; } - + const [min, max] = players; - + // 检查 min 和 max 是否为有效数字 if (typeof min !== 'number' || typeof max !== 'number') { console.warn('getPlayersText: min 或 max 不是有效数字:', { min, max }); return '未设置'; } - + return `最少${min}人,最多${max}人` }