Ver código fonte

消息列表

tanyanfei 1 ano atrás
pai
commit
5559c68e71
2 arquivos alterados com 21 adições e 4 exclusões
  1. 4 0
      src/api.js
  2. 17 4
      src/components/DocIndex.vue

+ 4 - 0
src/api.js

@@ -161,4 +161,8 @@ export default {
   get_patient_doctor_notice_list: params => {
     return axios.get(`${baseURL}/api/doctor/patient/doctor/notice/list`,{params:params})
   },
+  // 获取最新消息列表
+  get_patient_doctor_notice_new: params => {
+    return axios.get(`${baseURL}/api/doctor/patient/doctor/notice/new`,{params:params})
+  },
 }

+ 17 - 4
src/components/DocIndex.vue

@@ -2,6 +2,7 @@
   <div class="docContainer">
     <div style="position:relative;">
       <img @click="goPage('notice')" width="30" src="../assets/images/msg.png" class="msg">
+      <span v-if="new_notice" class="red"></span>
       <img src="../assets/images/infobg.png" alt="" width="100%" style="">
       <div class="docinfo">
         <img class="docavatar" src="../assets/images/doch1.jpg" width="60rem" height="60rem" />
@@ -38,7 +39,8 @@
     },
     data() {
       return {
-        doctorInfo: {}
+        doctorInfo: {},
+        new_notice:0
       }
     },
     methods: {
@@ -58,10 +60,11 @@
         })
       },
       getNotice(){
-          this.$api.get_patient_doctor_notice_list().then(res=>{
-            console.log(res.data.data)
+          this.$api.get_patient_doctor_notice_new().then(res=>{
             if (!res.data.code) {
-              this.doctorInfo = res.data.data
+              if(res.data.data.total>0){
+                this.new_notice=1
+              }
             }
           })
       },
@@ -122,6 +125,16 @@
       top: 10px;
       z-index: 9;
     }
+    .red{
+        width: 10px;
+        height: 10px;
+        border-radius: 50%;
+        background: red;
+        position: absolute;
+        top: 13px;
+        right: 15px;
+        z-index: 10;
+      }
     .bgimg {
       width: 100%;
       height: 24.8rem;