feat: 关于弹窗 + 帮助反馈Toast + 动态版本号(WGT热更新后自动变化)
This commit is contained in:
@ -9,25 +9,54 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="menu-card">
|
<view class="menu-card">
|
||||||
<view v-for="item in ['工作统计', '设置', '帮助与反馈', '关于']" :key="item" class="menu-item">
|
<view v-for="item in ['工作统计', '设置', '帮助与反馈', '关于']" :key="item"
|
||||||
|
class="menu-item" @click="handleMenuClick(item)">
|
||||||
<text class="menu-text">{{ item }}</text>
|
<text class="menu-text">{{ item }}</text>
|
||||||
|
<text class="menu-arrow">›</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<button class="logout-btn" @tap="handleLogout">退出登录</button>
|
<button class="logout-btn" @tap="handleLogout">退出登录</button>
|
||||||
<view class="version">T1.0.2</view>
|
<view class="version">{{ appVersion }}</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from "vue";
|
import { ref, computed, onMounted } from "vue";
|
||||||
|
|
||||||
const user = ref(null);
|
const user = ref(null);
|
||||||
try { const r = uni.getStorageSync("user"); if (r) user.value = JSON.parse(r); } catch {}
|
try { const r = uni.getStorageSync("user"); if (r) user.value = JSON.parse(r); } catch {}
|
||||||
const initial = computed(() => (user.value?.display_name || "?")[0]);
|
const initial = computed(() => (user.value?.display_name || "?")[0]);
|
||||||
|
|
||||||
|
// 🚀 动态版本号 — 热更新后自动变化
|
||||||
|
const appVersion = ref("T1.0.2");
|
||||||
|
onMounted(() => {
|
||||||
|
try {
|
||||||
|
const sysInfo = uni.getSystemInfoSync();
|
||||||
|
appVersion.value = sysInfo.appWgtVersion || sysInfo.appVersion || "T1.0.2";
|
||||||
|
} catch {}
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleMenuClick(item) {
|
||||||
|
switch (item) {
|
||||||
|
case "关于":
|
||||||
|
uni.showModal({
|
||||||
|
title: "关于 Track",
|
||||||
|
content: "Track 生产流转管理系统\n当前版本:" + appVersion.value + "\n核心架构:FastAPI + Vue3 + uni-app",
|
||||||
|
showCancel: false,
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "帮助与反馈":
|
||||||
|
uni.showToast({ title: "反馈通道搭建中,敬请期待...", icon: "none" });
|
||||||
|
break;
|
||||||
|
// 工作统计、设置 暂不处理
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function handleLogout() {
|
function handleLogout() {
|
||||||
uni.removeStorageSync("token");
|
uni.removeStorageSync("token");
|
||||||
|
uni.removeStorageSync("access_token");
|
||||||
|
uni.removeStorageSync("refresh_token");
|
||||||
uni.removeStorageSync("user");
|
uni.removeStorageSync("user");
|
||||||
uni.reLaunch({ url: "/pages/login/login" });
|
uni.reLaunch({ url: "/pages/login/login" });
|
||||||
}
|
}
|
||||||
@ -43,6 +72,7 @@ function handleLogout() {
|
|||||||
.menu-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #f3f4f6; }
|
.menu-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #f3f4f6; }
|
||||||
.menu-item:last-child { border-bottom: none; }
|
.menu-item:last-child { border-bottom: none; }
|
||||||
.menu-text { font-size: 14px; color: #374151; }
|
.menu-text { font-size: 14px; color: #374151; }
|
||||||
|
.menu-arrow { font-size: 18px; color: #d1d5db; }
|
||||||
.logout-btn { width: 100%; height: 44px; background: #fff; color: #dc2626; border: 1px solid #fecaca; border-radius: 10px; font-size: 14px; margin-top: 24px; line-height: 44px; }
|
.logout-btn { width: 100%; height: 44px; background: #fff; color: #dc2626; border: 1px solid #fecaca; border-radius: 10px; font-size: 14px; margin-top: 24px; line-height: 44px; }
|
||||||
.version { text-align: center; font-size: 11px; color: #d1d5db; margin-top: 16px; }
|
.version { text-align: center; font-size: 11px; color: #d1d5db; margin-top: 16px; }
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user