|
@@ -6,7 +6,22 @@
|
|
right-text=""
|
|
right-text=""
|
|
bind:click-left=""
|
|
bind:click-left=""
|
|
bind:click-right=""
|
|
bind:click-right=""
|
|
- />
|
|
|
|
|
|
+ >
|
|
|
|
+ </van-nav-bar>
|
|
|
|
+ <div class="dropdown-div">
|
|
|
|
+ <van-dropdown-menu active-color="#1989fa">
|
|
|
|
+ <van-dropdown-item
|
|
|
|
+ v-model="engineeringWorkChooseValue"
|
|
|
|
+ :options="engineeringWorkList"
|
|
|
|
+ :title="
|
|
|
|
+ engineeringWorkChooseValue
|
|
|
|
+ ? engineeringWorkChooseValue.text
|
|
|
|
+ : '工种选择'
|
|
|
|
+ "
|
|
|
|
+ @change="handleChangeEngneeringWorkFun"
|
|
|
|
+ />
|
|
|
|
+ </van-dropdown-menu>
|
|
|
|
+ </div>
|
|
<transition name="tab" mode="out-in">
|
|
<transition name="tab" mode="out-in">
|
|
<component :is="currentComponents" class="page" />
|
|
<component :is="currentComponents" class="page" />
|
|
</transition>
|
|
</transition>
|
|
@@ -14,7 +29,7 @@
|
|
v-model="activeTabName"
|
|
v-model="activeTabName"
|
|
active-color="#0088e9"
|
|
active-color="#0088e9"
|
|
inactive-color="#808080"
|
|
inactive-color="#808080"
|
|
- @change="onChange"
|
|
|
|
|
|
+ @change="onChangeTabFun"
|
|
>
|
|
>
|
|
<van-tabbar-item v-for="(item, index) in tabbars" :key="index">
|
|
<van-tabbar-item v-for="(item, index) in tabbars" :key="index">
|
|
<span>{{ item.title }}</span>
|
|
<span>{{ item.title }}</span>
|
|
@@ -64,7 +79,9 @@ export default {
|
|
iconInactive: require("@/assets/image/homeTab/person.png"),
|
|
iconInactive: require("@/assets/image/homeTab/person.png"),
|
|
iconActive: require("@/assets/image/homeTab/personActive.png")
|
|
iconActive: require("@/assets/image/homeTab/personActive.png")
|
|
}
|
|
}
|
|
- ]
|
|
|
|
|
|
+ ],
|
|
|
|
+ engineeringWorkChooseValue: null, // 工种选择的值
|
|
|
|
+ engineeringWorkList: "" // 工种可选列表
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -77,6 +94,7 @@ export default {
|
|
this.getCollection();
|
|
this.getCollection();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 初始化
|
|
initFun() {
|
|
initFun() {
|
|
this.$store.commit("updateUserItemStore", {
|
|
this.$store.commit("updateUserItemStore", {
|
|
field: "userInfo",
|
|
field: "userInfo",
|
|
@@ -94,12 +112,30 @@ export default {
|
|
group: "临时用户"
|
|
group: "临时用户"
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ this.engineeringWorkList = [
|
|
|
|
+ { text: "桥隧工", value: 0 },
|
|
|
|
+ { text: "桥梁工", value: 1 },
|
|
|
|
+ { text: "线路工", value: 2 }
|
|
|
|
+ ];
|
|
this.activeTabName = 0;
|
|
this.activeTabName = 0;
|
|
- this.currentComponents = this.tabbars[this.activeTabName].pageName;
|
|
|
|
|
|
+ this.onChangeTabFun(this.activeTabName);
|
|
},
|
|
},
|
|
- onChange(index) {
|
|
|
|
|
|
+ // 操作:切换tab
|
|
|
|
+ onChangeTabFun(index) {
|
|
this.currentComponents = this.tabbars[this.activeTabName].pageName;
|
|
this.currentComponents = this.tabbars[this.activeTabName].pageName;
|
|
},
|
|
},
|
|
|
|
+ // 操作:选择了工种
|
|
|
|
+ handleChangeEngneeringWorkFun(value) {
|
|
|
|
+ let resultItem = null;
|
|
|
|
+ for (let i = 0; i < this.engineeringWorkList.length; i++) {
|
|
|
|
+ let item = this.engineeringWorkList[i];
|
|
|
|
+ if (value === item.value) {
|
|
|
|
+ resultItem = item;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ console.log("选择的工种信息:", resultItem);
|
|
|
|
+ },
|
|
// 获取所有收藏
|
|
// 获取所有收藏
|
|
getCollection() {
|
|
getCollection() {
|
|
let path = {
|
|
let path = {
|
|
@@ -135,5 +171,24 @@ export default {
|
|
.home-box {
|
|
.home-box {
|
|
height: 100%; // 不要设置vh,手机浏览器计算问题
|
|
height: 100%; // 不要设置vh,手机浏览器计算问题
|
|
padding-bottom: 2rem; // 多2em,避免tab栏挡住内容
|
|
padding-bottom: 2rem; // 多2em,避免tab栏挡住内容
|
|
|
|
+ .dropdown-div {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 0;
|
|
|
|
+ right: 0.5rem;
|
|
|
|
+ width: 5rem;
|
|
|
|
+ height: 2.09091rem;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ z-index: 1000;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|
|
|
|
+<style lang="scss">
|
|
|
|
+.home-box {
|
|
|
|
+ .van-dropdown-menu__bar {
|
|
|
|
+ background-color: #7cc8ff;
|
|
|
|
+ .van-ellipsis {
|
|
|
|
+ font-size: 0.6rem;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|