roose 4 년 전
부모
커밋
4018e84c23
3개의 변경된 파일140개의 추가작업 그리고 65개의 파일을 삭제
  1. 42 25
      pages/idCard/idCard.js
  2. 59 2
      pages/notice/notice.js
  3. 39 38
      pages/notice/notice.wxml

+ 42 - 25
pages/idCard/idCard.js

@@ -6,31 +6,48 @@ Page({
     isTrue: true,
     isTrue: true,
   },
   },
   goShenFen() {
   goShenFen() {
-    if (!this.data.isTrue) {
-      wx.request({
-        url: app.globalData.publicUrl + '/applet/suppleUserInfo',
-        method: "POST",
-        header: {
-          appletsId: wx.getStorageSync('openId')
-        },
-        data: {
-          headPicPath: this.data.imgPath
-        },
-        success: (res) => {
-          console.log(res, "000");
-        }
-      })
-      wx.redirectTo({
-        url: '/pages/idCardDetail/idCardDetail',
-      })
-    } else {
-      wx.showToast({
-        title: "请上传照片",
-        icon: 'none',
-        duration: 2000,
-      })
-    }
-
+    //.....................................................
+    // if (!this.data.isTrue) {
+    //   wx.request({
+    //     url: app.globalData.publicUrl + '/applet/suppleUserInfo',
+    //     method: "POST",
+    //     header: {
+    //       appletsId: wx.getStorageSync('openId')
+    //     },
+    //     data: {
+    //       headPicPath: this.data.imgPath
+    //     },
+    //     success: (res) => {
+    //       console.log(res, "000");
+    //     }
+    //   })
+    //   wx.redirectTo({
+    //     url: '/pages/idCardDetail/idCardDetail',
+    //   })
+    // } else {
+    //   wx.showToast({
+    //     title: "请上传照片",
+    //     icon: 'none',
+    //     duration: 2000,
+    //   })
+    // }
+    //..................................................... 下边删除
+    wx.request({
+      url: app.globalData.publicUrl + '/applet/suppleUserInfo',
+      method: "POST",
+      header: {
+        appletsId: wx.getStorageSync('openId')
+      },
+      data: {
+        headPicPath: this.data.imgPath
+      },
+      success: (res) => {
+        console.log(res, "000");
+      }
+    })
+    wx.redirectTo({
+      url: '/pages/idCardDetail/idCardDetail',
+    })
   },
   },
   goPhoto() {
   goPhoto() {
     var that = this;
     var that = this;

+ 59 - 2
pages/notice/notice.js

@@ -66,10 +66,67 @@ Page({
     this.setData({
     this.setData({
       currentTabIndex: index
       currentTabIndex: index
     })
     })
+    console.log(index, "sss");
+    //..............................................................
+    // if (index == 0) {
+    //   this.read();
+    // } else {
+    //   this.noRead();
+    // }
+    //..............................................................
   },
   },
+  read() {
+    wx.request({
+      url: app.globalData.publicUrl + '/appletNotice/listForApplets',
+      method: "GET",
+      header: {
+        appletsId: wx.getStorageSync('openId')
+      },
+      success: (res) => {
+        console.log(res, "000");
+        this.setData({
+          readList: res.data.data
+        })
+      }
+    })
+  },
+  noRead() {
+    wx.request({
+      url: app.globalData.publicUrl + '/appletNotice/listForAppletsNoread ',
+      method: "GET",
+      header: {
+        appletsId: wx.getStorageSync('openId')
+      },
+      success: (res) => {
+        console.log(res, "000");
+        this.setData({
+          noreadList: res.data.data
+        })
+      }
+    })
+  },
+  know(e) {
+    console.log(e.currentTarget.dataset.infos._id);
+    wx.request({
+      url: app.globalData.publicUrl + '/readNotice/add',
+      method: "POST",
+      header: {
+        appletsId: wx.getStorageSync('openId')
+      },
+      data: {
+        noticeId: e.currentTarget.dataset.infos._id
+      },
+      success: (res) => {
+        console.log(res, "000");
+        if (res.data.code == 0) {
+          this.noRead();
+        }
+      }
+    })
 
 
+  },
   onLoad: function () {
   onLoad: function () {
-
-
+    this.read();
+    this.noRead();
   },
   },
 })
 })

