houwei 4 năm trước cách đây
mục cha
commit
f3873ad3c9

+ 5 - 4
app.json

@@ -1,18 +1,19 @@
 {
   "pages": [
     "pages/index/index",
+    "pages/onSiteActivity/onSiteActivity",
     "pages/targetInfo/targetInfo",
     "pages/personInfoDetail/personInfoDetail",
+    "pages/activeDetail/activeDetail",
+    "pages/personal/personal",
     "pages/personInfo/personInfo",
     "pages/complaint/complaint",
-    "pages/onSiteActivity/onSiteActivity",
     "pages/share/share",
     "pages/myActive/myActive",
     "pages/InfoType/InfoType",
-    "pages/personal/personal",
     "pages/registrationSuccess/registrationSuccess",
-    "pages/activeDetail/activeDetail",
-    "pages/service/service"
+    "pages/service/service",
+    "pages/sign/sign"
   ],
   "window": {
     "backgroundTextStyle": "light",

+ 40 - 5
pages/activeDetail/activeDetail.js

@@ -1,21 +1,56 @@
 const app = require('../../utils/util.js');
+const tool = require('../../utils/tool.js');
 Page({
-
   /**
    * 页面的初始数据
    */
   data: {
 
   },
-  baoming(){
-    wx.redirectTo({
-      url: '/pages/registrationSuccess/registrationSuccess',
+  baoming() {
+    // /wx/actives/{openId}/{activeId}/enter
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
+      method: "get",
+      success: (res) => {
+        if (res.data.code == 0) {
+          console.log(res, '报名成功了')
+          wx.redirectTo({
+            url: '/pages/registrationSuccess/registrationSuccess',
+          })
+        }
+      }
     })
   },
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (options) {
+  async onLoad(options) {
+    console.log(options)
+    const getOpenid = await tool.openidStatus();
+    this.setData({
+      openid: getOpenid[0],
+      sessionkey: getOpenid[1]
+    })
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + options.id + '/detail',
+      method: "get",
+      success: (res) => {
+        if (res.data.code == 0) {
+          console.log(res, '查询活动详情')
+          this.setData({
+            id:res.data.activeRoll.id,
+            actualCount:res.data.activeRoll.actualCount,
+            planCount:res.data.activeRoll.planCount,
+            activeStart:res.data.activeRoll.activeStart,
+            address:res.data.activeRoll.address,
+            remark:res.data.activeRoll.remark,
+            openId:options.openId
+          })
+          console.log(this.data.openId)
+        }
+      }
+    })
 
   },
 

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 6 - 5
pages/activeDetail/activeDetail.wxml


+ 16 - 11
pages/activeDetail/activeDetail.wxss

@@ -1,22 +1,27 @@
 /* pages/activeDetail/activeDetail.wxss */
-.line{
+.line {
   display: flex;
   color: #999999;
   margin-top: 30rpx;
 }
-.title{
-  margin-left:35rpx;
-  margin-top:35rpx;
+
+.title {
+  margin-left: 35rpx;
+  margin-top: 35rpx;
   display: flex;
 }
-.btn_area{
-width: 750rpx;
-height: 150rpx;
-/* border: 1px solid red; */
-box-shadow: 0px 0px 10px rgba(0,0,0,.2);
-position: relative;
+
+.btn_area {
+  width: 750rpx;
+  height: 150rpx;
+  /* border: 1px solid red; */
+  box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
+  position: fixed;
+  bottom: 0;
+  left: 0;
 }
-.btn{
+
+.btn {
   width: 680rpx;
   height: 80rpx;
   line-height: 80rpx;

+ 46 - 9
pages/index/index.js

@@ -1,23 +1,60 @@
 const app = require('../../utils/util.js');
+const tool = require('../../utils/tool.js');
 Page({
   data: {
     currentIndex: 0,
-    arr: [{
-      title: '月合红娘',
-      address: '吉林省长春市经开区赛德广场',
-      remark: '请大家按照规定时间前来参与',
-      activeTime: '2021-01-01',
-      activeStatus: 0
-    }]
+    arr: [],
+    arr1: []
   },
   handleChange: function (e) {
     this.setData({
       currentIndex: e.detail.current
     })
   },
-  goActive(){
+  goActive(e) {
+    console.log(e)
+    let id = e.currentTarget.dataset.id
+    let openId = e.currentTarget.dataset.openid
     wx.navigateTo({
-      url: '/pages/activeDetail/activeDetail',
+      url: '/pages/activeDetail/activeDetail?id=' + id + '&openId=' + openId,
     })
+  },
+  async onLoad() {
+    const getOpenid = await tool.openidStatus();
+    this.setData({
+      openid: getOpenid[0],
+      sessionkey: getOpenid[1]
+    })
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/actives',
+      method: "get",
+      data: {
+        activeStatus: 0
+      },
+      success: (res) => {
+        console.log(res)
+        if (res.data.code == 0) {
+          this.setData({
+            arr1: res.data.actives
+          })
+        }
+      }
+    })
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/actives',
+      method: "get",
+      data: {
+        activeStatus: 1
+      },
+      success: (res) => {
+        console.log(res)
+        if (res.data.code == 0) {
+          this.setData({
+            arr: this.data.arr1.concat(res.data.actives)
+          })
+        }
+      }
+    })
+
   }
 })

+ 3 - 4
pages/index/index.wxml

@@ -8,16 +8,15 @@
 	</swiper>
 	<image src="../../images/show.png" style="width:650rpx;margin-left:50rpx;height:200rpx"></image>
 	<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>
-	<view wx:for="{{arr}}" wx:key="index" class="box" bindtap="goActive">
+	<view wx:for="{{arr}}" wx:key="index" class="box" bindtap="goActive" data-id='{{item.id}}' data-openId='{{item.openId}}'>
 		<view class="top">
 			<image src="../../images/activephoto.png" style="width:80rpx;height:80rpx;"></image>
 			<view class="text">
 				<view class="title">{{item.title}}</view>
 				<view class="remark">{{item.remark}}</view>
 			</view>
-			<view wx:if="{{item.activeStatus==0}}" class="btn btn1">未开始</view>
-			<view wx:if="{{item.activeStatus==1}}" class="btn btn2">进行中</view>
-			<view wx:if="{{item.activeStatus==2}}" class="btn btn3">已结束</view>
+			<view wx:if="{{item.openId==null}}" class="btn btn1">报名</view>
+			<view wx:else class="btn btn2">已报名</view>
 		</view>
 		<image src="../../images/activeimg.png" class="img2"></image>
 		<view class="p1">

+ 23 - 12
pages/myActive/myActive.js

@@ -1,30 +1,41 @@
 const app = require('../../utils/util.js');
+const tool = require('../../utils/tool.js');
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-    arr: [ {
-      title: '月合红娘',
-      address: '吉林省长春市朝阳区栖乐荟广场',
-      remark: '请大家按照规定时间前来参与',
-      activeTime: '2020-12-25',
-      activeStatus: 0
-    }]
+    arr: []
   },
-  goActive(){
+  goActive(e){
+    console.log(e.currentTarget.dataset.id)
     // wx.redirectTo({
-    //   url: '/pages/activeDetail/activeDetail',
+    //   url: '/pages/onSiteActivity/onSiteActivity?id='+e.currentTarget.dataset.id,
     // })
   },
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (options) {
-
+  async onLoad (options) {
+    const getOpenid = await tool.openidStatus();
+    this.setData({
+      openid: getOpenid[0],
+      sessionkey: getOpenid[1]
+    })
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/myActive',
+      method: "get",
+      success: (res) => {
+        console.log(res)
+        if(res.data.code==0){
+          this.setData({
+            arr: res.data.actives
+          })
+        }
+      }
+    })
   },
-
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 2 - 2
pages/myActive/myActive.wxml

@@ -1,4 +1,4 @@
-<view wx:for="{{arr}}" wx:key="index" class="box" bindtap="goActive">
+<view wx:for="{{arr}}" wx:key="index" class="box">
 	<view class="top">
 		<image src="../../images/activephoto.png" style="width:80rpx;height:80rpx;"></image>
 		<view class="text">
@@ -6,7 +6,7 @@
 			<view class="remark">{{item.remark}}</view>
 		</view>
 		<view wx:if="{{item.activeStatus==0}}" class="btn btn1">未开始</view>
-		<view wx:if="{{item.activeStatus==1}}" class="btn btn2">进行中</view>
+		<view wx:if="{{item.activeStatus==1}}" class="btn btn2" data-id='{{item.id}}' bindtap="goActive">进行中</view>
     <view wx:if="{{item.activeStatus==2}}" class="btn btn3">已结束</view>
 	</view>
 	<image src="../../images/activeimg.png" class="img2"></image>

+ 59 - 14
pages/onSiteActivity/onSiteActivity.js

@@ -1,14 +1,12 @@
 const app = require('../../utils/util.js');
+const tool = require('../../utils/tool.js');
 Page({
-
-  /**
-   * 页面的初始数据
-   */
   data: {
     checkArr: []
   },
   love(e) {
     console.log(e.currentTarget.dataset.index)
+    console.log(e.currentTarget.dataset.id)
     let status=this.data.checkArr[e.currentTarget.dataset.index]
     let statusValue = 'checkArr[' + e.currentTarget.dataset.index + ']'
     console.log(status)
@@ -16,25 +14,72 @@ Page({
       this.setData({
         [statusValue]: false
       })
+      wx.request({
+        url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/unfollow',
+        method: "get",
+        data:{
+          targetId:e.currentTarget.dataset.id
+        },
+        success: (res) => {
+          if (res.data.code == 0) {
+            console.log(res, '我取消心动了')
+          }
+        }
+      })
     }else{
       this.setData({
         [statusValue]: true
       })
+      wx.request({
+        url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/heartbeat',
+        method: "get",
+        data:{
+          targetId:e.currentTarget.dataset.id
+        },
+        success: (res) => {
+          if (res.data.code == 0) {
+            console.log(res, '我心动了')
+          }
+        }
+      })
     }
   },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    var checkArr1 = [];
-    for (var i = 0; i < 50; i++) {
-      checkArr1[i] = false;
-    }
+  async onLoad (options) {
+    const getOpenid = await tool.openidStatus();
     this.setData({
-      checkArr: checkArr1
+      openid: getOpenid[0],
+      sessionkey: getOpenid[1],
+      activeId:options.id
+    })
+    // wx.request({
+    //   url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.activeId + '/sign',
+    //   method: "get",
+    //   success: (res) => {
+    //     if (res.data.code == 0) {
+    //       console.log(res, '我来到现场了')
+    //     }
+    //   }
+    // })
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.activeId + '/members',
+      method: "get",
+      success: (res) => {
+        if (res.data.code == 0) {
+          console.log(res.data.members, '我获取人员名单')
+          this.setData({
+            member:res.data.menmbers
+          })
+          let checkArr1 = [];
+          for (let i = 0; i < res.data.members.length; i++) {
+            checkArr1[i] = false;
+          }
+          this.setData({
+            checkArr: checkArr1
+          })
+        }
+      }
     })
   },
-
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 2 - 2
pages/onSiteActivity/onSiteActivity.wxml

@@ -13,12 +13,12 @@
     </view>
 	</scroll-view>
   <view class="num"> 
-  <view class='allnum'>嘉宾: 100名</view>
+  <view class='allnum'>嘉宾: {{members.length}}名</view>
   <view class="tousu">投诉反馈</view>
   </view>
   </view>
   <view class="photobox">
-  	<view wx:for="{{50}}" wx:key="index" data-index="{{index}}" bindtap="love" style="text-align:center;width: 140rpx;position:relative">
+  	<view wx:for="{{members}}" wx:key="index" data-index="{{index}}" data-index='{{id}}' bindtap="love" style="text-align:center;width: 140rpx;position:relative">
 			<image src="../../images/photo.jpg" style="width:110rpx;height:110rpx;border-radius:50%;margin-top:20rpx" mode="aspectFit"></image>
       <view style="color:#4d4d4d;font-size:28rpx;margin-top:5rpx">001</view>
       <view style="color:#4d4d4d;font-size:28rpx;padding-bottom:35rpx">小红阿</view>

+ 36 - 16
pages/personInfo/personInfo.js

@@ -23,7 +23,9 @@ Page({
       "白羊座", "金牛座", "双子座", "巨蟹座", "狮子座", "处女座", "天秤座", "天蝎座", "射手座", "摩羯座", "水瓶座", "双鱼座。"
     ],
     form: {
-      card: '',
+      // member: {
+      idFront: '',
+      idCard: '',
       name: '',
       sex: '',
       age: '',
@@ -31,6 +33,7 @@ Page({
       nation: '',
       birthday: '',
       constellation: ''
+      // }
     }
   },
   nationPicker(e) {
@@ -79,14 +82,12 @@ Page({
       success: (res) => {
         let tempFilePaths = res.tempFilePaths[0]
         console.log(tempFilePaths, '图片的临时路径')
-        this.setData({
-          imgsrc: tempFilePaths
-        })
-        this.toCos()
+
+        this.toCos(tempFilePaths)
       }
     })
   },
-  toCos() {
+  toCos(path) {
     var Bucket = 'yuehe-1257653330';
     var Region = 'ap-beijing';
     var ForcePathStyle = false;
@@ -155,7 +156,7 @@ Page({
       var requestTask = wx.uploadFile({
         url: prefix,
         name: 'file',
-        filePath: this.data.imgsrc,
+        filePath: path,
         formData: {
           'key': "face/" + Key,
           'success_action_status': 200,
@@ -165,9 +166,9 @@ Page({
         },
         success: (res) => {
           console.log(res.header.Location)
-          let card = 'form.card'
           this.setData({
-            [card]: res.header.Location
+            // [idFront]: res.header.Location,
+            imgsrc: path
           })
           this.toJx(res.header.Location)
         },
@@ -198,8 +199,13 @@ Page({
       success: (res) => {
         console.log(res)
         if (res.data.code == 0) {
-          let res1 = JSON.parse(res.data.cardMessage)
-          let card = 'form.card'
+          let res1=JSON.parse(res.data.cardMessage)
+          let sexTurn=0;
+          if(res1.words_result['性别'].words=='男'){
+            sexTurn=1;
+          }
+          let idFront = 'form.idFront'
+          let idCard = 'form.idCard'
           let name = 'form.name'
           let sex = 'form.sex'
           let age = 'form.age'
@@ -208,9 +214,10 @@ Page({
           let birthday = 'form.birthday'
           let constellation = 'form.constellation'
           this.setData({
-            [card]: res1.words_result['公民身份号码'].words,
+            [idFront]: location,
+            [idCard]: res1.words_result['公民身份号码'].words,
             [name]: res1.words_result['姓名'].words,
-            [sex]: res1.words_result['性别'].words,
+            [sex]: sexTurn,
             [age]: tools.formatTime(new Date()) - res1.words_result['出生'].words.substring(0, 4),
             [nativePlace]: res1.words_result['住址'].words,
             [nation]: res1.words_result['民族'].words,
@@ -233,7 +240,7 @@ Page({
           })
         }
       },
-      complete:()=>{
+      complete: () => {
         wx.hideLoading()
       }
     })
@@ -317,6 +324,9 @@ Page({
     wx.request({
       url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/info',
       method: "POST",
+      header: {
+        'content-type': 'application/x-www-form-urlencoded',
+      },
       data: params,
       success: (res) => {
         console.log(res)
@@ -336,13 +346,23 @@ Page({
       }
     })
   },
-  onLoad: function (options) {
+  async onLoad(options) {
     this.initValidate()
-    const getOpenid = tools.openidStatus();
+    const getOpenid = await tools.openidStatus();
     this.setData({
       openid: getOpenid[0],
       sessionkey: getOpenid[1]
     })
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/info',
+      method: "get",
+      success: (res) => {
+        console.log(res)
+        if (res.data.code == 0) {
+
+        }
+      }
+    })
   },
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 6 - 0
pages/personInfo/personInfo.wxml

@@ -5,6 +5,12 @@
 		<image class="cardimg" mode="aspectFit" src="{{imgsrc}}" bindtap="uploadCard"></image>
 	</view>
 	<form bindsubmit='formSubmit'>
+		<view style="display:none">
+			<input name="idFront" type="text" value="{{form.idFront}}"></input>
+		</view>
+		<view style="display:none">
+			<input name="idCard" type="text" value="{{form.idCard}}"></input>
+		</view>
 		<view class="block">
 			<view class='left'>姓名</view>
 			<view class='right'>

+ 150 - 201
pages/personInfoDetail/personInfoDetail.js

@@ -27,7 +27,7 @@ Page({
       parents: '',
       fatherWork: '',
       motherWork: '',
-      parentAssets:'',
+      parentAssets: '',
       composition: '',
       motionState: '',
       hobby: '',
@@ -39,172 +39,111 @@ Page({
     incomeArr: [],
     marriageList: [],
     childrenArr: [],
-    deposit: '',
-    assetHouseArr: ['租房', '购房'],
-    assetAreaArr: ['80平以下', '80-120平', '120平以上'],
-    assetHouseLoanArr: ['有', '没有'],
-    assetCarArr: ['有', '没有'],
-    assetCarValueArr: ['10万以下', '10-20万', '20-30万', '30-40万', '40-50万', '50-60万', '60-70万', '70-80万', '80-90万', '90-100万', '100万以上'],
-    assetCarLoanArr: ['有贷款', '无贷款'],
+    assetHouseArr: [],
+    assetAreaArr: [],
+    assetHouseLoanArr: [],
+    assetCarArr: [],
+    assetCarValueArr: [],
+    assetCarLoanArr: [],
     isCommenArr: ['一起', '没有'],
-    controlTimeArr: [{
-        name: '不限',
-        value: '不限',
-        checked: true
-      },
-      {
-        name: '晚18:00以后',
-        value: '晚18:00以后',
-        checked: false
-      }, {
-        name: '星期六',
-        value: '星期六',
-        checked: false
-      }, {
-        name: '星期日',
-        value: '星期日',
-        checked: false
-      }
-    ],
+    controlTimeArr: [],
     workStatusArr: [],
     companyNatureArr: [],
-    parentsArr: ['爹妈比我都健康,一直很恩爱', '爹妈比我都健康,离婚了', '世事无常'],
-    fatherWorkArr: ['退休', '政府机关', '事业单位', '外企企业', '世界500强', '上市公司', '国有企业', '私营企业', '个体'],
-    motherWorkArr: ['退休', '政府机关', '事业单位', '外企企业', '世界500强', '上市公司', '国有企业', '私营企业', '个体'],
-    parentAssetsArr:[],
-    compositionArr: [{
-        name: '没有唯我独尊',
-        value: '没有唯我独尊',
-        checked: false
-      },
-      {
-        name: '有姐姐',
-        value: '偶有姐姐',
-        checked: false
-      }, {
-        name: '有哥哥',
-        value: '有哥哥',
-        checked: false
-      }, {
-        name: '有弟弟',
-        value: '有弟弟',
-        checked: false
-      }, {
-        name: '有妹妹',
-        value: '有妹妹',
-        checked: false
-      }
-    ],
+    parentsArr: [],
+    fatherWorkArr: [],
+    motherWorkArr: [],
+    parentAssetsArr: [],
+    compositionArr: [],
     figureArr: ['龟息养生从不运动', '三天打鱼偶尔运动', '动如脱兔成天运动']
   },
   heightPicker(e) {
     let height = 'form.height'
     this.setData({
-      [height]: this.data.heightArr[e.detail.value]
+      heightLabel: this.data.heightArr[e.detail.value],
+      [height]: this.data.heightArrValue[e.detail.value]
     })
   },
   weightPicker(e) {
     let weight = 'form.weight'
     this.setData({
-      [weight]: this.data.weightArr[e.detail.value]
+      weightLabel: this.data.weightArr[e.detail.value],
+      [weight]: this.data.weightArrValue[e.detail.value]
     })
   },
   educationPicker(e) {
     let education = 'form.education'
     this.setData({
-      [education]: this.data.educationArr[e.detail.value]
+      educationLabel: this.data.educationArr[e.detail.value],
+      [education]: this.data.educationArrValue[e.detail.value]
     })
   },
   incomePicker(e) {
     let income = 'form.income'
     this.setData({
-      [income]: this.data.incomeArr[e.detail.value]
+      incomeLabel: this.data.incomeArr[e.detail.value],
+      [income]: this.data.incomeArrValue[e.detail.value]
     })
   },
   marriageChange(e) {
-    console.log(e.detail.value)
-    const items = this.data.marriageList
-    let checked = 'marriageList[0].checked';
-    let checked1 = 'marriageList[1].checked'
-    this.setData({
-      [checked]: false,
-      [checked1]: false
-    })
-    for (let i = 0, lenI = items.length; i < lenI; ++i) {
-      if (items[i].value == e.detail.value) {
-        items[i].checked = true;
-        break
-      }
-    }
-    this.setData({
-      marriageList: this.data.marriageList
-    })
     let marriage = 'form.marriage'
     this.setData({
-      [marriage]: e.detail.value
+      marriageLabel: this.data.marriageList[e.detail.value],
+      [marriage]: this.data.marriageListValue[e.detail.value]
     })
   },
-  childrenChange (e) {
-    console.log(e.detail.value)
-    const items = this.data.childrenArr;
-    const values = e.detail.value;
-    for (let i = 0, lenI = items.length; i < lenI; ++i) {
-      items[i].checked = false
-      for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
-        if (items[i].value === values[j]) {
-          items[i].checked = true
-          break
-        }
-      }
-    }
-    this.setData({
-      childrenArr: this.data.childrenArr
-    })
+  childrenChange(e) {
     let children = 'form.children'
     this.setData({
-      [children]: e.detail.value
+      childrenLabel: this.data.childrenArr[e.detail.value],
+      [children]: this.data.childrenArrValue[e.detail.value]
     })
   },
   assetHousePickerChange(e) {
     console.log(e)
     let assetHouse = 'form.assetHouse'
     this.setData({
-      [assetHouse]: this.data.assetHouseArr[e.detail.value]
+      assetHouseLabel: this.data.assetHouseArr[e.detail.value],
+      [assetHouse]: this.data.assetHouseArrValue[e.detail.value]
     })
   },
   assetAreaPickerChange(e) {
     console.log(e)
     let assetArea = 'form.assetArea'
     this.setData({
-      [assetArea]: this.data.assetAreaArr[e.detail.value]
+      assetAreaLabel: this.data.assetAreaArr[e.detail.value],
+      [assetArea]: this.data.assetAreaArrValue[e.detail.value]
     })
   },
   assetHouseLoanPickerChange(e) {
     console.log(e)
     let assetHouseLoan = 'form.assetHouseLoan'
     this.setData({
-      [assetHouseLoan]: this.data.assetHouseLoanArr[e.detail.value]
+      assetHouseLoanLabel: this.data.assetHouseLoanArr[e.detail.value],
+      [assetHouseLoan]: this.data.assetHouseLoanArrValue[e.detail.value]
     })
   },
   assetCarPickerChange(e) {
     console.log(e)
     let assetCar = 'form.assetCar'
     this.setData({
-      [assetCar]: this.data.assetCarArr[e.detail.value]
+      assetCarLabel: this.data.assetCarArr[e.detail.value],
+      [assetCar]: this.data.assetCarArrValue[e.detail.value]
     })
   },
   assetCarValuePickerChange(e) {
     console.log(e)
     let assetCarValue = 'form.assetCarValue'
     this.setData({
-      [assetCarValue]: this.data.assetCarValueArr[e.detail.value]
+      assetCarValueLabel: this.data.assetCarValueArr[e.detail.value],
+      [assetCarValue]: this.data.assetCarValueArrValue[e.detail.value]
     })
   },
   assetCarLoanPickerChange(e) {
     console.log(e)
     let assetCarLoan = 'form.assetCarLoan'
     this.setData({
-      [assetCarLoan]: this.data.assetCarLoanArr[e.detail.value]
+      assetCarLoanLabel: this.data.assetCarLoanArr[e.detail.value],
+      [assetCarLoan]: this.data.assetCarLoanArrValue[e.detail.value]
     })
   },
   isCommenChange(e) {
@@ -214,7 +153,6 @@ Page({
     })
   },
   controlTimeChange(e) {
-    console.log(e.detail.value)
     const items = this.data.controlTimeArr;
     const values = e.detail.value;
     for (let i = 0, lenI = items.length; i < lenI; ++i) {
@@ -226,13 +164,20 @@ Page({
         }
       }
     }
-    this.setData({
-      controlTimeArr: this.data.controlTimeArr
-    })
+    let indexArr = [];
+    for (let i = 0; i < e.detail.value.length; i++) {
+      indexArr.push(this.data.controlTimeArrLabel.indexOf(e.detail.value[i]))
+    }
+    let value = [];
+    for (let i = 0; i < indexArr.length; i++) {
+      value.push(this.data.controlTimeArrValue[indexArr[i]])
+    }
     let controlTime = 'form.controlTime'
     this.setData({
-      [controlTime]: e.detail.value
+      controlTimeArr: this.data.controlTimeArr,
+      [controlTime]: value
     })
+    console.log(this.data.form.controlTime)
   },
   workStatusChange(e) {
     console.log(e.detail.value)
@@ -247,47 +192,59 @@ Page({
         }
       }
     }
+    let indexArr = [];
+    for (let i = 0; i < e.detail.value.length; i++) {
+      indexArr.push(this.data.workStatusArrLabel.indexOf(e.detail.value[i]))
+    }
+    let value = [];
+    for (let i = 0; i < indexArr.length; i++) {
+      value.push(this.data.workStatusArrValue[indexArr[i]])
+    }
+    let workStatus = 'form.workStatus'
     this.setData({
+      [workStatus]: value,
       workStatusArr: this.data.workStatusArr
     })
-    let workStatus = 'form. workStatus'
-    this.setData({
-      [workStatus]: e.detail.value
-    })
+    console.log(this.data.form.workStatus)
   },
-  workplacePicker (e) {
+  companyNaturePicker(e) {
     let companyNature = 'form.companyNature'
     this.setData({
-      [companyNature]: this.data.workplaceArr[e.detail.value]
+      companyNatureLabel: this.data.companyNatureArr[e.detail.value],
+      [companyNature]: this.data.companyNatureArrValue[e.detail.value]
     })
   },
   parentsPicker(e) {
     let parents = 'form.parents'
     this.setData({
-      [parents]: this.data.parentsArr[e.detail.value]
+      parentsLabel: this.data.parentsArr[e.detail.value],
+      [parents]: this.data.parentsArrValue[e.detail.value]
     })
   },
-  fatherworkPicker (e) {
+  fatherworkPicker(e) {
     let fatherWork = 'form.fatherWork'
     this.setData({
-      [fatherWork]: this.data.dadworkplaceArr[e.detail.value]
+      fatherWorkLabel: this.data.fatherWorkArr[e.detail.value],
+      [fatherWork]: this.data.fatherWorkArrValue[e.detail.value]
     })
   },
-  motherworkPicker (e) {
+  motherworkPicker(e) {
     let motherWork = 'form.motherWork'
     this.setData({
-      [motherWork]: this.data.momworkplaceArr[e.detail.value]
+      motherWorkLabel: this.data.motherWorkArr[e.detail.value],
+      [motherWork]: this.data.motherWorkArrValue[e.detail.value]
     })
   },
-  parentAssetsPicker(e){
+  parentAssetsPicker(e) {
     let parentAssets = 'form.parentAssets'
     this.setData({
-      [parentAssets]: this.data.parentAssetsArr[e.detail.value]
+      parentAssetsLabel: this.data.parentAssetsArr[e.detail.value],
+      [parentAssets]: this.data.parentAssetsArrValue[e.detail.value]
     })
   },
   compositionChange(e) {
     console.log(e.detail.value)
-    const items = this.data.otherchildArr;
+    const items = this.data.compositionArr;
     const values = e.detail.value;
     for (let i = 0, lenI = items.length; i < lenI; ++i) {
       items[i].checked = false
@@ -298,12 +255,18 @@ Page({
         }
       }
     }
-    this.setData({
-      otherchildArr: this.data.otherchildArr
-    })
+    let indexArr = [];
+    for (let i = 0; i < e.detail.value.length; i++) {
+      indexArr.push(this.data.compositionArrLabel.indexOf(e.detail.value[i]))
+    }
+    let value = [];
+    for (let i = 0; i < indexArr.length; i++) {
+      value.push(this.data.compositionArrValue[indexArr[i]])
+    }
     let composition = 'form.composition'
     this.setData({
-      [composition]: e.detail.value
+      compositionArr: this.data.compositionArr,
+      [composition]: value
     })
   },
   figurePicker(e) {
@@ -315,6 +278,7 @@ Page({
   // 提交
   formSubmit(e) {
     const params = e.detail.value
+    console.log(params)
     //校验表单
     if (!this.WxValidate.checkForm(params)) {
       const error = this.WxValidate.errorList[0]
@@ -324,6 +288,9 @@ Page({
     wx.request({
       url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/info',
       method: "POST",
+      header: {
+        'content-type': 'application/x-www-form-urlencoded',
+      },
       data: params,
       success: (res) => {
         console.log(res)
@@ -418,10 +385,10 @@ Page({
       },
       hobby: {
         required: true
-      },
-      photo: {
-        required: true
       }
+      // photo: {
+      //   required: true
+      // }
     }
     const messages = {
       phone: {
@@ -489,10 +456,10 @@ Page({
       },
       hobby: {
         required: '请填写您的爱好'
-      },
-      photo: {
-        required: '请上传您的照片'
       }
+      // photo: {
+      //   required: '请上传您的照片'
+      // }
     }
     this.WxValidate = new WxValidate(rules, messages)
   },
@@ -528,89 +495,89 @@ Page({
       })
     })
     tool.formDetails('he_marriage').then(result => {
-      let marriageList = result[0].map((item, index) => {
-        return Object.assign({}, {
-          'name': item,
-          'value':item,
-          'checked':false
-        })
+      this.setData({
+        marriageList: result[0],
+        marriageListValue: result[1]
       })
-      let marriageListValue = result[1].map((item, index) => {
-        return Object.assign({}, {
-          'name': item,
-          'value':item,
-          'checked':false
-        })
+    })
+    tool.formDetails('he_children').then(result => {
+      this.setData({
+        childrenArr: result[0],
+        childrenArrValue: result[1]
       })
+    })
+    tool.formDetails('he_asset_house').then(result => {
       this.setData({
-        marriageList:marriageList,
-        marriageListValue: marriageListValue
+        assetHouseArr: result[0],
+        assetHouseArrValue: result[1]
       })
     })
-    tool.formDetails('he_children').then(result => {
-      let childrenArr = result[0].map((item, index) => {
-        return Object.assign({}, {
-          'name': item,
-          'value':item,
-          'checked':false
-        })
+    tool.formDetails('he_asset_house_area').then(result => {
+      this.setData({
+        assetAreaArr: result[0],
+        assetAreaArrValue: result[1]
       })
-      let childrenArrValue = result[1].map((item, index) => {
-        return Object.assign({}, {
-          'name': item,
-          'value':item,
-          'checked':false
-        })
+    })
+    tool.formDetails('he_asset_house_loan').then(result => {
+      this.setData({
+        assetHouseLoanArr: result[0],
+        assetHouseLoanArrValue: result[1]
       })
+    })
+    tool.formDetails('he_asset_car').then(result => {
       this.setData({
-        childrenArr: childrenArr,
-        childrenArrValue: childrenArrValue
+        assetCarArr: result[0],
+        assetCarArrValue: result[1]
+      })
+    })
+    tool.formDetails('he_asset_car_value').then(result => {
+      this.setData({
+        assetCarValueArr: result[0],
+        assetCarValueArrValue: result[1]
+      })
+    })
+    tool.formDetails('he_asset_car_loan').then(result => {
+      this.setData({
+        assetCarLoanArr: result[0],
+        assetCarLoanArrValue: result[1]
       })
     })
     tool.formDetails('he_control_time').then(result => {
       let controlTimeArr = result[0].map((item, index) => {
         return Object.assign({}, {
           'name': item,
-          'value':item,
-          'checked':false
-        })
-      })
-      let controlTimeArrValue = result[1].map((item, index) => {
-        return Object.assign({}, {
-          'name': item,
-          'value':item,
-          'checked':false
+          'value': item,
+          'checked': false
         })
       })
       this.setData({
         controlTimeArr: controlTimeArr,
-        controlTimeArrValue: controlTimeArrValue
+        controlTimeArrLabel: result[0],
+        controlTimeArrValue: result[1]
       })
     })
     tool.formDetails('he_work_status').then(result => {
       let workStatusArr = result[0].map((item, index) => {
         return Object.assign({}, {
           'name': item,
-          'value':item,
-          'checked':false
-        })
-      })
-      let workStatusArrValue = result[1].map((item, index) => {
-        return Object.assign({}, {
-          'name': item,
-          'value':item,
-          'checked':false
+          'value': item,
+          'checked': false
         })
       })
       this.setData({
         workStatusArr: workStatusArr,
-        workStatusArrValue: workStatusArrValue
+        workStatusArrLabel: result[0],
+        workStatusArrValue: result[1]
       })
     })
     tool.formDetails('he_company_nature').then(result => {
       this.setData({
         companyNatureArr: result[0],
-        companyNatureArrValue: result[1]
+        companyNatureArrValue: result[1],
+        fatherWorkArr: result[0],
+        fatherWorkArrValue: result[1],
+        motherWorkArr: result[0],
+        motherWorkArrValue: result[1]
       })
     })
     tool.formDetails('he_parents').then(result => {
@@ -619,18 +586,6 @@ Page({
         parentsArrValue: result[1]
       })
     })
-    tool.formDetails('he_father_work').then(result => {
-      this.setData({
-        fatherWorkArr: result[0],
-        fatherWorkArrValue: result[1]
-      })
-    })
-    tool.formDetails('he_mother_work').then(result => {
-      this.setData({
-        motherWorkArr: result[0],
-        motherWorkArrValue: result[1]
-      })
-    })
     tool.formDetails('he_parent_assets').then(result => {
       this.setData({
         parentAssetsArr: result[0],
@@ -641,20 +596,14 @@ Page({
       let compositionArr = result[0].map((item, index) => {
         return Object.assign({}, {
           'name': item,
-          'value':item,
-          'checked':false
-        })
-      })
-      let compositionArrValue = result[1].map((item, index) => {
-        return Object.assign({}, {
-          'name': item,
-          'value':item,
-          'checked':false
+          'value': item,
+          'checked': false
         })
       })
       this.setData({
         compositionArr: compositionArr,
-        compositionArrValue: compositionArrValue
+        compositionArrLabel: result[0],
+        compositionArrValue: result[1]
       })
     })
   },
@@ -685,7 +634,7 @@ Page({
       prefix = 'https://cos.' + Region + '.myqcloud.com/' + Bucket + '/';
     }
     var stsCache;
-    var getCredentials = function (callback) {
+    var getCredentials = (callback) => {
       if (stsCache && Date.now() / 1000 + 30 < stsCache.expiredTime) {
         callback(data.credentials);
         return;

+ 41 - 27
pages/personInfoDetail/personInfoDetail.wxml

@@ -11,7 +11,7 @@
 				<view class='right' style="width:50%">
 					<picker bindchange="heightPicker" range="{{heightArr}}" name='height' value="{{form.height}}">
 						<view style="text-align:right">
-							<view wx:if="{{form.height}}">{{form.height}}</view>
+							<view wx:if="{{heightLabel}}">{{heightLabel}}</view>
 							<view wx:else class='placeStyle'>
 								<view class="redpoint"></view>
 								<view class="placetext">未选择</view>
@@ -26,7 +26,7 @@
 				<view class='right' style="width:50%">
 					<picker bindchange="weightPicker" range="{{weightArr}}" name='weight' value="{{form.weight}}">
 						<view style="text-align:right">
-							<view wx:if="{{form.weight}}">{{form.weight}}</view>
+							<view wx:if="{{weightLabel}}">{{weightLabel}}</view>
 							<view wx:else class='placeStyle'>
 								<view class="redpoint"></view>
 								<view class="placetext">未选择</view>
@@ -41,7 +41,7 @@
 				<view class='right' style="width:35%">
 					<picker bindchange="educationPicker" range="{{educationArr}}" name='education' value="{{form.education}}">
 						<view style="text-align:right">
-							<view wx:if="{{form.education}}">{{form.education}}</view>
+							<view wx:if="{{educationLabel}}">{{educationLabel}}</view>
 							<view wx:else class='placeStyle'>
 								<view class="redpoint"></view>
 								<view class="placetext">未选择</view>
@@ -56,7 +56,7 @@
 				<view class='right' style="width:35%">
 					<picker bindchange="incomePicker" range="{{incomeArr}}" name='income' value="{{form.income}}">
 						<view style="text-align:right">
-							<view wx:if="{{form.income}}">{{form.income}}</view>
+							<view wx:if="{{incomeLabel}}">{{incomeLabel}}</view>
 							<view wx:else class='placeStyle'>
 								<view class="redpoint"></view>
 								<view class="placetext">未选择</view>
@@ -69,28 +69,38 @@
 			<view class="block">
 				<view class='left' style="width:50%">关于小红本本</view>
 				<view class='right' style="width:50%">
-					<radio-group class="parameter-wrap" bindchange="marriageChange" name='marriage' value="{{form.marriage}}">
-						<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="index" wx:for="{{marriageList}}">
-							<checkbox value="{{item.value}}" checked="{{item.checked}}" />{{item.name}}
-						</label>
-					</radio-group>
+						<picker bindchange="marriageChange" range="{{marriageList}}" name='marriage' value="{{form.marriage}}">
+						<view style="text-align:right">
+							<view wx:if="{{marriageLabel}}">{{marriageLabel}}</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='left' style="width:30%">亲生的小祖宗</view>
 				<view class='right' style="width:70%">
-					<checkbox-group class="parameter-wrap" bindchange="childrenChange" name='children' value="{{form.children}}">
-						<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="index" wx:for="{{childrenArr}}">
-							<checkbox value="{{item.value}}" checked="{{item.checked}}" />{{item.name}}
-						</label>
-					</checkbox-group>
+				<picker bindchange="childrenChange" range="{{childrenArr}}" name='children' value="{{form.children}}">
+						<view style="text-align:right">
+							<view wx:if="{{childrenLabel}}">{{childrenLabel}}</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='left' style="width:35%">房子情况</view>
 				<view class='right' style="width:65%">
 					<picker bindchange="assetHousePickerChange" range="{{assetHouseArr}}" name='assetHouse' value="{{form.assetHouse}}">
-						<view wx:if="{{form.assetHouse}}">{{form.assetHouse}}</view>
+						<view wx:if="{{assetHouseLabel}}">{{assetHouseLabel}}</view>
 						<view wx:else class='placeStyle'>
 							<view class="redpoint"></view>
 							<view class="placetext">未选择</view>
@@ -103,7 +113,7 @@
 				<view class='left' style="width:35%">房子多大啊</view>
 				<view class='right' style="width:65%">
 					<picker bindchange="assetAreaPickerChange" range="{{assetAreaArr}}" name='assetArea' value="{{form.assetArea}}">
-						<view wx:if="{{form.assetArea}}">{{form.assetArea}}</view>
+						<view wx:if="{{assetAreaLabel}}">{{assetAreaLabel}}</view>
 						<view wx:else class='placeStyle'>
 							<view class="redpoint"></view>
 							<view class="placetext">未选择</view>
@@ -116,7 +126,7 @@
 				<view class='left' style="width:35%">房子有贷款没</view>
 				<view class='right' style="width:65%">
 					<picker bindchange="assetHouseLoanPickerChange" range="{{assetHouseLoanArr}}" name='assetHouseLoan' value="{{form.assetHouseLoan}}">
-						<view wx:if="{{form.assetHouseLoan}}">{{form.assetHouseLoan}}</view>
+						<view wx:if="{{assetHouseLoanLabel}}">{{assetHouseLoanLabel}}</view>
 						<view wx:else class='placeStyle'>
 							<view class="redpoint"></view>
 							<view class="placetext">未选择</view>
@@ -129,7 +139,7 @@
 				<view class='left' style="width:35%">车子情况</view>
 				<view class='right' style="width:65%">
 					<picker bindchange="assetCarPickerChange" range="{{assetCarArr}}" name='assetCar' value="{{form.assetCar}}">
-						<view wx:if="{{form.assetCar}}">{{form.assetCar}}</view>
+						<view wx:if="{{assetCarLabel}}">{{assetCarLabel}}</view>
 						<view wx:else class='placeStyle'>
 							<view class="redpoint"></view>
 							<view class="placetext">未选择</view>
@@ -142,7 +152,7 @@
 				<view class='left' style="width:35%">车子多钱啊</view>
 				<view class='right' style="width:65%">
 					<picker bindchange="assetCarValuePickerChange" range="{{assetCarValueArr}}" name='assetCarValue' value="{{form.assetCarValue}}">
-						<view wx:if="{{form.assetCarValue}}">{{form.assetCarValue}}</view>
+						<view wx:if="{{assetCarValueLabel}}">{{assetCarValueLabel}}</view>
 						<view wx:else class='placeStyle'>
 							<view class="redpoint"></view>
 							<view class="placetext">未选择</view>
@@ -155,7 +165,7 @@
 				<view class='left' style="width:35%">车子有贷款没</view>
 				<view class='right' style="width:65%">
 					<picker bindchange="assetCarLoanPickerChange" range="{{assetCarLoanArr}}" name='assetCarLoan' value="{{form.assetCarLoan}}">
-						<view wx:if="{{form.assetCarLoan}}">{{form.assetCarLoan}}</view>
+						<view wx:if="{{assetCarLoanLabel}}">{{assetCarLoanLabel}}</view>
 						<view wx:else class='placeStyle'>
 							<view class="redpoint"></view>
 							<view class="placetext">未选择</view>
@@ -183,9 +193,9 @@
 			<view class="block">
 				<view class='left' style="width:40%">卖命主阵地</view>
 				<view class='right' style="width:60%">
-					<picker bindchange="workplacePicker" 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="{{form.companyNature}}">{{form.companyNature}}</view>
+							<view wx:if="{{companyNatureLabel}}">{{companyNatureLabel}}</view>
 							<view wx:else class='placeStyle'>
 								<view class="redpoint"></view>
 								<view class="placetext">未选择</view>
@@ -206,7 +216,7 @@
 				<view class='right' style="width:60%">
 					<picker bindchange="parentsPicker" range="{{parentsArr}}" name='parents' value="{{form.parents}}">
 						<view style="text-align:right">
-							<view wx:if="{{form.parents}}">{{form.parents}}</view>
+							<view wx:if="{{parentsLabel}}">{{parentsLabel}}</view>
 							<view wx:else class='placeStyle'>
 								<view class="redpoint"></view>
 								<view class="placetext">未选择</view>
@@ -216,7 +226,8 @@
 					</picker>
 				</view>
 			</view>
-			<view wx:if="{{form.parents!='世事无常'}}">
+			<!-- wx:if="{{form.parents!='世事无常'}}" -->
+			<view>
 				<view class="block">
 					<view class='left' style="width:35%">和父母一起住没</view>
 					<view class='right' style="width:65%">
@@ -235,7 +246,7 @@
 					<view class='right' style="width:60%">
 						<picker bindchange="fatherworkPicker" range="{{fatherWorkArr}}" name='fatherWork' value="{{form.fatherWork}}">
 							<view style="text-align:right">
-								<view wx:if="{{form.fatherWork}}">{{form.fatherWork}}</view>
+								<view wx:if="{{fatherWorkLabel}}">{{fatherWorkLabel}}</view>
 								<view wx:else class='placeStyle'>
 									<view class="redpoint"></view>
 									<view class="placetext">未选择</view>
@@ -250,7 +261,7 @@
 					<view class='right' style="width:60%">
 						<picker bindchange="motherworkPicker" range="{{motherWorkArr}}" name='motherWork' value="{{form.motherWork}}">
 							<view style="text-align:right">
-								<view wx:if="{{form.motherWork}}">{{form.motherWork}}</view>
+								<view wx:if="{{motherWorkLabel}}">{{motherWorkLabel}}</view>
 								<view wx:else class='placeStyle'>
 									<view class="redpoint"></view>
 									<view class="placetext">未选择</view>
@@ -266,7 +277,7 @@
 				<view class='right' style="width:60%">
 					<picker bindchange="parentAssetsPicker" range="{{parentAssetsArr}}" name='parentAssets' value="{{form.parentAssets}}">
 						<view style="text-align:right">
-							<view wx:if="{{form.parentAssets}}">{{form.parentAssets}}</view>
+							<view wx:if="{{parentAssetsLabel}}">{{parentAssetsLabel}}</view>
 							<view wx:else class='placeStyle'>
 								<view class="redpoint"></view>
 								<view class="placetext">未选择</view>
@@ -316,6 +327,9 @@
 					</view>
 				</view>
 			</view>
+			<view style="display:none">
+			<input name='photo' value="{{form.photo}}"></input>
+			</view>
 			<button form-type="submit" id="sunbmit">确认,去填写择偶意向</button>
 		</form>
 	</view>

+ 67 - 20
pages/personal/personal.js

@@ -1,6 +1,8 @@
 const app = require('../../utils/util.js');
+const tool = require('../../utils/tool.js');
 Page({
   data: {
+    // myHeartTimes:0,
     tabArr: [{
       name: '我的信息',
       img: '../../images/icon1.png',
@@ -10,22 +12,24 @@ Page({
       img: '../../images/icon2.png',
       url: '/pages/myActive/myActive'
     }, {
-      name: '心动11次',
+      name: '心动0次',
       img: '../../images/icon3.png',
       url: ''
     }, {
-      name: '被心动12次',
+      name: '被心动0次',
       img: '../../images/icon4.png',
       url: ''
-    }, {
-      name: '投诉',
-      img: '../../images/icon5.png',
-      url: '/pages/complaint/complaint'
-    }, {
-      name: '推荐好友',
-      img: '../../images/icon6.png',
-      url: '/pages/share/share'
-    }]
+    },
+    //  {
+    //   name: '投诉',
+    //   img: '../../images/icon5.png',
+    //   url: '/pages/complaint/complaint'
+    // }, {
+    //   name: '推荐好友',
+    //   img: '../../images/icon6.png',
+    //   url: '/pages/share/share'
+    // }
+  ]
   },
   goTab(e) {
     wx.navigateTo({
@@ -67,7 +71,50 @@ Page({
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (options) {
+  async onLoad(options) {
+    const getOpenid = await tool.openidStatus();
+    this.setData({
+      openid: getOpenid[0],
+      sessionkey: getOpenid[1]
+    })
+    let myHeartTimes = 'tabArr[2].name'
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/0/myHearts',
+      method: "get",
+      success: (res) => {
+        console.log(res)
+        if (res.data.code == 0) {
+          if (res.data.data) {
+            this.setData({
+              [myHeartTimes]: '心动' + res.data.data + '次'
+            })
+          } else {
+            this.setData({
+              [myHeartTimes]: '心动0次'
+            })
+          }
+        }
+      }
+    })
+    let myHeartedTimes = 'tabArr[3].name'
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/0/myHearted',
+      method: "get",
+      success: (res) => {
+        console.log(res)
+        if (res.data.code == 0) {
+          if (res.data.data) {
+            this.setData({
+              [myHeartedTimes]: '被心动' + res.data.data + '次'
+            })
+          } else {
+            this.setData({
+              [myHeartedTimes]: '被心动0次'
+            })
+          }
+        }
+      }
+    })
   },
 
   /**
@@ -112,12 +159,12 @@ Page({
 
   },
   onShareTimeline: function () {
-		return {
-	      title: '测试',
-	      query: {
-	        id: 0
-	      },
-	      imageUrl: '../../images/icon1.png'
-	    }
-	},
+    return {
+      title: '测试',
+      query: {
+        id: 0
+      },
+      imageUrl: '../../images/icon1.png'
+    }
+  },
 })

+ 63 - 0
pages/sign/sign.js

@@ -0,0 +1,63 @@
+Page({
+  data: {
+
+  },
+  go(){
+
+  }, 
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 4 - 0
pages/sign/sign.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "签到"
+}

+ 3 - 0
pages/sign/sign.wxml

@@ -0,0 +1,3 @@
+<!--pages/sign/sign.wxml-->
+<text>签到成功 您的号码是1号</text>
+<button bindtap="go">进入现场活动</button>

+ 1 - 0
pages/sign/sign.wxss

@@ -0,0 +1 @@
+/* pages/sign/sign.wxss */

+ 144 - 61
pages/targetInfo/targetInfo.js

@@ -38,10 +38,7 @@ Page({
     educationArr: ["都行", "初中", "中专", "高中", "大专", "本科", "硕士", "博士"],
     incomeArr: ["挣不挣都行", "2000-5000", "5000-10000", "10000-20000", "20000以上"],
     nativePlaceArr: ['咋的都行', '本地', '外地'],
-    marriageArr: [
-      ["不行", "行"],
-      []
-    ],
+    marriageArr: ["不行", "行"],
     constellationArr: [{
         name: '不限',
         value: '不限',
@@ -155,13 +152,15 @@ Page({
   educationPicker(e) {
     let education = 'form.education'
     this.setData({
-      [education]: this.data.educationArr[e.detail.value]
+      educationLabel: this.data.educationArr[e.detail.value],
+      [education]: this.data.educationArrValue[e.detail.value]
     })
   },
   incomePicker(e) {
     let income = 'form.income'
     this.setData({
-      [income]: this.data.incomeArr[e.detail.value]
+      incomeLabel: this.data.incomeArr[e.detail.value],
+      [income]: this.data.incomeArrValue[e.detail.value]
     })
   },
   nativePlacePicker(e) {
@@ -173,10 +172,7 @@ Page({
   marriageChange(e) {
     let marriage = 'form.marriage'
     this.setData({
-      [marriage]: [this.data.marriageArr[0][e.detail.value[0]], this.data.marriageArr[1][e.detail.value[1]]]
-    })
-    this.setData({
-      marriagemultiIndex: e.detail.value
+      [marriage]: this.data.marriageArr[e.detail.value]
     })
   },
   marriagePickerColumnChange(e) {
@@ -253,14 +249,19 @@ Page({
         }
       }
     }
-    this.setData({
-      constellationArr: this.data.constellationArr
-    })
+    let indexArr = [];
+    for (let i = 0; i < e.detail.value.length; i++) {
+      indexArr.push(this.data.constellationArrLabel.indexOf(e.detail.value[i]))
+    }
+    let value = [];
+    for (let i = 0; i < indexArr.length; i++) {
+      value.push(this.data.constellationArrValue[indexArr[i]])
+    }
     let constellation = 'form.constellation'
     this.setData({
-      [constellation]: e.detail.value
+      constellationArr: this.data.constellationArr,
+      [constellation]: value
     })
-
   },
   workStatusChange(e) {
     console.log(e.detail.value)
@@ -275,24 +276,33 @@ Page({
         }
       }
     }
+    let indexArr = [];
+    for (let i = 0; i < e.detail.value.length; i++) {
+      indexArr.push(this.data.workStatusArrLabel.indexOf(e.detail.value[i]))
+    }
+    let value = [];
+    for (let i = 0; i < indexArr.length; i++) {
+      value.push(this.data.workStatusArrValue[indexArr[i]])
+    }
+    let workStatus = 'form.workStatus'
     this.setData({
-      workStatusArr: this.data.workStatusArr
-    })
-    let workStatus = 'form. workStatus'
-    this.setData({
-      [workStatus]: e.detail.value
+      workStatusArr: this.data.workStatusArr,
+      [workStatus]: value
     })
+
   },
   companyNaturePicker: function (e) {
     let companyNature = 'form.companyNature'
     this.setData({
-      [companyNature]: this.data.companyNatureArr[e.detail.value]
+      companyNatureLabel:this.data.companyNatureArr[e.detail.value],
+      [companyNature]: this.data.companyNatureArrValue[e.detail.value]
     })
   },
   parentsPicker(e) {
     let parents = 'form.parents'
     this.setData({
-      [parents]: this.data.parentsArr[e.detail.value]
+      parentsLabel:this.data.parentsArr[e.detail.value],
+      [parents]: this.data.parentsArrValue[e.detail.value]
     })
   },
   compositionPicker(e) {
@@ -315,8 +325,29 @@ Page({
       this.showModal(error)
       return false
     }
-    wx.switchTab({
-      url: '/pages/index/index',
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/standard',
+      method: "POST",
+      header: {
+        'content-type': 'application/x-www-form-urlencoded',
+      },
+      data: params,
+      success: (res) => {
+        console.log(res)
+        if (res.data.code == 0) {
+          wx.showModal({
+            title: '上传成功',
+            showCancel: false,
+            success(res) {
+              if (res.confirm) {
+                wx.switchTab({
+                  url: '/pages/index/index',
+                })
+              }
+            }
+          });
+        }
+      }
     })
   },
   showModal(error) {
@@ -331,58 +362,58 @@ Page({
       ageMin: {
         required: true
       },
-      ageMax:{
+      ageMax: {
         required: true
       },
-      heightMin:{
+      heightMin: {
         required: true
       },
-      heightMax:{
+      heightMax: {
         required: true
       },
-      education:{
+      education: {
         required: true
       },
-      income:{
+      income: {
         required: true
       },
-      nativePlace:{
+      nativePlace: {
         required: true
       },
-      marriage:{
+      marriage: {
         required: true
       },
-      assetHouse:{
+      assetHouse: {
         required: true
       },
-      assetArea:{
+      assetArea: {
         required: true
       },
-      assetHouseLoan:{
+      assetHouseLoan: {
         required: true
       },
-      assetCar:{
+      assetCar: {
         required: true
       },
-      assetCarValue:{
+      assetCarValue: {
         required: true
       },
-      assetCarLoan:{
+      assetCarLoan: {
         required: true
       },
-      constellation:{
+      constellation: {
         required: true
       },
-      workStatus:{
+      workStatus: {
         required: true
       },
-      companyNature:{
+      companyNature: {
         required: true
       },
-      parents:{
+      parents: {
         required: true
       },
-      composition:{
+      composition: {
         required: true
       },
       isCommen: {
@@ -393,58 +424,58 @@ Page({
       ageMin: {
         required: '请输入您能接受的最小年纪'
       },
-      ageMax:{
+      ageMax: {
         required: '请输入您能接受的最大年纪'
       },
-      heightMin:{
+      heightMin: {
         required: '请输入您能接受的最低身高'
       },
-      heightMax:{
+      heightMax: {
         required: '请输入您能接受的最高身高'
       },
-      education:{
+      education: {
         required: '请输入您能接受的教育程度'
       },
-      income:{
+      income: {
         required: '请选择您能接受的收入'
       },
-      nativePlace:{
+      nativePlace: {
         required: '请选择本地或者外地'
       },
-      marriage:{
+      marriage: {
         required: '请选择您能接受的婚姻状态'
       },
-      assetHouse:{
+      assetHouse: {
         required: '请选择您可以接受的房子状态'
       },
-      assetArea:{
+      assetArea: {
         required: '请选择您可以接受的房子面积'
       },
-      assetHouseLoan:{
+      assetHouseLoan: {
         required: '请选择您可以接受的房子是否有贷款'
       },
-      assetCar:{
+      assetCar: {
         required: '请选择您可以接受的车子状态'
       },
-      assetCarValue:{
+      assetCarValue: {
         required: '请选择您可以接受的车子价值'
       },
-      assetCarLoan:{
+      assetCarLoan: {
         required: '请选择您是否可以接受的车子有贷款'
       },
-      constellation:{
+      constellation: {
         required: '请选择您的优先选择星座'
       },
-      workStatus:{
+      workStatus: {
         required: '请选择您能接受的工作状态'
       },
-      companyNature:{
+      companyNature: {
         required: '请选择您能接受的单位性质'
       },
-      parents:{
+      parents: {
         required: '请选择您能接受的父母状态'
       },
-      composition:{
+      composition: {
         required: '请选择您可以接受的家庭构成'
       },
       isCommen: {
@@ -453,13 +484,65 @@ Page({
     }
     this.WxValidate = new WxValidate(rules, messages)
   },
-  async onLoad (options) {
+  async onLoad(options) {
     this.initValidate()
     const getOpenid = await tool.openidStatus();
     this.setData({
       openid: getOpenid[0],
       sessionkey: getOpenid[1]
     })
+    tool.formDetails('he_education').then(result => {
+      this.setData({
+        educationArr: result[0],
+        educationArrValue: result[1]
+      })
+    })
+    tool.formDetails('he_income').then(result => {
+      this.setData({
+        incomeArr: result[0],
+        incomeArrValue: result[1]
+      })
+    })
+    tool.formDetails('he_astrology').then(result => {
+      let constellationArr = result[0].map((item, index) => {
+        return Object.assign({}, {
+          'name': item,
+          'value': item,
+          'checked': false
+        })
+      })
+      this.setData({
+        constellationArr: constellationArr,
+        constellationArrLabel: result[0],
+        constellationArrValue: result[1]
+      })
+    })
+    tool.formDetails('he_work_status').then(result => {
+      let workStatusArr = result[0].map((item, index) => {
+        return Object.assign({}, {
+          'name': item,
+          'value': item,
+          'checked': false
+        })
+      })
+      this.setData({
+        workStatusArr: workStatusArr,
+        workStatusArrLabel: result[0],
+        workStatusArrValue: result[1]
+      })
+    })
+    tool.formDetails('he_company_nature').then(result => {
+      this.setData({
+        companyNatureArr: result[0],
+        companyNatureArrValue: result[1]
+      })
+    })
+    tool.formDetails('he_parents').then(result => {
+      this.setData({
+        parentsArr: result[0],
+        parentsArrValue: result[1]
+      })
+    })
   },
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 18 - 7
pages/targetInfo/targetInfo.wxml

@@ -19,7 +19,7 @@
 			<view class='right' style="width:35%">
 				<picker bindchange="educationPicker" range="{{educationArr}}" name='education' value="{{form.education}}">
 					<view style="text-align:right">
-						<view wx:if="{{form.education}}">{{form.education}}</view>
+						<view wx:if="{{educationLabel}}">{{educationLabel}}</view>
 						<view wx:else class='placeStyle'>
 							<view class="redpoint"></view>
 							<view class="placetext">未选择</view>
@@ -34,7 +34,7 @@
 			<view class='right' style="width:35%">
 				<picker bindchange="incomePicker" range="{{incomeArr}}" name='income' value="{{form.income}}">
 					<view style="text-align:right">
-						<view wx:if="{{form.income}}">{{form.income}}</view>
+						<view wx:if="{{incomeLabel}}">{{incomeLabel}}</view>
 						<view wx:else class='placeStyle'>
 							<view class="redpoint"></view>
 							<view class="placetext">未选择</view>
@@ -62,9 +62,9 @@
 		<view class="block">
 			<view class='left' style="width:60%">人家有个小绿本你能不能行</view>
 			<view class='right' style="width:40%">
-				<picker mode="multiSelector" bindchange="marriageChange" bindcolumnchange="marriagePickerColumnChange" value="{{marriagemultiIndex}}" 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="{{marriageArr[0][marriagemultiIndex[0]]}}">{{marriageArr[0][marriagemultiIndex[0]]}},{{marriageArr[1][marriagemultiIndex[1]]}}</view>
+						<view wx:if="{{form.marriage}}">{{form.marriage}}</view>
 						<view wx:else class='placeStyle'>
 							<view class="redpoint"></view>
 							<view class="placetext">未选择</view>
@@ -74,17 +74,18 @@
 				</picker>
 			</view>
 		</view>
-
 		<view class="block">
 			<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="{{form.assetHouse}}">{{form.assetHouse}}</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>
@@ -92,12 +93,14 @@
 			<view class='left' style="width:35%">房子多大挑不</view>
 			<view class='right' style="width:65%">
 				<picker bindchange="assetAreaPickerChange" range="{{assetAreaArr}}" name='assetArea' value="{{form.assetArea}}">
+				<view style="text-align:right">
 					<view wx:if="{{form.assetArea}}">{{form.assetArea}}</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>
@@ -105,12 +108,14 @@
 			<view class='left' style="width:35%">房子有贷款行不</view>
 			<view class='right' style="width:65%">
 				<picker bindchange="assetHouseLoanPickerChange" range="{{assetHouseLoanArr}}" name='assetHouseLoan' value="{{form.assetHouseLoan}}">
+				<view style="text-align:right">
 					<view wx:if="{{form.assetHouseLoan}}">{{form.assetHouseLoan}}</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>
@@ -118,12 +123,14 @@
 			<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="{{form.assetCar}}">{{form.assetCar}}</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>
@@ -131,12 +138,14 @@
 			<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="{{form.assetCarValue}}">{{form.assetCarValue}}</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>
@@ -144,12 +153,14 @@
 			<view class='left' style="width:45%">车子有贷款行不</view>
 			<view class='right' style="width:55%">
 				<picker bindchange="assetCarLoanPickerChange" range="{{assetCarLoanArr}}" name='assetCarLoan' value="{{form.assetCarLoan}}">
+				<view style="text-align:right">
 					<view wx:if="{{form.assetCarLoan}}">{{form.assetCarLoan}}</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>
@@ -174,7 +185,7 @@
 			<view class='right' style="width:60%">
 				<picker bindchange="companyNaturePicker" range="{{companyNatureArr}}" name='companyNature' value="{{form.companyNature}}">
 					<view style="text-align:right">
-						<view wx:if="{{form.companyNature}}">{{form.companyNature}}</view>
+						<view wx:if="{{companyNatureLabel}}">{{companyNatureLabel}}</view>
 						<view wx:else class='placeStyle'>
 							<view class="redpoint"></view>
 							<view class="placetext">未选择</view>
@@ -204,7 +215,7 @@
 			<view class='right' style="width:55%">
 				<picker bindchange="parentsPicker" range="{{parentsArr}}" name='parents' value="{{form.parents}}">
 					<view style="text-align:right">
-						<view wx:if="{{form.parents}}">{{form.parents}}</view>
+						<view wx:if="{{parentsLabel}}">{{parentsLabel}}</view>
 						<view wx:else class='placeStyle'>
 							<view class="redpoint"></view>
 							<view class="placetext">未选择</view>

+ 9 - 7
utils/tool.js

@@ -46,13 +46,15 @@ const formDetails = (type) => {
       success: res => {
         console.log(res)
         if (res.data.code == 0) {
-          let labelArr = res.data.options.map((obj, index) => {
-            return obj.dictLabel;
-          })
-          let valueArr = res.data.options.map((obj, index) => {
-            return obj.dictValue;
-          })
-          resolve([labelArr,valueArr])
+          if(res.data.options){
+            let labelArr = res.data.options.map((obj, index) => {
+              return obj.dictLabel;
+            })
+            let valueArr = res.data.options.map((obj, index) => {
+              return obj.dictValue;
+            })
+            resolve([labelArr,valueArr])
+          }
         }else{
           reject(res)
         }

+ 2 - 1
utils/util.js

@@ -1,5 +1,6 @@
 const globalData = {
-  publicUrl: 'http://49.233.2.78'
+  publicUrl: 'https://yuehe.hellevil.com'
+  // publicUrl: 'http://192.168.0.113'
 };
 module.exports = {
   globalData: globalData