spring
7 天以前 12e71c59168070f5525ad5d2ed0d9859033746d0
src/pages/mine.vue
@@ -73,6 +73,12 @@
        <view class="card-illu faq"></view>
      </view>
    </view> -->
    <view class="version-wrap">
      <text class="version-text">版本号:{{ versionName }}</text>
    </view>
    <DownloadProgressMask />
  </view>
</template>
@@ -81,10 +87,11 @@
import config from '@/config.js'
import { getUserProfile } from "@/api/system/user";
import useUserStore from '@/store/modules/user'
import DownloadProgressMask from "@/components/DownloadProgressMask.vue";
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 或样式数值)
@@ -142,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>
@@ -150,9 +181,36 @@
.mine-page {
  min-height: 100vh;
   padding: 1.25rem;
   padding-top: env(safe-area-inset-top);
   /* 为所有设备设置基础padding-top */
   padding-top: 40px;
   position: relative;
  background: linear-gradient( 225deg, #E7F1FF 0%, rgba(255,255,255,0) 74%, rgba(255,255,255,0) 100%);
   /* iOS设备使用env()函数处理安全区域 */
   padding-top: env(safe-area-inset-top);
   /* 为安卓设备设置更大的顶部内边距 */
   /* #ifdef APP-PLUS && !MP && !H5 */
   padding-top: 45px;
   /* #endif */
   /* H5和小程序平台的通用样式 */
   /* #ifdef H5 || MP */
   padding-top: 30px;
   /* #endif */
}
/* 版本号 */
.version-wrap {
  width: 100%;
  text-align: center;
  margin-top: 18px;
  padding-bottom: 14px;
}
.version-text {
  font-size: 12px;
  color: #999;
}
/* 顶部个人信息卡 */
@@ -162,6 +220,11 @@
  align-items: center;
  color: #333;
  margin: 1.25rem 0;
  /* 为安卓设备额外调整卡片位置 */
   /* #ifdef APP-PLUS && !MP && !H5 */
   margin-top: 15px;
   /* #endif */
  .left {
    display: flex;