提交 6f5f3c4b3ce3685be92b4f0c9d8a64da6dc9da94

作者 wangyu
1 个父辈 bf1132d8

优化

... ... @@ -25,7 +25,7 @@
25 25 </view>
26 26 </view>
27 27 <view class="divide_line"></view>
28   - <picker mode="date" value="{{date}}" start="2015-09-01" end="2017-09-01" bindchange="bindDateChange">
  28 + <picker mode="date" value="{{date}}" start="1919-01-01" end="2017-09-01" bindchange="bindDateChange">
29 29 <view style='height:90rpx;padding:0 30rpx'>
30 30 <text style='color:red;font-size: 30rpx;line-height: 90rpx;float:left'>*</text>
31 31 <text style='color:#777;font-size: 30rpx;line-height: 90rpx; float:left'>共同赡养人出生日期</text>
... ...
... ... @@ -160,18 +160,19 @@ Page({
160 160 handleAddition: function(data) {
161 161 var newdata = data.items
162 162 for (var i = 0; i < newdata.length; i++) {
163   - if (newdata[i].education_start && newdata[i].education_start > 0) {
164   - newdata[i].education_start = format.formatTime_date(newdata[i].education_start)
  163 + if (newdata[i].education_start) {
  164 + newdata[i].education_start = this.formatDate(newdata[i].education_start)
165 165 }
166   - if (newdata[i].education_end && newdata[i].education_end > 0) {
167   - newdata[i].education_end = format.formatTime_date(newdata[i].education_end)
  166 + if (newdata[i].education_end) {
  167 + newdata[i].education_end = this.formatDate(newdata[i].education_end)
168 168 }
169   - if (newdata[i].approval_date && newdata[i].approval_date > 0) {
170   - newdata[i].approval_date = format.formatTime_date(newdata[i].approval_date)
  169 + if (newdata[i].approval_date) {
  170 + newdata[i].approval_date = this.formatDate(newdata[i].approval_date)
171 171 }
172   - if (newdata[i].patient_birthday && newdata[i].patient_birthday > 0) {
173   - newdata[i].patient_birthday = format.formatTime_date(newdata[i].patient_birthday)
  172 + if (newdata[i].patient_birthday) {
  173 + newdata[i].patient_birthday = this.formatDate(newdata[i].patient_birthday)
174 174 }
  175 +
175 176 if (newdata[i].house_address) {
176 177 if (newdata[i].house_address.province == newdata[i].house_address.city) {
177 178 newdata[i].house_address_new = newdata[i].house_address.city + newdata[i].house_address.district
... ... @@ -181,9 +182,10 @@ Page({
181 182 }
182 183 if (newdata[i].co_supporters && newdata[i].co_supporters.length > 0) {
183 184 for (var j = 0; j < newdata[i].co_supporters.length; j++) {
184   - if (newdata[i].co_supporters[j].birthday && newdata[i].birthday > 0) {
185   - newdata[i].co_supporters[j].birthday = format.formatTime_date(newdata[i].co_supporters[j].birthday)
  185 + if (newdata[i].co_supporters[j].birthday) {
  186 + newdata[i].co_supporters[j].birthday = this.formatDate(newdata[i].co_supporters[j].birthday)
186 187 }
  188 + newdata[i].co_supporters[j].id_card_no = this.formatIdNum(newdata[i].co_supporters[j].id_card_no)
187 189 }
188 190 }
189 191 newdata[i].id_card_no = this.formatIdNum(newdata[i].id_card_no)
... ... @@ -480,7 +482,17 @@ Page({
480 482 }
481 483 },
482 484
483   - formatIdNum: function (idnum) {
  485 + formatDate(date) {
  486 + if (date == 0 || date == -62135596800) {
  487 + date = ""
  488 + }else{
  489 + date = format.formatTime_date(date)
  490 + }
  491 + console.log("formatDate", date)
  492 + return date
  493 + },
  494 +
  495 + formatIdNum: function(idnum) {
484 496 if (idnum && idnum.length >= 6 && idnum.length < 10) {
485 497 idnum = idnum.substring(0, 2) + '****' + idnum.substring(idnum.length - 2, idnum.length);
486 498 }
... ... @@ -494,9 +506,11 @@ Page({
494 506
495 507 bindinput: function(e) {
496 508 console.log("bindinput", e)
497   - this.setData({
498   - reduce_amount: parseFloat(e.detail.value)
499   - })
  509 + if (e.detail.value && e.detail.value.replace(/\s+/g, "").length>0){
  510 + this.setData({
  511 + reduce_amount: parseFloat(e.detail.value)
  512 + })
  513 + }
500 514 },
501 515
502 516 showToast: function(data) {
... ...
... ... @@ -224,7 +224,7 @@
224 224 </view>
225 225 <view style='height:70rpx'>
226 226 <text class='text_999_28 ' style='line-height:70rpx'>共同赡养人出生日期:</text>
227   - <text class='text_orange_28 ' style='line-height:70rpx;margin-left:20rpx'>{{itemdetail.birthday}}</text>
  227 + <text class='text_333_28 ' style='line-height:70rpx;margin-left:20rpx'>{{itemdetail.birthday}}</text>
228 228 </view>
229 229 <view style='height:70rpx'>
230 230 <text class='text_999_28 ' style='line-height:70rpx'>共同赡养人国籍:</text>
... ...
注册登录 后发表评论