From 2cc66753086d6ce4c1154cd21f1cdacba09c914d Mon Sep 17 00:00:00 2001
From: 曹睿 <360930172@qq.com>
Date: 星期三, 23 四月 2025 10:13:06 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/yuanwang-mes-uniapp

---
 src/components/worker-calling-card/index.vue |   21 ++++-----------------
 1 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/src/components/worker-calling-card/index.vue b/src/components/worker-calling-card/index.vue
index 8a0ee70..3ea106d 100644
--- a/src/components/worker-calling-card/index.vue
+++ b/src/components/worker-calling-card/index.vue
@@ -3,12 +3,12 @@
     <template #title>
       <view>
         <text class="font-medium">
-          {{ user.nickName }}
-          <text class="text-[#0D867F] text-xs">路{{ user.roleName }}</text>
+          {{ userInfo?.nickName }}
+          <text class="text-[#0D867F] text-xs">路{{ userInfo?.roles[0].roleName }}</text>
         </text>
       </view>
       <view>
-        <text class="font-medium text-[#3D3D3D] text-sm">宸ュ彿: {{ user.userName }}</text>
+        <text class="font-medium text-[#3D3D3D] text-sm">宸ュ彿: {{ userInfo?.userName }}</text>
       </view>
     </template>
     <view class="mt-2">
@@ -18,21 +18,8 @@
 </template>
 <script setup lang="ts">
 import { useUserStore } from "@/store/modules/user";
-import { nextTick } from "vue";
 const userStore = useUserStore();
-const userInfo: any = computed(() => userStore.userInfo);
-const user = reactive({
-  nickName: "",
-  userName: "",
-  roleName: "",
-});
-
-onLoad(() => {
-  nextTick();
-  user.nickName = userInfo.value.user?.nickName;
-  user.userName = userInfo.value.user?.userName;
-  user.roleName = userInfo.value.user?.roles[0].roleName;
-});
+const userInfo = computed(() => userStore.userInfo);
 </script>
 <style lang="scss" scoped>
 .calling_card {

--
Gitblit v1.9.3