ux: 深色模式平台适配——小程序改为跟随系统说明项(原开关在小程序无效),H5保留手动开关;版本v1.4.7

This commit is contained in:
Hermes Agent
2026-09-19 21:22:19 +08:00
parent df52c039d8
commit a87a631459
2 changed files with 21 additions and 1 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "宇之然AI维度",
"appid": "wxdad62baf4ccd09e3",
"versionName": "1.4.6",
"versionName": "1.4.7",
"versionCode": "100",
"description": "AI 知识探索社区 — 从5个维度系统理解人工智能",
"uni-app": {
+20
View File
@@ -20,6 +20,7 @@
<view class="s-switch-knob" :class="{ on: pushOn }"></view>
</view>
</view>
<!-- #ifdef H5 -->
<view class="setting-item" @click="toggleDarkMode">
<view class="s-icon" style="background:rgba(77,208,225,0.1);color:#4dd0e1">🌙</view>
<view class="s-text">
@@ -30,6 +31,17 @@
<view class="s-switch-knob" :class="{ on: darkMode }"></view>
</view>
</view>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<view class="setting-item" @click="showDarkTip">
<view class="s-icon" style="background:rgba(77,208,225,0.1);color:#4dd0e1">🌙</view>
<view class="s-text">
<text class="s-label">深色模式</text>
<text class="s-desc">跟随系统设置自动切换</text>
</view>
<text class="s-arrow">›</text>
</view>
<!-- #endif -->
</view>
<!-- 其他 -->
@@ -85,6 +97,14 @@ function togglePush() {
})
}
function showDarkTip() {
uni.showModal({
title: '深色模式',
content: '小程序深色模式跟随系统:在手机的 系统设置 → 显示与亮度 中切换深色/浅色,小程序将自动适配。',
showCancel: false,
})
}
function toggleDarkMode() {
darkMode.value = !darkMode.value
const theme = darkMode.value ? 'dark' : 'light'