소스 검색

修改已读

zs 2 년 전
부모
커밋
712fe25da1
2개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      pages/notice/index.js
  2. 1 0
      pages/notice/index.wxml

+ 8 - 1
pages/notice/index.js

@@ -36,6 +36,13 @@ Page({
             that.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
         }
     },
+    //已读
+    toSend: async function (e) {
+        const that = this;
+        let { id } = e.currentTarget.dataset;
+        const arr = await app.$post(`/courtAdmin/api/notice/read/${id}`, { user_id: that.data.user._id, status: '1' });
+        if (arr.errcode == '0') wx.showToast({ title: `已读信息成功`, icon: 'success', duration: 2000 })
+    },
     // 关闭弹框
     toClose: function () {
         this.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
@@ -57,7 +64,7 @@ Page({
             success: async res => {
                 this.setData({ user: res.data });
                 let params = {};
-                if (res.data.type != '0') params.user_id = res.data.id;
+                // if (res.data.type != '0') params.user_id = res.data.id;
                 const arr = await app.$get(`/courtAdmin/api/notice`, params);
                 if (arr.errcode == '0') this.setData({ list: arr.data })
             },

+ 1 - 0
pages/notice/index.wxml

@@ -13,6 +13,7 @@
         </view>
         <view class="btn">
           <button size="mini" type="default" bindtap="toView" data-id="{{item._id}}">详情</button>
+          <button size="mini" type="default" bindtap="toSend" data-id="{{item._id}}">已读</button>
         </view>
       </view>
     </view>