From 057c13502ecedf49d85d47ab23f3492859f16653 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期六, 29 十一月 2025 10:43:15 +0800
Subject: [PATCH] fix: 技术文件变更时,生产就不能继续报工了。
---
src/pages/mine/index.vue | 71 +++++++++++++++++++++++++++++------
1 files changed, 59 insertions(+), 12 deletions(-)
diff --git a/src/pages/mine/index.vue b/src/pages/mine/index.vue
index d6e1504..5772f62 100644
--- a/src/pages/mine/index.vue
+++ b/src/pages/mine/index.vue
@@ -7,7 +7,7 @@
<view class="avatar-container" @click="navigateToProfile">
<image
class="avatar"
- :src="isLogin ? userInfo!.avatar : defaultAvatar"
+ :src="isLogin ? userInfo?.avatar : defaultAvatar"
mode="aspectFill"
/>
<view v-if="isLogin" class="avatar-edit">
@@ -16,7 +16,7 @@
</view>
<view class="user-details">
<block v-if="isLogin">
- <view class="nickname">{{ userInfo!.nickname || "鍖垮悕鐢ㄦ埛" }}</view>
+ <view class="nickname">{{ userInfo?.nickname || "鍖垮悕鐢ㄦ埛" }}</view>
<view class="user-id">ID: {{ userInfo?.username || "0000000" }}</view>
</block>
<block v-else>
@@ -215,6 +215,11 @@
<wd-button class="logout-btn" @click="handleLogout">閫�鍑虹櫥褰�</wd-button>
</view>
+ <!-- 鐗堟湰鍙� -->
+ <view class="version">
+ <text class="version-text">鐗堟湰鍙凤細{{ versionName }}</text>
+ </view>
+
<wd-toast />
</view>
</template>
@@ -223,7 +228,7 @@
import { useToast } from "wot-design-uni";
import { useUserStore } from "@/store/modules/user";
import { useThemeStore } from "@/store/modules/theme";
-import { computed } from "vue";
+import { computed, ref, onMounted } from "vue";
const toast = useToast();
const userStore = useUserStore();
@@ -231,6 +236,35 @@
const userInfo = computed(() => userStore.userInfo);
const isLogin = computed(() => !!userInfo.value);
const defaultAvatar = "/static/images/default-avatar.png";
+
+// 鐗堟湰鍙�
+const versionName = ref("1.0.16");
+
+// 鑾峰彇鐗堟湰鍙�
+onMounted(() => {
+ // #ifdef MP-WEIXIN
+ try {
+ const accountInfo = uni.getAccountInfoSync();
+ if (accountInfo?.miniProgram?.version) {
+ versionName.value = accountInfo.miniProgram.version;
+ }
+ } catch (e) {
+ // 鑾峰彇澶辫触鏃朵娇鐢ㄩ粯璁ゅ��
+ }
+ // #endif
+
+ // #ifdef APP-PLUS
+ try {
+ // @ts-ignore
+ if (plus?.runtime?.version) {
+ // @ts-ignore
+ versionName.value = plus.runtime.version;
+ }
+ } catch (e) {
+ // 鑾峰彇澶辫触鏃朵娇鐢ㄩ粯璁ゅ��
+ }
+ // #endif
+});
// 鐧诲綍
const navigateToLoginPage = () => {
@@ -268,14 +302,14 @@
};
// 甯歌闂
-const navigateToFAQ = () => {
- uni.navigateTo({ url: "/pages/mine/faq/index" });
-};
+// const navigateToFAQ = () => {
+// uni.navigateTo({ url: "/pages/mine/faq/index" });
+// };
// 鍏充簬鎴戜滑
-const navigateToAbout = () => {
- uni.navigateTo({ url: "/pages/mine/about/index" });
-};
+// const navigateToAbout = () => {
+// uni.navigateTo({ url: "/pages/mine/about/index" });
+// };
// 璁剧疆
const navigateToSettings = () => {
@@ -283,9 +317,9 @@
};
// 闂鍙嶉
-const handleQuestionFeedback = () => {
- uni.navigateTo({ url: "/pages/mine/feedback/index" });
-};
+// const handleQuestionFeedback = () => {
+// uni.navigateTo({ url: "/pages/mine/feedback/index" });
+// };
// 瀵艰埅鍒板悇涓澘鍧�
const navigateToSection = (section: string, subSection?: string) => {
@@ -661,4 +695,17 @@
}
}
}
+
+// 鐗堟湰鍙�
+.version {
+ display: flex;
+ justify-content: center;
+ margin-top: 20rpx;
+ margin-bottom: 40rpx;
+}
+
+.version-text {
+ font-size: 22rpx;
+ color: #9ca3af;
+}
</style>
--
Gitblit v1.9.3