Przeglądaj źródła

首页右上角显示默认id号

lighter 3 lat temu
rodzic
commit
179d4ee472

+ 2 - 3
src/views/Home.vue

@@ -13,7 +13,7 @@ import { getOpenId, getPatientIdByOpenId } from '../api/patient-id-cards'
 import store from '../store'
 import { useRouter } from 'vue-router'
 import { computed, onMounted } from 'vue'
-// import { initWebSocket } from '../utils/websocket'
+
 export default {
   name: 'Home',
   setup() {
@@ -22,7 +22,6 @@ export default {
       return store.state.patientCards.length
     })
     const toFirstTab = () => {
-      // initWebSocket()
       let to = router.currentRoute.value.params.to
       if (!to) {
         to = 'hospitalService'
@@ -60,4 +59,4 @@ export default {
     return {}
   },
 }
-</script>
+</script>

+ 31 - 5
src/views/hospital-service/HospitalServiceHome.vue

@@ -1,10 +1,17 @@
 <template>
   <window-size :showBackNav="false">
     <div class="logo-div">
-      <div style="width: 3%"></div>
-      <div><img src="../../assets/thyylogo.png" style="height: 60px" /></div>
-      <div style="height: 60px; line-height: 60px; color: #00525e">
-        <h3>微信医疗服务平台</h3>
+      <div style="display: flex">
+        <div><img src="../../assets/thyylogo.png" style="height: 60px" /></div>
+        <div style="color: #00525e">
+          <h3>医疗服务平台</h3>
+        </div>
+      </div>
+      <div style="font-size: 13px">
+        <i class="van-icon van-icon-user-o"></i>
+        <span style="margin-left: 4px; color: #777" @click="router.push('/myPatientIdCards')">{{
+          defaultPatientId
+        }}</span>
       </div>
     </div>
     <div
@@ -160,6 +167,20 @@ export default {
     const filterPath = (singleCardPath, multipleCardsPath) => {
       return cards.value.length === 1 ? singleCardPath + cards.value[0].patientId : multipleCardsPath
     }
+    const defaultPatientId = computed(() => {
+      if (cards.value.length === 0) {
+        return '未绑卡'
+      }
+      if (cards.value.length === 1) {
+        return cards.value[0].patientId
+      }
+      for (let i = 0; i < cards.value.length; i++) {
+        if (cards.value[i].isDefault === 1) {
+          return cards.value[i].patientId
+        }
+      }
+    })
+
     const doctors = computed(() => {
       return store.state.homePageDoctors
     })
@@ -202,6 +223,7 @@ export default {
     return {
       filterPath,
       doctors,
+      router,
       clickDoctor,
       swipeStyle,
       swipeRowStyle,
@@ -209,6 +231,7 @@ export default {
       portraitWidth,
       infoStyle,
       specialtyStyle,
+      defaultPatientId,
       openExternalLink,
       routeTo,
       toVaccinateAppointment,
@@ -221,9 +244,12 @@ export default {
 
 <style scoped>
 .logo-div {
-  width: 100%;
+  width: 92.5%;
+  margin-left: 3%;
   height: 60px;
+  line-height: 60px;
   display: flex;
+  justify-content: space-between;
 }
 .yuyueguahao {
   margin-top: 10px;