提交 b01aa781cf7c6b0f14386973de935476c480d11d

作者 pangy
1 个父辈 f8d685b5

优化

... ... @@ -40,6 +40,7 @@ Page({
40 40 edit_id:null,
41 41 data: {
42 42 hasLover:false,
  43 + hasGetLover:false,
43 44 house_type: "",
44 45 deduction_amount: '',
45 46 lable: 0,
... ... @@ -640,7 +641,7 @@ Page({
640 641 var hasLoverData = that.data.hasLoverData
641 642 hasLoverData.selected = '是'
642 643 hasLoverData.disabled = true
643   - var data = res.data.items[0], setData = { hasLover: true, hasLoverData: hasLoverData}
  644 + var data = res.data.items[0], setData = { hasGetLover:true, hasLover: true, hasLoverData: hasLoverData}
644 645 if (data.name && data.name.length) {
645 646 setData.spouse_name = data.name
646 647 }
... ... @@ -689,11 +690,11 @@ Page({
689 690 childrenpercentData.selected = data.percent + '%'
690 691 setData.childrenpercentData = childrenpercentData
691 692 var studystartdate = this.data.studystartdate
692   - studystartdate.selected = format.formatTime_date(data.education_start)
  693 + studystartdate.selected = format.formatTime_month(data.education_start)
693 694 studystartdate.datelong = data.education_start
694 695 setData.studystartdate = studystartdate
695 696 var studyenddate = this.data.studyenddate
696   - studyenddate.selected = format.formatTime_date(data.education_end)
  697 + studyenddate.selected = format.formatTime_month(data.education_end)
697 698 studyenddate.datelong = data.education_end
698 699 setData.studyenddate = studyenddate
699 700 setData.deduction_amount = data.deduction_amount
... ... @@ -725,6 +726,7 @@ Page({
725 726 hasLoverData.selected = data.has_spouse == 'y' ? '是' : '否'
726 727 hasLoverData.disabled = data.has_spouse == 'y' ? true : false
727 728 setData.hasLover = data.has_spouse == 'y' ? true : false
  729 + setData.hasGetLover = data.has_spouse == 'y' ? true : false
728 730 setData.hasLoverData = hasLoverData
729 731 if (data.spouse_name && data.spouse_name.length) {
730 732 setData.spouse_name = data.spouse_name
... ... @@ -750,11 +752,11 @@ Page({
750 752 setData.edulevelData = edulevelData
751 753 }
752 754 var studystartdate = this.data.studystartdate
753   - studystartdate.selected = format.formatTime_date(data.education_start)
  755 + studystartdate.selected = format.formatTime_month(data.education_start)
754 756 studystartdate.datelong = data.education_start
755 757 setData.studystartdate = studystartdate
756 758 var studyenddate = this.data.studyenddate
757   - studyenddate.selected = format.formatTime_date(data.education_end)
  759 + studyenddate.selected = format.formatTime_month(data.education_end)
758 760 studyenddate.datelong = data.education_end
759 761 setData.studyenddate = studyenddate
760 762
... ... @@ -837,6 +839,7 @@ Page({
837 839 var hasLoverData = this.data.hasLoverData
838 840 hasLoverData.selected = data.has_spouse == 'y'?'是':'否'
839 841 setData.hasLover = data.has_spouse=='y'?true:false
  842 + setData.hasGetLover = data.has_spouse == 'y' ? true : false
840 843 setData.hasLoverData = hasLoverData
841 844 if (data.spouse_name && data.spouse_name.length) {
842 845 setData.spouse_name = data.spouse_name
... ...
... ... @@ -340,7 +340,7 @@
340 340 <view class='divide_line_30'></view>
341 341 <view style='height:90rpx'>
342 342 <text class='text_777_30 float_left head_in'>配偶姓名</text>
343   - <input class='input_wrap' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入配偶姓名' name='spouse_name' value='{{spouse_name}}' disabled='{{hasLover}}'></input>
  343 + <input class='input_wrap' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入配偶姓名' name='spouse_name' value='{{spouse_name}}' disabled='{{hasGetLover}}'></input>
344 344 </view>
345 345 <view class='divide_line_30'></view>
346 346 <template is="picker_cell_normal" data="{{...lovercardtypeData}}" />
... ... @@ -348,8 +348,8 @@
348 348 <view style='height:90rpx'>
349 349 <text class='text_777_30 float_left head_in'>配偶证照号码</text>
350 350 <view wx:if="{{isIdCard}}">
351   - <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' hidden='{{hasLover}}' id="spouse_id_card_no"></image>
352   - <input class='input_wrap' style='color:#000;' placeholder='请输入或拍摄身份证' placeholder-class='text_999_30' name='spouse_id_card_no' maxlength='18' type='idcard' value='{{spouse_id_card_no}}' bindinput="idChange" id='spouse_id_card_no_input' disabled='{{hasLover}}'></input>
  351 + <image class='image_camera float_right' src='/images/camera.png' bindtap='getIdInfo' hidden='{{hasGetLover}}' id="spouse_id_card_no"></image>
  352 + <input class='input_wrap' style='color:#000;' placeholder='请输入或拍摄身份证' placeholder-class='text_999_30' name='spouse_id_card_no' maxlength='18' type='idcard' value='{{spouse_id_card_no}}' bindinput="idChange" id='spouse_id_card_no_input' disabled='{{hasGetLover}}'></input>
353 353 </view>
354 354 </view>
355 355 <view class='divide_line_30'></view>
... ...
... ... @@ -16,6 +16,11 @@ function formatTime_date(date) {
16 16 var day = dayFormString(date)
17 17 return [year, month, day].map(formatNumber).join('-')
18 18 }
  19 +function formatTime_month(date) {
  20 + var year = yearFormString(date)
  21 + var month = monthFormString(date)
  22 + return [year, month].map(formatNumber).join('-')
  23 +}
19 24
20 25 function formatDate_min(date) {
21 26 var year = yearFormString(date)
... ... @@ -235,6 +240,7 @@ function checkEmail(email){
235 240 module.exports = {
236 241 formatTime: formatTime,
237 242 formatTime_date: formatTime_date,
  243 + formatTime_month: formatTime_month,
238 244 formatDate_min: formatDate_min,
239 245 formatDateString: formatDateString,
240 246 yearFormString: yearFormString,
... ...
注册登录 后发表评论