Преглед на файлове

0927 修改退出登录后tabbar增加提示认证 采集探访删除checked选中问题

roose преди 4 години
родител
ревизия
2eb89c3a2c

+ 19 - 9
pages/collectInfo/collectInfo.js

@@ -631,7 +631,7 @@ Page({
             regularsInfos: this.data.regularsInfos,
             regularsInfo: this.data.regularsInfo
           })
-          this.getSelfLocation();
+          //this.getSelfLocation();
         }
         wx.hideLoading();
       }
@@ -3804,8 +3804,18 @@ Page({
   },
   onShow() {
     if (wx.getStorageSync('user') == '') {
-      wx.redirectTo({
-        url: '/pages/login/login',
+      wx.showModal({
+        showCancel: false,
+        content: '当前您未登录,请登录',
+        success (res) {
+          if (res.confirm) {
+            wx.redirectTo({
+              url: '/pages/login/login',
+            })
+          } else if (res.cancel) {
+            console.log('用户点击取消')
+          }
+        }
       })
     } else {
       const app = getApp();
@@ -3877,12 +3887,12 @@ Page({
     });
   },
   onLoad() {
-    console.log(wx.getStorageSync('user'), '000000')
-    if (wx.getStorageSync('user') == '') {
-      wx.redirectTo({
-        url: '/pages/login/login',
-      })
-    }
+    // console.log(wx.getStorageSync('user'), '000000')
+    // if (wx.getStorageSync('user') == '') {
+    //   wx.redirectTo({
+    //     url: '/pages/login/login',
+    //   })
+    // }
   },
   // 表单校验老人身份证号
   formCheckCard() {

+ 41 - 8
pages/index/index.js

@@ -34,14 +34,47 @@ Page({
     ]
   },
   goCollect() {
-    wx.switchTab({
-      url: '/pages/collectInfo/collectInfo',
-    })
+
+    if (wx.getStorageSync('user') == '') {
+      wx.showModal({
+        showCancel: false,
+        content: '当前您未登录,请登录',
+        success(res) {
+          if (res.confirm) {
+            wx.redirectTo({
+              url: '/pages/login/login',
+            })
+          } else if (res.cancel) {
+            console.log('用户点击取消')
+          }
+        }
+      })
+    } else {
+      wx.switchTab({
+        url: '/pages/collectInfo/collectInfo',
+      })
+    }
   },
   goXunfang() {
-    wx.switchTab({
-      url: '/pages/visitandinfo/visitandinfo',
-    })
+    if (wx.getStorageSync('user') == '') {
+      wx.showModal({
+        showCancel: false,
+        content: '当前您未登录,请登录',
+        success(res) {
+          if (res.confirm) {
+            wx.redirectTo({
+              url: '/pages/login/login',
+            })
+          } else if (res.cancel) {
+            console.log('用户点击取消')
+          }
+        }
+      })
+    } else {
+      wx.switchTab({
+        url: '/pages/visitandinfo/visitandinfo',
+      })
+    }
   },
   goTongzhi() {
     if (wx.getStorageSync('user') == '') {
@@ -123,7 +156,7 @@ Page({
         method: "GET",
         success: (res) => {
           if (res.data.code == 0) {
-    
+
             if (res.data.data.length != 0) {
               let result = res.data.data[0].title
               this.data.msgList.push({
@@ -148,7 +181,7 @@ Page({
         },
         success: (res) => {
           if (res.data.code == 0) {
-            console.log(res,"111111111111111");
+            console.log(res, "111111111111111");
             if (res.data.data.length == 0) {
               this.data.msgList.push({
                 title: '暂无通知'

+ 4 - 1
pages/login/login.js

@@ -81,6 +81,10 @@ Page({
     })
   },
   onLoad: function () {
+
+  },
+  onShow(){
+    console.log("登录onshow000000")
     var that = this;
     wx.login({
       success: res => {
@@ -110,6 +114,5 @@ Page({
         });
       }
     });
-
   },
 })

+ 12 - 2
pages/personInfo/personInfo.js

@@ -78,8 +78,18 @@ Page({
   onShow() {
     console.log(wx.getStorageSync('user'), "打印");
     if (wx.getStorageSync('user') == '') {
-      wx.redirectTo({
-        url: '/pages/login/login',
+      wx.showModal({
+        showCancel: false,
+        content: '当前您未登录,请登录',
+        success (res) {
+          if (res.confirm) {
+            wx.redirectTo({
+              url: '/pages/login/login',
+            })
+          } else if (res.cancel) {
+            console.log('用户点击取消')
+          }
+        }
       })
       this.setData({
         isTure: false,

+ 2 - 1
pages/personInfo/personInfo.wxml

@@ -1,4 +1,5 @@
-<view wx:if='{{isTure}}'>
+<!--  wx:if='{{isTure}}' -->
+<view>
 	<image src="/images/mybj.png" style="width: 100%; height: 400rpx;"></image>
 	<view class="personxx">
 		<view class="tx">

+ 21 - 7
pages/visitandinfo/visitandinfo.js

@@ -118,6 +118,9 @@ Page({
                 }
               }
             })
+            that.setData({
+              isAllTrue: false,
+            })
           } else {
             wx.showToast({
               title: '请选择要删除的记录',
@@ -280,10 +283,10 @@ Page({
     query.exec(res => {
       console.log(res,"000000000000000000000");
        
-      // let searchHeight = res[0].height
-      // let titleHeight = res[1].height
+      let searchHeight = res[0].height
+      let titleHeight = res[1].height
       let windowHeight = wx.getSystemInfoSync().windowHeight
-      let scrollHeight = windowHeight - 21 - 31 - 30 - 5 - 50 - 44
+      let scrollHeight = windowHeight - searchHeight - titleHeight - 30 - 10 - 50 - 44
       this.setData({
         scrollHeight: scrollHeight
       })
@@ -296,9 +299,9 @@ Page({
     query.exec(res => {
       console.log(res);
       
-      // let searchHeight = res[0].height
+      let searchHeight = res[0].height
       let windowHeight = wx.getSystemInfoSync().windowHeight
-      let scrollHeight = windowHeight - 21 - 30 - 5 - 50
+      let scrollHeight = windowHeight - searchHeight - 30 - 5 - 50
       this.setData({
         scrollHeight1: scrollHeight
       })
@@ -311,9 +314,20 @@ Page({
   onShow() {
     console.log(wx.getStorageSync('user'), "打印");
     if (wx.getStorageSync('user') == '') {
-      wx.redirectTo({
-        url: '/pages/login/login',
+      wx.showModal({
+        showCancel: false,
+        content: '当前您未登录,请登录',
+        success (res) {
+          if (res.confirm) {
+            wx.redirectTo({
+              url: '/pages/login/login',
+            })
+          } else if (res.cancel) {
+            console.log('用户点击取消')
+          }
+        }
       })
+     
       this.setData({
         isTrue: false,
       })

+ 3 - 2
pages/visitandinfo/visitandinfo.wxml

@@ -5,7 +5,8 @@
 	<wxs module="oldMind" src="../../utils/oldmind.wxs"></wxs>
 	<wxs module="oldHealth" src="../../utils/oldhealth.wxs"></wxs>
 	<wxs module="oldSecurity" src="../../utils/oldsecurity.wxs"></wxs>
-	<view wx:if='{{isTrue}}'>
+	<!-- wx:if='{{isTrue}}' -->
+	<view >
 		<view id='tabs'>
 			<view class='tabs-box'>
 				<block wx:for="{{['采集记录','探访记录']}}" wx:key="index">
@@ -28,7 +29,7 @@
 					<scroll-view class="center" scroll-y="true" style='height: {{scrollHeight + "px"}}'>
 						<view class="tr" style=" border-bottom: 1px solid #dadada;width:670rpx;font-size:30rpx">
 							<view class="td " style="border-bottom: unset; width:78rpx;">
-								<checkbox checked="{{isAllTrue}}" bindtap="selectall" />
+								<checkbox checked="{{isAllTrue}}"  bindtap="selectall" />
 							</view>
 							<view style="border-bottom: unset;width:290rpx;text-align:left">姓名</view>
 							<view style="border-bottom: unset;width:180rpx;text-align:left">保存时间</view>