houwei vor 4 Jahren
Ursprung
Commit
88c5564820

+ 3 - 3
app.json

@@ -1,17 +1,17 @@
 {
   "pages": [
     "pages/index/index",
+    "pages/onSiteActivity/onSiteActivity",
+    
+    "pages/targetInfo/targetInfo",
     "pages/infoAgreement/infoAgreement",
     "pages/personInfo/personInfo",
-   
     "pages/share/share",
-    "pages/targetInfo/targetInfo",
     "pages/personInfoDetail/personInfoDetail",
     "pages/isAgree/isAgree",
     "pages/paylists/paylists",
     "pages/addRights/addRights",
     "pages/sign/sign",
-    "pages/onSiteActivity/onSiteActivity",
     "pages/activeDetail/activeDetail",
     "pages/personal/personal",
     

+ 53 - 17
pages/activeDetail/activeDetail.js

@@ -1,11 +1,13 @@
 const app = require('../../utils/util.js');
 const tool = require('../../utils/tool.js');
 Page({
-  data: {},
+  data: {
+    isInit:false
+  },
   isOk() {
-    tool.isFinishInfo().then(result => {
-      console.log('我完善信息了')
-      tool.isLogin().then(result2 => {
+    tool.isLogin().then(result => {
+      console.log('我完善信息了并获取授权了')
+      tool.isFinishInfo().then(result2 => {
         tool.isFinishTargetInfo().then(redult3 => {
           this.baoming()
         }).catch(err => {
@@ -24,12 +26,12 @@ Page({
         })
       }).catch(err => {
         wx.showModal({
-          title: '您还未登陆',
+          title: '您还未完善个人信息',
           showCancel: false,
           success(res) {
             if (res.confirm) {
-              wx.redirectTo({
-                url: '/pages/personal/personal',
+              wx.navigateTo({
+                url: '/pages/personInfo/personInfo',
               })
             }
           }
@@ -38,16 +40,16 @@ Page({
       })
     }).catch(err => {
       wx.showModal({
-        title: '您还未完善个人信息',
+        title: '您还未登录',
         showCancel: false,
         success(res) {
           if (res.confirm) {
-            wx.navigateTo({
-              url: '/pages/personInfo/personInfo',
+            wx.redirectTo({
+              url: '/pages/personal/personal',
             })
           }
         }
-      })
+      });
       return false;
     })
   },
@@ -59,14 +61,14 @@ Page({
         if (res.data.code == 0) {
           wx.requestSubscribeMessage({
             tmplIds: ['YNGZW3voCNtjvTkhi2xbbVinJkjFKcILEG7uFC_xz2Y'],
-            success(res) {
-              console.log(res, '成功了');
+            success: (res) => {
+              console.log(res,'我订阅成功了')
               wx.redirectTo({
                 url: '/pages/registrationSuccess/registrationSuccess',
               })
             },
-            fail(res1) {
-              console.log(res1, '失败了')
+            fail:(err)=>{
+              console.log(err,'我订阅失败了')
               wx.redirectTo({
                 url: '/pages/registrationSuccess/registrationSuccess',
               })
@@ -75,15 +77,49 @@ Page({
         }
       }
     })
-  },
+    // wx.requestSubscribeMessage({
+    //   tmplIds: ['YNGZW3voCNtjvTkhi2xbbVinJkjFKcILEG7uFC_xz2Y'],
+    //   success:(res)=> {
+    //     wx.request({
+    //       url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
+    //       method: "get",
+    //       success: (res) => {
+    //         if (res.data.code == 0) {
+    //           wx.redirectTo({
+    //             url: '/pages/registrationSuccess/registrationSuccess',
+    //           })
+    //         }
+    //       }
+    //     })
+    //   },
+    //   fail:(res1)=> {
+    //     console.log(res1, '失败了')
+    //     wx.request({
+    //       url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
+    //       method: "get",
+    //       success: (res) => {
+    //         if (res.data.code == 0) {
+    //           wx.redirectTo({
+    //             url: '/pages/registrationSuccess/registrationSuccess',
+    //           })
+    //         }
+    //       }
+    //     })
+    //     // wx.redirectTo({
+    //     //   url: '/pages/registrationSuccess/registrationSuccess',
+    //     // })
+    //   }
+    // })
 
+  },
   async onLoad(options) {
     console.log(options)
     tool.openidStatus().then(result => {
       this.setData({
         openid: result[0],
         sessionkey: result[1],
-        activeOpenid: options.openId
+        activeOpenid: options.openId,
+        isInit:true
       })
       this.getActivies(options.id);
     })

+ 3 - 2
pages/activeDetail/activeDetail.wxml

@@ -1,6 +1,5 @@
 <view style="background:#fff">
 	<image src="../../images/activeimg.png" style="width:690rpx;height:360rpx;margin-left:35rpx"></image>
-	<image src="../../images/remarked.png" class="remarkImg" wx:if="{{activeOpenid !='null'}}"></image>
 	<view class="line">
 		<van-icon name="like-o" size="40rpx" color="#906cff" style="margin-left:35rpx;margin-bottom:35rpx" />
 		<p style='margin-left:35rpx'>已报名{{actualCount}}/{{planCount}}</p>
@@ -22,7 +21,9 @@
 	<view style="color:#999999;margin:35rpx;font-size:30rpx">
 		{{remark}}
 	</view>
-	<view class="btn_area" wx:if="{{!activeOpenid||activeOpenid=='null'}}">
+	<image src="../../images/remarked.png" class="remarkImg" wx:if="{{isInit&&activeOpenid !='null'}}"></image>
+	<!--  -->
+	<view class="btn_area" wx:if="{{isInit&&(!activeOpenid||activeOpenid=='null')}}">
 		<view class="btn" bindtap="isOk">报名</view>
 	</view>
 </view>

+ 2 - 0
pages/index/index.wxml

@@ -10,6 +10,8 @@
 	<view style="display:flex;margin-left:30rpx;margin-top:30rpx;margin-bottom:30rpx">
 		<view style='width:10rpx;height:45rpx;background-color:#986aff;margin-right:20rpx;border-radius:10rpx'></view>近期活动
 	</view>
+	<image wx:if='{{arr.length==0&&arr1.length==0}}' src="../../images/empty.png" style="width:320rpx;height:320rpx;margin-left:215rpx"></image>
+	<view wx:if='{{arr.length==0&&arr1.length==0}}' style="color:#999;width:750rpx;height:320rpx;top:550rpx;left:0rpx;text-align:center">近期还没有活动呦</view>
 	<view style="margin-bottom:150rpx">
 		<view wx:for="{{arr}}" wx:key="index" class="box" bindtap="goActive" data-id='{{item.id}}' data-openId='{{item.openId}}'>
 			<view class="top">

+ 3 - 3
pages/index/index.wxss

@@ -33,7 +33,7 @@ page {
 
 .box {
   width: 650rpx;
-  height: 530rpx;
+  /* height: 530rpx; */
   margin: 25rpx;
   box-shadow: 0 0 10rpx 10rpx #eceafa;
   padding: 25rpx;
@@ -49,13 +49,13 @@ page {
 }
 
 .title {
-  color: #999999;
+  color: #4d4d4d;
   font-size: 28rpx;
   margin-left: 30rpx;
 }
 
 .remark {
-  color: #4d4d4d;
+  color: #999999;
   font-size: 28rpx;
   margin-left: 30rpx;
   margin-top: 10rpx;

+ 30 - 22
pages/onSiteActivity/onSiteActivity.js

@@ -16,7 +16,7 @@ Page({
   love(e) {
     console.log(e)
     let status = this.data.member[e.currentTarget.dataset.index].hearted
-    let status1 = 'member['+e.currentTarget.dataset.index+'].hearted'
+    let status1 = 'member[' + e.currentTarget.dataset.index + '].hearted'
     console.log(status)
     if (status == 0) {
       wx.request({
@@ -29,8 +29,8 @@ Page({
           if (res.data.code == 0) {
             console.log(res, '我取消心动了')
             this.setData({
-              [status1]:1,
-              member:this.data.member
+              [status1]: 1,
+              member: this.data.member
             })
             console.log(this.data.member)
             this.getMyheartNowTimes();
@@ -38,24 +38,32 @@ Page({
         }
       })
     } else {
-      wx.request({
-        url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.activeId + '/heartbeat',
-        method: "get",
-        data: {
-          targetId: e.currentTarget.dataset.openid
-        },
-        success: (res) => {
-          if (res.data.code == 0) {
-            console.log(res, '我心动了')
-            this.setData({
-              [status1]:0,
-              member:this.data.member
-            })
-            console.log(this.data.member)
-            this.getMyheartNowTimes();
+      if (this.data.heartTime < this.data.planHeart) {
+        wx.request({
+          url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.activeId + '/heartbeat',
+          method: "get",
+          data: {
+            targetId: e.currentTarget.dataset.openid
+          },
+          success: (res) => {
+            if (res.data.code == 0) {
+              console.log(res, '我心动了')
+              this.setData({
+                [status1]: 0,
+                member: this.data.member
+              })
+              console.log(this.data.member)
+              this.getMyheartNowTimes();
+            }
           }
-        }
-      })
+        })
+      } else {
+        wx.showToast({
+          title: '您已经达到心动上限了呦',
+          icon: 'none',
+          duration: 3000,
+        })
+      }
     }
   },
   // 获取我的心动次数
@@ -98,7 +106,7 @@ Page({
                 myNum: res.data.members[i].activeNumber
               })
               // 删除自己
-             res.data.members.splice(i,1);
+              res.data.members.splice(i, 1);
             }
           }
           this.setData({
@@ -109,7 +117,7 @@ Page({
     })
   },
   async onLoad(options) {
-   
+
     tool.openidStatus().then(result => {
       this.setData({
         openid: result[0],

+ 27 - 15
pages/personInfo/personInfo.js

@@ -4,6 +4,7 @@ const tool = require('../../utils/tool.js');
 const COS = require('../../utils/cos.js');
 Page({
   data: {
+    myInfo:[],
     imgsrc: '../../images/cardModel.png',
     photo: '../../images/cardModel.png',
     questionList: [{
@@ -364,6 +365,11 @@ Page({
       method: "get",
       success: (res) => {
         console.log(res, '我是获取的信息')
+        if (res.data.code == 0) {
+          this.setData({
+            myInfo: res.data.info
+          })
+        }
         let idFront = 'form.idFront'
         let photoUrl = 'form.photoUrl'
         let idCard = 'form.idCard'
@@ -379,7 +385,7 @@ Page({
             constellationArr: result[0],
             constellationArrValue: result[1]
           })
-          if (res.data.info.constellation) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[1].length; i++) {
               if (result[1][i] == res.data.info.constellation) {
                 this.setData({
@@ -423,6 +429,7 @@ Page({
   // 表单提交事件
   formSubmit(e) {
     console.log(e.detail.value)
+    console.log(this.data.myInfo)
     const params = e.detail.value
     //校验表单
     if (!this.WxValidate.checkForm(params)) {
@@ -430,14 +437,14 @@ Page({
       this.showModal(error)
       return false
     }
-    if (!this.data.xyAgree) {
-      wx.showToast({
-        title: '请仔细阅读协议并勾选呦',
-        icon: 'none',
-        duration: 3000,
-      })
-      return false
-    }
+    // if (!this.data.xyAgree) {
+    //   wx.showToast({
+    //     title: '请仔细阅读协议并勾选呦',
+    //     icon: 'none',
+    //     duration: 3000,
+    //   })
+    //   return false
+    // }
     wx.request({
       url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/info',
       method: "POST",
@@ -450,13 +457,18 @@ Page({
         if (res.data.code == 0) {
           wx.showModal({
             title: '信息提交成功了呦',
-            // content: '快去完善详细信息吧!',
             showCancel: false,
-            success(res) {
+            success:(res)=> {
               if (res.confirm) {
-                wx.redirectTo({
-                  url: '/pages/InfoType/InfoType',
-                })
+                if(this.data.myInfo&&this.data.myInfo.height){
+                  wx.redirectTo({
+                    url: '/pages/index/index',
+                  })
+                }else{
+                  wx.redirectTo({
+                    url: '/pages/personInfoDetail/personInfoDetail',
+                  })
+                }
               }
             }
           });
@@ -464,7 +476,7 @@ Page({
       }
     })
   },
-  goxy(){
+  goxy() {
     wx.navigateTo({
       url: '/pages/infoAgreement/infoAgreement',
     })

+ 6 - 4
pages/personInfo/personInfo.wxml

@@ -93,16 +93,18 @@
 			</view>
 		</view>
 		<view class="btn-area">
-			<button form-type="submit" id="sunbmit">提交信息</button>
+			<button form-type="submit" id="sunbmit">
+				<span wx:if="{{myInfo&&myInfo.height}}">确认</span>
+				<span wx:else>确认,快去完善详细信息吧</span>
+			</button>
 		</view>
-		<view style="font-size:25rpx;display:flex;margin-left:120rpx">
+		<!-- <view style="font-size:25rpx;display:flex;margin-left:120rpx">
 			<checkbox-group bindchange="change">
 				<label class="checkbox">
 					<checkbox value="cb" />
 				</label>
 			</checkbox-group>
 			<p bindtap='goxy'>同意并遵守《月合权益购买协议》</p>
-		</view>
-		<!-- <checkbox value="agree" checked="true"/><p bindtap='goxy'>同意并遵守《月合权益购买协议》</p></view> -->
+		</view> -->
 	</form>
 </view>

+ 88 - 136
pages/personInfoDetail/personInfoDetail.js

@@ -261,8 +261,8 @@ Page({
     let motionState = 'form.motionState'
     this.setData({
       motionStateLabel: this.data.motionStateArr[e.detail.value],
-      [motionState]:this.data.motionStateArrValue[e.detail.value]
-     
+      [motionState]: this.data.motionStateArrValue[e.detail.value]
+
     })
   },
   hobbyChange(e) {
@@ -300,36 +300,50 @@ Page({
   },
   // 获取手机号
   getPhoneNumber(e) {
-    console.log(e)
-    if (e.detail.errMsg == "getPhoneNumber:ok") {
-      wx.request({
-        url: app.globalData.publicUrl + '/wx/user/wxbfa171fdd4000e03/phone',
-        header: {
-          'content-type': 'application/x-www-form-urlencoded',
-        },
-        data: {
-          sessionKey: this.data.sessionkey,
-          signature: this.data.signature,
-          rawData: this.data.rawData,
-          encryptedData: e.detail.encryptedData,
-          iv: e.detail.iv
-        },
-        method: "POST",
-        success: (res) => {
-          console.log(res, '我是解析的手号');
-          let phone = 'form.phone'
-          if (res.data.phoneNumber) {
-            this.setData({
-              [phone]: res.data.phoneNumber
-            })
-          } else {
-            this.setData({
-              [phone]: 0
+    tool.isLogin().then(res => {
+      console.log(res)
+      if (e.detail.errMsg == "getPhoneNumber:ok") {
+        wx.request({
+          url: app.globalData.publicUrl + '/wx/user/wxbfa171fdd4000e03/phone',
+          header: {
+            'content-type': 'application/x-www-form-urlencoded',
+          },
+          data: {
+            sessionKey: this.data.sessionkey,
+            signature: res.signature,
+            rawData: res.rawData,
+            encryptedData: e.detail.encryptedData,
+            iv: e.detail.iv
+          },
+          method: "POST",
+          success: (res) => {
+            console.log(res, '我是解析的手号');
+            let phone = 'form.phone'
+            if (res.data.phoneNumber) {
+              this.setData({
+                [phone]: res.data.phoneNumber
+              })
+            } else {
+              this.setData({
+                [phone]: 0
+              })
+            }
+          }
+        })
+      }
+    }).catch(err => {
+      wx.showModal({
+        title: '您还未登录',
+        showCancel: false,
+        success(res) {
+          if (res.confirm) {
+            wx.redirectTo({
+              url: '/pages/personal/personal',
             })
           }
         }
-      })
-    }
+      });
+    })
   },
   getInfos() {
     wx.showLoading();
@@ -368,7 +382,7 @@ Page({
             heightArr: result[0],
             heightArrValue: result[1]
           })
-          if (res.data.info.height) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.height) {
                 this.setData({
@@ -384,7 +398,7 @@ Page({
             weightArr: result[0],
             weightArrValue: result[1]
           })
-          if (res.data.info.weight) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.weight) {
                 this.setData({
@@ -400,7 +414,7 @@ Page({
             educationArr: result[0],
             educationArrValue: result[1]
           })
-          if (res.data.info.education) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.education) {
                 this.setData({
@@ -416,7 +430,7 @@ Page({
             incomeArr: result[0],
             incomeArrValue: result[1]
           })
-          if (res.data.info.income) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.income) {
                 this.setData({
@@ -432,7 +446,7 @@ Page({
             marriageList: result[0],
             marriageListValue: result[1]
           })
-          if (res.data.info.marriage) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.marriage) {
                 this.setData({
@@ -448,7 +462,7 @@ Page({
             childrenArr: result[0],
             childrenArrValue: result[1]
           })
-          if (res.data.info.children) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.children) {
                 this.setData({
@@ -464,7 +478,7 @@ Page({
             assetHouseArr: result[0],
             assetHouseArrValue: result[1]
           })
-          if (res.data.info.assetHouse) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.assetHouse) {
                 this.setData({
@@ -481,7 +495,7 @@ Page({
             assetAreaArr: result[0],
             assetAreaArrValue: result[1]
           })
-          if (res.data.info.assetHouseArea) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.assetHouseArea) {
                 this.setData({
@@ -498,7 +512,7 @@ Page({
             assetHouseLoanArr: result[0],
             assetHouseLoanArrValue: result[1]
           })
-          if (res.data.info.assetHouseLoan) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.assetHouseLoan) {
                 this.setData({
@@ -514,7 +528,7 @@ Page({
             assetCarArr: result[0],
             assetCarArrValue: result[1]
           })
-          if (res.data.info.assetCar) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.assetCar) {
                 this.setData({
@@ -531,7 +545,7 @@ Page({
             assetCarValueArr: result[0],
             assetCarValueArrValue: result[1]
           })
-          if (res.data.info.assetCarValue) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.assetCarValue) {
                 this.setData({
@@ -547,7 +561,7 @@ Page({
             assetCarLoanArr: result[0],
             assetCarLoanArrValue: result[1]
           })
-          if (res.data.info.assetCarLoan) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.assetCarLoan) {
                 this.setData({
@@ -566,7 +580,7 @@ Page({
               'checked': false
             })
           })
-          if (res.data.info.controlTime) {
+          if (res.data.code == 0 && res.data.info.controlTime) {
             let resControlTime = res.data.info.controlTime.split(",");
             let resControlTimeIndexArr = [];
             for (let i = 0; i < resControlTime.length; i++) {
@@ -594,6 +608,7 @@ Page({
             controlTimeArrLabel: result[0],
             controlTimeArrValue: result[1],
           })
+          console.log(this.data.controlTimeArr, '1111111111111')
         })
         tool.formDetails('he_work_status').then(result => {
           let workStatusArr = result[0].map((item, index) => {
@@ -603,7 +618,7 @@ Page({
               'checked': false
             })
           })
-          if (res.data.info.workStatus) {
+          if (res.data.code == 0 && res.data.info.workStatus) {
             let resWorkStatus = res.data.info.workStatus.split(",");
             let resWorkStatusIndexArr = [];
             for (let i = 0; i < resWorkStatus.length; i++) {
@@ -633,7 +648,7 @@ Page({
           })
         })
         tool.formDetails('he_company_nature').then(result => {
-          if (res.data.info.companyNature) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.companyNature) {
                 this.setData({
@@ -643,7 +658,7 @@ Page({
               }
             }
           }
-          if (res.data.info.fatherWork) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.fatherWork) {
                 this.setData({
@@ -653,7 +668,7 @@ Page({
               }
             }
           }
-          if (res.data.info.matherWork) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.matherWork) {
                 this.setData({
@@ -672,7 +687,7 @@ Page({
             matherWorkArrValue: result[1]
           })
         })
-        if (res.data.info) {
+        if (res.data.code == 0) {
           this.setData({
             [phone]: res.data.info.tel,
             [company]: res.data.info.company,
@@ -686,7 +701,7 @@ Page({
             parentsArr: result[0],
             parentsArrValue: result[1]
           })
-          if (res.data.info.parents) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.parents) {
                 this.setData({
@@ -702,7 +717,7 @@ Page({
             parentAssetsArr: result[0],
             parentAssetsArrValue: result[1]
           })
-          if (res.data.info.parentAssets) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.parentAssets) {
                 this.setData({
@@ -721,7 +736,7 @@ Page({
               'checked': false
             })
           })
-          if (res.data.info.composition) {
+          if (res.data.code == 0 && res.data.info.composition) {
             let resComposition = res.data.info.composition.split(",");
             let resCompositionIndexArr = [];
             for (let i = 0; i < resComposition.length; i++) {
@@ -757,7 +772,7 @@ Page({
             motionStateArr: result[0],
             motionStateArrValue: result[1]
           })
-          if (res.data.info.motionState) {
+          if (res.data.code == 0) {
             for (let i = 0; i < result[0].length; i++) {
               if (result[1][i] == res.data.info.motionState) {
                 console.log(i)
@@ -777,7 +792,7 @@ Page({
               'checked': false
             })
           })
-          if (res.data.info.hobby) {
+          if (res.data.code == 0 && res.data.info.hobby) {
             let reshobby = res.data.info.hobby.split(",");
             let reshobbyIndexArr = [];
             for (let i = 0; i < reshobby.length; i++) {
@@ -806,46 +821,6 @@ Page({
             hobbyArrValue: result[1]
           })
         })
-        // tool.formDetails('he_hobby').then(result=>{
-        //   console.log(result)
-        //   let hobbyArr = result[0].map((item, index) => {
-        //     return Object.assign({}, {
-        //       'name': item,
-        //       'value': item,
-        //       'checked': false
-        //     })
-        //   })
-        //   if (res.data.info.hobby) {
-        //     let resHobby = res.data.info.hobby.split(",");
-        //     let resHobbyIndexArr = [];
-        //     for (let i = 0; i < resHobby.length; i++) {
-        //       for (let j = 0; j < result[1].length; j++) {
-        //         if (resHobby[i] == result[1][j]) {
-        //           resHobbyIndexArr.push(i)
-        //         }
-        //       }
-        //     }
-        //     let resHobbyLabel = [];
-        //     for (let i = 0; i < resHobbyIndexArr.length; i++) {
-        //       resHobbyLabel.push(result[0][resHobbyIndexArr[i]])
-        //     }
-        //     for (let i = 0; i < resHobbyLabel.length; i++) {
-        //       if (resHobbyLabel[i] == hobbyArr[i].value) {
-        //         hobbyArr[i].checked = true;
-        //       }
-        //     }
-        //     this.setData({
-        //       [hobby]: resHobbyLabel
-        //     })
-        //   }
-        //   this.setData({
-        //     hobbyArr: hobbyArr,
-        //     HobbyLabel: result[0],
-        //     HobbyValue: result[1]
-        //   })
-        //   console.log(result[0])
-        //   console.log(this.data.HobbyLabel)
-        // })
       },
       complete: () => {
         wx.hideLoading()
@@ -926,11 +901,17 @@ Page({
           wx.showModal({
             title: '上传成功',
             showCancel: false,
-            success(res) {
+            success:(res)=> {
               if (res.confirm) {
-                wx.redirectTo({
-                  url: '/pages/InfoType/InfoType',
-                })
+                if(this.data.targetStatus){
+                  wx.redirectTo({
+                    url: '/pages/index/index',
+                  })
+                }else{
+                  wx.redirectTo({
+                    url: '/pages/targetInfo/targetInfo',
+                  })
+                }
               }
             }
           });
@@ -1098,48 +1079,19 @@ Page({
         openid: result[0],
         sessionkey: result[1]
       })
-      // this.getForm();
       this.getInfos();
-      wx.getSetting({
-        success: res => {
-          console.log(res)
-          if (res.authSetting['scope.userInfo']) {
-            // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
-            wx.getUserInfo({
-              success: res => {
-                this.setData({
-                  rawData: res.rawData,
-                  signature: res.signature
-                })
-                if (this.userInfoReadyCallback) {
-                  this.userInfoReadyCallback(res)
-                }
-              }
-            })
-          } else {
-            // wx.showModal({
-            //   title: '您还未登录',
-            //   showCancel: false,
-            //   success(res) {
-            //     if (res.confirm) {
-            //       wx.redirectTo({
-            //         url: '/pages/personal/personal',
-            //       })
-            //     }
-            //   }
-            // });
-          }
-        }
+      tool.isFinishTargetInfo().then(res => {
+        console.log(res)
+        this.setData({
+          targetStatus: true
+        })
+      }).catch(err=>{
+        console.log(err)
+        this.setData({
+          targetStatus: false
+        })
       })
-      // wx.getUserInfo({
-      //   success: (res) => {
-      //     console.log(res)
-      //     this.setData({
-      //       rawData: res.rawData,
-      //       signature: res.signature
-      //     })
-      //   }
-      // })
+      // this.getTargetInfostatus();
     })
   },
   // 上传头像

+ 8 - 5
pages/personInfoDetail/personInfoDetail.wxml

@@ -175,7 +175,7 @@
 					</picker>
 				</view>
 			</view>
-			<view class="block" style="height:160rpx;">
+			<view class="block" style="height:200rpx;">
 				<view class='left' style="width:100%">啥时候方便我给你介绍个对象(多选)</view>
 				<checkbox-group class="parameter-wrap" bindchange="controlTimeChange" name='controlTime' value="{{form.controlTime}}">
 					<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="index" wx:for="{{controlTimeArr}}">
@@ -288,7 +288,7 @@
 					</picker>
 				</view>
 			</view>
-			<view class="block" style="height:260rpx;">
+			<view class="block" style="height:240rpx;">
 				<view class='left' style="width:100%">家里有跟你争宠的没(多选)</view>
 				<checkbox-group class="parameter-wrap" bindchange="compositionChange" name='composition' value="{{form.composition}}">
 					<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="index" wx:for="{{compositionArr}}">
@@ -311,14 +311,17 @@
 					</picker>
 				</view>
 			</view>
-			<view class="block" style="height:260rpx;">
-				<view class='left' style="width:100%">喜欢铜鼓点啥(多选  )</view>
+			<view class="block" style="height:300rpx;">
+				<view class='left' style="width:100%">喜欢铜鼓点啥(多选)</view>
 					<checkbox-group class="parameter-wrap" bindchange="hobbyChange" name='hobby' value="{{form.hobby}}">
 					<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="index" wx:for="{{hobbyArr}}">
 						<checkbox value="{{item.value}}" checked="{{item.checked}}" />{{item.name}}
 					</label>
 				</checkbox-group>
 			</view>
-			<button form-type="submit" id="sunbmit">提交个人详细信息</button>
+			<button form-type="submit" id="sunbmit">
+			<span wx:if="{{targetStatus}}">确认</span>
+			<span wx:else>确认,去完善择偶信息吧</span>
+			</button>
 		</form>
 	</view>

+ 4 - 2
pages/personInfoDetail/personInfoDetail.wxss

@@ -52,8 +52,10 @@
   color: rgba(51, 51, 51, 1);
   border: 1px solid #d7d8d8;
   border-radius: 40rpx;
-  padding: 8rpx 20rpx;
-  margin-right: 10rpx;
+  padding: 0rpx 25rpx;
+  margin-right: 20rpx;
+  display: inline-block;
+  line-height: 50rpx;
 }
 .checkboxbox {
   background: -webkit-linear-gradient(left, #bd64ff, #8873ff);

+ 64 - 80
pages/personal/personal.js

@@ -38,82 +38,70 @@ Page({
     ]
   },
   goTab(e) {
-    wx.navigateTo({
-      url: e.currentTarget.dataset.src
-    })
+    if (this.data.loginStatus) {
+      wx.navigateTo({
+        url: e.currentTarget.dataset.src
+      })
+    } else {
+      wx.showModal({
+        title: '您还未登录',
+        showCancel: false,
+        success(res) {
+          if (res.confirm) {
+            wx.redirectTo({
+              url: '/pages/personal/personal',
+            })
+          }
+        }
+      });
+    }
   },
   goIndex() {
     wx.redirectTo({
       url: '/pages/index/index',
     })
   },
-  onShareAppMessage: function (options) {
-    console.log(options)
-    var that = this;
-    // 设置菜单中的转发按钮触发转发事件时的转发内容
-    var shareObj = {
-      title: "月合文化", // 默认是小程序的名称(可以写slogan等)
-      path: '/pages/personal/personal', // 默认是当前页面,必须是以‘/’开头的完整路径
-      imageUrl: '../../images/photo.jpg', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
-      success: function (res) {
-        console.log(res)
-        // 转发成功之后的回调
-        if (res.errMsg == 'shareAppMessage:ok') {}
-      },
-      fail: function () {
-        // 转发失败之后的回调
-        if (res.errMsg == 'shareAppMessage:fail cancel') {
-          // 用户取消转发
-        } else if (res.errMsg == 'shareAppMessage:fail') {
-          // 转发失败,其中 detail message 为详细失败信息
-        }
-      }
-    }
-    // 来自页面内的按钮的转发
-    if (options.from == 'button') {
-      var eData = options.target.dataset;
-      console.log(eData.name); // shareBtn
-      // 此处可以修改 shareObj 中的内容
-      shareObj.path = '/pages/btnname/btnname?btn_name=' + eData.name;
-    }
-    // 返回shareObj
-    return shareObj;
-  },
+  // onShareAppMessage: function (options) {
+  //   console.log(options)
+  //   var that = this;
+  //   // 设置菜单中的转发按钮触发转发事件时的转发内容
+  //   var shareObj = {
+  //     title: "月合文化", // 默认是小程序的名称(可以写slogan等)
+  //     path: '/pages/personal/personal', // 默认是当前页面,必须是以‘/’开头的完整路径
+  //     imageUrl: '../../images/photo.jpg', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
+  //     success: function (res) {
+  //       console.log(res)
+  //       // 转发成功之后的回调
+  //       if (res.errMsg == 'shareAppMessage:ok') {}
+  //     },
+  //     fail: function () {
+  //       // 转发失败之后的回调
+  //       if (res.errMsg == 'shareAppMessage:fail cancel') {
+  //         // 用户取消转发
+  //       } else if (res.errMsg == 'shareAppMessage:fail') {
+  //         // 转发失败,其中 detail message 为详细失败信息
+  //       }
+  //     }
+  //   }
+  //   // 来自页面内的按钮的转发
+  //   if (options.from == 'button') {
+  //     var eData = options.target.dataset;
+  //     console.log(eData.name); // shareBtn
+  //     // 此处可以修改 shareObj 中的内容
+  //     shareObj.path = '/pages/btnname/btnname?btn_name=' + eData.name;
+  //   }
+  //   // 返回shareObj
+  //   return shareObj;
+  // },
   bindGetUserInfo: function (e) {
     console.log(e.detail.userInfo)
     this.setData({
       nick: e.detail.userInfo.nickName,
-      avatarUrl: e.detail.userInfo.avatarUrl
+      avatarUrl: e.detail.userInfo.avatarUrl,
+      loginStatus:true
     })
     this.upload(e.detail.userInfo.nickName, e.detail.userInfo.avatarUrl);
   },
-  getNick() {
-    // if (wx.getStorageSync('nick') && wx.getStorageSync('avatarUrl')) {
-    //   this.setData({
-    //     nick: wx.getStorageSync('nick'),
-    //     avatarUrl: wx.getStorageSync('avatarUrl')
-    //   })
-    // } else {
-    // wx.getSetting({
-    //   success: (res) => {
-    //     if (res.authSetting['scope.userInfo']) {
-    //       wx.getUserInfo({
-    //         success: (res) => {
-    //           this.setData({
-    //             nick: res.userInfo.nickName,
-    //             avatarUrl: res.userInfo.avatarUrl
-    //           })
-    //           wx.setStorageSync('nick', res.userInfo.nickName)
-    //           wx.setStorageSync('avatarUrl', res.userInfo.avatarUrl)
-    //         }
-    //       })
-    //     } else {
-    //       console.log(res)
-    //     }
-    //   }
-    // })
-    // }
-  },
   upload(nickName, avatar) {
     const form = {
       nickName: nickName,
@@ -192,31 +180,27 @@ Page({
     // console.log(e.detail.encryptedData)
   },
   getInfos() {
-    wx.request({
-      url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/info',
-      method: "get",
-      success: (res) => {
-        console.log(res, '我是获取的信息')
-        if (res.data.code == 0) {
-          if (res.data.info.nickName && res.data.info.avatar) {
-            this.setData({
-              nick: res.data.info.nickName,
-              avatarUrl: res.data.info.avatar
-            })
-            wx.setStorageSync('nick', res.data.info.nickName)
-            wx.setStorageSync('avatarUrl', res.data.info.avatar)
-          }
-        }
-      }
+    tool.isLogin().then(res => {
+      this.setData({
+        avatarUrl: res.userInfo.avatarUrl,
+        nick: res.userInfo.nickName,
+        loginStatus: true
+      })
+      wx.hideLoading();
+    }).catch(err => {
+      this.setData({
+        loginStatus: false
+      })
+      wx.hideLoading();
     })
   },
   async onShow() {
+    wx.showLoading();
     tool.openidStatus().then(result => {
       this.setData({
         openid: result[0],
         sessionkey: result[1]
       })
-      // this.getNick();
       this.getInfos();
       this.getTimes();
     })

+ 60 - 9
pages/share/share.js

@@ -50,15 +50,64 @@ Page({
     })
   },
   getEwm() {
-    wx.request({
-      url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/share',
-      method: "get",
-      success: (res) => {
-        if (res.data.code == 0) {
-          console.log(res.data.qrcode, '我是获取的二维码')
-          this.draw(res.data.qrcode);
+    tool.isLogin().then(result => {
+      console.log('我完善信息了并获取授权了')
+      tool.isFinishInfo().then(result2 => {
+        tool.isFinishTargetInfo().then(redult3 => {
+          
+          wx.request({
+            url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/share',
+            method: "get",
+            success: (res) => {
+              if (res.data.code == 0) {
+                this.draw(res.data.qrcode);
+              }
+            },
+            fail(){
+              wx.hideLoading();
+            }
+          })
+        }).catch(err => {
+          wx.showModal({
+            title: '您还未完善择偶信息',
+            showCancel: false,
+            success(res) {
+              if (res.confirm) {
+                wx.navigateTo({
+                  url: '/pages/targetInfo/targetInfo',
+                })
+              }
+            }
+          })
+          return false;
+        })
+      }).catch(err => {
+        wx.showModal({
+          title: '您还未完善个人信息',
+          showCancel: false,
+          success(res) {
+            if (res.confirm) {
+              wx.navigateTo({
+                url: '/pages/personInfo/personInfo',
+              })
+            }
+          }
+        })
+        return false;
+      })
+    }).catch(err => {
+      wx.showModal({
+        title: '您还未登录',
+        showCancel: false,
+        success(res) {
+          if (res.confirm) {
+            wx.redirectTo({
+              url: '/pages/personal/personal',
+            })
+          }
         }
-      }
+      });
+      return false;
     })
   },
   draw(qrcode) {
@@ -77,20 +126,22 @@ Page({
               this.setData({
                 imagePath: tempFilePath
               })
+              wx.hideLoading();
             },
             fail: (res) => {
               console.log(res);
+              wx.hideLoading();
             }
           });
         }, 200);
       }
     })
-
   },
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+    wx.showLoading();
     tool.openidStatus().then(result => {
       this.setData({
         openid: result[0],

+ 60 - 25
pages/targetInfo/targetInfo.js

@@ -32,7 +32,7 @@ Page({
     marriageArr: [],
     constellationArr: [],
     workStatusArr: [],
-    assetHouseArr: ['租房', '购房', '咋的都行'],
+    assetHouseArr: ['咋的都行','租房', '购房'],
     assetHouseAreaArr: [],
     // assetHouseLoanArr: ['有', '没有', '咋的都行'],
     assetCarArr: ['咋的都行','有', '没有'],
@@ -96,15 +96,20 @@ Page({
     })
   },
   assetHousePickerChange(e) {
-    let assetHouse = 'form.assetHouse';
+    let assetHouse = 'form.assetHouse'
     this.setData({
-      assetHouseLabel: this.data.assetHouseArr[e.detail.value]
+      assetHouseLabel: this.data.assetHouseArr[e.detail.value],
+      [assetHouse]: this.data.assetHouseArrValue[e.detail.value]
     })
-    if (e.detail.value != 2) {
-      this.setData({
-        [assetHouse]: e.detail.value
-      })
-    }
+    // let assetHouse = 'form.assetHouse';
+    // this.setData({
+    //   assetHouseLabel: this.data.assetHouseArr[e.detail.value]
+    // })
+    // if (e.detail.value != 2) {
+    //   this.setData({
+    //     [assetHouse]: e.detail.value
+    //   })
+    // }
   },
   assetHouseAreaPickerChange(e) {
     let assetHouseArea = 'form.assetHouseArea'
@@ -245,7 +250,7 @@ Page({
       url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/standard',
       method: "get",
       success: (res) => {
-        console.log(res.data.standard, '我是获取的信息')
+        console.log(res, '我是获取的信息')
         let ageMin = 'form.ageMin';
         let ageMax = 'form.ageMax';
         let heightMin = 'form.heightMin';
@@ -267,7 +272,7 @@ Page({
         let parentAssets = 'form.parentAssets';
         let isCommon = 'form.isCommon';
         let id = 'form.id'
-        if (res.data.standard) {
+        if (res.data.code==0) {
           this.setData({
             [ageMin]: res.data.standard.ageMin,
             [ageMax]: res.data.standard.ageMax,
@@ -277,8 +282,8 @@ Page({
             // [nativePlace]: res.data.standard.nativePlace,
             // marriageLabel: this.data.marriageArr[res.data.standard.marriage],
             // [marriage]: res.data.standard.marriage,
-            assetHouseLabel: this.data.assetHouseArr[res.data.standard.assetHouse],
-            [assetHouse]: res.data.standard.assetHouse,
+            // assetHouseLabel: this.data.assetHouseArr[res.data.standard.assetHouse],
+            // [assetHouse]: res.data.standard.assetHouse,
             assetHouseAreaLabel: this.data.assetHouseAreaArr[res.data.standard.assetHouseArea],
             [assetHouseArea]: res.data.standard.assetHouseArea,
             // assetHouseLoanLabel: this.data.assetHouseLoanArr[res.data.standard.assetHouseLoan],
@@ -299,7 +304,7 @@ Page({
             nativePlaceArr: ['咋的都行'].concat(result[0]),
             nativePlaceArrValue: ['0'].concat(result[1]),
           })
-          if (res.data.standard.nativePlace) {
+          if (res.data.code==0) {
             for (let i = 0; i < ['0'].concat(result[1]).length; i++) {
               if (res.data.standard.nativePlace == ['0'].concat(result[1])[i]) {
                 this.setData({
@@ -316,7 +321,7 @@ Page({
             marriageArr: ['咋的都行'].concat(result[0]),
             marriageArrValue: ['0'].concat(result[1]),
           })
-          if (res.data.standard.marriage) {
+          if (res.data.code==0) {
             for (let i = 0; i < [''].concat(result[1]).length; i++) {
               if (res.data.standard.marriage == ['0'].concat(result[1])[i]) {
                 this.setData({
@@ -328,15 +333,19 @@ Page({
           }
         })
         tool.formDetails('he_education').then(result => {
+          let oArr=[];
+          for(let i=0;i<result[0].length;i++){
+            oArr.push(result[0][i].concat('以上'))
+          }
           this.setData({
-            educationArr: ['咋的都行'].concat(result[0]),
+            educationArr: ['咋的都行'].concat(oArr),
             educationArrValue: ['0'].concat(result[1]),
           })
-          if (res.data.standard.education) {
+          if (res.data.code==0) {
             for (let i = 0; i < ['0'].concat(result[1]).length; i++) {
               if (res.data.standard.education == ['0'].concat(result[1])[i]) {
                 this.setData({
-                  educationLabel: ['咋的都行'].concat(result[0])[i],
+                  educationLabel: ['咋的都行'].concat(oArr)[i],
                   [education]: res.data.standard.education
                 })
               }
@@ -348,7 +357,7 @@ Page({
             incomeArr: ['咋的都行'].concat(result[0]),
             incomeArrValue: ['0'].concat(result[1])
           })
-          if (res.data.standard) {
+          if (res.data.code==0) {
             for (let i = 0; i < [''].concat(result[1]).length; i++) {
               if (res.data.standard.income == ['0'].concat(result[1])[i]) {
                 this.setData({
@@ -359,12 +368,38 @@ Page({
             }
           }
         })
+        tool.formDetails('he_asset_house').then(result => {
+          this.setData({
+            assetHouseArr: ['咋的都行'].concat(result[0]),
+            assetHouseArrValue:  ['0'].concat(result[1])
+          })
+          if (res.data.code==0) {
+            for (let i = 0; i < [''].concat(result[1]).length; i++) {
+              if (res.data.standard.assetHouse == ['0'].concat(result[1])[i]) {
+                this.setData({
+                  assetHouseLabel: ['咋的都行'].concat(result[0])[i],
+                  [assetHouse]: res.data.standard.assetHouse
+                })
+              }
+            }
+          }
+          // if (res.data.code==0) {
+          //   for (let i = 0; i < result[0].length; i++) {
+          //     if (result[1][i] == res.data.info.assetHouse) {
+          //       this.setData({
+          //         assetHouseLabel: result[0][i],
+          //         [assetHouse]: result[1][i],
+          //       })
+          //     }
+          //   }
+          // }
+        })
         tool.formDetails('he_asset_house_area').then(result => {
           this.setData({
             assetHouseAreaArr: ['咋的都行'].concat(result[0]),
             assetHouseAreaArrValue: ['0'].concat(result[1])
           })
-          if (res.data.standard) {
+          if (res.data.code==0) {
             for (let i = 0; i < [''].concat(result[1]).length; i++) {
               if (res.data.standard.assetHouseArea == ['0'].concat(result[1])[i]) {
                 this.setData({
@@ -380,7 +415,7 @@ Page({
             assetCarValueArr: ['咋的都行'].concat(result[0]),
             assetCarValueArrValue: ['0'].concat(result[1])
           })
-          if (res.data.standard) {
+          if (res.data.code==0) {
             for (let i = 0; i < [''].concat(result[1]).length; i++) {
               if (res.data.standard.assetCarValue == ['0'].concat(result[1])[i]) {
                 this.setData({
@@ -400,7 +435,7 @@ Page({
             })
           })
           console.log(result);
-          if (res.data.standard) {
+          if (res.data.code==0&&res.data.standard.constellation) {
             let resComposition = res.data.standard.constellation.split(",");
             let resCompositionIndexArr = [];
             for (let i = 0; i < resComposition.length; i++) {
@@ -438,7 +473,7 @@ Page({
               'checked': false
             })
           })
-          if (res.data.standard) {
+          if (res.data.code==0&&res.data.standard.workStatus) {
             let resWorkStatus = res.data.standard.workStatus.split(",");
             let resWorkStatusIndexArr = [];
             for (let i = 0; i < resWorkStatus.length; i++) {
@@ -475,7 +510,7 @@ Page({
               'checked': false
             })
           })
-          if (res.data.standard.companyNature) {
+          if (res.data.code==0&&res.data.standard.companyNature) {
             let rescompanyNature = res.data.standard.companyNature.split(",");
             let recompanyNatureIndexArr = [];
             for (let i = 0; i < rescompanyNature.length; i++) {
@@ -509,7 +544,7 @@ Page({
             compositionArr: ['咋的都行'].concat(result[0]),
             compositionArrValue: ['0'].concat(result[1])
           })
-          if (res.data.standard.composition) {
+          if (res.data.code==0) {
             for (let i = 0; i < [''].concat(result[1]).length; i++) {
               if (res.data.standard.composition == ['0'].concat(result[1])[i]) {
                 this.setData({
@@ -525,7 +560,7 @@ Page({
             parentAssetsArr: ['咋的都行'].concat(result[0]),
             parentAssetsArrValue: ['0'].concat(result[1])
           })
-          if (res.data.standard) {
+          if (res.data.code==0) {
             for (let i = 0; i < [''].concat(result[1]).length; i++) {
               if (res.data.standard.parentAssets == ['0'].concat(result[1])[i]) {
                 this.setData({

+ 39 - 39
pages/targetInfo/targetInfo.wxml

@@ -62,7 +62,7 @@
 		<view class="block">
 			<view class='left' style="width:60%">人家离过你行不</view>
 			<view class='right' style="width:40%">
-					<picker bindchange="marriageChange" range="{{marriageArr}}" name='marriage' value="{{form.marriage}}">
+				<picker bindchange="marriageChange" range="{{marriageArr}}" name='marriage' value="{{form.marriage}}">
 					<view style="text-align:right">
 						<view wx:if="{{marriageLabel}}">{{marriageLabel}}</view>
 						<view wx:else class='placeStyle'>
@@ -78,28 +78,28 @@
 			<view class='left' style="width:35%">房子挑不挑</view>
 			<view class='right' style="width:65%">
 				<picker bindchange="assetHousePickerChange" range="{{assetHouseArr}}" name='assetHouse' value="{{form.assetHouse}}">
-				<view style="text-align:right">
-					<view wx:if="{{assetHouseLabel}}">{{assetHouseLabel}}</view>
-					<view wx:else class='placeStyle'>
-						<view class="redpoint"></view>
-						<view class="placetext">未选择</view>
-						<van-icon size="15px" name="arrow" />
-					</view>
+					<view style="text-align:right">
+						<view wx:if="{{assetHouseLabel}}">{{assetHouseLabel}}</view>
+						<view wx:else class='placeStyle'>
+							<view class="redpoint"></view>
+							<view class="placetext">未选择</view>
+							<van-icon size="15px" name="arrow" />
+						</view>
 					</view>
 				</picker>
 			</view>
 		</view>
-		<view class="block">
+		<view class="block" wx:if="{{assetHouseLabel!='咋的都行'&&assetHouseLabel!='租房'}}">
 			<view class='left' style="width:35%">房子多大挑不</view>
 			<view class='right' style="width:65%">
 				<picker bindchange="assetHouseAreaPickerChange" range="{{assetHouseAreaArr}}" name='assetHouseArea' value="{{form.assetHouseArea}}">
-				<view style="text-align:right">
-					<view wx:if="{{assetHouseAreaLabel}}">{{assetHouseAreaLabel}}</view>
-					<view wx:else class='placeStyle'>
-						<view class="redpoint"></view>
-						<view class="placetext">未选择</view>
-						<van-icon size="15px" name="arrow" />
-					</view>
+					<view style="text-align:right">
+						<view wx:if="{{assetHouseAreaLabel}}">{{assetHouseAreaLabel}}</view>
+						<view wx:else class='placeStyle'>
+							<view class="redpoint"></view>
+							<view class="placetext">未选择</view>
+							<van-icon size="15px" name="arrow" />
+						</view>
 					</view>
 				</picker>
 			</view>
@@ -123,28 +123,28 @@
 			<view class='left' style="width:35%">对车啥要求</view>
 			<view class='right' style="width:65%">
 				<picker bindchange="assetCarPickerChange" range="{{assetCarArr}}" name='assetCar' value="{{form.assetCar}}">
-				<view style="text-align:right">
-					<view wx:if="{{assetCarLabel}}">{{assetCarLabel}}</view>
-					<view wx:else class='placeStyle'>
-						<view class="redpoint"></view>
-						<view class="placetext">未选择</view>
-						<van-icon size="15px" name="arrow" />
-					</view>
+					<view style="text-align:right">
+						<view wx:if="{{assetCarLabel}}">{{assetCarLabel}}</view>
+						<view wx:else class='placeStyle'>
+							<view class="redpoint"></view>
+							<view class="placetext">未选择</view>
+							<van-icon size="15px" name="arrow" />
+						</view>
 					</view>
 				</picker>
 			</view>
 		</view>
-		<view class="block">
+		<view class="block" wx:if="{{assetCarLabel!='咋的都行'&&assetCarLabel!='没有'}}">
 			<view class='left' style="width:45%">对车多钱有啥要求啊</view>
 			<view class='right' style="width:55%">
 				<picker bindchange="assetCarValuePickerChange" range="{{assetCarValueArr}}" name='assetCarValue' value="{{form.assetCarValue}}">
-				<view style="text-align:right">
-					<view wx:if="{{assetCarValueLabel}}">{{assetCarValueLabel}}</view>
-					<view wx:else class='placeStyle'>
-						<view class="redpoint"></view>
-						<view class="placetext">未选择</view>
-						<van-icon size="15px" name="arrow" />
-					</view>
+					<view style="text-align:right">
+						<view wx:if="{{assetCarValueLabel}}">{{assetCarValueLabel}}</view>
+						<view wx:else class='placeStyle'>
+							<view class="redpoint"></view>
+							<view class="placetext">未选择</view>
+							<van-icon size="15px" name="arrow" />
+						</view>
 					</view>
 				</picker>
 			</view>
@@ -164,7 +164,7 @@
 				</picker>
 			</view>
 		</view> -->
-		<view class="block" style="height:440rpx;">
+		<view class="block" style="height:300rpx;">
 			<view class='left' style="width:100%">人家什么星座你能行(多选)</view>
 			<checkbox-group class="parameter-wrap" bindchange="constellationPicker" name='constellation' value="{{form.constellation}}">
 				<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="index" wx:for="{{constellationArr}}">
@@ -172,7 +172,7 @@
 				</label>
 			</checkbox-group>
 		</view>
-		<view class="block" style="height:340rpx;">
+		<view class="block" style="height:300rpx;">
 			<view class='left' style="width:100%">人家什么节奏你不行(多选)</view>
 			<checkbox-group class="parameter-wrap" bindchange="workStatusChange" name='workStatus' value="{{form.workStatus}}">
 				<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="index" wx:for="{{workStatusArr}}">
@@ -180,15 +180,15 @@
 				</label>
 			</checkbox-group>
 		</view>
-		<view class="block" style="height:320rpx">
-			<view class='left' style="width:100%">人家什么阵地你能行</view>
+		<view class="block" style="height:300rpx">
+			<view class='left' style="width:100%">人家什么阵地你能行(多选)</view>
 			<!-- <view class='right' style="width:60%"> -->
-				<checkbox-group class="parameter-wrap" bindchange="companyNaturePicker" name='companyNature' value="{{form.companyNature}}">
+			<checkbox-group class="parameter-wrap" bindchange="companyNaturePicker" name='companyNature' value="{{form.companyNature}}">
 				<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="index" wx:for="{{companyNatureArr}}">
 					<checkbox value="{{item.value}}" checked="{{item.checked}}" />{{item.name}}
 				</label>
 			</checkbox-group>
-				<!-- <picker bindchange="companyNaturePicker" range="{{companyNatureArr}}" name='companyNature' value="{{form.companyNature}}">
+			<!-- <picker bindchange="companyNaturePicker" range="{{companyNatureArr}}" name='companyNature' value="{{form.companyNature}}">
 					<view style="text-align:right">
 						<view wx:if="{{companyNatureLabel}}">{{companyNatureLabel}}</view>
 						<view wx:else class='placeStyle'>
@@ -230,7 +230,7 @@
 				</picker>
 			</view>
 		</view>
-				<view class="block">
+		<view class="block">
 			<view class='left' style="width:45%">是否愿意与父母同住</view>
 			<view class='right' style="width:55%">
 				<picker bindchange="isCommonPicker" range="{{isCommonArr}}" name='isCommon' value="{{form.isCommon}}">
@@ -246,7 +246,7 @@
 			</view>
 		</view>
 		<view class="btn-area">
-			<button form-type="submit" id="sunbmit">提交择偶信息</button>
+			<button form-type="submit" id="sunbmit">确认,提交择偶信息</button>
 		</view>
 	</form>
 </view>

+ 3 - 1
pages/targetInfo/targetInfo.wxss

@@ -57,8 +57,10 @@
   color: rgba(51, 51, 51, 1);
   border: 1px solid #d7d8d8;
   border-radius: 40rpx;
-  padding: 8rpx 50rpx;
+  padding: 0rpx 25rpx;
   margin-right: 20rpx;
+  display: inline-block;
+  line-height: 50rpx;
 }
 
 .checkboxbox {

+ 23 - 8
utils/tool.js

@@ -66,18 +66,33 @@ const formDetails = (type) => {
 // 判断是否登录
 const isLogin = () => {
   return new Promise((resolve, reject) => {
-    wx.request({
-      url: util.globalData.publicUrl + '/wx/member/' + wx.getStorageSync('openId') + '/info',
-      method: "get",
-      success: (res) => {
+    wx.getSetting({
+      success: res => {
         console.log(res)
-        if (res.data.code == 0 && res.data.info.avatar) {
-          resolve(res.data.info.avatar);
+        if (res.authSetting['scope.userInfo']) {
+          // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
+          wx.getUserInfo({
+            success: res => {
+              resolve(res)
+            }
+          })
         } else {
-          reject(res)
+         reject(false)
         }
       }
     })
+    // wx.request({
+    //   url: util.globalData.publicUrl + '/wx/member/' + wx.getStorageSync('openId') + '/info',
+    //   method: "get",
+    //   success: (res) => {
+    //     console.log(res)
+    //     if (res.data.code == 0 && res.data.info.avatar) {
+    //       resolve(res.data.info.avatar);
+    //     } else {
+    //       reject(res)
+    //     }
+    //   }
+    // })
   })
 };
 // 判断是否完善个人信息
@@ -88,7 +103,7 @@ const isFinishInfo = () => {
       method: "get",
       success: (res) => {
         console.log(res)
-        if (res.data.code == 0) {
+        if (res.data.code == 0&&res.data.info.name&&res.data.info.tel) {
           resolve(res.data.info)
         } else {
           reject(res.data.code)