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'
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 {
|
||||||
@@ -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'
|
||||||
@@ -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 = {
|
||||||
Reference in New Issue
Block a user