<input class="weui-input" name="receiptMan" maxlength="10" bindinput="inputVal" data-name="receiptMan" value="{{form.receiptMan}}" placeholder="请输入姓名" />
regStrFn: function(str){
let reg = /([^u0020-u007Eu00A0-u00BEu2E80-uA4CFuF900-uFAFFuFE30-uFE4FuFF00-uFFEFu0080-u009Fu2000-u201fu2026u2022u20ac
])|(s)/g ,
indexArr = reg.exec(str);
if(str.match(reg)) {
str = str.replace(reg, '');
}
let obj = { val: str, index: indexArr}
return obj
},
inputVal: function (e) {
let name = 'form.' + e.target.dataset.name
let val = e.detail.value,
pos = e.detail.cursor;
let reg = /([^u0020-u007Eu00A0-u00BEu2E80-uA4CFuF900-uFAFFuFE30-uFE4FuFF00-uFFEFu0080-u009Fu2000-u201fu2026u2022u20ac
])|(s)/g
if (!reg.test(val)){
return
}
let obj = this.regStrFn(val)
if (pos != -1 && obj.index) {
/ /计算光标的位置
pos = obj.index.index
}
return {
value: obj.val,
cursor: pos
}
},