提交 a82d0ad7102dab340bd8eece57dfbf8c26f11705

作者 wangyu
1 个父辈 dae8172d

优化 解决bug

@@ -16,8 +16,8 @@ Page({ @@ -16,8 +16,8 @@ Page({
16 "house_fund": "住房" 16 "house_fund": "住房"
17 }, 17 },
18 singlechildtype:{ 18 singlechildtype:{
19 - "D": "独生子女",  
20 - "S": "非独生子女" 19 + "y": "是",
  20 + "n": "否"
21 }, 21 },
22 reducetype: { 22 reducetype: {
23 "":"月", 23 "":"月",
@@ -58,6 +58,10 @@ Page({ @@ -58,6 +58,10 @@ Page({
58 this.verifyDate(newdata.rent_start) 58 this.verifyDate(newdata.rent_start)
59 this.verifyDate(newdata.rent_end) 59 this.verifyDate(newdata.rent_end)
60 60
  61 + newdata.children_id_card_no = this.formatIdNum(newdata.children_id_card_no)
  62 + newdata.spouse_id_card_no = this.formatIdNum(newdata.spouse_id_card_no)
  63 + newdata.id_card_no = this.formatIdNum(newdata.id_card_no)
  64 +
61 if (newdata.house_address) { 65 if (newdata.house_address) {
62 if (newdata.house_address.province == newdata.house_address.city) { 66 if (newdata.house_address.province == newdata.house_address.city) {
63 newdata.house_address_new = newdata.house_address.city + newdata.house_address.district 67 newdata.house_address_new = newdata.house_address.city + newdata.house_address.district
@@ -84,6 +88,18 @@ Page({ @@ -84,6 +88,18 @@ Page({
84 } 88 }
85 }, 89 },
86 90
  91 + formatIdNum: function (idnum) {
  92 + if (idnum && idnum.length >= 6 && idnum.length < 10) {
  93 + idnum = idnum.substring(0, 2) + '****' + idnum.substring(idnum.length - 2, idnum.length);
  94 + }
  95 + if (idnum && idnum.length >= 10) {
  96 + idnum = idnum.substring(0, 4) + '****' + idnum.substring(idnum.length - 4, idnum.length);
  97 + }
  98 +
  99 + console.log("formatIdNum", idnum)
  100 + return idnum
  101 + },
  102 +
87 /** 103 /**
88 * Lifecycle function--Called when page is initially rendered 104 * Lifecycle function--Called when page is initially rendered
89 */ 105 */
@@ -479,6 +479,16 @@ Page({ @@ -479,6 +479,16 @@ Page({
479 } 479 }
480 }, 480 },
481 481
  482 + formatIdNum: function (idnum) {
  483 + if (idnum && idnum.length >= 6 && idnum.length < 10) {
  484 + return idnum.substring(0, 2) + '****' + idnum.substring(idnum.length - 2, idnum.length);
  485 + } else if (idnum.length >= 10) {
  486 + return idnum.substring(0, 4) + '****' + idnum.substring(idnum.length - 4, idnum.length);
  487 + } else {
  488 + return idnum
  489 + }
  490 + },
  491 +
482 bindinput: function(e) { 492 bindinput: function(e) {
483 console.log("bindinput", e) 493 console.log("bindinput", e)
484 this.setData({ 494 this.setData({
@@ -220,7 +220,7 @@ @@ -220,7 +220,7 @@
220 </view> 220 </view>
221 <view style='height:70rpx'> 221 <view style='height:70rpx'>
222 <text class='text_999_28 ' style='line-height:70rpx'>共同赡养人证照号码:</text> 222 <text class='text_999_28 ' style='line-height:70rpx'>共同赡养人证照号码:</text>
223 - <text class='text_333_28 ' style='line-height:70rpx;margin-left:20rpx'>{{itemdetail.id_card_no}}</text> 223 + <text class='text_333_28 ' style='line-height:70rpx;margin-left:20rpx'>{{formatIdNum(itemdetail.id_card_no)}}</text>
224 </view> 224 </view>
225 <view style='height:70rpx'> 225 <view style='height:70rpx'>
226 <text class='text_999_28 ' style='line-height:70rpx'>共同赡养人出生日期:</text> 226 <text class='text_999_28 ' style='line-height:70rpx'>共同赡养人出生日期:</text>
@@ -283,7 +283,7 @@ @@ -283,7 +283,7 @@
283 </view> 283 </view>
284 <view style='height:70rpx'> 284 <view style='height:70rpx'>
285 <text class='text_999_28 ' style='line-height:70rpx'>病人证照号码:</text> 285 <text class='text_999_28 ' style='line-height:70rpx'>病人证照号码:</text>
286 - <text class='text_333_28 ' style='line-height:70rpx;margin-left:20rpx'>{{item.id_card_no}}</text> 286 + <text class='text_333_28 ' style='line-height:70rpx;margin-left:20rpx'>{{formatIdNum(item.id_card_no)}}</text>
287 </view> 287 </view>
288 <view style='height:70rpx'> 288 <view style='height:70rpx'>
289 <text class='text_999_28 ' style='line-height:70rpx'>病人出生日期:</text> 289 <text class='text_999_28 ' style='line-height:70rpx'>病人出生日期:</text>
注册登录 后发表评论