Sfoglia il codice sorgente

手机端短信已读

Administrator 7 anni fa
parent
commit
50decd2b5a

+ 16 - 1
pages/mobile/center/user/collect/message.vue

@@ -73,6 +73,7 @@
             this.isChange = false
           } else {
             this.msgList = [...this.msgList, ...val.content]
+            this.getRead()
           }
         },
         immediate: true
@@ -85,6 +86,20 @@
       onPullUpAction: function () {
         this.page++
         this.reloadList()
+      },
+      getRead () {
+        let ids = []
+        this.msgList.forEach((value) => {
+          if (value.isRead !== 1) {
+            ids.push(value.id)
+          }
+        })
+        if (ids.length !== 0) {
+          this.$http.post('/messages/read', {receiverUu: this.user.data.userUU, receiverEnuu: this.user.data.enterprise.uu, messageId: ids.join(','), consumerApp: 'MALL'})
+            .then((res) => {
+              console.log(res.data)
+            })
+        }
       }
     }
   }
@@ -108,7 +123,7 @@
           position: relative;
           b{
             position: absolute;
-            left: .2rem;
+            left: .1rem;
             top: .25rem;
             width: .16rem;
             height: .16rem;

+ 16 - 1
pages/mobile/center/vendor/message.vue

@@ -73,6 +73,7 @@
             this.isChange = false
           } else {
             this.msgList = [...this.msgList, ...val.content]
+            this.getRead()
           }
         },
         immediate: true
@@ -85,6 +86,20 @@
       onPullUpAction: function () {
         this.page++
         this.reloadList()
+      },
+      getRead () {
+        let ids = []
+        this.msgList.forEach((value) => {
+          if (value.isRead !== 1) {
+            ids.push(value.id)
+          }
+        })
+        if (ids.length !== 0) {
+          this.$http.post('/messages/read', {receiverUu: this.user.data.userUU, receiverEnuu: this.user.data.enterprise.uu, messageId: ids.join(','), consumerApp: 'MALL'})
+            .then((res) => {
+              console.log(res.data)
+            })
+        }
       }
     }
   }
@@ -108,7 +123,7 @@
           position: relative;
           b{
             position: absolute;
-            left: .2rem;
+            left: .1rem;
             top: .25rem;
             width: .16rem;
             height: .16rem;