...
|
...
|
@@ -198,9 +198,26 @@ Page({ |
|
|
const add = label_ids.every((label_ids) => {
|
|
|
return label_ids != id
|
|
|
})
|
|
|
if (add) {
|
|
|
// if (add) {
|
|
|
// console.log(add)
|
|
|
if (!(label_list[mindex].data[sindex].status)) {
|
|
|
label_ids.push(id)
|
|
|
console.log(22, label_ids)
|
|
|
} else {
|
|
|
for (var i = 0; i < label_ids.length; i++) {
|
|
|
// if (!(label_list[mindex].data[sindex].status)) {
|
|
|
if (label_list[mindex].data[sindex].id == label_ids[i]) {
|
|
|
label_ids.splice(i, 1);
|
|
|
console.log(11, label_ids)
|
|
|
}
|
|
|
// }
|
|
|
}
|
|
|
}
|
|
|
// }
|
|
|
// console.log(label_list, label_ids)
|
|
|
|
|
|
|
|
|
|
|
|
label_list[mindex].data[sindex].status = !(label_list[mindex].data[sindex].status)
|
|
|
this.setData({
|
|
|
label_list: label_list,
|
...
|
...
|
@@ -249,17 +266,16 @@ Page({ |
|
|
|
|
|
//成员信息的修改,新增
|
|
|
listVerify(e) {
|
|
|
console.log(111)
|
|
|
let that = this;
|
|
|
var warn = "";
|
|
|
var flag = true;
|
|
|
var state = that.data.state
|
|
|
var list = this.data.list;
|
|
|
var sex_index = parseInt(this.data.sex_index)
|
|
|
var sex_index = (this.data.sex_index)
|
|
|
console.log(sex_index, sex_index == '')
|
|
|
if (list.name == "") {
|
|
|
warn = "请填写您的姓名";
|
|
|
} else if (sex_index==''&&sex_index!=0) {
|
|
|
} else if (sex_index == undefined) {
|
|
|
warn = "请填写您的性别";
|
|
|
} else if (list.family_role == '') {
|
|
|
warn = '请填写您的家庭角色'
|
...
|
...
|
@@ -280,7 +296,7 @@ Page({ |
|
|
mid: list.mid,
|
|
|
user_status: list.user_status,
|
|
|
status_num: list.status_num,
|
|
|
picurl: this.data.hasimg,
|
|
|
picurl: list.picurl,
|
|
|
text: list.text,
|
|
|
label_ids: this.data.label_ids,
|
|
|
family_id: that.data.familyid,
|
...
|
...
|
@@ -295,9 +311,9 @@ Page({ |
|
|
title: '录入成功',
|
|
|
})
|
|
|
wx.setStorageSync('familyid', res.data.data.family_id)
|
|
|
setTimeout(()=>{
|
|
|
setTimeout(() => {
|
|
|
wx.navigateBack()
|
|
|
},1500)
|
|
|
}, 1500)
|
|
|
// wx.navigateTo({
|
|
|
// url: '/pages/index/addNewFamily/addNewFamily?familyid=' + res.data.data.family_id,
|
|
|
// })
|
...
|
...
|
@@ -338,21 +354,22 @@ Page({ |
|
|
for (var j = 0; j < label_list[i].data.length; j++) {
|
|
|
if (label_list[i].data[j].status == 1) {
|
|
|
label_ids.push(label_list[i].data[j].id)
|
|
|
label_list[i].data[j].status = true
|
|
|
} else {
|
|
|
label_list[i].data[j].status = false
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
var list = res.data.data.list;
|
|
|
list.sex = res.data.data.list.sex;
|
|
|
console.log(list.sex)
|
|
|
that.setData({
|
|
|
list: list,
|
|
|
label_list: res.data.data.label_list,
|
|
|
label_list: label_list,
|
|
|
sex_index: res.data.data.list.sex,
|
|
|
card_index: parseInt(res.data.data.list.user_status) - 1,
|
|
|
addsess_current: res.data.data.list.mid,
|
|
|
label_ids: label_ids
|
|
|
})
|
|
|
|
|
|
}
|
|
|
}).catch((errMsg) => {
|
|
|
console.log(errMsg)
|
...
|
...
|
|