feat: 分包
This commit is contained in:
@@ -60,7 +60,7 @@ src/
|
|||||||
```typescript
|
```typescript
|
||||||
// 跳转到发布页面
|
// 跳转到发布页面
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: '/pages/publishBall/index'
|
url: '/publish_pages/publishBall/index'
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -175,4 +175,4 @@ rules: [
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
*此功能已完全按照设计稿实现,包括颜色、间距、样式等所有细节。*
|
*此功能已完全按照设计稿实现,包括颜色、间距、样式等所有细节。*
|
||||||
@@ -1,12 +1,22 @@
|
|||||||
export default defineAppConfig({
|
export default defineAppConfig({
|
||||||
pages: [
|
pages: [
|
||||||
"pages/home/index", //中转页
|
"pages/home/index", //中转页
|
||||||
"pages/login/index/index",
|
|
||||||
"pages/login/verification/index",
|
|
||||||
"pages/login/terms/index",
|
|
||||||
"pages/publishBall/index",
|
|
||||||
],
|
],
|
||||||
subPackages: [
|
subPackages: [
|
||||||
|
{
|
||||||
|
root: 'login_pages',
|
||||||
|
pages: [
|
||||||
|
"login/index/index",
|
||||||
|
"login/verification/index",
|
||||||
|
"login/terms/index",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
root: 'publish_pages',
|
||||||
|
pages: [
|
||||||
|
"publishBall/index",
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
root: "mod_user",
|
root: "mod_user",
|
||||||
pages: [
|
pages: [
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ interface AppProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class App extends Component<AppProps> {
|
class App extends Component<AppProps> {
|
||||||
onLaunch() {
|
onLaunch(options) {
|
||||||
|
console.log('launch options: ', options)
|
||||||
console.log("小程序启动,初始化逻辑写这里");
|
console.log("小程序启动,初始化逻辑写这里");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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: `/pages/login/index/index${
|
// url: `/login_pages/login/index/index${
|
||||||
// currentPage ? `?redirect=${encodeURIComponent(currentPage)}` : ""
|
// currentPage ? `?redirect=${encodeURIComponent(currentPage)}` : ""
|
||||||
// }`,
|
// }`,
|
||||||
// });
|
// });
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const GuideBar = (props) => {
|
|||||||
|
|
||||||
const handlePublish = () => {
|
const handlePublish = () => {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: "/pages/publishBall/index",
|
url: "/publish_pages/publishBall/index",
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const PublishMenu: React.FC<PublishMenuProps> = () => {
|
|||||||
// 跳转到publishBall页面并传递type参数
|
// 跳转到publishBall页面并传递type参数
|
||||||
console.log(type, 'type');
|
console.log(type, 'type');
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/pages/publishBall/index?type=${type}`
|
url: `/publish_pages/publishBall/index?type=${type}`
|
||||||
})
|
})
|
||||||
setIsVisible(false)
|
setIsVisible(false)
|
||||||
}
|
}
|
||||||
@@ -29,11 +29,11 @@ const PublishMenu: React.FC<PublishMenuProps> = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.publishMenu}>
|
<View className={styles.publishMenu}>
|
||||||
|
|
||||||
{/* 菜单选项 */}
|
{/* 菜单选项 */}
|
||||||
{isVisible && (
|
{isVisible && (
|
||||||
<View className={styles.menuCard}>
|
<View className={styles.menuCard}>
|
||||||
<View
|
<View
|
||||||
className={styles.menuItem}
|
className={styles.menuItem}
|
||||||
onClick={() => handleMenuItemClick('individual')}
|
onClick={() => handleMenuItemClick('individual')}
|
||||||
>
|
>
|
||||||
@@ -48,8 +48,8 @@ const PublishMenu: React.FC<PublishMenuProps> = () => {
|
|||||||
<Image src={images.ICON_ARROW_RIGHT} className={styles.img} />
|
<Image src={images.ICON_ARROW_RIGHT} className={styles.img} />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
className={styles.menuItem}
|
className={styles.menuItem}
|
||||||
onClick={() => handleMenuItemClick('group')}
|
onClick={() => handleMenuItemClick('group')}
|
||||||
>
|
>
|
||||||
@@ -66,9 +66,9 @@ const PublishMenu: React.FC<PublishMenuProps> = () => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* 绿色圆形按钮 */}
|
{/* 绿色圆形按钮 */}
|
||||||
<View
|
<View
|
||||||
className={`${styles.greenButton} ${isVisible ? styles.rotated : ''}`}
|
className={`${styles.greenButton} ${isVisible ? styles.rotated : ''}`}
|
||||||
onClick={handleIconClick}
|
onClick={handleIconClick}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { View, Text, Button, Image } from '@tarojs/components';
|
import { View, Text, Button, Image } from '@tarojs/components';
|
||||||
import Taro, { useRouter } from '@tarojs/taro';
|
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';
|
import './index.scss';
|
||||||
|
|
||||||
const LoginPage: React.FC = () => {
|
const LoginPage: React.FC = () => {
|
||||||
@@ -82,7 +82,7 @@ const LoginPage: React.FC = () => {
|
|||||||
|
|
||||||
// 跳转到验证码页面
|
// 跳转到验证码页面
|
||||||
Taro.navigateTo({
|
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') => {
|
const handle_view_terms = (type: string = 'terms') => {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/pages/login/terms/index?type=${type}`
|
url: `/login_pages/login/terms/index?type=${type}`
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
send_sms_code,
|
send_sms_code,
|
||||||
save_login_state,
|
save_login_state,
|
||||||
updateUserPhone,
|
updateUserPhone,
|
||||||
} from "../../../services/loginService";
|
} from "@/services/loginService";
|
||||||
import "./index.scss";
|
import "./index.scss";
|
||||||
|
|
||||||
const VerificationPage: React.FC = () => {
|
const VerificationPage: React.FC = () => {
|
||||||
@@ -239,7 +239,7 @@ const EditProfilePage: React.FC = () => {
|
|||||||
clear_login_state();
|
clear_login_state();
|
||||||
|
|
||||||
Taro.reLaunch({
|
Taro.reLaunch({
|
||||||
url: '/pages/login/index/index'
|
url: '/login_pages/login/index/index'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import { View, } from '@tarojs/components';
|
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 { useUserActions } from '@/store/userStore';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
@@ -20,10 +20,10 @@ const HomePage: React.FC = () => {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取用户信息失败:', error);
|
console.error('获取用户信息失败:', error);
|
||||||
// 如果获取用户信息失败,跳转到登录页
|
// 如果获取用户信息失败,跳转到登录页
|
||||||
Taro.redirectTo({ url: '/pages/login/index/index' });
|
Taro.redirectTo({ url: '/login_pages/login/index/index' });
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Taro.redirectTo({ url: '/pages/login/index/index' });
|
Taro.redirectTo({ url: '/login_pages/login/index/index' });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useState, useEffect } from 'react'
|
import React, { useState, useEffect } from 'react'
|
||||||
import { View, Text } from '@tarojs/components'
|
import { View, Text } from '@tarojs/components'
|
||||||
import { CommonPopup } from '../../../../components'
|
import { CommonPopup } from '@/components'
|
||||||
import styles from './PopupGameplay.module.scss'
|
import styles from './PopupGameplay.module.scss'
|
||||||
|
|
||||||
interface PopupGameplayProps {
|
interface PopupGameplayProps {
|
||||||
@@ -13,28 +13,28 @@ interface PopupGameplayProps {
|
|||||||
|
|
||||||
export default function PopupGameplay({ visible, onClose, onConfirm, value = '不限', options = [] }: PopupGameplayProps) {
|
export default function PopupGameplay({ visible, onClose, onConfirm, value = '不限', options = [] }: PopupGameplayProps) {
|
||||||
const [selectedOption, setSelectedOption] = useState(value)
|
const [selectedOption, setSelectedOption] = useState(value)
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (visible && value) {
|
if (visible && value) {
|
||||||
setSelectedOption(value)
|
setSelectedOption(value)
|
||||||
}
|
}
|
||||||
}, [visible, value])
|
}, [visible, value])
|
||||||
|
|
||||||
const handleOptionSelect = (option: string) => {
|
const handleOptionSelect = (option: string) => {
|
||||||
setSelectedOption(option)
|
setSelectedOption(option)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
onClose()
|
onClose()
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleConfirm = () => {
|
const handleConfirm = () => {
|
||||||
onConfirm(selectedOption)
|
onConfirm(selectedOption)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CommonPopup
|
<CommonPopup
|
||||||
visible={visible}
|
visible={visible}
|
||||||
onClose={handleClose}
|
onClose={handleClose}
|
||||||
showHeader={false}
|
showHeader={false}
|
||||||
@@ -44,7 +44,7 @@ export default function PopupGameplay({ visible, onClose, onConfirm, value = '
|
|||||||
>
|
>
|
||||||
<View className={styles.optionsList}>
|
<View className={styles.optionsList}>
|
||||||
{options.map((option) => (
|
{options.map((option) => (
|
||||||
<View
|
<View
|
||||||
key={option.value}
|
key={option.value}
|
||||||
className={`${styles.optionItem} ${selectedOption === option.value ? styles.selected : ''}`}
|
className={`${styles.optionItem} ${selectedOption === option.value ? styles.selected : ''}`}
|
||||||
onClick={() => handleOptionSelect(option.value)}
|
onClick={() => handleOptionSelect(option.value)}
|
||||||
@@ -3,7 +3,7 @@ import { View, Text, Input, ScrollView, Image } from '@tarojs/components'
|
|||||||
import Taro from '@tarojs/taro'
|
import Taro from '@tarojs/taro'
|
||||||
import { Loading } from '@nutui/nutui-react-taro'
|
import { Loading } from '@nutui/nutui-react-taro'
|
||||||
import StadiumDetail, { StadiumDetailRef } from './StadiumDetail'
|
import StadiumDetail, { StadiumDetailRef } from './StadiumDetail'
|
||||||
import { CommonPopup } from '../../../../components'
|
import { CommonPopup } from '@/components'
|
||||||
import { getLocation } from '@/utils/locationUtils'
|
import { getLocation } from '@/utils/locationUtils'
|
||||||
import PublishService from '@/services/publishService'
|
import PublishService from '@/services/publishService'
|
||||||
import images from '@/config/images'
|
import images from '@/config/images'
|
||||||
@@ -57,7 +57,7 @@ const SelectStadium: React.FC<SelectStadiumProps> = ({
|
|||||||
setLoading(false)
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
@@ -157,8 +157,8 @@ const SelectStadium: React.FC<SelectStadiumProps> = ({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 如果显示详情页面
|
// 如果显示详情页面
|
||||||
if (showDetail && selectedStadium) {
|
if (showDetail && selectedStadium) {
|
||||||
@@ -194,7 +194,7 @@ const SelectStadium: React.FC<SelectStadiumProps> = ({
|
|||||||
position="bottom"
|
position="bottom"
|
||||||
round
|
round
|
||||||
>
|
>
|
||||||
|
|
||||||
<View className='select-stadium'>
|
<View className='select-stadium'>
|
||||||
{/* 搜索框 */}
|
{/* 搜索框 */}
|
||||||
<View className='search-section'>
|
<View className='search-section'>
|
||||||
@@ -255,20 +255,20 @@ const SelectStadium: React.FC<SelectStadiumProps> = ({
|
|||||||
<View className='stadium-item-right'>
|
<View className='stadium-item-right'>
|
||||||
<View className='stadium-name' dangerouslySetInnerHTML={{ __html: markSearchText(stadium.name) }}></View>
|
<View className='stadium-name' dangerouslySetInnerHTML={{ __html: markSearchText(stadium.name) }}></View>
|
||||||
<View className='stadium-address'>
|
<View className='stadium-address'>
|
||||||
<Text
|
<Text
|
||||||
className='stadium-distance'
|
className='stadium-distance'
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
handleItemLocation(stadium)
|
handleItemLocation(stadium)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{calculateDistance(stadium)} ·
|
{calculateDistance(stadium)} ·
|
||||||
</Text>
|
</Text>
|
||||||
<Text
|
<Text
|
||||||
className='stadium-address-text'
|
className='stadium-address-text'
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
handleItemLocation(stadium)
|
handleItemLocation(stadium)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{stadium.address}
|
{stadium.address}
|
||||||
@@ -276,7 +276,7 @@ const SelectStadium: React.FC<SelectStadiumProps> = ({
|
|||||||
<Image src={images.ICON_ARRORW_SMALL} className='stadium-map-icon' />
|
<Image src={images.ICON_ARRORW_SMALL} className='stadium-map-icon' />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
{searchValue && (
|
{searchValue && (
|
||||||
@@ -297,10 +297,10 @@ const SelectStadium: React.FC<SelectStadiumProps> = ({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
{/* 场馆列表 */}
|
{/* 场馆列表 */}
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
</CommonPopup>
|
</CommonPopup>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SelectStadium
|
export default SelectStadium
|
||||||
@@ -2,14 +2,14 @@ import React, { useState, useEffect } from "react";
|
|||||||
import { View, Text, Button, Image } from "@tarojs/components";
|
import { View, Text, Button, Image } from "@tarojs/components";
|
||||||
import { Checkbox } from "@nutui/nutui-react-taro";
|
import { Checkbox } from "@nutui/nutui-react-taro";
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from "@tarojs/taro";
|
||||||
import { type ActivityType } from "../../components/ActivityTypeSwitch";
|
import { type ActivityType } from "@/components/ActivityTypeSwitch";
|
||||||
import CommonDialog from "../../components/CommonDialog";
|
import CommonDialog from "@/components/CommonDialog";
|
||||||
import { withAuth } from "@/components";
|
import { withAuth } from "@/components";
|
||||||
import PublishForm from "./publishForm";
|
import PublishForm from "./publishForm";
|
||||||
import {
|
import {
|
||||||
FormFieldConfig,
|
FormFieldConfig,
|
||||||
publishBallFormSchema,
|
publishBallFormSchema,
|
||||||
} from "../../config/formSchema/publishBallFormSchema";
|
} from "@/config/formSchema/publishBallFormSchema";
|
||||||
import { PublishBallFormData } from "../../../types/publishBall";
|
import { PublishBallFormData } from "../../../types/publishBall";
|
||||||
import PublishService from "@/services/publishService";
|
import PublishService from "@/services/publishService";
|
||||||
import { getNextHourTime, getEndTime, delay } from "@/utils";
|
import { getNextHourTime, getEndTime, delay } from "@/utils";
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
import React, { useState, useEffect } from 'react'
|
import React, { useState, useEffect } from 'react'
|
||||||
import { View, Text } from '@tarojs/components'
|
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 FormBasicInfo from './components/FormBasicInfo'
|
||||||
import { type CoverImage } from '../../components/index.types'
|
import { type CoverImage } from '@/components/index.types'
|
||||||
import { FormFieldConfig, FieldType } from '../../config/formSchema/publishBallFormSchema'
|
import { FormFieldConfig, FieldType } from '@/config/formSchema/publishBallFormSchema'
|
||||||
import { PublishBallFormData } from '../../../types/publishBall';
|
import { PublishBallFormData } from '../../../types/publishBall';
|
||||||
import WechatSwitch from './components/WechatSwitch/WechatSwitch'
|
import WechatSwitch from './components/WechatSwitch/WechatSwitch'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import { useDictionaryActions } from '../../store/dictionaryStore'
|
import { useDictionaryActions } from '@/store/dictionaryStore'
|
||||||
|
|
||||||
// 组件映射器
|
// 组件映射器
|
||||||
const componentMap = {
|
const componentMap = {
|
||||||
@@ -97,15 +97,15 @@ const PublishForm: React.FC<{
|
|||||||
console.warn('getNTRPText: ntrp 不是有效的数组格式:', ntrp);
|
console.warn('getNTRPText: ntrp 不是有效的数组格式:', ntrp);
|
||||||
return '未设置';
|
return '未设置';
|
||||||
}
|
}
|
||||||
|
|
||||||
const [min, max] = ntrp;
|
const [min, max] = ntrp;
|
||||||
|
|
||||||
// 检查 min 和 max 是否为有效数字
|
// 检查 min 和 max 是否为有效数字
|
||||||
if (typeof min !== 'number' || typeof max !== 'number') {
|
if (typeof min !== 'number' || typeof max !== 'number') {
|
||||||
console.warn('getNTRPText: min 或 max 不是有效数字:', { min, max });
|
console.warn('getNTRPText: min 或 max 不是有效数字:', { min, max });
|
||||||
return '未设置';
|
return '未设置';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (min === 1.0 && max === 5.0) {
|
if (min === 1.0 && max === 5.0) {
|
||||||
return '不限'
|
return '不限'
|
||||||
}
|
}
|
||||||
@@ -124,7 +124,7 @@ const PublishForm: React.FC<{
|
|||||||
if (min > 1.0 && max < 5.0) {
|
if (min > 1.0 && max < 5.0) {
|
||||||
return `${min.toFixed(1)} - ${max.toFixed(1)}之间`
|
return `${min.toFixed(1)} - ${max.toFixed(1)}之间`
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,15 +134,15 @@ const PublishForm: React.FC<{
|
|||||||
console.warn('getPlayersText: players 不是有效的数组格式:', players);
|
console.warn('getPlayersText: players 不是有效的数组格式:', players);
|
||||||
return '未设置';
|
return '未设置';
|
||||||
}
|
}
|
||||||
|
|
||||||
const [min, max] = players;
|
const [min, max] = players;
|
||||||
|
|
||||||
// 检查 min 和 max 是否为有效数字
|
// 检查 min 和 max 是否为有效数字
|
||||||
if (typeof min !== 'number' || typeof max !== 'number') {
|
if (typeof min !== 'number' || typeof max !== 'number') {
|
||||||
console.warn('getPlayersText: min 或 max 不是有效数字:', { min, max });
|
console.warn('getPlayersText: min 或 max 不是有效数字:', { min, max });
|
||||||
return '未设置';
|
return '未设置';
|
||||||
}
|
}
|
||||||
|
|
||||||
return `最少${min}人,最多${max}人`
|
return `最少${min}人,最多${max}人`
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user