feat: 增加环境切换

This commit is contained in:
R524809
2026-10-19 17:49:19 +08:00
parent 997042789d
commit fe1074e3f0
21 changed files with 968 additions and 123 deletions
@@ -1,4 +1,5 @@
import { getNavInnerPx } from '../../utils/navMetrics';
import { getApiEnvironment } from '../../config/api';
const HOME_TAB_URL = '/pages/home/home';
const HOME_ROUTE = 'pages/home/home';
@@ -24,6 +25,7 @@ Component({
leftActionType: 'none' as 'none' | 'back' | 'home' | 'brand',
/** 仅首页(Tab 根页)在 logo 旁展示「涂鸦丫」;其余主 Tab 只展示 logo */
showBrandName: false,
apiEnvironment: '',
},
lifetimes: {
attached() {
@@ -44,6 +46,12 @@ Component({
},
methods: {
syncLeftAction() {
this.setData({
apiEnvironment:
wx.getAccountInfoSync().miniProgram.envVersion === 'develop'
? getApiEnvironment()
: '',
});
const pages = getCurrentPages();
const currentRoute = pages[pages.length - 1]?.route || '';
const isTabBarPage = TAB_BAR_ROUTES.has(currentRoute);