gyh change
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
</view>
|
||||
<!-- 标签 -->
|
||||
<view class="tab_lable">
|
||||
<view :class="{'cur': rSelect.indexOf(index)!=-1}" v-for="(item,index) in tab_lables" :key="index" @click="tapClick(index)">{{item.name}}</view>
|
||||
<view :class="{'cur': rSelect.indexOf(index)!=-1}" v-for="(item,index) in tab_lables" :key="index" @click="tapClick(index,item.id)">{{item.name}}</view>
|
||||
</view>
|
||||
<!-- 提交按钮 -->
|
||||
<view class="submites" @click="toHomePage">{{submites}}</view>
|
||||
@@ -30,12 +30,12 @@
|
||||
show: false,
|
||||
tab_lables: [],
|
||||
submites: '选好了进入首页',
|
||||
rSelect:[]
|
||||
rSelect:[],
|
||||
list: [],
|
||||
};
|
||||
},
|
||||
onLoad(){
|
||||
// 标签的列表展示
|
||||
console.log("11111222")
|
||||
this.$u.api.labelList({
|
||||
|
||||
}).then((res) => {
|
||||
@@ -59,14 +59,17 @@
|
||||
this.show = !this.show
|
||||
},
|
||||
// 点击切换颜色
|
||||
tapClick(index) {
|
||||
console.log(index)
|
||||
tapClick(index,id) {
|
||||
// console.log(id);
|
||||
if (this.rSelect.indexOf(index) == -1) {
|
||||
console.log(index) //打印下标
|
||||
this.rSelect.push(index); //选中添加到数组里
|
||||
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);
|
||||
},
|
||||
toHomePage() {
|
||||
uni.switchTab({
|
||||
|
||||
Reference in New Issue
Block a user