ssfg 4 years ago
parent
commit
d6352ee628

+ 2 - 71
app.js

@@ -5,85 +5,15 @@ App({
     id: null,
     name: null,
   },
-  onLaunch(options) {
-    console.log(options, "onLaunch");
-    // if (wx.getStorageSync('openId')) {
-    //   wx.request({
-    //     url: 'http://info.windd.cn:8080/test/applet/isExist',
-    //     method: "GET",
-    //     data: {
-    //       appletsId: wx.getStorageSync('openId')
-    //     },
-    //     success: (res) => {
-    //       console.log(res, "000000000000000000");
-    //       if (res.data.code == 0) {
-    //         wx.switchTab({
-    //           url: '/pages/index/index',
-    //         })
-    //       }
-    //     }
-    //   })
-    // } else {
-
-    // }
-    // wx.login({
-    //   success: res => {
-    //     // 获取到用户的 code 之后:res.code
-    //     console.log("用户的code:" + res.code);
-    //     const appid = "wx1c015df104db7030"
-    //     const secret = "d1956c1b5d3601657c98b0dc80a006f7"
-    //     let url = 'https://api.weixin.qq.com/sns/jscode2session?appid=' + appid + '&secret=' + secret + '&js_code=' + res.code + '&grant_type=authorization_code';
-    //     wx.request({
-    //       // 自行补上自己的 APPID 和 SECRET
-    //       url: url,
-    //       success: res => {
-    //         // 获取到用户的 openid
-    //         console.log("用户的openid:" + res.data.openid);
-    //         wx.setStorageSync('openId', res.data.openid)
-
-    //         wx.request({
-    //           url: 'http://info.windd.cn:8080/test/applet/isExist',
-    //           method: "GET",
-    //           data: {
-    //             appletsId: wx.getStorageSync('openId')
-    //           },
-    //           success: (res) => {
-    //             console.log(res, "apppppppppppppppppppppppppp");
-    //             if (res.data.code == 0) {
-    //               if(res.data.data){
-    //                 wx.setStorageSync('user', 'user');
-    //               }
-    //             }
-
-    //           }
-    //         })
-    //       }
-    //     });
-    //   }
-    // });
-
-  },
-
-  onShow(options) {
-    // Do something when show.
-  },
-  onHide() {
-    // Do something when hide.
-  },
   onError(msg) {
     console.log(msg)
   },
   getAuthKey: function () {
     console.log("apppppppjsjsjsjsjjsjsj");
-    
     return new Promise(function (resolve, reject) {
-      // 调用登录接口  
       wx.login({
         success: function (res) {
           if (res.code) {
-            // const appid = "wx1c015df104db7030"
-            // const secret = "d1956c1b5d3601657c98b0dc80a006f7"
-            // let url = 'https://api.weixin.qq.com/sns/jscode2session?appid=' + appid + '&secret=' + secret + '&js_code=' + res.code + '&grant_type=authorization_code';
             wx.request({
               url: util.globalData.publicUrl + '/wx/getAppletOpenId',
               method: "GET",
@@ -108,11 +38,12 @@ App({
                           wx.setStorageSync('user', 'user');
                         }
                         resolve(res);
+                      }else{
+                        wx.clearStorageSync();
                       }
                     }
                   })
                 }
-
               }
             });
           } else {

BIN
images/bg_main_new.jpg


BIN
images/user_10.png


BIN
images/user_11.png


BIN
images/user_12.png


BIN
images/user_13.png


BIN
images/user_9.png


BIN
images/user_card.png


BIN
images/user_info.png


BIN
images/user_inputname.png


BIN
images/user_login.png


BIN
images/user_old.png


+ 68 - 30
pages/collectInfo/collectInfo.js

@@ -3861,37 +3861,75 @@ Page({
     isonShow = false;
   },
   onShow() {
-    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('用户点击取消')
-          }
+    wx.login({
+      success: (res) => {
+        if (res.code) {
+          wx.request({
+            url: util.globalData.publicUrl + '/wx/getAppletOpenId',
+            method: "GET",
+            data: {
+              cid: 'applet',
+              code: res.code
+            },
+            success: res => {
+              // 获取到用户的 openid
+              if (res.data.status == 200) {
+                wx.setStorageSync('openId', res.data.data.openid)
+                wx.request({
+                  url: util.globalData.publicUrl + '/applet/isExist',
+                  method: "GET",
+                  data: {
+                    appletsId: wx.getStorageSync('openId')
+                  },
+                  success: (res) => {
+                    console.log('app登录是否绑定的', res.data.code);
+                    if (res.data.code == 0) {
+                      if (res.data.data) {
+                        const app = getApp();
+                        if (isTwoOnshow) {
+                          isTwoOnshow = false;
+                          return;
+                        };
+                        if (isonShow) {
+                          isonShow = false;
+                          return;
+                        };
+                        this.setData({
+                          addOldname: '',
+                          currentIndex: 0
+                        })
+                        this.huixian(app.globalData.id, app.globalData.name);
+                        this.AllFalse();
+                      }
+                    } else {
+                      wx.clearStorageSync();
+                      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,
+                      })
+                    }
+                  }
+                })
+              }
+            }
+          });
+        } else {
+          console.log('获取用户登录态失败!' + res.errMsg);
         }
-      })
-    } else {
-      const app = getApp();
-      if (isTwoOnshow) {
-        isTwoOnshow = false;
-        return;
-      };
-      if (isonShow) {
-        isonShow = false;
-        return;
-      };
-      this.setData({
-        addOldname: '',
-        currentIndex: 0
-      })
-      this.huixian(app.globalData.id, app.globalData.name);
-      this.AllFalse();
-    }
+      }
+    })
   },
   onHide() {
     const app = getApp()

+ 285 - 157
pages/index/index.js

@@ -22,79 +22,14 @@ Page({
     interval: 5000,
     duration: 500,
     number: {},
-    msgList: [
-      // {
-      //   url: "url",
-      //   title: "欢迎来到吉顺致养小程序"
-      // },
-      // {
-      //   url: "url",
-      //   title: "欢迎来到吉顺致养小程序"
-      // },
-    ]
+    msgList: []
   },
   goCollect() {
-    // 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',
-    //   })
-    // }
-    // if (wx.getStorageSync('user') == '') {
-    //   wx.redirectTo({
-    //     url: '/pages/login/login',
-    //   })
-    // } else {
-    // wx.switchTab({
-    //   url: '/pages/collectInfo/collectInfo',
-    // })
-    // }
     wx.navigateTo({
       url: '/pages/userBook/userBook',
     })
   },
   goXunfang() {
-    // 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',
-    //   })
-    // }
-    // if (wx.getStorageSync('user') == '') {
-    //   wx.redirectTo({
-    //     url: '/pages/login/login',
-    //   })
-    // } else {
-    //   wx.switchTab({
-    //     url: '/pages/visitandinfo/visitandinfo',
-    //   })
-    // }
     if (!wx.getStorageSync('openId')) {
       wx.login({
         success: res => {
@@ -150,54 +85,163 @@ Page({
     });
   },
   goTongzhi() {
-    if (wx.getStorageSync('user') == '') {
-      wx.redirectTo({
-        url: '/pages/login/login',
-      })
-    } else {
-      wx.navigateTo({
-        url: '/pages/notice/notice',
-      })
-    }
+    wx.login({
+      success: (res) => {
+        if (res.code) {
+          wx.request({
+            url: app.globalData.publicUrl + '/wx/getAppletOpenId',
+            method: "GET",
+            data: {
+              cid: 'applet',
+              code: res.code
+            },
+            success: res => {
+              // 获取到用户的 openid
+              if (res.data.status == 200) {
+                wx.setStorageSync('openId', res.data.data.openid)
+                wx.request({
+                  url: app.globalData.publicUrl + '/applet/isExist',
+                  method: "GET",
+                  data: {
+                    appletsId: wx.getStorageSync('openId')
+                  },
+                  success: (res) => {
+                    console.log('app登录是否绑定的', res.data.code);
+                    if (res.data.code == 0) {
+                      if (res.data.data) {
+                        wx.navigateTo({
+                          url: '/pages/notice/notice',
+                        })
+                      }
+                    } else {
+                      wx.redirectTo({
+                        url: '/pages/login/login',
+                      })
+                    }
+                  }
+                })
+              }
+            }
+          });
+        } else {
+          console.log('获取用户登录态失败!' + res.errMsg);
+        }
+      }
+    })
+    // if (wx.getStorageSync('user') == '') {
+    //   wx.redirectTo({
+    //     url: '/pages/login/login',
+    //   })
+    // } else {
+    //   wx.navigateTo({
+    //     url: '/pages/notice/notice',
+    //   })
+    // }
   },
   goPaiming() {
-    if (wx.getStorageSync('user') == '') {
-      wx.redirectTo({
-        url: '/pages/login/login',
-      })
-    } else {
-      wx.navigateTo({
-        url: '/pages/paiming/paiming',
-      })
-    }
+    wx.login({
+      success: (res) => {
+        if (res.code) {
+          wx.request({
+            url: app.globalData.publicUrl + '/wx/getAppletOpenId',
+            method: "GET",
+            data: {
+              cid: 'applet',
+              code: res.code
+            },
+            success: res => {
+              // 获取到用户的 openid
+              if (res.data.status == 200) {
+                wx.setStorageSync('openId', res.data.data.openid)
+                wx.request({
+                  url: app.globalData.publicUrl + '/applet/isExist',
+                  method: "GET",
+                  data: {
+                    appletsId: wx.getStorageSync('openId')
+                  },
+                  success: (res) => {
+                    console.log('app登录是否绑定的', res.data.code);
+                    if (res.data.code == 0) {
+                      if (res.data.data) {
+                        wx.navigateTo({
+                          url: '/pages/paiming/paiming',
+                        })
+                      }
+                    } else {
+                      wx.redirectTo({
+                        url: '/pages/login/login',
+                      })
+                    }
+                  }
+                })
+              }
+            }
+          });
+        } else {
+          console.log('获取用户登录态失败!' + res.errMsg);
+        }
+      }
+    })
   },
   goSaoMa() {
-    console.log("扫阿");
-    if (wx.getStorageSync('user') == '') {
-      wx.redirectTo({
-        url: '/pages/login/login',
-      })
-    } else {
-      wx.scanCode({
-        onlyFromCamera: true,
-        success: (res) => {
-          console.log(res, "扫码成功");
-          let length = res.result.substring(res.result.lastIndexOf('/') + 1, res.result.length)
-          wx.navigateTo({
-            url: '/pages/love/love?id=' + length,
-          })
-        },
-        fail: (res) => {
-          console.log(res, "扫码失败");
-          wx.showToast({
-            title: '扫码失败',
-            icon: 'none',
-            duration: 2000,
-          })
+    wx.login({
+      success: (res) => {
+        if (res.code) {
+          wx.request({
+            url: app.globalData.publicUrl + '/wx/getAppletOpenId',
+            method: "GET",
+            data: {
+              cid: 'applet',
+              code: res.code
+            },
+            success: res => {
+              // 获取到用户的 openid
+              if (res.data.status == 200) {
+                wx.setStorageSync('openId', res.data.data.openid)
+                wx.request({
+                  url: app.globalData.publicUrl + '/applet/isExist',
+                  method: "GET",
+                  data: {
+                    appletsId: wx.getStorageSync('openId')
+                  },
+                  success: (res) => {
+                    console.log('app登录是否绑定的', res.data.code);
+                    if (res.data.code == 0) {
+                      if (res.data.data) {
+                        wx.scanCode({
+                          onlyFromCamera: true,
+                          success: (res) => {
+                            console.log(res, "扫码成功");
+                            let length = res.result.substring(res.result.lastIndexOf('/') + 1, res.result.length)
+                            wx.navigateTo({
+                              url: '/pages/love/love?id=' + length,
+                            })
+                          },
+                          fail: (res) => {
+                            console.log(res, "扫码失败");
+                            wx.showToast({
+                              title: '扫码失败',
+                              icon: 'none',
+                              duration: 2000,
+                            })
+                          }
+                        })
+                      }
+                    } else {
+                      wx.redirectTo({
+                        url: '/pages/login/login',
+                      })
+                    }
+                  }
+                })
+              }
+            }
+          });
+        } else {
+          console.log('获取用户登录态失败!' + res.errMsg);
         }
-      })
-    }
-
+      }
+    })
   },
   depts() {
     console.log("1111111111111111111111111111");
@@ -222,56 +266,140 @@ Page({
     this.setData({
       msgList: []
     })
-    if (wx.getStorageSync('user') == '') {
-      wx.request({
-        url: app.globalData.publicUrl + '/welcomeMessage/list',
-        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({
-                title: result
-              });
-              this.data.msgList.push({
-                title: result
-              });
-              this.setData({
-                msgList: this.data.msgList
-              })
-            }
-          }
-        }
-      })
-    } else {
-      wx.request({
-        url: app.globalData.publicUrl + '/appletNotice/listForAppletsFirst',
-        method: "GET",
-        header: {
-          appletsId: wx.getStorageSync('openId')
-        },
-        success: (res) => {
-          if (res.data.code == 0) {
-            if (res.data.data.length == 0) {
-              this.data.msgList.push({
-                title: '暂无通知'
-              });
-              this.setData({
-                msgList: this.data.msgList
-              })
-            } else {
-              let result = res.data.data.title;
-              this.data.msgList.push({
-                title: result
-              });
-              this.setData({
-                msgList: this.data.msgList
-              })
+    wx.login({
+      success: (res) => {
+        if (res.code) {
+          wx.request({
+            url: app.globalData.publicUrl + '/wx/getAppletOpenId',
+            method: "GET",
+            data: {
+              cid: 'applet',
+              code: res.code
+            },
+            success: res => {
+              // 获取到用户的 openid
+              if (res.data.status == 200) {
+                wx.setStorageSync('openId', res.data.data.openid)
+                wx.request({
+                  url: app.globalData.publicUrl + '/applet/isExist',
+                  method: "GET",
+                  data: {
+                    appletsId: wx.getStorageSync('openId')
+                  },
+                  success: (res) => {
+                    console.log('app登录是否绑定的', res.data.code);
+                    if (res.data.code == 0) {
+                      if (res.data.data) {
+                        wx.request({
+                          url: app.globalData.publicUrl + '/appletNotice/listForAppletsFirst',
+                          method: "GET",
+                          header: {
+                            appletsId: wx.getStorageSync('openId')
+                          },
+                          success: (res) => {
+                            if (res.data.code == 0) {
+                              if (res.data.data.length == 0) {
+                                this.data.msgList.push({
+                                  title: '暂无通知'
+                                });
+                                this.setData({
+                                  msgList: this.data.msgList
+                                })
+                              } else {
+                                let result = res.data.data.title;
+                                this.data.msgList.push({
+                                  title: result
+                                });
+                                this.setData({
+                                  msgList: this.data.msgList
+                                })
+                              }
+                            }
+                          }
+                        })
+                      }
+                    } else {
+                      wx.request({
+                        url: app.globalData.publicUrl + '/welcomeMessage/list',
+                        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({
+                                title: result
+                              });
+                              this.data.msgList.push({
+                                title: result
+                              });
+                              this.setData({
+                                msgList: this.data.msgList
+                              })
+                            }
+                          }
+                        }
+                      })
+                    }
+                  }
+                })
+              }
             }
-          }
+          });
+        } else {
+          console.log('获取用户登录态失败!' + res.errMsg);
         }
-      })
-    }
+      }
+    })
+    // if (wx.getStorageSync('user') == '') {
+    //   wx.request({
+    //     url: app.globalData.publicUrl + '/welcomeMessage/list',
+    //     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({
+    //             title: result
+    //           });
+    //           this.data.msgList.push({
+    //             title: result
+    //           });
+    //           this.setData({
+    //             msgList: this.data.msgList
+    //           })
+    //         }
+    //       }
+    //     }
+    //   })
+    // } else {
+    //   wx.request({
+    //     url: app.globalData.publicUrl + '/appletNotice/listForAppletsFirst',
+    //     method: "GET",
+    //     header: {
+    //       appletsId: wx.getStorageSync('openId')
+    //     },
+    //     success: (res) => {
+    //       if (res.data.code == 0) {
+    //         if (res.data.data.length == 0) {
+    //           this.data.msgList.push({
+    //             title: '暂无通知'
+    //           });
+    //           this.setData({
+    //             msgList: this.data.msgList
+    //           })
+    //         } else {
+    //           let result = res.data.data.title;
+    //           this.data.msgList.push({
+    //             title: result
+    //           });
+    //           this.setData({
+    //             msgList: this.data.msgList
+    //           })
+    //         }
+    //       }
+    //     }
+    //   })
+    // }
   },
   onShow() {
     this.depts();

+ 0 - 1
pages/index/index.wxml

@@ -10,7 +10,6 @@
 	</view>
 	<view class="flex-box" bindtap="goTongzhi">
 		<image src="/images/tongzhi.png" style="width: 80rpx; height: 31rpx;"></image>
-		<!-- <view class="bck">今日巡访老人可得双倍积分</view> -->
 		<swiper class="swiper_container" vertical="true" autoplay="true" circular="true" interval="3000">
 			<block wx:key="title" wx:for="{{msgList}}">
 				<swiper-item>

+ 76 - 40
pages/personInfo/personInfo.js

@@ -30,7 +30,7 @@ Page({
       url: '/pages/aboutUs/aboutUs',
     })
   },
-  adviceSubmit(){
+  adviceSubmit() {
     wx.navigateTo({
       url: '/pages/adviceSubmit/adviceSubmit',
     })
@@ -38,15 +38,16 @@ Page({
   tuichu() {
     wx.showModal({
       showCancel: true,
-      content: "您确认要退出吗?",
-      success:(res)=> {
+      title: '是否退出?',
+      content: "退出后将会解绑当前微信号,无法使用当前微信号自动登陆",
+      success: (res) => {
         if (res.confirm) {
           wx.showLoading({
             mask: true,
             title: '退出中',
           })
           this.setData({
-            isTure :false 
+            isTure: false
           })
           wx.request({
             url: app.globalData.publicUrl + '/applet/unbind',
@@ -79,47 +80,82 @@ Page({
 
   },
   onShow() {
-    console.log(wx.getStorageSync('user'), "打印");
-    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('用户点击取消')
-          }
-        }
-      })
-      this.setData({
-        isTure: false,
-      })
-    } else {
-      this.setData({
-        isTure: true,
-      })
-      wx.request({
-        url: app.globalData.publicUrl + '/applet/findUserInfo',
-        method: "GET",
-        header: {
-          appletsId: wx.getStorageSync('openId')
-        },
-        success: (res) => {
-          console.log(res, "000");
-          this.setData({
-            info: res.data.data
-          })
+    wx.login({
+      success: (res) => {
+        if (res.code) {
+          wx.request({
+            url: app.globalData.publicUrl + '/wx/getAppletOpenId',
+            method: "GET",
+            data: {
+              cid: 'applet',
+              code: res.code
+            },
+            success: res => {
+              // 获取到用户的 openid
+              if (res.data.status == 200) {
+                wx.setStorageSync('openId', res.data.data.openid)
+                wx.request({
+                  url: app.globalData.publicUrl + '/applet/isExist',
+                  method: "GET",
+                  data: {
+                    appletsId: wx.getStorageSync('openId')
+                  },
+                  success: (res) => {
+                    console.log('app登录是否绑定的', res.data.code);
+                    if (res.data.code == 0) {
+                      if (res.data.data) {
+                        // wx.setStorageSync('user', 'user');
+                        this.setData({
+                          isTure: true,
+                        })
+                        wx.request({
+                          url: app.globalData.publicUrl + '/applet/findUserInfo',
+                          method: "GET",
+                          header: {
+                            appletsId: wx.getStorageSync('openId')
+                          },
+                          success: (res) => {
+                            console.log(res, "000");
+                            this.setData({
+                              info: res.data.data
+                            })
+                          }
+                        })
+                      }
+                    } else {
+                      wx.clearStorageSync();
+                      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,
+                      })
+                    }
+                  }
+                })
+              }
+            }
+          });
+        } else {
+          console.log('获取用户登录态失败!' + res.errMsg);
         }
-      })
-    }
+      }
+    })
   },
   onLoad() {
 
   },
-  onHide () {
+  onHide() {
     this.setData({
       info: ''
     })

+ 50 - 3
pages/userBook/userBook.wxml

@@ -61,9 +61,9 @@
 	<view class="hd">⑤如添加同一家庭的老人,点击老人姓名右方的加号然后继续填写所有信息。点击✖可删除当前老人。</view>
 	<view class="hd">⑥采集一个老人积分+5</view>
 	<view style="display:flex;margin-top: 20rpx;margin-bottom: 20rpx;">
-	<image src="../../images/user_info.png" class="img4"></image>
+		<image src="../../images/user_info.png" class="img4"></image>
 		<image src="../../images/user_inputname.png" class="img4"></image>
-		
+
 	</view>
 	<view class="block">
 		<view class="num">
@@ -119,7 +119,54 @@
 		<image src="../../images/user_2.png" class="img9"></image>
 		<image src="../../images/user_4.png" class="img10"></image>
 	</view>
-	<van-divider   customStyle="color: #000;font-size: 16px;font-weight:800" contentPosition="center">子女(赡养人)使用手册</van-divider>
+	<view class="block">
+		<view class="num">
+			Q10
+		</view>
+		<view class="question">
+			修改密码
+		</view>
+	</view>
+	<view class="hd">①点击我的->修改密码</view>
+	<view class="hd">②输入原密码,新密码即可修改</view>
+	<view style="display:flex;margin-top: 20rpx;margin-bottom: 20rpx;">
+		<image src="../../images/user_9.png" class="img7"></image>
+		<image src="../../images/user_10.png" class="img8"></image>
+	</view>
+	<view class="block">
+		<view class="num">
+			Q11
+		</view>
+		<view class="question">
+			意见反馈
+		</view>
+	</view>
+	<view class="hd">①点击我的->意见反馈</view>
+	<view class="hd">②输入您想要提交的意见及建议,点击提交即可。</view>
+	<image src="../../images/user_11.png" class="img1"></image>
+	<view class="block">
+		<view class="num">
+			Q12
+		</view>
+		<view class="question">
+			关于我们
+		</view>
+	</view>
+	<view class="hd">①点击我的->关于我们</view>
+	<view class="hd">②详细的介绍了小程序,客服电话,客服邮箱,工作时间。</view>
+	<image src="../../images/user_12.png" class="img1"></image>
+	<view class="block">
+		<view class="num">
+			Q12
+		</view>
+		<view class="question">
+			退出登录
+		</view>
+	</view>
+	<view class="hd">①点击我的->退出登录</view>
+	<view class="hd">②退出后将会解绑当前微信号,无法使用当前微信号自动登陆</view>
+	<image src="../../images/user_13.png" class="img1"></image>
+	<van-divider customStyle="color: #000;font-size: 16px;font-weight:800" contentPosition="center">子女(赡养人)使用手册</van-divider>
 	<view class="hd">①点击首页->巡访查询</view>
 	<view class="hd">②输入要绑定的老人身份证号->绑定成功</view>
 	<image src="../../images/user_7.jpg" class="img11"></image>

+ 1 - 1
pages/userBook/userBook.wxss

@@ -45,7 +45,7 @@
 
 .img1 {
   width: 400rpx;
-  height: 400rpx;
+  height:600rpx;
   margin-left: 175rpx;
   margin-top: 20rpx;
   margin-bottom: 20rpx;

+ 97 - 64
pages/visitandinfo/visitandinfo.js

@@ -274,72 +274,105 @@ Page({
     })
   },
   onShow() {
-    console.log('onshow')
-    console.log(wx.getStorageSync('user'), "打印");
-    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('用户点击取消')
-          }
-        }
-      })
-      this.setData({
-        isTrue: false,
-      })
-    } else {
-      this.setData({
-        isAllTrue: false,
-        select_all: false,
-        isTrue: true,
-      })
-      if (this.data.isTrue) {
-        this.computeScrollViewHeight();
-        this.computeScrollViewHeight1();
-      }
-      this.oldInfo();
-      this.visitInfo();
-      switch (this.data.number) {
-        case 0:
-          this.openIdInfo();
-          break;
-        case 1:
-          this.openIdInfo({
-            status: "1"
-          });
-          break;
-        case 2:
-          this.openIdInfo({
-            status: "0"
-          });
-          break;
-        case 3:
-          this.openIdInfo({
-            status: "2"
-          });
-          break;
-        case 4:
-          this.openIdInfo({
-            status: "3"
-          });
-          break;
-        case 5:
-          this.openIdInfo({
-            status: "4"
+    wx.login({
+      success: (res) => {
+        if (res.code) {
+          wx.request({
+            url: app.globalData.publicUrl + '/wx/getAppletOpenId',
+            method: "GET",
+            data: {
+              cid: 'applet',
+              code: res.code
+            },
+            success: res => {
+              // 获取到用户的 openid
+              if (res.data.status == 200) {
+                wx.setStorageSync('openId', res.data.data.openid)
+                wx.request({
+                  url: app.globalData.publicUrl + '/applet/isExist',
+                  method: "GET",
+                  data: {
+                    appletsId: wx.getStorageSync('openId')
+                  },
+                  success: (res) => {
+                    console.log('app登录是否绑定的', res.data.code);
+                    if (res.data.code == 0) {
+                      if (res.data.data) {
+                        this.setData({
+                          isAllTrue: false,
+                          select_all: false,
+                          isTrue: true,
+                        })
+                        if (this.data.isTrue) {
+                          this.computeScrollViewHeight();
+                          this.computeScrollViewHeight1();
+                        }
+                        this.oldInfo();
+                        this.visitInfo();
+                        switch (this.data.number) {
+                          case 0:
+                            this.openIdInfo();
+                            break;
+                          case 1:
+                            this.openIdInfo({
+                              status: "1"
+                            });
+                            break;
+                          case 2:
+                            this.openIdInfo({
+                              status: "0"
+                            });
+                            break;
+                          case 3:
+                            this.openIdInfo({
+                              status: "2"
+                            });
+                            break;
+                          case 4:
+                            this.openIdInfo({
+                              status: "3"
+                            });
+                            break;
+                          case 5:
+                            this.openIdInfo({
+                              status: "4"
+                            });
+                            break;
+                          default:
+                            this.openIdInfo();
+                            break;
+                        }
+                        this.visitInfo();
+                      }
+                    } else {
+                      wx.clearStorageSync();
+                      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,
+                      })
+                    }
+                  }
+                })
+              }
+            }
           });
-          break;
-        default:
-          this.openIdInfo();
-          break;
+        } else {
+          console.log('获取用户登录态失败!' + res.errMsg);
+        }
       }
-      this.visitInfo();
-    }
+    })
   },
   onHide() {
     this.setData({

+ 2 - 2
utils/util.js

@@ -1,6 +1,6 @@
 const globalData = {
-   publicUrl: 'https://info.windd.cn/collection',//公众号
-  // publicUrl: 'https://info.windd.cn/test',//测试
+  //  publicUrl: 'https://info.windd.cn/collection',//正式
+  publicUrl: 'https://info.windd.cn/test',//测试
   // publicUrl:'http://10.16.4.7:7001'//立秋
 };
 module.exports = {