spring
2 天以前 12e71c59168070f5525ad5d2ed0d9859033746d0
src/pages/mine.vue
@@ -75,7 +75,7 @@
    </view> -->
    <view class="version-wrap">
      <text class="version-text">版本号:{{ version }}</text>
      <text class="version-text">版本号:{{ versionName }}</text>
    </view>
    <DownloadProgressMask />
@@ -91,7 +91,7 @@
const userStore = useUserStore()
const name = userStore.name;
const roleName = userStore.roleName;
const version = config.appInfo.version;
const versionName = ref(config?.appInfo?.version || "1.0.0");
const avatar = ref(userStore.avatar);
// rem 基准:1rem = 16px(如有不同请调整 REM_BASE 或样式数值)
@@ -149,6 +149,30 @@
   // 设置用户信息
   // 设置用户信息
   userStore.getInfo()
  // #ifdef MP-WEIXIN
  try {
    const accountInfo = uni.getAccountInfoSync();
    if (accountInfo?.miniProgram?.version) {
      versionName.value = String(accountInfo.miniProgram.version);
    }
  } catch (e) {}
  // #endif
  // #ifdef APP-PLUS
  try {
    // @ts-ignore
    if (plus?.runtime?.getProperty) {
      // @ts-ignore
      const appid = plus.runtime.appid;
      // @ts-ignore
      plus.runtime.getProperty(appid, (info) => {
        const v = info?.version || info?.versionName || info?.appVersion || "";
        if (v) versionName.value = String(v);
      });
    }
  } catch (e) {}
  // #endif
});
</script>