|
@@ -479,6 +479,7 @@ Page({
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
+
|
|
|
if (!han.test(this.data.addOldname)) {
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
@@ -1104,10 +1105,27 @@ Page({
|
|
|
return
|
|
|
} else {
|
|
|
console.log(this.data.nameArr)
|
|
|
+ let han = /^[\u4e00-\u9fa5]+$/;
|
|
|
+ if (!han.test(e.detail.value )) {
|
|
|
+ wx.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ content: '您输入的内容不是汉字哦'
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+ if (e.detail.value .length < 2) {
|
|
|
+ wx.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ content: '老人姓名不可以少于两个字哦'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
let name = 'nameArr[' + this.data.activeIndex + '].name'
|
|
|
+ let oldName = 'oldInfo[' + this.data.activeIndex + '].name'
|
|
|
this.setData({
|
|
|
oldName: false,
|
|
|
- [name]: e.detail.value
|
|
|
+ [name]: e.detail.value,
|
|
|
+ [oldName]: e.detail.value
|
|
|
})
|
|
|
console.log(this.data.nameArr)
|
|
|
}
|