|
@@ -719,10 +719,17 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
addOldName(e) {
|
|
|
+ console.log(e,'我是添加的姓名1111')
|
|
|
this.setData({
|
|
|
addOldname: e.detail.value
|
|
|
})
|
|
|
+ console.log(e.detail.value,'我是添加的姓名222222')
|
|
|
},
|
|
|
+ // addOldNameBlur(e){
|
|
|
+ // this.setData({
|
|
|
+ // addOldname: e.detail.value
|
|
|
+ // })
|
|
|
+ // },
|
|
|
addOldName1(e) {
|
|
|
this.setData({
|
|
|
addOldname1: e.detail.value
|
|
@@ -755,23 +762,24 @@ Page({
|
|
|
shiBaiShow: false
|
|
|
})
|
|
|
},
|
|
|
- sure() {
|
|
|
+ formSubmit(e) {
|
|
|
+ console.log(e.detail.value.oldName,'我是点击确定之后的名字')
|
|
|
let han = /^[\u4e00-\u9fa5]+$/;
|
|
|
- if (this.data.addOldname == '' || this.data.addOldname == null) {
|
|
|
+ if (e.detail.value.oldName == '' || e.detail.value.oldName == null) {
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
|
content: '老人姓名不可以为空哦'
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
- if (!han.test(this.data.addOldname)) {
|
|
|
+ if (!han.test(e.detail.value.oldName)) {
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
|
content: '您输入的内容不是汉字哦'
|
|
|
})
|
|
|
return false;
|
|
|
};
|
|
|
- if (this.data.addOldname.length < 2) {
|
|
|
+ if (e.detail.value.oldName.length < 2) {
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
|
content: '老人姓名不可以少于两个字哦'
|
|
@@ -790,19 +798,20 @@ Page({
|
|
|
appletsId: wx.getStorageSync('openId')
|
|
|
},
|
|
|
data: {
|
|
|
- name: this.data.addOldname
|
|
|
+ name: e.detail.value.oldName
|
|
|
},
|
|
|
success: (res) => {
|
|
|
if (res.data.code == 0) {
|
|
|
let name = 'oldInfo[' + this.data.activeIndex + '].name'
|
|
|
console.log(res.data.data.name)
|
|
|
- console.log(this.data.addOldname)
|
|
|
+ console.log(e.detail.value.oldName,'我是老人输入的姓名')
|
|
|
this.setData({
|
|
|
nameArr: this.data.nameArr.concat(res.data.data),
|
|
|
familyFid: res.data.data.fid,
|
|
|
- [name]: this.data.addOldname,
|
|
|
+ [name]: res.data.data.name,
|
|
|
oldInfo: this.data.oldInfo
|
|
|
})
|
|
|
+ console.log(this.data.nameArr,'我是老人姓名的数组 显示最上方的姓名')
|
|
|
wx.hideLoading();
|
|
|
}
|
|
|
}
|
|
@@ -883,23 +892,24 @@ Page({
|
|
|
visitTimesFromOther: false
|
|
|
})
|
|
|
},
|
|
|
- sure1() {
|
|
|
+ formSubmit1(e) {
|
|
|
+ console.log(e.detail.value.oldName1)
|
|
|
let han = /^[\u4e00-\u9fa5]+$/;
|
|
|
- if (this.data.addOldname1 == '' || this.data.addOldname1 == null) {
|
|
|
+ if (e.detail.value.oldName1 == '' || e.detail.value.oldName1 == null) {
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
|
content: '老人姓名不可以为空哦'
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
- if (!han.test(this.data.addOldname1)) {
|
|
|
+ if (!han.test(e.detail.value.oldName1)) {
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
|
content: '您输入的内容不是汉字哦'
|
|
|
})
|
|
|
return false;
|
|
|
};
|
|
|
- if (this.data.addOldname1.length < 2) {
|
|
|
+ if (e.detail.value.oldName1.length < 2) {
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
|
content: '老人姓名不可以少于两个字哦'
|
|
@@ -919,13 +929,13 @@ Page({
|
|
|
appletsId: wx.getStorageSync('openId')
|
|
|
},
|
|
|
data: {
|
|
|
- name: this.data.addOldname1,
|
|
|
+ name: e.detail.value.oldName1,
|
|
|
fid: this.data.familyFid
|
|
|
},
|
|
|
success: (res) => {
|
|
|
if (res.data.code == 0) {
|
|
|
this.data.oldInfo.push({
|
|
|
- name: this.data.addOldname1,
|
|
|
+ name: e.detail.value.oldName1,
|
|
|
oldSex: [{
|
|
|
name: '男'
|
|
|
}, {
|
|
@@ -1440,6 +1450,16 @@ Page({
|
|
|
},
|
|
|
})
|
|
|
},
|
|
|
+ // tab1Change1(e) {
|
|
|
+ // let name = 'oldInfo[' + this.data.activeIndex + '].name'
|
|
|
+ // this.setData({
|
|
|
+ // [name]: e.detail.value
|
|
|
+ // })
|
|
|
+ // this.SubmitOldmanInfo({
|
|
|
+ // id: this.data.nameArr[this.data.activeIndex]._id,
|
|
|
+ // name: e.detail.value
|
|
|
+ // })
|
|
|
+ // },
|
|
|
// 性别单选
|
|
|
tab1Change2(e) {
|
|
|
let data = this.data.oldInfo[this.data.activeIndex].oldSex.map(v => {
|