From 6f4834d34a5ab4270026e9008d1a6560a764bd74 Mon Sep 17 00:00:00 2001 From: zpc Date: Sun, 5 Apr 2026 17:48:29 +0800 Subject: [PATCH] 21 --- odf-uniapp/.hbuilderx/launch.json | 1 + odf-uniapp/pages/portal/index.vue | 20 ++++++++++++++++++ odf-uniapp/unpackage/debug/.roid.ins | 1 - .../release/apk/绥时录_1.0.3_test.apk | Bin 17873468 -> 17873468 bytes 4 files changed, 21 insertions(+), 1 deletion(-) delete mode 100644 odf-uniapp/unpackage/debug/.roid.ins diff --git a/odf-uniapp/.hbuilderx/launch.json b/odf-uniapp/.hbuilderx/launch.json index 8ae452a..4724a85 100644 --- a/odf-uniapp/.hbuilderx/launch.json +++ b/odf-uniapp/.hbuilderx/launch.json @@ -2,6 +2,7 @@ "version" : "1.0", "configurations" : [ { + "customPlaygroundType" : "local", "playground" : "standard", "type" : "uni-app:app-android" } diff --git a/odf-uniapp/pages/portal/index.vue b/odf-uniapp/pages/portal/index.vue index cb30a7e..11c2652 100644 --- a/odf-uniapp/pages/portal/index.vue +++ b/odf-uniapp/pages/portal/index.vue @@ -37,6 +37,9 @@ 暂无可用功能模块 + + + @@ -45,8 +48,14 @@ import { ref, computed } from 'vue' import { onLoad } from '@dcloudio/uni-app' import store from '@/store' import { getUserModules } from '@/services/permission' +import { checkAppVersion } from '@/services/home' +import { APP_VERSION } from '@/services/api' +import updateDialog from '@/components/update-dialog.vue' const statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 0 +const showUpdate = ref(false) +const updateUrl = ref('') +const forceUpdate = ref(false) // 所有可用功能版块定义 const allModules = [ @@ -77,7 +86,18 @@ function goSettings() { onLoad(() => { // 页面加载时刷新权限 handleRefresh() + // 检查版本更新 + loadVersionCheck() }) + +async function loadVersionCheck() { + const res = await checkAppVersion(APP_VERSION) + if (res.code === 200 && res.data && res.data.needUpdate) { + updateUrl.value = res.data.downloadUrl || '' + forceUpdate.value = !!res.data.forceUpdate + showUpdate.value = true + } +}