Browse Source

message已读设置

Karsa 2 years ago
parent
commit
b8c97e82fe
2 changed files with 8 additions and 9 deletions
  1. 1 1
      manifest.json
  2. 7 8
      pages-user/messageList.vue

+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "hongze_yb_xcx",
-    "appid" : "",
+    "appid" : "__UNI__CA0EBC2",
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",

+ 7 - 8
pages-user/messageList.vue

@@ -171,7 +171,13 @@
 			},
 			
 			/* 到报告详情 */
-			toReportDetail({ report_chapter_id,report_id  }) {
+			async toReportDetail( item ) {
+				const { report_chapter_id,report_id,is_read,msg_id  } = item;
+				if(!is_read) {
+					const { code } = await $message.apiReadOneMessage({ msg_id })
+					item.is_read = 1;					
+				}
+				
 				report_chapter_id 
 				? uni.navigateTo({url: `/pages-report/chapterDetail?chapterId=${report_chapter_id}&fromPage=message`})
 				: uni.navigateTo({url:`/pages-report/reportDetail?reportId=${report_id}&fromPage=message`})
@@ -180,13 +186,6 @@
 			async drawStart(item,e) {
 				let touch = e.touches[0];
 				this.startX = touch.clientX;
-				
-				if(!item.is_read) {
-					const { msg_id } = item;
-					const { code } = await $message.apiReadOneMessage({ msg_id })
-					if( code!==200 ) return
-					item.is_read = 1;					
-				}
 			},
 			//触摸滑动
 			drawMove(e) {