houwei %!s(int64=4) %!d(string=hai) anos
pai
achega
955e6e14d9

+ 4 - 6
app.json

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

+ 1 - 1
asset/iconfont/iconfont.wxss

@@ -17,7 +17,7 @@
 }
 .icon-jianjiaohao1:after {
   content: "\e63c";
-  color: #d7d8d8;
+  color: #4d4d4d;
   margin-left: 10rpx;
 }
 

BIN=BIN
images/demo.png


BIN=BIN
images/ewm.png


+ 1 - 1
pages/InfoType/InfoType.js

@@ -1,4 +1,4 @@
-// pages/InfoType/InfoType.js
+const app = require('../../utils/util.js');
 Page({
 
   /**

+ 1 - 1
pages/activeDetail/activeDetail.js

@@ -1,4 +1,4 @@
-// pages/activeDetail/activeDetail.js
+const app = require('../../utils/util.js');
 Page({
 
   /**

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 3 - 4
pages/activeDetail/activeDetail.wxml


+ 86 - 7
pages/complaint/complaint.js

@@ -1,15 +1,94 @@
-// pages/complaint/complaint.js
+const app = require('../../utils/util.js');
 Page({
   data: {
-    active: 0
+    active: 0,
+    form:{
+      type:'',
+      neirong:'',
+      tel:''
+    },
+    arr:[{
+      time:'2020-09-09',
+      status:'已回复',
+      type:'XX问题回复啦啦啦啦啦啦啦啦啦啦啦',
+      title:'我遇到了一个什么问题回复啦啦啦啦啦啦啦啦啦啦啦',
+      neirong:'我是正文我是正文我是正文我是正文我是正文我是正文',
+      reply:'回复啦啦啦啦啦啦啦啦啦啦啦回复啦啦啦啦啦啦啦啦啦啦啦',
+      replyTime:'2020-09-09'
+    },
+    {
+      time:'2020-09-09',
+      status:'待回复',
+      type:'XX问题回复啦啦啦啦啦啦啦啦啦啦啦',
+      title:'我遇到了一个什么问题回复啦啦啦啦啦啦啦啦啦啦啦',
+      neirong:'我是正文我是正文我是正文我是正文我是正文我是正文',
+      reply:'',
+      replyTime:''
+    }],
+    activeNames: ['1'],
+    questionArr: [
+    {
+      value: '其它',
+      checked: true
+    }
+  ],
   },
-
-  onChange(event) {
-    wx.showToast({
-      title: `切换到标签 ${event.detail.name}`,
-      icon: 'none',
+  collapseonChange(event) {
+    this.setData({
+      activeNames: event.detail,
     });
   },
+  onChange(event) {
+    // wx.showToast({
+    //   title: `切换到标签 ${event.detail.name}`,
+    //   icon: 'none',
+    // });
+  },
+  tipsChange: function (e) {
+    console.log(e.detail.value)
+    const items = this.data.questionArr;
+    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({
+      questionArr: this.data.questionArr
+    })
+    let type = 'form.type'
+    this.setData({
+      [type]: e.detail.value
+    })
+  },
+  neirongChange(e){
+    let neirong = 'form.neirong'
+    this.setData({
+      [neirong]: e.detail.value
+    })
+
+  },
+  telChange(e){
+    let tel = 'form.tel'
+    this.setData({
+      [tel]: e.detail.value
+    })
+  },
+  formSubmit(e){
+    if(!this.data.form.neirong){
+      wx.showModal({
+        content: "您还没有填写投诉内容哦",
+        showCancel: false
+      })
+    }else{
+      console.log(e.detail.value)
+    }
+    
+  },
   /**
    * 生命周期函数--监听页面加载
    */

+ 1 - 1
pages/complaint/complaint.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "投诉"
+  "navigationBarTitleText": ""
 }

+ 38 - 8
pages/complaint/complaint.wxml

@@ -1,9 +1,39 @@
-<van-tabs active="{{ active }}" bind:change="onChange" color ='#ab65ff'>
-  <van-tab title="投诉">
-  <view>投诉问题</view>
-  
-  
-  
-  </van-tab>
-  <van-tab title="记录">内容 2</van-tab>
+<van-tabs active="{{ active }}" bind:change="onChange" color='#ab65ff'>
+	<van-tab title="投诉">
+		<form bindsubmit='formSubmit'>
+			<view class="title">投诉问题分类</view>
+			<checkbox-group class="parameter-wrap" bindchange="tipsChange" name='type' value='{{form.type}}'>
+				<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="index" wx:for="{{questionArr}}">
+					<checkbox value="{{item.value}}" checked="{{item.checked}}" />{{item.value}}
+				</label>
+			</checkbox-group>
+			<view class="title">投诉内容<span style='color:red'>*</span></view>
+			<textarea maxlength='200' class="cont" name='neirong' value='{{form.neirong}}' bindinput="neirongChange"></textarea>
+			<view class="title">联系方式</view>
+			<input class="tel" placeholder="请输入您的电话或邮箱,方便我们联系您" name='tel' value='{{form.tel}}' bindinput="telChange"></input>
+			<button form-type="submit" id="sunbmit">提交</button>
+		</form>
+	</van-tab>
+	<van-tab title="记录">
+		<view wx:for="{{arr}}" wx:key="index" class="replybox">
+			<view class="status">{{item.status}}</view>
+			<view class="middle">
+				<view style="color:#333333;font-size:30rpx">{{item.title}}</view>
+				<view style="color:#666666">{{item.time}}</view>
+				<view style="color:#666666">{{item.neirong}}</view>
+				<view wx:if='{{item.reply}}' class="reply">
+				<view style="height:50rpx"><p style='float:left'>客服回复</p><p style='float:right'>{{item.replyTime}}</p></view>
+				{{item.reply}}
+				</view>
+			</view>
+		</view>
+		<!-- <van-collapse value="{{ activeNames }}" bind:change="collapseonChange" wx:for="{{arr}}">
+			<van-collapse-item title="{{item.status}}-{{item.type}}" value="{{index}}">
+				<view>{{item.title}}</view>
+				<view>{{item.time}}</view>
+				<view style="margin-top:20rpx">{{item.reply}}</view>
+				<view>{{item.replyTime}}</view>
+			</van-collapse-item>
+		</van-collapse> -->
+	</van-tab>
 </van-tabs>

+ 87 - 1
pages/complaint/complaint.wxss

@@ -1 +1,87 @@
-/* pages/complaint/complaint.wxss */
+/* pages/complaint/complaint.wxss */
+.title {
+  text-indent: 50rpx;
+  line-height: 100rpx;
+}
+
+.my-choosebox {
+  color: #999999;
+  /* border: 1px solid #d7d8d8; */
+  border-radius: 20rpx;
+  padding: 10rpx 30rpx;
+  margin-right: 10rpx;
+  margin-bottom: 20rpx;
+  display: inline-block;
+  background: #f5f6fa;
+}
+
+.checkboxbox {
+  background: -webkit-linear-gradient(left, #bd64ff, #8873ff);
+  color: white;
+}
+
+.parameter-wrap {
+  padding: 20rpx 40rpx;
+}
+
+.parameter-wrap radio {
+  display: none;
+}
+
+.parameter-wrap checkbox {
+  display: none;
+}
+
+.cont {
+  border: 1px solid #e4e5e6;
+  width: 650rpx;
+  margin-left: 50rpx;
+  height: 300rpx;
+}
+
+.tel {
+  border: 1px solid #e4e5e6;
+  width: 650rpx;
+  margin-left: 50rpx;
+  height: 80rpx;
+}
+
+#sunbmit {
+  width: 200rpx;
+  background: -webkit-linear-gradient(left, #bd64ff, #8873ff);
+  color: #fff;
+  height: 60rpx !important;
+  line-height: 30rpx !important;
+  border-radius: 50rpx !important;
+  font-weight: normal !important;
+  margin: 60rpx 275rpx;
+}
+
+.replybox {
+  display: flex;
+  padding: 10rpx 20rpx;
+  border-bottom: 1rpx solid #f1f1f1;
+  margin-top:20rpx;
+}
+
+.status {
+  background: #ffad00;
+  color: #fff;
+  border-radius: 5rpx;
+  height: 55rpx;
+  line-height: 55rpx;
+  width: 120rpx;
+  text-align: center;
+}
+.middle{
+  width: 540rpx;
+  margin-left: 30rpx;
+  font-size: 28rpx;
+  line-height: 50rpx;
+}
+.reply{
+  background: #f9f9fb;
+  color: #999999;
+  margin-top: 30rpx;
+  padding: 20rpx;
+}

+ 3 - 14
pages/index/index.js

@@ -1,24 +1,13 @@
+const app = require('../../utils/util.js');
 Page({
   data: {
     currentIndex: 0,
     arr: [{
       title: '月合红娘',
-      address: '吉林省长春市某某大厦',
+      address: '吉林省长春市经开区赛德广场',
       remark: '请大家按照规定时间前来参与',
-      activeTime: '2020-02-20',
+      activeTime: '2021-01-01',
       activeStatus: 0
-    }, {
-      title: '月合红娘',
-      address: '吉林省长春市某某大厦',
-      remark: '请大家按照规定时间前来参与',
-      activeTime: '2020-02-20',
-      activeStatus: 1
-    }, {
-      title: '月合红娘',
-      address: '吉林省长春市某某大厦',
-      remark: '请大家按照规定时间前来参与',
-      activeTime: '2020-02-20',
-      activeStatus: 2
     }]
   },
   handleChange: function (e) {

+ 3 - 3
pages/index/index.wxml

@@ -1,14 +1,14 @@
 <view class="swiper-cont container-fill">
 	<swiper class="imageContainer" bindchange="handleChange" previous-margin="50rpx" next-margin="50rpx" circular autoplay>
-		<block wx:for="{{3}}" wx:key="{{index}}">
+		<block wx:for="{{3}}" wx:key="index">
 			<swiper-item class="item">
 				<image class="itemImg {{currentIndex == index ? 'active': ''}}" src="../../images/lb.png"></image>
 			</swiper-item>
 		</block>
 	</swiper>
 	<image src="../../images/show.png" style="width:650rpx;margin-left:50rpx;height:200rpx"></image>
-	<view style="display:flex;margin-left:30rpx;margin-top:20rpx;margin-bottom:20rpx"><view style='width:10rpx;height:35rpx;background-color:#986aff;margin-right:20rpx;border-radius:10rpx'></view>近期活动</view>
-	<view wx:for="{{arr}}" class="box" bindtap="goActive">
+	<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 class="top">
 			<image src="../../images/activephoto.png" style="width:80rpx;height:80rpx;"></image>
 			<view class="text">

+ 1 - 78
pages/index/index.wxss

@@ -1,82 +1,5 @@
-
-/* .container {
-  flex: 1;
-  flex-direction: column;
-  box-sizing: border-box;
-  padding: 0;
-  align-items: initial;
-  justify-content: first baseline;
-}
-
-.container-fill {
-  height: 100%;
-  overflow: hidden;
-}
-
-.scroll-fullpage {
-  height: 100%;
-}
-
-.section {
-  height: 100%;
-}
-
-.active .cont {
-  -webkit-animation-duration: 1.8s;
-  animation-duration: 1.8s;
-  -webkit-animation-fill-mode: both;
-  animation-fill-mode: both;
-  -webkit-animation-name: fadeInUp;
-  animation-name: fadeInUp;
-}
-
-.cont {
-  width: 100%;
-  height: 100%;
-  margin: 0 auto;
-  position: relative;
-}
-
-.cont .cont-body {
-  width: 75%;
-  position: absolute;
-  left: 50%;
-  top: 50%;
-  transform: translate(-50%, -50%);
-}
-
-.tabbar {
-  width: 750rpx;
-  box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
-  height: 100rpx;
-  position: fixed;
-  bottom: 0;
-  left: 0;
-  display: flex;
-  font-size: 28rpx;
-}
-
-.tab1 {
-  height: 100rpx;
-  width: 250rpx;
-  text-align: center;
-  color: #999999;
-}
-
-#red {
-  background: none;
-  color: #999999;
-  font-weight: normal;
-  width: 250rpx;
-  height: 100rpx;
-  line-height: 125rpx;
-  font-size: 28rpx;
-  position: absolute;
-  bottom: 0;
-} */
-
 page {
-  background: #f7f7f7f7;
+  background: #f7f7f7;
 }
 .imageContainer {
   width: 100%;

+ 7 - 19
pages/myActive/myActive.js

@@ -1,34 +1,22 @@
-// pages/myActive/myActive.js
+const app = require('../../utils/util.js');
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-    arr: [{
+    arr: [ {
       title: '月合红娘',
-      address: '吉林省长春市某某大厦',
+      address: '吉林省长春市朝阳区栖乐荟广场',
       remark: '请大家按照规定时间前来参与',
-      activeTime: '2020-02-20',
+      activeTime: '2020-12-25',
       activeStatus: 0
-    }, {
-      title: '月合红娘',
-      address: '吉林省长春市某某大厦',
-      remark: '请大家按照规定时间前来参与',
-      activeTime: '2020-02-20',
-      activeStatus: 1
-    }, {
-      title: '月合红娘',
-      address: '吉林省长春市某某大厦',
-      remark: '请大家按照规定时间前来参与',
-      activeTime: '2020-02-20',
-      activeStatus: 2
     }]
   },
   goActive(){
-    wx.redirectTo({
-      url: '/pages/activeDetail/activeDetail',
-    })
+    // wx.redirectTo({
+    //   url: '/pages/activeDetail/activeDetail',
+    // })
   },
   /**
    * 生命周期函数--监听页面加载

+ 1 - 1
pages/myActive/myActive.wxml

@@ -1,4 +1,4 @@
-<view wx:for="{{arr}}" class="box" bindtap="goActive">
+<view wx:for="{{arr}}" wx:key="index" class="box" bindtap="goActive">
 	<view class="top">
 		<image src="../../images/activephoto.png" style="width:80rpx;height:80rpx;"></image>
 		<view class="text">

+ 1 - 1
pages/onSiteActivity/onSiteActivity.js

@@ -1,4 +1,4 @@
-// pages/onSiteActivity/onSiteActivity.js
+const app = require('../../utils/util.js');
 Page({
 
   /**

+ 3 - 3
pages/onSiteActivity/onSiteActivity.wxml

@@ -3,10 +3,10 @@
 	<view class="subtitle">请给你喜欢的嘉宾点击心动,心动上限为十个</view>
 	<scroll-view scroll-x="true" enable-flex="true" style="margin-top:40rpx">
   <view class="heartbox">
-		<view wx:for="{{5}}" style="z-index:10;">
+		<view wx:for="{{5}}" wx:key="index" style="z-index:10;">
 			<image src="../../images/heart.png" style="width:50rpx;height:50rpx"></image>
 		</view>
-		<view wx:for="{{5}}"  style="z-index:10;">
+		<view wx:for="{{5}}"  wx:key="index" style="z-index:10;">
 			<image src="../../images/gray.png" style="width:35rpx;height:35rpx"></image>
 		</view>
 		<view class="line"></view>
@@ -18,7 +18,7 @@
   </view>
   </view>
   <view class="photobox">
-  	<view wx:for="{{50}}" data-index="{{index}}" bindtap="love" style="text-align:center;width: 140rpx;position:relative">
+  	<view wx:for="{{50}}" wx:key="index" data-index="{{index}}" 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>

+ 197 - 98
pages/personInfo/personInfo.js

@@ -1,14 +1,14 @@
-import WxValidate from '../../utils/WxValidate.js'
+import WxValidate from '../../utils/WxValidate.js';
+const app = require('../../utils/util.js');
+const tools = require('../../utils/tool.js');
+const COS = require('../../utils/cos.js');
 Page({
-  /**
-   * 页面的初始数据
-   */
   data: {
     imgsrc: '../../images/cardModel.png',
     questionList: [{
         name: '男',
         value: '男',
-        checked: true
+        checked: false
       },
       {
         name: '女',
@@ -23,46 +23,30 @@ Page({
       "白羊座", "金牛座", "双子座", "巨蟹座", "狮子座", "处女座", "天秤座", "天蝎座", "射手座", "摩羯座", "水瓶座", "双鱼座。"
     ],
     form: {
+      card: '',
       name: '',
       sex: '',
       age: '',
       nativePlace: '',
       nation: '',
       birthday: '',
-      strar: ''
-    }
-  },
-  // 表单提交事件
-  formSubmit(e) {
-    console.log(e.detail.value)
-    const params = e.detail.value
-    //校验表单
-    if (!this.WxValidate.checkForm(params)) {
-      const error = this.WxValidate.errorList[0]
-      this.showModal(error)
-      return false
+      constellation: ''
     }
-    // this.showModal({
-    //   msg: '提交成功'
-    // })
-    wx.navigateTo({
-      url: '/pages/personInfoDetail/personInfoDetail',
-    })
   },
   nationPicker(e) {
-    let nation='form.nation'
+    let nation = 'form.nation'
     this.setData({
       [nation]: this.data.mzArr[e.detail.value],
     })
   },
   birthdayPicker(e) {
-    let birthday='form.birthday'
+    let birthday = 'form.birthday'
     this.setData({
       [birthday]: e.detail.value
     })
   },
   constellationPicker(e) {
-    let constellation='form.constellation'
+    let constellation = 'form.constellation'
     this.setData({
       [constellation]: this.data.constellationArr[e.detail.value]
     })
@@ -85,9 +69,9 @@ Page({
     })
   },
   uploadCard() {
-    // wx.showLoading({
-    //   title: '加载中',
-    // })
+    wx.showLoading({
+      title: '解析中',
+    })
     wx.chooseImage({
       count: 1,
       sizeType: ['compressed'],
@@ -98,89 +82,167 @@ Page({
         this.setData({
           imgsrc: tempFilePaths
         })
-        // this.goOcr(tempFilePaths)
+        this.toCos()
       }
-      // ,
-      // fail: () => {
-      //   wx.hideLoading();
-      // }
     })
   },
-  // 百度身份证OCR接口 首先去后台获得token
-  goOcr(file) {
+  toCos() {
+    var Bucket = 'yuehe-1257653330';
+    var Region = 'ap-beijing';
+    var ForcePathStyle = false;
+    var prefix = 'https://' + Bucket + '.cos.' + Region + '.myqcloud.com/';
+    if (ForcePathStyle) {
+      prefix = 'https://cos.' + Region + '.myqcloud.com/' + Bucket + '/';
+    }
+    var stsCache;
+    var getCredentials = (callback) => {
+      if (stsCache && Date.now() / 1000 + 30 < stsCache.expiredTime) {
+        callback(data.credentials);
+        return;
+      }
+      wx.request({
+        method: 'POST',
+        url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/getCosSts',
+        success: function (result) {
+          console.log(result, '222222222222')
+          var credentials = result.data.credential.credentials;
+          if (credentials) {
+            stsCache = result.data.credential
+          } else {
+            wx.hideLoading()
+            wx.showModal({
+              title: '临时密钥获取失败',
+              content: JSON.stringify(data),
+              showCancel: false
+            });
+          }
+          callback(stsCache && stsCache.credentials);
+        },
+        error: function (err) {
+          wx.hideLoading()
+          wx.showModal({
+            title: '临时密钥获取失败',
+            content: JSON.stringify(err),
+            showCancel: false
+          });
+        }
+      });
+    };
+    // 计算签名
+    var getAuthorization = function (options, callback) {
+      getCredentials(function (credentials) {
+        callback({
+          XCosSecurityToken: credentials.sessionToken,
+          Authorization: COS({
+            SecretId: credentials.tmpSecretId,
+            SecretKey: credentials.tmpSecretKey,
+            Method: options.Method,
+            Pathname: options.Pathname,
+          })
+        });
+      });
+    };
+    // 上传文件
+    var Key = this.data.imgsrc.substr(this.data.imgsrc.lastIndexOf('/') + 1); // 这里指定上传的文件名
+    var signPathname = '/';
+    if (ForcePathStyle) {
+      signPathname = '/' + Bucket + '/';
+    }
+    getAuthorization({
+      Method: 'POST',
+      Pathname: signPathname
+    }, (AuthData) => {
+      var requestTask = wx.uploadFile({
+        url: prefix,
+        name: 'file',
+        filePath: this.data.imgsrc,
+        formData: {
+          'key': "face/" + Key,
+          'success_action_status': 200,
+          'Signature': AuthData.Authorization,
+          'x-cos-security-token': AuthData.XCosSecurityToken,
+          'Content-Type': '',
+        },
+        success: (res) => {
+          console.log(res.header.Location)
+          let card = 'form.card'
+          this.setData({
+            [card]: res.header.Location
+          })
+          this.toJx(res.header.Location)
+        },
+        fail: function () {
+          wx.hideLoading()
+          wx.showModal({
+            title: '上传失败',
+            showCancel: false
+          });
+        }
+      });
+      requestTask.onProgressUpdate(function (res) {
+        console.log('进度:', res.progress);
+      });
+    });
+  },
+  toJx(location) {
     wx.request({
-      url: app.globalData.publicUrl + '/applet/getToken',
-      method: "GET",
+      url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/ocrCard',
+      method: "POST",
       header: {
-        appletsId: wx.getStorageSync('openId')
+        'content-type': 'application/x-www-form-urlencoded',
+      },
+      data: {
+        path: location,
+        side: 'front'
       },
       success: (res) => {
-        if (res.data.data.status == 200) {
-          let token = res.data.data.token;
-          if (token) {
-            var _this = this;
-            wx.getFileSystemManager().readFile({
-              filePath: file,
-              encoding: 'base64',
-              success: res1 => {
-                console.log('读取本地文件basema ', res1)
-                let img = 'data:image/png;base64,' + res1.data
-                wx.request({
-                  url: 'https://aip.baidubce.com/rest/2.0/ocr/v1/idcard?access_token=' + token,
-                  method: 'POST',
-                  header: {
-                    'content-type': 'application/x-www-form-urlencoded'
-                  },
-                  data: {
-                    id_card_side: 'front',
-                    image: img
-                  },
-                  dataType: 'json',
-                  success: (e) => {
-                    // 扫描后赋值 
-                    if (e.data.idcard_number_type == 1) {
-                      let result = e.data.words_result
-                      _this.data.parameter.forEach(item => {
-                        if (item.name == result['性别'].words) {
-                          item.checked = true;
-                        }
-                      })
-                      var myDate = new Date();
-                      var tYear = myDate.getFullYear();
-                      let aa = parseInt(result['公民身份号码'].words.slice(6, 10));
-                      _this.setData({
-                        userName: result['姓名'].words,
-                        idCardNumber: result['公民身份号码'].words,
-                        parameter: _this.data.parameter,
-                        age: tYear - aa
-                      })
-                    } else {
-                      wx.showToast({
-                        title: "身份证识别失败",
-                        icon: 'none',
-                        duration: 2000,
-                      })
-                    }
-                  }
-                })
+        console.log(res)
+        if (res.data.code == 0) {
+          let res1 = JSON.parse(res.data.cardMessage)
+          let card = 'form.card'
+          let name = 'form.name'
+          let sex = 'form.sex'
+          let age = 'form.age'
+          let nativePlace = 'form.nativePlace'
+          let nation = 'form.nation'
+          let birthday = 'form.birthday'
+          let constellation = 'form.constellation'
+          this.setData({
+            [card]: res1.words_result['公民身份号码'].words,
+            [name]: res1.words_result['姓名'].words,
+            [sex]: res1.words_result['性别'].words,
+            [age]: tools.formatTime(new Date()) - res1.words_result['出生'].words.substring(0, 4),
+            [nativePlace]: res1.words_result['住址'].words,
+            [nation]: res1.words_result['民族'].words,
+            [birthday]: res1.words_result['出生'].words.substring(0, 4) + '-' + res1.words_result['出生'].words.substring(4, 6) + '-' + res1.words_result['出生'].words.substring(6, 8),
+            [constellation]: this.getXingzuo(res1.words_result['出生'].words.substring(4, 6), res1.words_result['出生'].words.substring(6, 8))
+          })
+          const items = this.data.questionList;
+          const values = res1.words_result['性别'].words;
+          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
               }
-            })
-          } else {
-            wx.showToast({
-              title: '身份证识别失败',
-              icon: 'none',
-              duration: 2000,
-            })
+            }
           }
-        } else {
-          wx.hideLoading()
+          this.setData({
+            questionList: this.data.questionList
+          })
         }
       },
-      complete: () => {
-        wx.hideLoading();
+      complete:()=>{
+        wx.hideLoading()
       }
     })
   },
+  getXingzuo(month, day) {
+    const s = '魔羯水瓶双鱼白羊金牛双子巨蟹狮子处女天秤天蝎射手魔羯';
+    const arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22];
+    return s.substr(month * 2 - (day < arr[month - 1] ? 2 : 0), 2);
+  },
   //报错 
   showModal(error) {
     wx.showModal({
@@ -242,8 +304,45 @@ Page({
     }
     this.WxValidate = new WxValidate(rules, messages)
   },
+  // 表单提交事件
+  formSubmit(e) {
+    console.log(e.detail.value)
+    const params = e.detail.value
+    //校验表单
+    if (!this.WxValidate.checkForm(params)) {
+      const error = this.WxValidate.errorList[0]
+      this.showModal(error)
+      return false
+    }
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/info',
+      method: "POST",
+      data: params,
+      success: (res) => {
+        console.log(res)
+        if (res.data.code == 0) {
+          wx.showModal({
+            title: '上传成功',
+            showCancel: false,
+            success(res) {
+              if (res.confirm) {
+                wx.navigateTo({
+                  url: '/pages/personInfoDetail/personInfoDetail',
+                })
+              }
+            }
+          });
+        }
+      }
+    })
+  },
   onLoad: function (options) {
     this.initValidate()
+    const getOpenid = tools.openidStatus();
+    this.setData({
+      openid: getOpenid[0],
+      sessionkey: getOpenid[1]
+    })
   },
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 1 - 1
pages/personInfo/personInfo.wxml

@@ -15,7 +15,7 @@
 			<view class='left'>性别</view>
 			<view class='right'>
 				<radio-group class="parameter-wrap" bindchange="checkboxChange" name='sex' value="{{form.sex}}">
-					<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="{{item.value}}" wx:for="{{questionList}}">
+					<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="index" wx:for="{{questionList}}">
 						<checkbox value="{{item.value}}" checked="{{item.checked}}" />{{item.name}}
 					</label>
 				</radio-group>

+ 382 - 219
pages/personInfoDetail/personInfoDetail.js

@@ -1,7 +1,12 @@
-import WxValidate from '../../utils/WxValidate.js'
+import WxValidate from '../../utils/WxValidate.js';
+const app = require('../../utils/util.js');
+const request = require('../../utils/request.js');
+const COS = require('../../utils/cos.js');
+const tool = require('../../utils/tool.js');
 Page({
   data: {
     form: {
+      phone: '',
       height: '',
       weight: '',
       education: '',
@@ -22,57 +27,18 @@ Page({
       parents: '',
       fatherWork: '',
       motherWork: '',
+      parentAssets:'',
       composition: '',
       motionState: '',
-      hobby: ''
+      hobby: '',
+      photo: ''
     },
-    heightArr: [
-      '150以下',
-      '150-155',
-      '155-160',
-      '160-165',
-      '165-170',
-      '170-175',
-      '175-185',
-      '185-190',
-      '190以上'
-    ],
-    weightArr: [
-      "50kg以下", "50-60", "60-70", "70-80", "80-90", "90-100", "100以上"
-    ],
-    educationArr: ["初中", "中专", "高中", "大专", "本科", "硕士", "博士"],
-    incomeArr: ["2000-5000", "5000-10000", "10000-20000", "20000以上"],
-    marriageList: [{
-        name: '未婚',
-        value: '未婚',
-        checked: true
-      },
-      {
-        name: '离异',
-        value: '离异',
-        checked: false
-      }
-    ],
-    childrenArr: [{
-        name: '无',
-        value: '无',
-        checked: true
-      },
-      {
-        name: '有',
-        value: '有',
-        checked: false
-      }, {
-        name: '同住',
-        value: '同住',
-        checked: false
-      },
-      {
-        name: '不同住',
-        value: '不同住',
-        checked: false
-      }
-    ],
+    heightArr: [],
+    weightArr: [],
+    educationArr: [],
+    incomeArr: [],
+    marriageList: [],
+    childrenArr: [],
     deposit: '',
     assetHouseArr: ['租房', '购房'],
     assetAreaArr: ['80平以下', '80-120平', '120平以上'],
@@ -100,44 +66,13 @@ Page({
         checked: false
       }
     ],
-    // 工作时间自由、朝九晚五、偶尔加班、经常加班、偶尔出差、经常出差、常有应酬
-    workStatusArr: [{
-        name: '工作时间自由',
-        value: '工作时间自由',
-        checked: true
-      },
-      {
-        name: '朝九晚五',
-        value: '朝九晚五',
-        checked: false
-      }, {
-        name: '偶尔加班',
-        value: '偶尔加班',
-        checked: false
-      }, {
-        name: '经常加班',
-        value: '经常加班',
-        checked: false
-      },
-      {
-        name: '偶尔出差',
-        value: '偶尔出差',
-        checked: false
-      }, {
-        name: '经常出差',
-        value: '经常出差',
-        checked: false
-      }, {
-        name: '常有应酬',
-        value: '常有应酬',
-        checked: false
-      }
-    ],
-    workplaceArr: ['政府机关', '事业单位', '外企企业', '世界500强', '上市公司', '国有企业', '私营企业', '个体'],
+    workStatusArr: [],
+    companyNatureArr: [],
     parentsArr: ['爹妈比我都健康,一直很恩爱', '爹妈比我都健康,离婚了', '世事无常'],
-    dadworkplaceArr: ['退休', '政府机关', '事业单位', '外企企业', '世界500强', '上市公司', '国有企业', '私营企业', '个体'],
-    momworkplaceArr: ['退休', '政府机关', '事业单位', '外企企业', '世界500强', '上市公司', '国有企业', '私营企业', '个体'],
-    otherchildArr: [{
+    fatherWorkArr: ['退休', '政府机关', '事业单位', '外企企业', '世界500强', '上市公司', '国有企业', '私营企业', '个体'],
+    motherWorkArr: ['退休', '政府机关', '事业单位', '外企企业', '世界500强', '上市公司', '国有企业', '私营企业', '个体'],
+    parentAssetsArr:[],
+    compositionArr: [{
         name: '没有唯我独尊',
         value: '没有唯我独尊',
         checked: false
@@ -186,7 +121,7 @@ Page({
       [income]: this.data.incomeArr[e.detail.value]
     })
   },
-  marriageChange: function (e) {
+  marriageChange(e) {
     console.log(e.detail.value)
     const items = this.data.marriageList
     let checked = 'marriageList[0].checked';
@@ -209,7 +144,7 @@ Page({
       [marriage]: e.detail.value
     })
   },
-  childrenChange: function (e) {
+  childrenChange (e) {
     console.log(e.detail.value)
     const items = this.data.childrenArr;
     const values = e.detail.value;
@@ -320,7 +255,7 @@ Page({
       [workStatus]: e.detail.value
     })
   },
-  workplacePicker: function (e) {
+  workplacePicker (e) {
     let companyNature = 'form.companyNature'
     this.setData({
       [companyNature]: this.data.workplaceArr[e.detail.value]
@@ -332,19 +267,25 @@ Page({
       [parents]: this.data.parentsArr[e.detail.value]
     })
   },
-  dadworkplacePicker: function (e) {
+  fatherworkPicker (e) {
     let fatherWork = 'form.fatherWork'
     this.setData({
       [fatherWork]: this.data.dadworkplaceArr[e.detail.value]
     })
   },
-  momworkplacePicker: function (e) {
+  motherworkPicker (e) {
     let motherWork = 'form.motherWork'
     this.setData({
       [motherWork]: this.data.momworkplaceArr[e.detail.value]
     })
   },
-  otherchildChange: function (e) {
+  parentAssetsPicker(e){
+    let parentAssets = 'form.parentAssets'
+    this.setData({
+      [parentAssets]: this.data.parentAssetsArr[e.detail.value]
+    })
+  },
+  compositionChange(e) {
     console.log(e.detail.value)
     const items = this.data.otherchildArr;
     const values = e.detail.value;
@@ -365,13 +306,13 @@ Page({
       [composition]: e.detail.value
     })
   },
-
   figurePicker(e) {
     let motionState = 'form.motionState'
     this.setData({
       [motionState]: this.data.figureArr[e.detail.value]
     })
   },
+  // 提交
   formSubmit(e) {
     const params = e.detail.value
     //校验表单
@@ -380,8 +321,26 @@ Page({
       this.showModal(error)
       return false
     }
-    wx.navigateTo({
-      url: '/pages/targetInfo/targetInfo',
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/info',
+      method: "POST",
+      data: params,
+      success: (res) => {
+        console.log(res)
+        if (res.data.code == 0) {
+          wx.showModal({
+            title: '上传成功',
+            showCancel: false,
+            success(res) {
+              if (res.confirm) {
+                wx.navigateTo({
+                  url: '/pages/targetInfo/targetInfo',
+                })
+              }
+            }
+          });
+        }
+      }
     })
   },
   //报错 
@@ -394,222 +353,426 @@ Page({
   //验证函数
   initValidate() {
     const rules = {
+      phone: {
+        required: true
+      },
       height: {
         required: true
       },
-      weight:  {
+      weight: {
         required: true
       },
-      education:  {
+      education: {
         required: true
       },
-      income:  {
+      income: {
         required: true
       },
-      marriage:  {
+      marriage: {
         required: true
       },
-      children:  {
+      children: {
         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
       },
-      isCommen:  {
+      isCommen: {
         required: true
       },
-      controlTime:  {
+      controlTime: {
         required: true
       },
-      workStatus:  {
+      workStatus: {
         required: true
       },
-      companyNature:  {
+      companyNature: {
         required: true
       },
-      company:  {
+      company: {
         required: true
       },
-      parents:  {
+      parents: {
         required: true
       },
-      // fatherWork:  {
-      //   required: true
-      // },
-      // motherWork:  {
-      //   required: true
-      // },
-      composition:  {
+      composition: {
         required: true
       },
-      motionState:  {
+      motionState: {
         required: true
       },
-      hobby:  {
+      hobby: {
+        required: true
+      },
+      photo: {
         required: true
       }
     }
     const messages = {
-      // name: {
-      //   required: '请填写姓名',
-      //   minlength: '请输入正确的名称',
-      //   maxlength: '请输入正确的名称'
-      // },
-      // sex: {
-      //   required: '请选择性别'
-      // },
-      // age: {
-      //   required: '请填写年龄'
-      // },
-      // nativePlace: {
-      //   required: '请填写户籍地址'
-      // },
-      // nation: {
-      //   required: '请选择民族'
-      // },
-      // birthday: {
-      //   required: '请填写生日'
-      // },
-      // constellation: {
-      //   required: '请选择星座'
-      // }
+      phone: {
+        required: '请输入联系方式'
+      },
       height: {
         required: '请选择身高'
       },
-      weight:  {
+      weight: {
         required: '请选择体重'
       },
-      education:  {
+      education: {
         required: '请选择教育程度'
       },
-      income:  {
+      income: {
         required: '请选择收入'
       },
-      marriage:  {
+      marriage: {
         required: '请选择婚姻状态'
       },
-      children:  {
+      children: {
         required: '请选择有没有孩子'
       },
-      assetHouse:  {
+      assetHouse: {
         required: '请选择是否买房子'
       },
-      assetArea:  {
+      assetArea: {
         required: '请选择房子多大面积'
       },
-      assetHouseLoan:  {
+      assetHouseLoan: {
         required: '请选择房子贷款了没'
       },
-      assetCar:  {
+      assetCar: {
         required: '请选择车子情况'
       },
-      assetCarValue:  {
+      assetCarValue: {
         required: '请选择车子的价值'
       },
-      assetCarLoan:  {
+      assetCarLoan: {
         required: '请选择车子贷款了没'
       },
-      isCommen:  {
+      isCommen: {
         required: '请选择是否与父母同住'
       },
-      controlTime:  {
+      controlTime: {
         required: '请选择您的空闲时间'
       },
-      workStatus:  {
+      workStatus: {
         required: '请选择您的工作状态'
       },
-      companyNature:  {
+      companyNature: {
         required: '请选择您的单位性质'
       },
-      company:  {
+      company: {
         required: '请输入您的单位具体名称'
       },
-      parents:  {
+      parents: {
         required: '请选择您的父母情况'
       },
-      // fatherWork:  {
-      //   required: 
-      // },
-      // motherWork:  {
-      //   required: 
-      // },
-      composition:  {
+      composition: {
         required: '请选择有没有兄弟姐妹'
       },
-      motionState:  {
+      motionState: {
         required: '请选择您是否喜欢运动'
       },
-      hobby:  {
+      hobby: {
         required: '请填写您的爱好'
+      },
+      photo: {
+        required: '请上传您的照片'
       }
     }
     this.WxValidate = new WxValidate(rules, messages)
   },
-  onLoad: function (options) {
-    this.initValidate()
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-
+  async onLoad(options) {
+    this.initValidate();
+    const getOpenid = await tool.openidStatus();
+    this.setData({
+      openid: getOpenid[0],
+      sessionkey: getOpenid[1]
+    })
+    tool.formDetails('he_body_height').then(result => {
+      this.setData({
+        heightArr: result[0],
+        heightArrValue: result[1]
+      })
+    })
+    tool.formDetails('he_body_weight').then(result => {
+      this.setData({
+        weightArr: result[0],
+        weightArrValue: result[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_marriage').then(result => {
+      let marriageList = result[0].map((item, index) => {
+        return Object.assign({}, {
+          'name': item,
+          'value':item,
+          'checked':false
+        })
+      })
+      let marriageListValue = result[1].map((item, index) => {
+        return Object.assign({}, {
+          'name': item,
+          'value':item,
+          'checked':false
+        })
+      })
+      this.setData({
+        marriageList:marriageList,
+        marriageListValue: marriageListValue
+      })
+    })
+    tool.formDetails('he_children').then(result => {
+      let childrenArr = result[0].map((item, index) => {
+        return Object.assign({}, {
+          'name': item,
+          'value':item,
+          'checked':false
+        })
+      })
+      let childrenArrValue = result[1].map((item, index) => {
+        return Object.assign({}, {
+          'name': item,
+          'value':item,
+          'checked':false
+        })
+      })
+      this.setData({
+        childrenArr: childrenArr,
+        childrenArrValue: childrenArrValue
+      })
+    })
+    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
+        })
+      })
+      this.setData({
+        controlTimeArr: controlTimeArr,
+        controlTimeArrValue: controlTimeArrValue
+      })
+    })
+    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
+        })
+      })
+      this.setData({
+        workStatusArr: workStatusArr,
+        workStatusArrValue: workStatusArrValue
+      })
+    })
+    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]
+      })
+    })
+    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],
+        parentAssetsArrValue: result[1]
+      })
+    })
+    tool.formDetails('he_composition').then(result => {
+      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
+        })
+      })
+      this.setData({
+        compositionArr: compositionArr,
+        compositionArrValue: compositionArrValue
+      })
+    })
   },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-
+  // 上传头像
+  uploadPhoto() {
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['original', 'compressed'],
+      sourceType: ['', 'camera'],
+      success: (res) => {
+        console.log(res)
+        let path = res.tempFilePaths[0];
+        console.log(path)
+        this.setData({
+          carWin_img: path
+        })
+        this.toCos();
+      }
+    })
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-
+  // 传cos
+  toCos() {
+    var Bucket = 'yuehe-1257653330';
+    var Region = 'ap-beijing';
+    var ForcePathStyle = false;
+    var prefix = 'https://' + Bucket + '.cos.' + Region + '.myqcloud.com/';
+    if (ForcePathStyle) {
+      prefix = 'https://cos.' + Region + '.myqcloud.com/' + Bucket + '/';
+    }
+    var stsCache;
+    var getCredentials = function (callback) {
+      if (stsCache && Date.now() / 1000 + 30 < stsCache.expiredTime) {
+        callback(data.credentials);
+        return;
+      }
+      wx.request({
+        method: 'POST',
+        url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/getCosSts',
+        // dataType: 'json',
+        success: function (result) {
+          console.log(result, '222222222222')
+          var credentials = result.data.credential.credentials;
+          if (credentials) {
+            stsCache = result.data.credential
+          } else {
+            wx.hideLoading()
+            wx.showModal({
+              title: '临时密钥获取失败',
+              content: JSON.stringify(data),
+              showCancel: false
+            });
+          }
+          callback(stsCache && stsCache.credentials);
+        },
+        error: function (err) {
+          wx.hideLoading()
+          wx.showModal({
+            title: '临时密钥获取失败',
+            content: JSON.stringify(err),
+            showCancel: false
+          });
+        }
+      });
+    };
+    // 计算签名
+    var getAuthorization = function (options, callback) {
+      getCredentials(function (credentials) {
+        callback({
+          XCosSecurityToken: credentials.sessionToken,
+          Authorization: COS({
+            SecretId: credentials.tmpSecretId,
+            SecretKey: credentials.tmpSecretKey,
+            Method: options.Method,
+            Pathname: options.Pathname,
+          })
+        });
+      });
+    };
+    // 上传文件
+    var Key = this.data.carWin_img.substr(this.data.carWin_img.lastIndexOf('/') + 1); // 这里指定上传的文件名
+    var signPathname = '/';
+    if (ForcePathStyle) {
+      signPathname = '/' + Bucket + '/';
+    }
+    getAuthorization({
+      Method: 'POST',
+      Pathname: signPathname
+    }, (AuthData) => {
+      var requestTask = wx.uploadFile({
+        url: prefix,
+        name: 'file',
+        filePath: this.data.carWin_img,
+        formData: {
+          'key': "face/" + Key,
+          'success_action_status': 200,
+          'Signature': AuthData.Authorization,
+          'x-cos-security-token': AuthData.XCosSecurityToken,
+          'Content-Type': '',
+        },
+        success: (res) => {
+          console.log(res.header.Location)
+          let photo = 'form.photo'
+          this.setData({
+            [photo]: res.header.Location
+          })
+          // this.tj(params, res.header.Location)
+        },
+        fail: function () {
+          wx.hideLoading()
+          wx.showModal({
+            title: '上传失败',
+            showCancel: false
+          });
+        }
+      });
+      requestTask.onProgressUpdate(function (res) {
+        console.log('进度:', res.progress);
+      });
+    });
   }
 })

+ 64 - 34
pages/personInfoDetail/personInfoDetail.wxml

@@ -1,5 +1,11 @@
 	<view class="container">
 		<form bindsubmit='formSubmit'>
+			<view class="block">
+				<view class='left' style="width:40%">咋联系你呢</view>
+				<view class='right' style="width:60%">
+					<input name="phone" value="{{form.phone}}" placeholder="未填写" placeholder-class="iconfont icon-jianjiaohao1 icon-tubiaozhizuo-1"></input>
+				</view>
+			</view>
 			<view class="block">
 				<view class='left' style="width:50%">你得有一米八吧</view>
 				<view class='right' style="width:50%">
@@ -64,7 +70,7 @@
 				<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="{{item.value}}" wx:for="{{marriageList}}">
+						<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>
@@ -74,7 +80,7 @@
 				<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="{{item.value}}" wx:for="{{childrenArr}}">
+						<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>
@@ -161,7 +167,7 @@
 			<view class="block" style="height:160rpx;">
 				<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="{{item.value}}" wx:for="{{controlTimeArr}}">
+					<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="index" wx:for="{{controlTimeArr}}">
 						<checkbox value="{{item.value}}" checked="{{item.checked}}" />{{item.name}}
 					</label>
 				</checkbox-group>
@@ -169,7 +175,7 @@
 			<view class="block" style="height:260rpx;">
 				<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="{{item.value}}" wx:for="{{workStatusArr}}">
+					<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="index" wx:for="{{workStatusArr}}">
 						<checkbox value="{{item.value}}" checked="{{item.checked}}" />{{item.name}}
 					</label>
 				</checkbox-group>
@@ -177,7 +183,7 @@
 			<view class="block">
 				<view class='left' style="width:40%">卖命主阵地</view>
 				<view class='right' style="width:60%">
-					<picker bindchange="workplacePicker" range="{{workplaceArr}}" name='companyNature' value="{{form.companyNature}}">
+					<picker bindchange="workplacePicker" range="{{companyNatureArr}}" name='companyNature' value="{{form.companyNature}}">
 						<view style="text-align:right">
 							<view wx:if="{{form.companyNature}}">{{form.companyNature}}</view>
 							<view wx:else class='placeStyle'>
@@ -211,40 +217,56 @@
 				</view>
 			</view>
 			<view wx:if="{{form.parents!='世事无常'}}">
-			<view class="block">
-				<view class='left' style="width:35%">和父母一起住没</view>
-				<view class='right' style="width:65%">
-					<picker bindchange="isCommenChange" range="{{isCommenArr}}" name='isCommen' value="{{form.isCommen}}">
-						<view wx:if="{{form.isCommen}}">{{form.isCommen}}</view>
-						<view wx:else class='placeStyle'>
-							<view class="redpoint"></view>
-							<view class="placetext">未选择</view>
-							<van-icon size="15px" name="arrow" />
-						</view>
-					</picker>
-				</view>
-			</view>
-			<view class="block">
-				<view class='left' style="width:40%">爸比在哪高就</view>
-				<view class='right' style="width:60%">
-					<picker bindchange="dadworkplacePicker" range="{{dadworkplaceArr}}" name='fatherWork' value="{{form.fatherWork}}">
-						<view style="text-align:right">
-							<view wx:if="{{form.fatherWork}}">{{form.fatherWork}}</view>
+				<view class="block">
+					<view class='left' style="width:35%">和父母一起住没</view>
+					<view class='right' style="width:65%">
+						<picker bindchange="isCommenChange" range="{{isCommenArr}}" name='isCommen' value="{{form.isCommen}}">
+							<view wx:if="{{form.isCommen}}">{{form.isCommen}}</view>
 							<view wx:else class='placeStyle'>
 								<view class="redpoint"></view>
 								<view class="placetext">未选择</view>
 								<van-icon size="15px" name="arrow" />
 							</view>
-						</view>
-					</picker>
+						</picker>
+					</view>
+				</view>
+				<view class="block">
+					<view class='left' style="width:40%">爸比在哪高就</view>
+					<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: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:40%">那么妈咪呢</view>
+					<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:else class='placeStyle'>
+									<view class="redpoint"></view>
+									<view class="placetext">未选择</view>
+									<van-icon size="15px" name="arrow" />
+								</view>
+							</view>
+						</picker>
+					</view>
 				</view>
 			</view>
 			<view class="block">
-				<view class='left' style="width:40%">那么妈咪呢</view>
+				<view class='left' style="width:40%">爹妈有工资没</view>
 				<view class='right' style="width:60%">
-					<picker bindchange="momworkplacePicker" range="{{momworkplaceArr}}" name='motherWork' value="{{form.motherWork}}">
+					<picker bindchange="parentAssetsPicker" range="{{parentAssetsArr}}" name='parentAssets' value="{{form.parentAssets}}">
 						<view style="text-align:right">
-							<view wx:if="{{form.motherWork}}">{{form.motherWork}}</view>
+							<view wx:if="{{form.parentAssets}}">{{form.parentAssets}}</view>
 							<view wx:else class='placeStyle'>
 								<view class="redpoint"></view>
 								<view class="placetext">未选择</view>
@@ -254,11 +276,10 @@
 					</picker>
 				</view>
 			</view>
-			</view>
 			<view class="block" style="height:260rpx;">
 				<view class='left' style="width:100%">家里有跟你争宠的没</view>
-				<checkbox-group class="parameter-wrap" bindchange="otherchildChange" name='composition' value="{{form.composition}}">
-					<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="{{item.value}}" wx:for="{{otherchildArr}}">
+				<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}}">
 						<checkbox value="{{item.value}}" checked="{{item.checked}}" />{{item.name}}
 					</label>
 				</checkbox-group>
@@ -284,8 +305,17 @@
 					<input name="hobby" value="{{form.hobby}}" placeholder="未填写" placeholder-class="iconfont icon-jianjiaohao1 icon-tubiaozhizuo-1"></input>
 				</view>
 			</view>
-			<view class="btn-area">
-				<button form-type="submit" id="sunbmit">确认,去填写择偶意向</button>
+			<view class="block" style="height:350rpx">
+				<view class='left' style="width:40%">上传一张您的照片吧</view>
+				<view class='right' style="width:59%;color:#656565;height:80rpx" bindtap="uploadPhoto">
+					<image wx:if='{{form.photo}}' mode="aspectFit" src="{{form.photo}}" style="width:200rpx;height:350rpx;"></image>
+					<view wx:else class='placeStyle'>
+						<view class="redpoint"></view>
+						<view class="placetext">未上传</view>
+						<van-icon size="15px" name="arrow" />
+					</view>
+				</view>
 			</view>
+			<button form-type="submit" id="sunbmit">确认,去填写择偶意向</button>
 		</form>
 	</view>

+ 2 - 1
pages/personal/personal.js

@@ -1,3 +1,4 @@
+const app = require('../../utils/util.js');
 Page({
   data: {
     tabArr: [{
@@ -19,7 +20,7 @@ Page({
     }, {
       name: '投诉',
       img: '../../images/icon5.png',
-      url: ''
+      url: '/pages/complaint/complaint'
     }, {
       name: '推荐好友',
       img: '../../images/icon6.png',

+ 14 - 10
pages/personal/personal.wxml

@@ -1,13 +1,17 @@
 <view class="bj">
-<image src="../../images/person_bj.png" style="width:750rpx;height:380rpx"></image>
-<view class="top">
-	<image src="../../images/photo.jpg" mode='aspectFill' style="width:160rpx;height:160rpx;border-radius:50%;position:absolute;top:70rpx;left:295rpx;border:6rpx solid #fff"></image>
-	<view style="color:#111111;font-size:35rpx;text-align:center;margin-top:270rpx">某某某</view>
-</view>
-<view class="middle">
-	<view wx:for="{{tabArr}}" class="block"  data-src="{{item.url}}" bindtap="goTab">
-  <image src="{{item.img}}" style="width:91rpx;height:92rpx;margin-left:30rpx"></image>
-		<view style="color:#6f7582;font-size:30rpx;margin-left:30rpx">{{item.name}}</view>
+	<image src="../../images/person_bj.png" style="width:750rpx;height:380rpx"></image>
+	<view class="top">
+		<view class="img">
+			<open-data type="userAvatarUrl"></open-data>
+		</view>
+		<view class="nick">
+			<open-data type="userNickName" lang="zh_CN"></open-data>
+		</view>
+	</view>
+	<view class="middle">
+		<view wx:for="{{tabArr}}" wx:key="index" class="block" data-src="{{item.url}}" bindtap="goTab">
+			<image src="{{item.img}}" style="width:91rpx;height:92rpx;margin-left:30rpx"></image>
+			<view style="color:#6f7582;font-size:30rpx;margin-left:30rpx">{{item.name}}</view>
+		</view>
 	</view>
-</view>
 </view>

+ 26 - 8
pages/personal/personal.wxss

@@ -1,22 +1,25 @@
-.bj{
+.bj {
   background: #fafafa;
   height: 100vh;
 }
-.top{
+
+.top {
   width: 750rpx;
-  height:380rpx;
+  height: 380rpx;
   position: absolute;
   top: 0;
   left: 0;
 }
-.middle{
+
+.middle {
   display: flex;
-  flex-direction:row;
-  flex-wrap:wrap; 
+  flex-direction: row;
+  flex-wrap: wrap;
   /* border: 1px solid red; */
   width: 100%;
 }
-.block{
+
+.block {
   width: 330rpx;
   height: 180rpx;
   background: #fff;
@@ -27,10 +30,11 @@
   /* justify-content:space-around; */
   align-items: center;
 }
+
 .tabbar {
   width: 750rpx;
   /* border: 1px solid #999; */
-  box-shadow: 0px 0px 10px rgba(0,0,0,.2);
+  box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
   height: 100rpx;
   position: fixed;
   bottom: 0;
@@ -44,4 +48,18 @@
   width: 250rpx;
   text-align: center;
   color: #999999;
+}
+
+.img {
+  width: 160rpx;
+  height: 160rpx;
+  border-radius: 160rpx;
+  position: absolute;
+  top: 70rpx;
+  left: 295rpx;
+  border-radius: 50%;
+  overflow: hidden;
+}
+.nick{
+  color:#111111;font-size:35rpx;text-align:center;margin-top:270rpx
 }

+ 0 - 6
pages/red/red.js

@@ -1,6 +0,0 @@
-Page({
-  data: {
-  },
-  onLoad: function () {
-  }
-})

+ 0 - 4
pages/red/red.json

@@ -1,4 +0,0 @@
-{
-  "navigationBarTitleText": "红娘",
-  "usingComponents": {}
-}

+ 0 - 0
pages/red/red.wxml


+ 0 - 8
pages/red/red.wxss

@@ -1,8 +0,0 @@
-.log-list {
-  display: flex;
-  flex-direction: column;
-  padding: 40rpx;
-}
-.log-item {
-  margin: 10rpx;
-}

+ 1 - 1
pages/registrationSuccess/registrationSuccess.js

@@ -1,4 +1,4 @@
-// pages/registrationSuccess/registrationSuccess.js
+const app = require('../../utils/util.js');
 Page({
 
   /**

+ 1 - 1
pages/service/service.js

@@ -1,4 +1,4 @@
-// pages/service/service.js
+const app = require('../../utils/util.js');
 Page({
 
   /**

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 4 - 7
pages/share/share.js


+ 1 - 1
pages/share/share.wxml

@@ -1,5 +1,5 @@
 <view style="position:relative">
 	<image src='../../images/ewmbj.png' style="width:604rpx;height:512rpx;margin:100rpx 73rpx" />
 	<image src="{{codeImg}}" style="position:absolute;top:328rpx;left:248rpx;width:220rpx;height:220rpx;"/>
-	<button id="sunbmit" bindtap="save">保存图片</button>
+	<button id="sunbmit" bindtap="save">保存二维码</button>
 </view>

+ 9 - 3
pages/targetInfo/targetInfo.js

@@ -1,4 +1,6 @@
-import WxValidate from '../../utils/WxValidate.js'
+import WxValidate from '../../utils/WxValidate.js';
+const app = require('../../utils/util.js');
+const tool = require('../../utils/tool.js');
 Page({
   data: {
     form: {
@@ -451,10 +453,14 @@ Page({
     }
     this.WxValidate = new WxValidate(rules, messages)
   },
-  onLoad: function (options) {
+  async onLoad (options) {
     this.initValidate()
+    const getOpenid = await tool.openidStatus();
+    this.setData({
+      openid: getOpenid[0],
+      sessionkey: getOpenid[1]
+    })
   },
-
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 2 - 2
pages/targetInfo/targetInfo.wxml

@@ -156,7 +156,7 @@
 		<view class="block" style="height:440rpx;">
 			<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="{{item.value}}" wx:for="{{constellationArr}}">
+				<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="index" wx:for="{{constellationArr}}">
 					<checkbox value="{{item.value}}" checked="{{item.checked}}" />{{item.name}}
 				</label>
 			</checkbox-group>
@@ -164,7 +164,7 @@
 		<view class="block" style="height:320rpx;">
 			<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="{{item.value}}" wx:for="{{workStatusArr}}">
+				<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="index" wx:for="{{workStatusArr}}">
 					<checkbox value="{{item.value}}" checked="{{item.checked}}" />{{item.name}}
 				</label>
 			</checkbox-group>

+ 1 - 1
project.config.json

@@ -4,7 +4,7 @@
 		"ignore": []
 	},
 	"setting": {
-		"urlCheck": true,
+		"urlCheck": false,
 		"es6": true,
 		"postcss": true,
 		"preloadBackgroundData": false,

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 0
utils/cos.js


+ 28 - 0
utils/request.js

@@ -0,0 +1,28 @@
+const app = require('../utils/util.js');
+const request = (url, data = {}, type = 'GET') => {
+  return new Promise((resolve, reject) => {
+    wx.request({
+      url: `${app.globalData.publicUrl}${url}`,
+      method: type,
+      data,
+      success({
+        data
+      }) {
+        resolve({
+          status: 0,
+          data,
+          msg: 'request请求成功获取到数据'
+        });
+      },
+      fail() {
+        reject({
+          status: 1,
+          msg: 'request请求失败'
+        })
+      }
+    });
+  });
+};
+module.exports = {
+  request
+}

+ 40 - 8
utils/tool.js

@@ -1,23 +1,24 @@
 const util = require('../utils/util.js');
 const openidStatus = () => {
-  console.log(wx.getStorageSync('openId'),'缓存里是否有openid')
   if (wx.getStorageSync('openId')) {
-    return wx.getStorageSync('openId')
+    return [wx.getStorageSync('openId'), wx.getStorageSync('sessionKey')]
   } else {
     return new Promise((resolve, reject) => {
       wx.login({
         success: (res) => {
           if (res.code) {
             wx.request({
-              url: util.globalData.publicUrl + '/wx/getAppletOpenId',
+              url: util.globalData.publicUrl + '/wx/user/wxbfa171fdd4000e03/login',
               method: "GET",
               data: {
                 code: res.code
               },
               success: res => {
-                if (res.data.status == 200) {
-                  wx.setStorageSync('openId', res.data.data.openid)
-                  return res.data.data.openid;
+                console.log(res)
+                if (res.statusCode == 200) {
+                  wx.setStorageSync('openId', res.data.openid)
+                  wx.setStorageSync('sessionKey', res.data.sessionKey)
+                  return [res.data.openid, res.data.sessionKey];
                 }
               }
             });
@@ -28,8 +29,39 @@ const openidStatus = () => {
       })
     })
   }
- 
+};
+
+function formatTime(date) {
+  var year = date.getFullYear()
+  return year
+}
+const formDetails = (type) => {
+  return new Promise((resolve, reject) => {
+    wx.request({
+      url: util.globalData.publicUrl + '/wx/member/'+ wx.getStorageSync('openId') +'/options',
+      method: "GET",
+      data: {
+        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])
+        }else{
+          reject(res)
+        }
+      }
+    })
+  })
 };
 module.exports = {
-  openidStatus
+  openidStatus,
+  formDetails,
+  formatTime
 }

+ 1 - 1
utils/util.js

@@ -1,5 +1,5 @@
 const globalData = {
-  publicUrl: 'https://info.windd.cn/test'
+  publicUrl: 'http://49.233.2.78'
 };
 module.exports = {
   globalData: globalData