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

@@ -180,9 +180,15 @@
return false
} else {
me.loginIn(res.data.token); //存储一个字符传值
uni.navigateTo({
url: '/pageA/topick/topick'
})
if (res.data.member.has_labels) {
uni.switchTab({
url: '/pages/index/index'
})
} else {
uni.navigateTo({
url: '/pageA/topick/topick'
})
}
// 缓存用户的信息
// uni.setStorageSync({
// key: 'user_info',
@@ -198,7 +204,6 @@
}
// 存储接口请求所需token
me.loginIn(res.data.token); //存储一个字符传值
// // 注册返回参数
// this.$refs.uToast.show({
// title: res.message,

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);
}
})
},
}