Your Name 5 år sedan
förälder
incheckning
e364c003c5

+ 1 - 1
pages/Jurisdiction/click_Jurisdiction/click_Jurisdiction.json

@@ -1,3 +1,3 @@
1 1
 {
2
-  "navigationBarTitleText": "约会绑"
2
+  "navigationBarTitleText": "佳人佳缘"
3 3
 }

+ 5 - 0
pages/index/index.js

@@ -79,6 +79,11 @@ Page({
79 79
       that.onLoad();
80 80
     } 
81 81
     app.globalData.trigger = false;
82
+
83
+    wx.setTabBarBadge({
84
+      index: 0,
85
+      text: '1'
86
+    })  
82 87
   },
83 88
  
84 89
  

+ 2 - 2
pages/personal_core/personaldata/personaldata.wxml

@@ -105,9 +105,9 @@
105 105
       </view>
106 106
 
107 107
       <view class='data_list c' wx:if='{{optioninfocode.code == 201}}'>
108
-              <text  wx:if='{{optioninfo.age_max && optioninfo.age_min}}'>{{optioninfo.age}}</text>
108
+              <text  wx:if='{{optioninfo.age}}'>{{optioninfo.age}}</text>
109 109
               <text wx:if='{{optioninfo.marry}}'>{{optioninfo.marry}}</text>
110
-              <text wx:if='{{optioninfo.height_max && optioninfo.height_min}}'>{{optioninfo.height}}</text>
110
+              <text wx:if='{{optioninfo.height}}'>{{optioninfo.height}}</text>
111 111
               <text wx:if='{{optioninfo.education}}'>{{optioninfo.education}}</text>
112 112
               <text wx:if='{{optioninfo.income_min && optioninfo.income_max}}'>{{optioninfo.income_min}}-{{optioninfo.income_max}}</text>
113 113
               <text wx:if='{{optioninfo.occupation}}'>职业:{{optioninfo.occupation}}</text>

+ 161 - 60
pages/personal_core/requirements/requirements.js

