From 115bc268902a9899d7d159133c2ba693eddfe00d Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 03 十一月 2026 17:58:50 +0800
Subject: [PATCH] 完善门户与会员审批交互

---
 src/views/ums/member/profile/index.vue |   37 +++++++++++++++++++++++++++++++------
 1 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/src/views/ums/member/profile/index.vue b/src/views/ums/member/profile/index.vue
index 7950db4..14bbeea 100644
--- a/src/views/ums/member/profile/index.vue
+++ b/src/views/ums/member/profile/index.vue
@@ -20,6 +20,7 @@
 
 const loading = ref(false);
 const submitting = ref(false);
+const profileState = ref<'loading' | 'ready' | 'unlinked' | 'error'>('loading');
 const latestChange = ref<UmsMemberProfileApi.ChangeRecord>();
 
 /** 鏈�杩戜竴娆$敵璇峰緟瀹℃牳鏃剁姝㈤噸澶嶆彁浜� */
@@ -58,11 +59,15 @@
 
 async function loadData() {
   loading.value = true;
+  profileState.value = 'loading';
   try {
-    const [profile, latest] = await Promise.all([
-      getMyProfile(),
-      getMyLatestChange(),
-    ]);
+    const profile = await getMyProfile();
+    if (!profile) {
+      latestChange.value = undefined;
+      profileState.value = 'unlinked';
+      return;
+    }
+    const latest = await getMyLatestChange();
     latestChange.value = latest ?? undefined;
     await formApi.setValues(
       {
@@ -83,12 +88,16 @@
       },
       false,
     );
+    profileState.value = 'ready';
+  } catch {
+    profileState.value = 'error';
   } finally {
     loading.value = false;
   }
 }
 
 async function handleSubmit() {
+  if (profileState.value !== 'ready') return;
   const { valid } = await formApi.validate();
   if (!valid) {
     return;
@@ -143,7 +152,23 @@
       </div>
 
       <Alert
-        v-if="latestAlert"
+        v-if="profileState === 'unlinked'"
+        type="info"
+        show-icon
+        message="褰撳墠璐﹀彿鏈叧鑱斾細鍛樻。妗�"
+        description="姝ら〉闈㈢敤浜庣淮鎶や細鍛樿祫鏂欍�傝鑱旂郴瀛︿細绠$悊鍛樺皢璐﹀彿鍏宠仈鍒板搴斾細鍛橈紱绯荤粺璐﹀彿淇℃伅鍙湪鍙充笂瑙掍釜浜轰腑蹇冩煡鐪嬨��"
+      />
+      <Alert
+        v-else-if="profileState === 'error'"
+        type="error"
+        show-icon
+        message="璧勬枡鍔犺浇澶辫触"
+        description="璇锋鏌ョ綉缁滆繛鎺ュ悗閲嶈瘯銆�"
+      >
+        <template #action><Button size="small" @click="loadData">閲嶈瘯</Button></template>
+      </Alert>
+      <Alert
+        v-if="profileState === 'ready' && latestAlert"
         class="mb-4"
         :type="latestAlert.type"
         show-icon
@@ -151,7 +176,7 @@
         :description="latestAlert.description"
       />
 
-      <div class="rounded-lg border border-border bg-background p-4">
+      <div v-if="profileState === 'ready'" class="rounded-lg border border-border bg-background p-4">
         <Form class="mx-3" />
         <div class="mt-4 flex justify-end">
           <Button

--
Gitblit v1.9.3