feat(specialArea/list): tab页签展示逻辑变更,当只有一个的情况下不展示,修复了之前异步的问题
This commit is contained in:
parent
b3c76bf7a5
commit
7e4d43b517
|
@ -17,7 +17,7 @@
|
||||||
<img :src="pkCountryImg" alt="" />
|
<img :src="pkCountryImg" alt="" />
|
||||||
<u-icon name="arrow-down" color="#999"></u-icon>
|
<u-icon name="arrow-down" color="#999"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<u-scroll-list :indicator="false" v-if="itemChildren.length > 0" class="tabList_a">
|
<u-scroll-list :indicator="false" v-if="itemChildren.length > 1" class="tabList_a">
|
||||||
<view class="tab">
|
<view class="tab">
|
||||||
<view v-for="(item, index) in itemChildren" :key="index" @click="setSpecial(item)" v-show="item.isShow"
|
<view v-for="(item, index) in itemChildren" :key="index" @click="setSpecial(item)" v-show="item.isShow"
|
||||||
:class="[specialArea == item.value ? 'actTab' : 'tab_i']">
|
:class="[specialArea == item.value ? 'actTab' : 'tab_i']">
|
||||||
|
@ -175,23 +175,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.titLabel = options.label;
|
this.titLabel = options.label;
|
||||||
let arr = JSON.parse(options.children);
|
let tempArr = JSON.parse(options.children);
|
||||||
if (this.specialArea != 18) {
|
if (this.specialArea != 18) {
|
||||||
arr.forEach((ctem) => {
|
|
||||||
ctem.isShow = false;
|
|
||||||
});
|
|
||||||
api.menuList().then((res) => {
|
api.menuList().then((res) => {
|
||||||
res.data.forEach((item) => {
|
tempArr = tempArr.filter(item => res.data.find(ctem => ctem.menuKey == item.name));
|
||||||
arr.forEach((ctem) => {
|
this.itemChildren = tempArr;
|
||||||
if (ctem.name == item.menuKey) {
|
|
||||||
ctem.isShow = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.itemChildren = arr;
|
|
||||||
// 修改标题
|
// 修改标题
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: this.titLabel,
|
title: this.titLabel,
|
||||||
|
|
Loading…
Reference in New Issue