@@ -90,30 +90,53 @@ Page({
90 90
       let Age_data = {
91 91
         // pid: '0'
92 92
       };
93
+      let _age_min = res.data.age_min == 0 ? '不限' : res.data.age_min;
94
+      let _age_max = res.data.age_max == 0 ? '以上' : res.data.age_max;
93 95
 
94
-      let _age_min = res.data.age_min;
95
-      let _age_max = res.data.age_max;
96 96
       // console.log(_age_min);
97 97
       // console.log(_age_max);
98 98
       app.postRequest(Age_url, Age_data, function (res) {   //  年龄 ajax
99 99
               if (res.code == 201) {
100 100
 
101
-                let min = data_processing(res.data, _age_min);      //已选中的数据处理  min
102
-                let max = data_processing(res.data, _age_max);   //已选中的数据处理  max
101
+
102
+                let newarray = ['不限'];
103
+                var res_data = newarray.concat(res.data);      //在原有的数据上 凭借上 不限
104
+
105
+                let newarray1 = ['以上'];
106
+                var res_data1 = newarray1.concat(res.data);      //在原有的数据上 凭借上 以上
107
+
108
+                let min = data_processing(res_data, _age_min);      //已选中的数据处理  min
109
+                let max = data_processing(res_data1, _age_max);   //已选中的数据处理  max
110
+
111
+          
103 112
 
104 113
                 that.setData({
105 114
                   AgeIndex: [min, max]
106 115
                 })
107 116
 
117
+
108 118
                 let dictObject = res.data;    //对象不能直接使用  以下转成数组
109
-                  // 对象转成数组
110
-                  var createArr = []
111
-                  for (let i in dictObject) {
112
-                    createArr.push(dictObject[i] + "岁");
113
-                  }
114
-                  that.setData({
115
-                    AgeArray: [createArr, createArr],
116
-                  })
119
+                // 对象转成数组
120
+                var createArr = []
121
+                for (let i in dictObject) {
122
+                  createArr.push(dictObject[i] + "岁");      //在数据后面凭借  岁
123
+                }
124
+
125
+                let bx = ['不限'];
126
+                var Unlimited = bx.concat(createArr);   //在原有的数据上 凭借上   不限
127
+
128
+                let ys = ['以上'];
129
+                var Above = ys.concat(createArr);       //在原有的数据上 凭借上    以上
130
+
131
+
132
+
133
+                that.setData({
134
+                  AgeArray: [Unlimited, Above],
135
+                })
136
+
137
+
138
+
139
+
117 140
 
118 141
                             // console.log(createArr);           
119 142
                 }
@@ -128,30 +151,49 @@ Page({
128 151
         pid: '0'
129 152
       };
130 153
 
131
-      let _height_min = res.data.height_min;
132
-      let _height_max = res.data.height_max;
154
+
155
+      let _height_min = res.data.height_min == 0 ? '不限' : res.data.height_min;
156
+      let _height_max = res.data.height_max == 0 ? '以上' : res.data.height_max;
157
+
158
+      // console.log(_height_min)
159
+      // console.log(_height_max)
133 160
 
134 161
       app.postRequest(height_url, height_data, function (res) {      //  身高 ajax
135 162
                 if (res.code == 201) {
136 163
           
137
-                  // let min = data_processing(res.data, _height_min);      //已选中的数据处理  min
138
-                  // let max = data_processing(res.data, _height_max);   //已选中的数据处理  max
139
-
140
-                  // that.setData({
141
-                  //   heightindex: [min, max]
142
-                  // })
143
-   
144
-
145
-                        let dictObject = res.data;        //对象不能直接使用  以下转成数组
146
-                        // 对象转成数组
147
-                        var createArr = []
148
-                        for (let i in dictObject) {
149
-                          createArr.push(dictObject[i] + "cm");
150
-                        }
151
-                        // console.log(createArr);
152
-                        that.setData({                
153
-                          heightArray: [createArr, createArr],
154
-                        })
164
+                  let newarray = ['不限'];
165
+                  var res_data = newarray.concat(res.data);      //在原有的数据上 凭借上 不限
166
+
167
+                  let newarray1 = ['以上'];
168
+                  var res_data1 = newarray1.concat(res.data);      //在原有的数据上 凭借上 以上
169
+
170
+
171
+                  let min = data_processing(res_data, _height_min);      //已选中的数据处理  min
172
+                  let max = data_processing(res_data1, _height_max);   //已选中的数据处理  max
173
+      
174
+                  that.setData({
175
+                    heightindex: [min, max]
176
+                  })
177
+       
178
+
179
+                  let dictObject = res.data;        //对象不能直接使用  以下转成数组
180
+                  // 对象转成数组
181
+                  var createArr = []
182
+                  for (let i in dictObject) {
183
+                    createArr.push(dictObject[i] + "cm");
184
+                  }
185
+
186
+
187
+                  let bx = ['不限'];
188
+                  var Unlimited = bx.concat(createArr);
189
+
190
+                  let ys = ['以上'];
191
+                  var Above = ys.concat(createArr);
192
+
193
+                  // console.log(createArr);
194
+                  that.setData({
195
+                    heightArray: [Unlimited, Above],
196
+                  })
155 197
 
156 198
 
157 199
                 }
@@ -216,25 +258,37 @@ Page({
216 258
       let income_data = {
217 259
         // pid: '0'
218 260
       };
219
-      let _income_min = res.data.income_min;
220
-      let _income_max = res.data.income_max;
221
-      // console.log(_income_min);
222
-      // console.log(_income_max);
261
+      let _income_min = res.data.income_min == 0 ? '不限' : res.data.income_min;
262
+      let _income_max = res.data.income_max == 0 ? '以上' : res.data.income_max;
263
+
264
+
265
+      console.log(_income_min);
266
+      console.log(_income_max);
223 267
       app.postRequest(income_url, income_data, function (res) {      //  收入 ajax
224 268
         if (res.code == 201) {
225 269
     
226 270
 
227
-          var min = data_processing(res.data, _income_min);      //已选中的数据处理  min
228
-          var max = data_processing(res.data, _income_max);   //已选中的数据处理  max
271
+          let newarray = ['不限'];
272
+          var res_data = newarray.concat(res.data);      //在原有的数据上 凭借上 不限
273
+
274
+          let newarray1 = ['以上'];
275
+          var res_data1 = newarray1.concat(res.data);      //在原有的数据上 凭借上 以上
276
+
277
+
278
+          var min = data_processing(res_data, _income_min);      //已选中的数据处理  min
279
+          var max = data_processing(res_data1, _income_max);   //已选中的数据处理  max
280
+          console.log(min);
281
+          console.log(max);
229 282
 
230 283
             that.setData({
231 284
               incomeindex: [min, max]
232 285
             })
233 286
           
234 287
 
235
-            that.setData({
236
-              incomeArray: [res.data, res.data],
237
-            })
288
+              that.setData({
289
+                incomeArray: [res_data, res_data1],
290
+              })
291
+
238 292
         }
239 293
 
240 294
       })
@@ -272,18 +326,37 @@ Page({
272 326
 
273 327
     
274 328
       if (res.code == 201) {
275
-   
329
+        var _age , _height , _income ;
330
+        if (res.data.age_min == 0 && res.data.age_max == 0){
331
+          _age = '';
332
+         }else{
333
+          _age = res.data.age_min + '-' + res.data.age_max
334
+         }
335
+
336
+        if (res.data.height_min == 0 && res.data.height_max == 0) {
337
+          _height = '';
338
+        }else{
339
+          _height = res.data.height_min + '-' + res.data.height_max
340
+        }
341
+
342
+        if (res.data.income_min == 0 && res.data.income_max == 0) {
343
+          _income = '';
344
+        }else {
345
+          _income = res.data.income_min + '-' + res.data.income_max
346
+        }
347
+
348
+
276 349
         that.setData({
277 350
           
278 351
           // sex: res.data.sex,     //  性别  
279
-          age: res.data.age_min + '-' + res.data.age_max,      //  年龄  
280
-          height: res.data.height_min + '-' + res.data.height_max,      //  身高  
352
+          age: _age,      //  年龄  
353
+          height: _height,      //  身高  
281 354
           province: res.data.province,     // 市
282 355
           city: res.data.city,     // 市
283 356
           area: res.data.area,     // 区
284 357
           education: res.data.education,    //  学历  
285 358
           marry: res.data.marry,    //   婚史 
286
-          income: res.data.income_min + '-' + res.data.income_max,     //  收入 
359
+          income: _income,     //  收入 
287 360
           occupation: res.data.occupation,     //  职业
288 361
 
289 362
         
@@ -661,22 +734,24 @@ Page({
661 734
 
662 735
   //下一步事件
663 736
   register: function (e) {
664
-
665
-        // console.log(this.data.sex);                 //  性别  
737
+  var that =this ;
738
+    var _age = transformation(that.data.age)      //不限以上 转换成0
739
+    var _height = transformation(that.data.height)      //不限以上 转换成0
740
+    var _income = transformation(that.data.income)      //不限以上 转换成0
741
+    console.log(_age);
666 742
         // console.log(this.data.age);              //  年龄 
667
-        // console.log(this.data.height);           //  身高 
668
-        // console.log(this.data.education);      //  学历  
669
-        // console.log(this.data.marry);          //   婚史 
670
-        // console.log(this.data.income);        //  收入 
671
-        // console.log(this.data.province);       //  省 
672
-        // console.log(this.data.city);              //  市 
673
-        // console.log(this.data.area);              //  区 
674
-        // console.log(this.data.occupation);     //  职业 
743
+        console.log(this.data.height);           //  身高 
744
+        console.log(this.data.education);      //  学历  
745
+        console.log(this.data.marry);          //   婚史 
746
+        console.log(this.data.income);        //  收入 
747
+        console.log(this.data.province);       //  省 
748
+        console.log(this.data.city);              //  市 
749
+        console.log(this.data.area);              //  区 
750
+        console.log(this.data.occupation);     //  职业 
675 751
 
676 752
     // let _Receive_img = that.data.Receive_news;
677 753
     // _Receive_img.push(obj);      //合并历史消息对象
678 754
 
679
-        // var sex = this.data.sex                     //  性别  
680 755
         var age = this.data.age                     //  年龄  
681 756
         var height = this.data.height             //  身高  
682 757
         var province = this.data.province      // 省
@@ -687,19 +762,19 @@ Page({
687 762
         var income = this.data.income             //  收入 
688 763
         var occupation = this.data.occupation  //  职业
689 764
 
690
-       if (age || height || province || city || area || education || marry || income || occupation){
765
+    if (_age || height || province || city || area || education || marry || income || occupation){
691 766
                     //  修改择偶信息
692 767
                     let editinfoform_url = 'my/personaloption/editoptionform';
693 768
                     let editinfoform_data = {
694 769
 
695
-                      age: this.data.age,      //  年龄  
696
-                      height: this.data.height,      //  身高  
770
+                      age: _age,      //  年龄  
771
+                      height: _height,      //  身高  
697 772
                       province: this.data.province,     // 市
698 773
                       city: this.data.city,     // 市
699 774
                       area: this.data.area,     // 区
700 775
                       education: this.data.education,    //  学历  
701 776
                       marry: this.data.marry,    //   婚史 
702
-                      income: this.data.income,     //  收入 
777
+                      income: _income,     //  收入 
703 778
                       occupation: this.data.occupation,     //  职业
704 779
 
705 780
                     };
@@ -740,3 +815,29 @@ var data_processing = function (data, min_max, ) {
740 815
     }
741 816
   }
742 817
 }
818
+
819
+
820
+
821
+
822
+var transformation = function (resdata) {
823
+  if (resdata) {
824
+    let newArry = resdata.split("-");  //转成数组
825
+
826
+    if (newArry[0] == '不限' || newArry[0] == undefined) {
827
+      var _min = 0
828
+    } else {
829
+      var _min = newArry[0];
830
+    }
831
+
832
+    if (newArry[1] == '以上' || newArry[1] == undefined) {
833
+      var _max = 0
834
+    } else {
835
+      var _max = newArry[1];
836
+    }
837
+
838
+    resdata = _min + '-' + _max
839
+  }
840
+  return resdata;
841
+
842
+
843
+}

+ 2 - 2
pages/personal_core/requirements/requirements.wxml

@@ -147,14 +147,14 @@
147 147
 
148 148
                                 <view class="Choice_dx_text picker"  wx:if='{{incomeid == 0}}'>
149 149
                                     <block wx:if='{{personacodel.code == 201 && personacodel.data.income_max}}'>
150
-                                       {{incomeArray[0][incomeindex[0]]}}-{{incomeArray[1][incomeindex[1]]}}
150
+                                       {{incomeArray[0][incomeindex[0]]}}-{{incomeArray[1][incomeindex[1]]}}1
151 151
                                      </block>
152 152
                                     
153 153
                                       <block wx:else>请选择</block>
154 154
                                 </view>   
155 155
 
156 156
                                 <view class="Choice_dx_text picker"  wx:else>
157
-                                      {{incomeArray[0][incomeindex[0]]}}-{{incomeArray[1][incomeindex[1]]}}
157
+                                      {{incomeArray[0][incomeindex[0]]}}-{{incomeArray[1][incomeindex[1]]}}2
158 158
 
159 159
                                 </view> 
160 160