提交 b01aa781cf7c6b0f14386973de935476c480d11d

作者 pangy
1 个父辈 f8d685b5

优化

@@ -40,6 +40,7 @@ Page({ @@ -40,6 +40,7 @@ Page({
40 edit_id:null, 40 edit_id:null,
41 data: { 41 data: {
42 hasLover:false, 42 hasLover:false,
  43 + hasGetLover:false,
43 house_type: "", 44 house_type: "",
44 deduction_amount: '', 45 deduction_amount: '',
45 lable: 0, 46 lable: 0,
@@ -640,7 +641,7 @@ Page({ @@ -640,7 +641,7 @@ Page({
640 var hasLoverData = that.data.hasLoverData 641 var hasLoverData = that.data.hasLoverData
641 hasLoverData.selected = '是' 642 hasLoverData.selected = '是'
642 hasLoverData.disabled = true 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 if (data.name && data.name.length) { 645 if (data.name && data.name.length) {
645 setData.spouse_name = data.name 646 setData.spouse_name = data.name
646 } 647 }
@@ -689,11 +690,11 @@ Page({ @@ -689,11 +690,11 @@ Page({
689 childrenpercentData.selected = data.percent + '%' 690 childrenpercentData.selected = data.percent + '%'
690 setData.childrenpercentData = childrenpercentData 691 setData.childrenpercentData = childrenpercentData
691 var studystartdate = this.data.studystartdate 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 studystartdate.datelong = data.education_start 694 studystartdate.datelong = data.education_start
694 setData.studystartdate = studystartdate 695 setData.studystartdate = studystartdate
695 var studyenddate = this.data.studyenddate 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 studyenddate.datelong = data.education_end 698 studyenddate.datelong = data.education_end
698 setData.studyenddate = studyenddate 699 setData.studyenddate = studyenddate
699 setData.deduction_amount = data.deduction_amount 700 setData.deduction_amount = data.deduction_amount
@@ -725,6 +726,7 @@ Page({ @@ -725,6 +726,7 @@ Page({
725 hasLoverData.selected = data.has_spouse == 'y' ? '是' : '否' 726 hasLoverData.selected = data.has_spouse == 'y' ? '是' : '否'
726 hasLoverData.disabled = data.has_spouse == 'y' ? true : false 727 hasLoverData.disabled = data.has_spouse == 'y' ? true : false
727 setData.hasLover = data.has_spouse == 'y' ? true : false 728 setData.hasLover = data.has_spouse == 'y' ? true : false
  729 + setData.hasGetLover = data.has_spouse == 'y' ? true : false
728 setData.hasLoverData = hasLoverData 730 setData.hasLoverData = hasLoverData
729 if (data.spouse_name && data.spouse_name.length) { 731 if (data.spouse_name && data.spouse_name.length) {
730 setData.spouse_name = data.spouse_name 732 setData.spouse_name = data.spouse_name
@@ -750,11 +752,11 @@ Page({ @@ -750,11 +752,11 @@ Page({
750 setData.edulevelData = edulevelData 752 setData.edulevelData = edulevelData
751 } 753 }
752 var studystartdate = this.data.studystartdate 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 studystartdate.datelong = data.education_start 756 studystartdate.datelong = data.education_start
755 setData.studystartdate = studystartdate 757 setData.studystartdate = studystartdate
756 var studyenddate = this.data.studyenddate 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 studyenddate.datelong = data.education_end 760 studyenddate.datelong = data.education_end
759 setData.studyenddate = studyenddate 761 setData.studyenddate = studyenddate
760 762
@@ -837,6 +839,7 @@ Page({ @@ -837,6 +839,7 @@ Page({
837 var hasLoverData = this.data.hasLoverData 839 var hasLoverData = this.data.hasLoverData
838 hasLoverData.selected = data.has_spouse == 'y'?'是':'否' 840 hasLoverData.selected = data.has_spouse == 'y'?'是':'否'
839 setData.hasLover = data.has_spouse=='y'?true:false 841 setData.hasLover = data.has_spouse=='y'?true:false
  842 + setData.hasGetLover = data.has_spouse == 'y' ? true : false
840 setData.hasLoverData = hasLoverData 843 setData.hasLoverData = hasLoverData
841 if (data.spouse_name && data.spouse_name.length) { 844 if (data.spouse_name && data.spouse_name.length) {
842 setData.spouse_name = data.spouse_name 845 setData.spouse_name = data.spouse_name
@@ -340,7 +340,7 @@ @@ -340,7 +340,7 @@
340 <view class='divide_line_30'></view> 340 <view class='divide_line_30'></view>
341 <view style='height:90rpx'> 341 <view style='height:90rpx'>
342 <text class='text_777_30 float_left head_in'>配偶姓名</text> 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 </view> 344 </view>
345 <view class='divide_line_30'></view> 345 <view class='divide_line_30'></view>
346 <template is="picker_cell_normal" data="{{...lovercardtypeData}}" /> 346 <template is="picker_cell_normal" data="{{...lovercardtypeData}}" />
@@ -348,8 +348,8 @@ @@ -348,8 +348,8 @@
348 <view style='height:90rpx'> 348 <view style='height:90rpx'>
349 <text class='text_777_30 float_left head_in'>配偶证照号码</text> 349 <text class='text_777_30 float_left head_in'>配偶证照号码</text>
350 <view wx:if="{{isIdCard}}"> 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 </view> 353 </view>
354 </view> 354 </view>
355 <view class='divide_line_30'></view> 355 <view class='divide_line_30'></view>
@@ -16,6 +16,11 @@ function formatTime_date(date) { @@ -16,6 +16,11 @@ function formatTime_date(date) {
16 var day = dayFormString(date) 16 var day = dayFormString(date)
17 return [year, month, day].map(formatNumber).join('-') 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 function formatDate_min(date) { 25 function formatDate_min(date) {
21 var year = yearFormString(date) 26 var year = yearFormString(date)
@@ -235,6 +240,7 @@ function checkEmail(email){ @@ -235,6 +240,7 @@ function checkEmail(email){
235 module.exports = { 240 module.exports = {
236 formatTime: formatTime, 241 formatTime: formatTime,
237 formatTime_date: formatTime_date, 242 formatTime_date: formatTime_date,
  243 + formatTime_month: formatTime_month,
238 formatDate_min: formatDate_min, 244 formatDate_min: formatDate_min,
239 formatDateString: formatDateString, 245 formatDateString: formatDateString,
240 yearFormString: yearFormString, 246 yearFormString: yearFormString,
注册登录 后发表评论