当前位置:网站首页>[input ID number] is replaced by an asterisk, and input is cut into multiple small squares (similar)
[input ID number] is replaced by an asterisk, and input is cut into multiple small squares (similar)
2022-07-28 21:09:00 【Hey, little apple】
The first one is , ID number check , also Specific date Show **** Instead of
<div class="list">
<div> ID number </div>
<input placeholder=" Please input ID card number " type="text" v-model="idNumber" @blur="idNumberFun"/>
</div>
idNumberFun(){
var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if(reg.test(this.idNumber) === false){
this.$toast(' Please enter the correct ID number ');
return false;
}
this.requstIdNumber = this.idNumber
this.idNumber = this.changeIdCardIncludeStart(this.idNumber)
console.log(this.idNumber,'-===',this.requstIdNumber)
},
changeIdCardIncludeStart (cardId) {
const newStr = cardId.replace(/^(.{6})(?:\d+)(.{4})$/,"$1****$2");
return newStr;
},
The second kind , coordination vant Of ID card keyboard 
<div class="cardbox" @click="open">
<span>{
{
card1}}</span>
<span>{
{
card2}}</span>
<span>{
{
card3}}</span>
<span>{
{
card4}}</span>
<span>{
{
card5}}</span>
<span>{
{
card6}}</span>
<span>{
{
card7}}</span>
<span>{
{
card8}}</span>
<span>{
{
card9}}</span>
<span>{
{
card10}}</span>
<span class="xingbox">*</span>
<span class="xingbox">*</span>
<span class="xingbox">*</span>
<span class="xingbox">*</span>
<span>{
{
card15}}</span>
<span>{
{
card16}}</span>
<span>{
{
card17}}</span>
<span>{
{
card18}}</span>
</div>
<van-number-keyboard
v-model="value"
extra-key="X"
close-button-text=" complete "
:show="showKeyboard"
@blur="closekeyboard"
@close="closekeyboard"
/>
data() {
return {
value: '', // watch monitor Real time input Numbers
showKeyboard: false, // Whether the keyboard pops up
cardarr:[], // Deposit Input number Array
card1:'',
card2:'',
card3:'',
card4:'',
card5:'',
card6:'',
card7:'',
card8:'',
card9:'',
card10:'',
card15:'',
card16:'',
card17:'',
card18:'',
xing:'*'
}
}
watch: {
value(value) {
// character string turn Array Be similar to 123 turn 【1,2,3】
this.cardarr = [ ...value ]
// Because in the middle Four digit turn **** Instead of , therefore , A total of 14 Digit number
if(this.cardarr.length > 14){
this.cardarr = this.cardarr.splice(0,14);
this.value = this.value.substring(0,14);
}
this.card1 = this.cardarr[0]
this.card2 = this.cardarr[1]
this.card3 = this.cardarr[2]
this.card4 = this.cardarr[3]
this.card5 = this.cardarr[4]
this.card6 = this.cardarr[5]
this.card7 = this.cardarr[6]
this.card8 = this.cardarr[7]
this.card9 = this.cardarr[8]
this.card10 = this.cardarr[9]
this.card15 = this.cardarr[10]
this.card16 = this.cardarr[11]
this.card17 = this.cardarr[12]
this.card18 = this.cardarr[13]
},
},
// Open the keyboard
methods:{
open(){
this.showKeyboard = true
this.cardarr = []
this.value = ''
this.card1 = ''
this.card2 = ''
this.card3 = ''
this.card4 = ''
this.card5 = ''
this.card6 = ''
this.card7 = ''
this.card8 = ''
this.card9 = ''
this.card10 = ''
this.card15 = ''
this.card16 = ''
this.card17 = ''
this.card18 = ''
},
// Turn off the keyboard
closekeyboard(){
this.showKeyboard = false
if(this.cardarr.length < 14){
this.$toast(' Please enter the correct ID number ');
return false;
}
this.idNumber = this.value
this.requstIdNumber = this.idNumber
// ID number Spliced like this 4108820000****1222
this.requstIdNumber = this.requstIdNumber.slice(0,10) + "****" + this.requstIdNumber.slice(10,14)
},
}
边栏推荐
- The cloud native programming challenge is hot, with 510000 bonus waiting for you to challenge!
- 九鑫智能正式加入openGauss社区
- ctfshow 网络迷踪做题记录(2)
- 取色器实战(Qt含源码)
- Confusing knowledge points of software designer examination
- EfficientFormer:轻量化ViT Backbone
- Observer mode, object pool
- DLL decompile (decompile encrypted DLL)
- 又一款装机神器
- ctfshow 网络迷踪做题记录(1)
猜你喜欢

BUUCTF做题Upload-Labs记录pass-11~pass-20

Unity - Fundamentals of 3D mathematics

Ctfshow network lost track record (2)

Moco V2: further upgrade of Moco series

ctfshow 网络迷踪做题记录(1)

The development of smart home industry pays close attention to edge computing and applet container technology

How to modify the ID of NetApp expansion enclosure disk shelf

Eureka registers with each other, only showing each other or only showing problems in one

什么是 CI/CD? | 实现更快更好的软件交付

Explain various coordinate systems in unity in detail
随机推荐
mysql梳理复习内容--附思维导图
C # basic 3-value type and reference type, packing and unpacking
Report redirect after authorized login on wechat official account_ The problem of wrong URI parameters
58岁安徽人,干出瑞士今年最大IPO 投资界
作业 ce
上市1个月接连发生两起安全事故,理想L9还理想吗?
Baklib|为什么说企业需要重视客户体验?
Cause analysis of restart of EMC cx4-120 SPB controller
(转)冒泡排序及优化详解
The cloud native programming challenge is hot, with 510000 bonus waiting for you to challenge!
Integrating database Ecology: using eventbridge to build CDC applications
Space shooting Lesson 10: score (painting and writing)
Eureka registers with each other, only showing each other or only showing problems in one
Young freshmen yearn for more open source | here comes the escape guide from open source to employment!
mfc wpf winform(工业用mfc还是qt)
MoCo V1:视觉领域也能自监督啦
小程序容器技术,让移动研发效率提升500%
ctfshow 网络迷踪做题记录(2)
Unity3d tutorial notes - unity initial 04
Observer mode, object pool