From 0107d03b1270871b6c791080a23da93a227da4d2 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期五, 21 十月 2022 16:26:01 +0800
Subject: [PATCH] 454

---
 src/views/myMine/index.vue |   44 ++++++++++++++++++++++++++++++--------------
 1 files changed, 30 insertions(+), 14 deletions(-)

diff --git a/src/views/myMine/index.vue b/src/views/myMine/index.vue
index 8f1e705..78830ed 100644
--- a/src/views/myMine/index.vue
+++ b/src/views/myMine/index.vue
@@ -7,31 +7,34 @@
                         round
                         width="50px"
                         height="50px"
-                        src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
+                        :src="patientInfo.patientInfo.patientAvatarIcon"
                     />
                 </div>
                 <div class="rowtext">
-                    用户名:1771723243242
+                    手机号:{{patientInfo.patientInfo.patientTelNo}}
                 </div>
             </div>
         </div>
         <div class="userInfo">
-            <van-row style="padding-left: 20px; padding-top: 12px; border-bottom: 1px solid #F1F1F2;">
-                <van-col span="12">患者卡片</van-col>
-                <van-col span="12" style="text-align: right;padding-right: 25px;"> <van-icon name="arrow" /></van-col>
-            </van-row>
+            <div style="padding-left: 20px; padding-top: 12px; padding-right: 20px;">
+                <van-row style="border-bottom: 1px solid #F1F1F2;margin-top: 12px;">
+                    <van-col span="12" style="margin-bottom: 12px;">患者卡片</van-col>
+                    <van-col span="12" style="text-align: right;padding-right: 25px;"> <van-icon name="arrow" /></van-col>
+                </van-row>
+            </div>
+
             <van-row style="padding-left: 20px;">
                 <van-col span="16" class="info16">
-                    <div class="div1">张三丰
+                    <div class="div1">{{patientInfo.patientInfo.patientName}}
                         <span class="but">排班提醒</span>
                     </div>
                     <div class="div2">患者卡号</div>
-                    <div class="div3">000000001</div>
+                    <div class="div3">{{patientInfo.patientInfo.patientCardNo}} </div>
                 </van-col>
                 <van-col span="8" class="info8">
                     <div class="img">
                         <img
-                            style=" width: 55px;height: 55px;margin-left: 8%; margin-top: 22px;"
+                            style=" width: 55px;height: 55px;margin-left: 8%; margin-top: 15px;"
                             referrerpolicy="no-referrer"
                             src="./imgs/erwm.png"
                         />
@@ -98,7 +101,7 @@
             </div>
         </div>
         <div class="ButtonBody">
-            <van-button type="primary" round block>退出登录</van-button>
+            <van-button type="primary" @click="logOUT" round block>退出登录</van-button>
         </div>
         <van-tabbar v-model="active" @change="tabChang">
             <van-tabbar-item name="home" icon="like">首页</van-tabbar-item>
@@ -107,19 +110,32 @@
     </div>
 </template>
 <script lang="ts" setup>
-    import { ref } from 'vue'
+    import { ref,computed } from 'vue'
+    import {ajaxPost} from '@/utils/axios'
+    import { Session } from '@/utils/storage'
+    import { userInfoStore } from '@/stores/userInfo'
     import serve1 from './imgs/serve1.png'
     import { Image as VanImage,Tabbar as VanTabbar , TabbarItem as VanTabbarItem} from 'vant'
     import {useRouter} from 'vue-router'
     const router=useRouter()
+    const userInfo = userInfoStore()
     const active=ref('my')
     const tabChang=(index:any)=>{
-        alert(index)
         if (index==='home'){
             router.push('/')
         } else {
             router.push('my')
         }
+    }
+    const patientInfo=computed(()=>{
+        return userInfo.patient
+    })
+    const logOUT=()=>{
+        ajaxPost('/patient/info/logout','').then((re:any)=>{
+            console.log(re)
+            Session.clear() // 清除缓存/token等
+            router.push('login')
+        })
     }
 </script>
 <style lang="scss" scoped>
@@ -158,7 +174,7 @@
     .userInfo{
         width: 92%;
         margin-left: 4%;
-        height: 140px;
+        height: 160px;
         background: #FFFFFF;
         box-shadow: 0px 2px 4px 0px rgba(70,150,249,0.1);
         border-radius: 5px;
@@ -256,7 +272,7 @@
     background: #166bd3;
 }
 .ButtonBody{
-    margin-top: 20px;
+    margin-top: 40px;
     width: 92%;
     margin-left: 4%;
     // background: #166bd3;

--
Gitblit v1.8.0