| | |
| | | </up-checkbox> |
| | | </view> |
| | | </view> |
| | | <view class="version-wrap"> |
| | | <text class="version-text">版本号:{{ versionName }}</text> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup> |
| | |
| | | import { wxLogin } from "@/api/oauth"; |
| | | import { setToken } from "@/utils/auth"; |
| | | import View from "@/pages/procurementManagement/procurementLedger/view.vue"; |
| | | import config from "@/config"; |
| | | const userStore = useUserStore(); |
| | | const useWxLogin = ref(false); // 是否使用微信登录 |
| | | const rememberPassword = ref(false); // 记住密码 |
| | | const versionName = ref(config?.appInfo?.version || "1.0.0"); |
| | | const loginForm = ref({ |
| | | userName: "", |
| | | password: "", |
| | |
| | | // 更新tabbar的角标 |
| | | if (count > 0) { |
| | | uni.setTabBarBadge({ |
| | | index: 1, // 消息标签页的索引 |
| | | index: 2, // 消息标签页的索引 |
| | | text: count.toString(), |
| | | }); |
| | | } else { |
| | | uni.removeTabBarBadge({ |
| | | index: 1, |
| | | index: 2, |
| | | }); |
| | | } |
| | | }) |
| | |
| | | } |
| | | // 页面加载时检查是否有保存的密码 |
| | | onMounted(() => { |
| | | console.log("[login-version] 开始获取登录页版本,默认值:", versionName.value); |
| | | // #ifdef MP-WEIXIN |
| | | try { |
| | | const accountInfo = uni.getAccountInfoSync(); |
| | | if (accountInfo?.miniProgram?.version) { |
| | | versionName.value = accountInfo.miniProgram.version; |
| | | console.log("[login-version] 当前环境=MP-WEIXIN,版本=", versionName.value); |
| | | } |
| | | } catch (e) { |
| | | // 获取失败时使用默认值 |
| | | console.log("[login-version] MP-WEIXIN 获取版本失败:", e); |
| | | } |
| | | // #endif |
| | | |
| | | // #ifdef APP-PLUS |
| | | try { |
| | | // @ts-ignore |
| | | if (plus?.runtime?.version) { |
| | | // @ts-ignore |
| | | versionName.value = plus.runtime.version; |
| | | console.log("[login-version] 当前环境=APP-PLUS,版本=", versionName.value); |
| | | } |
| | | } catch (e) { |
| | | // 获取失败时使用默认值 |
| | | console.log("[login-version] APP-PLUS 获取版本失败:", e); |
| | | } |
| | | // #endif |
| | | console.log("[login-version] 最终版本号:", versionName.value); |
| | | |
| | | loadPassword(); |
| | | getUserLoginFacotryList(); |
| | | }); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .version-wrap { |
| | | width: 100%; |
| | | text-align: center; |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .version-text { |
| | | font-size: 12px; |
| | | color: #999; |
| | | } |
| | | </style> |