zhb 1 месяц назад
Родитель
Сommit
0cb7e94f14
2 измененных файлов с 72 добавлено и 4 удалено
  1. 11 4
      App.vue
  2. 61 0
      pages.json

+ 11 - 4
App.vue

@@ -30,14 +30,12 @@ function initTheme() {
 	// H5 端:使用 matchMedia 主动获取当前系统主题
 	const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
 	const theme = isDarkMode ? 'dark' : 'light'
-	console.log('H5 初始主题:', theme)
 	globalStore.setGlobalTheme(theme)
 
 	// 监听变化(你的 onThemeChange 已经能工作,但可以再加一层保险)
 	const darkModeQuery = window.matchMedia('(prefers-color-scheme: dark)')
 	const handleChange = (e) => {
 		const newTheme = e.matches ? 'dark' : 'light'
-		console.log('matchMedia 监听到主题变化:', newTheme)
 		globalStore.setGlobalTheme(newTheme)
 	}
 	// 兼容旧版浏览器
@@ -46,6 +44,10 @@ function initTheme() {
 	} else {
 		darkModeQuery.addListener(handleChange)
 	}
+	// 设置 data-bs-theme 属性到 html 标签
+	document.documentElement.setAttribute('data-bs-theme', theme);
+	// 同时设置到 body 标签
+	document.body.setAttribute('data-bs-theme', theme);
 	// #endif
 
 	// #ifdef APP-PLUS
@@ -53,12 +55,10 @@ function initTheme() {
 	uni.getSystemInfo({
 		success: (res) => {
 			let theme = res.osTheme || 'light'
-			console.log('App 系统主题:', theme)
 			globalStore.setGlobalTheme(theme)
 		}
 	})
 	uni.onThemeChange((res) => {
-		console.log('App 主题变化:', res.theme)
 		globalStore.setGlobalTheme(res.theme)
 	})
 	// #endif
@@ -176,10 +176,17 @@ span {
 }
 
 html {
+	--bs-bg-opacity: 1;
+	background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
 	font-size: 32px !important;
 }
 
 uni-page-body {
 	height: 100%;
 }
+
+page {
+	--bs-bg-opacity: 1;
+	background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
+}
 </style>

+ 61 - 0
pages.json

@@ -32,6 +32,7 @@
       "path": "pages/launch/index",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -39,6 +40,7 @@
       "path": "pages/mine/info",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -46,6 +48,7 @@
       "path": "pages/mine/kyc",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -53,6 +56,7 @@
       "path": "pages/mine/improveImmediately",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -60,6 +64,7 @@
       "path": "pages/login/index",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom",
         "topWindow": false,
         "leftWindow": false,
@@ -70,6 +75,7 @@
       "path": "pages/login/regist",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom",
         "topWindow": false,
         "leftWindow": false,
@@ -80,6 +86,7 @@
       "path": "pages/login/reset",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom",
         "topWindow": false,
         "leftWindow": false,
@@ -90,6 +97,7 @@
       "path": "pages/activities/index",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -97,6 +105,7 @@
       "path": "pages/activities/content",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -104,6 +113,7 @@
       "path": "pages/activities/monthly-list",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -111,6 +121,7 @@
       "path": "pages/activities/surplus-list",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -118,6 +129,7 @@
       "path": "pages/activities/detail",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -125,6 +137,7 @@
       "path": "pages/customer/index",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -132,6 +145,7 @@
       "path": "pages/customer/payment-history",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -139,6 +153,7 @@
       "path": "pages/customer/recording-history",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -146,6 +161,7 @@
       "path": "pages/customer/account-select",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -153,6 +169,7 @@
       "path": "pages/customer/create-account",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -160,6 +177,7 @@
       "path": "pages/customer/deposit-select",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -167,6 +185,7 @@
       "path": "pages/customer/withdrawal-select",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -174,6 +193,7 @@
       "path": "pages/customer/deposit",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -181,6 +201,7 @@
       "path": "pages/customer/withdrawal",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -188,6 +209,7 @@
       "path": "pages/customer/transfer",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -195,6 +217,7 @@
       "path": "pages/customer/trade-history",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -202,6 +225,7 @@
       "path": "pages/customer/trade-position",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -209,6 +233,7 @@
       "path": "pages/customer/wallet-history",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -216,6 +241,7 @@
       "path": "pages/customer/wallet-transfer",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -223,6 +249,7 @@
       "path": "pages/ib/index",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -230,6 +257,7 @@
       "path": "pages/ib/customer",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -237,6 +265,7 @@
       "path": "pages/ib/accountList",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -244,6 +273,7 @@
       "path": "pages/ib/subsList",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -251,6 +281,7 @@
       "path": "pages/ib/agentList",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -258,6 +289,7 @@
       "path": "pages/ib/linkList",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -265,6 +297,7 @@
       "path": "pages/ib/report",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -272,6 +305,7 @@
       "path": "pages/ib/complexReport",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -279,6 +313,7 @@
       "path": "pages/ib/transfer",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -286,6 +321,7 @@
       "path": "pages/ib/agent-transfer",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -293,6 +329,7 @@
       "path": "pages/ib/withdraw-select",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -300,6 +337,7 @@
       "path": "pages/ib/withdraw",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -307,6 +345,7 @@
       "path": "pages/ib/recording",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -314,6 +353,7 @@
       "path": "pages/ib/settingPammManager",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -321,6 +361,7 @@
       "path": "pages/ib/openAccount",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -328,6 +369,7 @@
       "path": "pages/ib/openPammManager",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -335,6 +377,7 @@
       "path": "pages/ib/promotion",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -342,6 +385,7 @@
       "path": "pages/analytics/analystViews",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -349,6 +393,7 @@
       "path": "pages/analytics/news",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -356,6 +401,7 @@
       "path": "pages/analytics/detail",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -363,6 +409,7 @@
       "path": "pages/common/chat",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -370,6 +417,7 @@
       "path": "pages/common/download",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -377,6 +425,7 @@
       "path": "pages/common/webview",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -384,6 +433,7 @@
       "path": "pages/common/notice",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -391,6 +441,7 @@
       "path": "pages/follow/index",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -398,6 +449,7 @@
       "path": "pages/follow/report",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -405,6 +457,7 @@
       "path": "pages/follow/transfer",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -412,6 +465,7 @@
       "path": "pages/follow/transfer-history",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -419,6 +473,7 @@
       "path": "pages/follow/trading-management",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -426,6 +481,7 @@
       "path": "pages/follow/follow-list",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -433,6 +489,7 @@
       "path": "pages/follow/subscribe-list",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -440,6 +497,7 @@
       "path": "pages/follow/account-management",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -447,6 +505,7 @@
       "path": "pages/follow/record",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -454,6 +513,7 @@
       "path": "pages/follow/trading-center",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     },
@@ -461,6 +521,7 @@
       "path": "pages/follow/trading-center-single",
       "style": {
         "navigationBarTitleText": "",
+        "backgroundColor": "transparent",
         "navigationStyle": "custom"
       }
     }