+ 39 - 38
pages/notice/notice.wxml

@@ -1,48 +1,49 @@
-	<view id='tabs'>
-		<view class='tabs-box'>
-			<block wx:for="{{['未读消息','已读消息']}}" wx:key="index">
-				<view class="tabs-item {{currentTabIndex == index ? 'selected' : '' }}" bindtap='onTabsItemTap' data-index='{{index}}'>
-					{{item}}
+<wxs module="time" src="../../utils/time.wxs"></wxs>
+<view id='tabs'>
+	<view class='tabs-box'>
+		<block wx:for="{{['未读消息','已读消息']}}" wx:key="index">
+			<view class="tabs-item {{currentTabIndex == index ? 'selected' : '' }}" bindtap='onTabsItemTap' data-index='{{index}}'>
+				{{item}}
+			</view>
+		</block>
+	</view>
+	<view class="yuan" wx:if='{{currentTabIndex != 1}}'></view>
+	<view class='ordert-detail'>
+		<view hidden='{{currentTabIndex != 0}}'>
+			<view class="onread" wx:for='{{noreadList}}'>  
+				<view>
+					【{{item.title}}】
 				</view>
 				</view>
-			</block>
-		</view>
-		<view class="yuan" wx:if='{{currentTabIndex != 1}}'></view>
-		<view class='ordert-detail'>
-			<view hidden='{{currentTabIndex != 0}}'>
-				<view class="onread" wx:for='{{readList}}'>
-					<view>
-						【{{item.title}}】
-					</view>
-					<view class="title">
-						{{item.time}}
-					</view>
-					<view class="title"> {{item.content}} </view>
-					<view class="flex-box">
-						<view class="readwenzi">未读</view>
-						<view style="display: flex;">
-							<image src="/images/dui.png" style="width: 40rpx; height: 40rpx; margin-right: 10rpx;"></image>
-							<view>我知道了</view>
-						</view>
+				<view class="title">
+					{{time.formatDate(item.createTime)}}
+				</view>
+				<view class="title"> {{item.content}} </view>
+				<view class="flex-box"> 
+					<view class="readwenzi">未读</view>
+					<view style="display: flex;">
+						<image src="/images/dui.png" style="width: 40rpx; height: 40rpx; margin-right: 10rpx;"></image>
+						<view bindtap="know" data-infos='{{item}}'>我知道了</view>
 					</view>
 					</view>
 				</view>
 				</view>
 			</view>
 			</view>
-			<view hidden='{{currentTabIndex != 1}}'>
-				<view class="onread" wx:for='{{readList}}'>
-					<view>
-						【{{item.title}}】
-					</view>
-					<view class="title">
-						{{item.time}}
-					</view>
-					<view class="title">{{item.content}}</view>
-					<view class="flex-box">
-						<view class="readwenzi" style="background:#dcdcdc">已读</view>
-						<!-- <view style="display: flex;  align-items: center;">
+		</view>
+		<view hidden='{{currentTabIndex != 1}}'>
+			<view class="onread" wx:for='{{readList}}'>
+				<view>
+					【{{item.title}}】
+				</view>
+				<view class="title">
+					{{item.time}}
+				</view>
+				<view class="title">{{item.content}}</view>
+				<view class="flex-box">
+					<view class="readwenzi" style="background:#dcdcdc">已读</view>
+					<!-- <view style="display: flex;  align-items: center;">
 							<image src="/images/shan.png" style="width: 50rpx; height: 50rpx; margin-right: 10rpx;"></image>
 							<image src="/images/shan.png" style="width: 50rpx; height: 50rpx; margin-right: 10rpx;"></image>
 							<view>删除</view>
 							<view>删除</view>
 						</view> -->
 						</view> -->
-					</view>
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
-	</view>
+	</view>
+</view>