Wire Taro social pages to social_svc (Centrifugo + live RTMP), drop multi-channel chat chrome, and add weapp WXSS sanitize/deploy helpers. Co-authored-by: Cursor <cursoragent@cursor.com>
224 lines
5.2 KiB
TypeScript
224 lines
5.2 KiB
TypeScript
const tabBar = {
|
||
color: '#8b93a7',
|
||
selectedColor: '#4ecdc4',
|
||
backgroundColor: '#0c0c0f',
|
||
borderStyle: 'black',
|
||
list: [
|
||
{
|
||
pagePath: 'pages/home/index',
|
||
text: '首页',
|
||
iconPath: 'assets/tab/home.png',
|
||
selectedIconPath: 'assets/tab/home-active.png',
|
||
},
|
||
{
|
||
pagePath: 'pages/nav/index',
|
||
text: '导航',
|
||
iconPath: 'assets/tab/nav.png',
|
||
selectedIconPath: 'assets/tab/nav-active.png',
|
||
},
|
||
{
|
||
pagePath: 'pages/book/index',
|
||
text: '小册',
|
||
iconPath: 'assets/tab/book.png',
|
||
selectedIconPath: 'assets/tab/book-active.png',
|
||
},
|
||
{
|
||
pagePath: 'pages/community/index',
|
||
text: '社群',
|
||
iconPath: 'assets/tab/community.png',
|
||
selectedIconPath: 'assets/tab/community-active.png',
|
||
},
|
||
{
|
||
pagePath: 'pages/mine/index',
|
||
text: '我的',
|
||
iconPath: 'assets/tab/mine.png',
|
||
selectedIconPath: 'assets/tab/mine-active.png',
|
||
},
|
||
],
|
||
}
|
||
|
||
/**
|
||
* H5 / 微信:默认无原生 tabBar(首页入口卡片跳转)。
|
||
* 仅当显式 TARO_APP_TABBAR=1 时才挂五 Tab。
|
||
*/
|
||
const isH5 =
|
||
process.env.TARO_ENV === 'h5' || process.env.TARO_APP_TARGET === 'h5'
|
||
const wantTabBar = !isH5 && process.env.TARO_APP_TABBAR === '1'
|
||
|
||
/** 微信主包必须 ≤2MB:首页/我的/小册留主包(提审小册勿进分包,避免下载失败黑屏) */
|
||
const weappConfig = {
|
||
// 启动页:门户首页(提审专用包见 apps/miniprogram/weapp-audit)
|
||
pages: [
|
||
'pages/home/index',
|
||
'pages/book/index',
|
||
'pages/mine/index',
|
||
'pages/index/index',
|
||
],
|
||
subPackages: [
|
||
{
|
||
root: 'pages/nav',
|
||
name: 'nav',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/reader',
|
||
name: 'reader',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/community',
|
||
name: 'community',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/destinations',
|
||
name: 'destinations',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/destination',
|
||
name: 'destination',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/meetups',
|
||
name: 'meetups',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/vip',
|
||
name: 'vip',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/vip-account',
|
||
name: 'vip-account',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/vip-course',
|
||
name: 'vip-course',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/vip-lesson',
|
||
name: 'vip-lesson',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/vip-ebook',
|
||
name: 'vip-ebook',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/vip-store',
|
||
name: 'vip-store',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/vip-store-detail',
|
||
name: 'vip-store-detail',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/vip-store-orders',
|
||
name: 'vip-store-orders',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/vip-memo',
|
||
name: 'vip-memo',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/vip-memo-detail',
|
||
name: 'vip-memo-detail',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
// weapp 用 index.weapp.tsx stub(无 Three.js);H5 仍用完整 index.tsx
|
||
root: 'pages/game',
|
||
name: 'game',
|
||
pages: ['index'],
|
||
},
|
||
{
|
||
root: 'pages/social',
|
||
name: 'social',
|
||
pages: [
|
||
'index',
|
||
'chat/index',
|
||
'date/index',
|
||
'people/index',
|
||
'people/profile/index',
|
||
'roster/index',
|
||
'meetup/index',
|
||
'meetup-live/index',
|
||
'team/index',
|
||
],
|
||
},
|
||
],
|
||
preloadRule: {
|
||
'pages/home/index': {
|
||
network: 'all',
|
||
packages: ['nav', 'reader', 'social'],
|
||
},
|
||
},
|
||
// AI 开发模式:agent / ai-pkg 独立分包由 weapp/scripts/copy-weapp-static 在 TARO_APP_AI_MODE=1 时注入,勿写进提审包
|
||
// lazyCodeLoading: 'requiredComponents' as const,
|
||
}
|
||
|
||
const h5Config = {
|
||
pages: [
|
||
'pages/home/index',
|
||
'pages/index/index',
|
||
'pages/nav/index',
|
||
'pages/community/index',
|
||
'pages/mine/index',
|
||
'pages/book/index',
|
||
'pages/reader/index',
|
||
'pages/destinations/index',
|
||
'pages/destination/index',
|
||
'pages/meetups/index',
|
||
'pages/vip/index',
|
||
'pages/vip-account/index',
|
||
'pages/vip-course/index',
|
||
'pages/vip-lesson/index',
|
||
'pages/vip-ebook/index',
|
||
'pages/vip-store/index',
|
||
'pages/vip-store-detail/index',
|
||
'pages/vip-store-orders/index',
|
||
'pages/vip-memo/index',
|
||
'pages/vip-memo-detail/index',
|
||
'pages/game/index',
|
||
'pages/social/index',
|
||
'pages/social/chat/index',
|
||
'pages/social/date/index',
|
||
'pages/social/people/index',
|
||
'pages/social/people/profile/index',
|
||
'pages/social/roster/index',
|
||
'pages/social/meetup/index',
|
||
'pages/social/meetup-live/index',
|
||
'pages/social/team/index',
|
||
],
|
||
}
|
||
|
||
export default defineAppConfig({
|
||
...(isH5 ? h5Config : weappConfig),
|
||
window: {
|
||
backgroundTextStyle: 'light',
|
||
navigationBarBackgroundColor: '#0c0c0f',
|
||
navigationBarTitleText: 'nomadro',
|
||
navigationBarTextStyle: 'white',
|
||
backgroundColor: '#0c0c0f',
|
||
},
|
||
permission: {
|
||
'scope.camera': {
|
||
desc: '用于游民社区语音视频见面(live-pusher)',
|
||
},
|
||
'scope.record': {
|
||
desc: '用于游民社区语音视频见面麦克风',
|
||
},
|
||
},
|
||
...(wantTabBar ? { tabBar } : {}),
|
||
})
|