diff --git a/apps/mini-user/config/index.ts b/apps/mini-user/config/index.ts index 51b5602..dfbeb86 100644 --- a/apps/mini-user/config/index.ts +++ b/apps/mini-user/config/index.ts @@ -63,11 +63,17 @@ export default defineConfig(async () => ({ }, }, h5: { + // 生产发版由 remote-release 注入 TARO_H5_PUBLIC_PATH=/user/、TARO_H5_ROUTER_BASENAME=/user + // 本地预览勿强制 basename,否则静态托管下易白屏 publicPath: process.env.TARO_H5_PUBLIC_PATH || '/', - router: { - mode: 'browser', - basename: process.env.TARO_H5_ROUTER_BASENAME || '/', - }, + ...(process.env.TARO_H5_ROUTER_BASENAME + ? { + router: { + mode: 'browser' as const, + basename: process.env.TARO_H5_ROUTER_BASENAME, + }, + } + : {}), staticDirectory: 'static', devServer: { port: 5177, diff --git a/apps/mini-user/src/app.css b/apps/mini-user/src/app.css index eab96a0..ce40b8e 100644 --- a/apps/mini-user/src/app.css +++ b/apps/mini-user/src/app.css @@ -19,3 +19,34 @@ body { font-family: var(--font-body); margin: 0; } + +/* 全局隐藏滚动条(H5 + 小程序均可滚动,仅隐藏轨道) */ +html, +page, +body, +#app, +.taro_page, +.taro_router, +.taro-tabbar__panel { + scrollbar-width: none; /* Firefox */ + -ms-overflow-style: none; /* legacy Edge */ +} + +html::-webkit-scrollbar, +page::-webkit-scrollbar, +body::-webkit-scrollbar, +#app::-webkit-scrollbar, +.taro_page::-webkit-scrollbar, +.taro_router::-webkit-scrollbar, +.taro-tabbar__panel::-webkit-scrollbar, +*::-webkit-scrollbar { + width: 0 !important; + height: 0 !important; + display: none !important; + background: transparent; +} + +* { + scrollbar-width: none; + -ms-overflow-style: none; +} diff --git a/apps/mini-user/src/components/PageNavBar.tsx b/apps/mini-user/src/components/PageNavBar.tsx index 8203bb6..40397ff 100644 --- a/apps/mini-user/src/components/PageNavBar.tsx +++ b/apps/mini-user/src/components/PageNavBar.tsx @@ -41,7 +41,9 @@ export default function PageNavBar({ ) : ( )} - {right ?? ( + {right ? ( + {right} + ) : ( )} diff --git a/apps/mini-user/src/components/RegionPicker.tsx b/apps/mini-user/src/components/RegionPicker.tsx index 1fa3aba..af2c71d 100644 --- a/apps/mini-user/src/components/RegionPicker.tsx +++ b/apps/mini-user/src/components/RegionPicker.tsx @@ -167,7 +167,7 @@ export default function RegionPicker({ - + {listItems.map((item) => (