正在显示
3 个修改的文件
包含
30 行增加
和
4 行删除
| ... | ... | @@ -16,8 +16,8 @@ Page({ |
| 16 | 16 | "house_fund": "住房" |
| 17 | 17 | }, |
| 18 | 18 | singlechildtype:{ |
| 19 | - "D": "独生子女", | |
| 20 | - "S": "非独生子女" | |
| 19 | + "y": "是", | |
| 20 | + "n": "否" | |
| 21 | 21 | }, |
| 22 | 22 | reducetype: { |
| 23 | 23 | "":"月", |
| ... | ... | @@ -58,6 +58,10 @@ Page({ |
| 58 | 58 | this.verifyDate(newdata.rent_start) |
| 59 | 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 | 65 | if (newdata.house_address) { |
| 62 | 66 | if (newdata.house_address.province == newdata.house_address.city) { |
| 63 | 67 | newdata.house_address_new = newdata.house_address.city + newdata.house_address.district |
| ... | ... | @@ -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 | 104 | * Lifecycle function--Called when page is initially rendered |
| 89 | 105 | */ | ... | ... |
| ... | ... | @@ -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 | 492 | bindinput: function(e) { |
| 483 | 493 | console.log("bindinput", e) |
| 484 | 494 | this.setData({ | ... | ... |
| ... | ... | @@ -220,7 +220,7 @@ |
| 220 | 220 | </view> |
| 221 | 221 | <view style='height:70rpx'> |
| 222 | 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 | 224 | </view> |
| 225 | 225 | <view style='height:70rpx'> |
| 226 | 226 | <text class='text_999_28 ' style='line-height:70rpx'>共同赡养人出生日期:</text> |
| ... | ... | @@ -283,7 +283,7 @@ |
| 283 | 283 | </view> |
| 284 | 284 | <view style='height:70rpx'> |
| 285 | 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 | 287 | </view> |
| 288 | 288 | <view style='height:70rpx'> |
| 289 | 289 | <text class='text_999_28 ' style='line-height:70rpx'>病人出生日期:</text> | ... | ... |
请
注册
或
登录
后发表评论