feat(tab): 小程序仅保留 3 个 tab:预约/测评/入驻

- app.config tabBar.list 减为 booking(预约)/test(测评)/park-apply(入驻),首页/资讯/我的移出 tab(保留为可导航页)
- custom-tab-bar LIST 同步 3 项、去居中首页 blob;selected 默认 0(预约)
- park-apply 加 useTabIndex(2) 成为 tab;首页「申请入驻」entry 改 switchTab
- 引导页改 booking(预约) 为启动 tab

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Pine
2026-08-27 16:11:39 +08:00
parent 22169108c0
commit cd2f79e264
4 changed files with 13 additions and 15 deletions
+6 -8
View File
@@ -1,7 +1,7 @@
export default {
pages: [
'pages/index/index',
'pages/booking/index',
'pages/index/index',
'pages/test/index',
'pages/policy/index',
'pages/plan/index',
@@ -26,15 +26,13 @@ export default {
tabBar: {
custom: true,
color: '#8a8a93',
selectedColor: '#ffd28a',
backgroundColor: '#000000',
borderStyle: 'black',
selectedColor: '#6284ff',
backgroundColor: '#ffffff',
borderStyle: 'white',
list: [
{ pagePath: 'pages/booking/index', text: '活动' },
{ pagePath: 'pages/booking/index', text: '预约' },
{ pagePath: 'pages/test/index', text: '测评' },
{ pagePath: 'pages/index/index', text: '首页' },
{ pagePath: 'pages/content/index', text: '资讯' },
{ pagePath: 'pages/mine/index', text: '我的' }
{ pagePath: 'pages/park-apply/index', text: '入驻' }
]
}
};
+4 -6
View File
@@ -3,18 +3,16 @@ import { View, Text } from '@tarojs/components';
import Taro from '@tarojs/taro';
import './index.scss';
/* 与 app.config.js tabBar.list 保持一致;首页(index)居中并做特殊凸起按钮 */
/* 与 app.config.js tabBar.list 保持一致;仅 3 项:预约 / 测评 / 入驻 */
const LIST = [
{ pagePath: '/pages/booking/index', text: '活动', icon: 'book' },
{ pagePath: '/pages/booking/index', text: '预约', icon: 'book' },
{ pagePath: '/pages/test/index', text: '测评', icon: 'compass' },
{ pagePath: '/pages/index/index', text: 'OPC', icon: 'star', center: true },
{ pagePath: '/pages/content/index', text: '资讯', icon: 'shield' },
{ pagePath: '/pages/mine/index', text: '我的', icon: 'user' }
{ pagePath: '/pages/park-apply/index', text: '入驻', icon: 'shield' }
];
export default class CustomTabBar extends Component {
state = {
selected: 2 // 默认首页(居中)
selected: 0 // 默认预约
};
switchTab = (item, index) => {
+1 -1
View File
@@ -25,7 +25,7 @@ export default function Index() {
<View className="mk-cta">
<Button className="btn btn-cta" onClick={goTab(MK_HERO.ctaPrimary.tab)}>{MK_HERO.ctaPrimary.label} </Button>
<Button className="btn btn-ghost" onClick={goTab(MK_HERO.ctaSecondary.tab)}>{MK_HERO.ctaSecondary.label}</Button>
<Button className="btn btn-ghost" onClick={() => Taro.navigateTo({ url: '/pages/park-apply/index' })}>申请入驻</Button>
<Button className="btn btn-ghost" onClick={() => Taro.switchTab({ url: '/pages/park-apply/index' })}>申请入驻</Button>
<Button className="btn btn-ghost" onClick={() => Taro.navigateTo({ url: '/pages/cert-apply/index' })}>OPC认证</Button>
<Button className="btn btn-ghost" onClick={() => Taro.navigateTo({ url: '/pages/park-transfer/index' })}>转园申请</Button>
</View>
@@ -1,5 +1,6 @@
import { View, Text, Input, Textarea, Button, Radio, RadioGroup, Checkbox, CheckboxGroup, Picker } from '@tarojs/components';
import Taro from '@tarojs/taro';
import { useTabIndex } from '@/utils/tab';
import { useState, useEffect } from 'react';
import { phoneLogin, bindPhone, isAuthed, getUser } from '@/utils/auth';
import {
@@ -19,6 +20,7 @@ const EMPTY = () => ({
});
export default function ParkApply() {
useTabIndex(2);
const [authed, setAuthed] = useState(isAuthed());
const [gatePhone, setGatePhone] = useState('');
const [gateCode, setGateCode] = useState('');