This commit is contained in:
Gdpao
2020-08-01 11:16:53 +08:00
parent f30c4f4922
commit 5b31193750
11 changed files with 279 additions and 125 deletions

View File

@@ -59,25 +59,35 @@
},
// 点击切换颜色
tapClick(index, id) {
// console.log(id);
// console.log(index);
if (this.rSelect.indexOf(index) == -1) {
this.rSelect.push(index); // 选中状态
this.list.push(id); //选中添加到数组里
if (this.rSelect.length > 9) {
this.$u.toast("只能选择10个标签");
return false;
}
this.rSelect.push(index); // 选中状态
this.list.push(id); //选中添加到数组里
} else {
this.rSelect.splice(this.rSelect.indexOf(index), 1); //取消
this.list.splice(this.rSelect.indexOf(id), 1); //取消
}
// console.log(this.rSelect);
// console.log(this.list);
console.log(this.list);
},
toHomePage() {
uni.switchTab({
url: '/pages/index/index'
});
this.$u.post("StartUp/addLabel", {
label_ids: this.list
}).then(res => {
// console.log(res);
if (res.errCode == 0) {
// this.$u.toast(res.message);
uni.switchTab({
url: '/pages/index/index'
});
} else {
this.$u.toast(res.message);
}
})
},
}