导航标签缓存

This commit is contained in:
2024-04-18 15:11:55 +08:00
parent 92ef6a11d4
commit 3f98374988
5 changed files with 101 additions and 12 deletions

View File

@@ -31,7 +31,7 @@
</view>
</view>
<view class="sec_menu_wraper" :class="show ? 'popshow' : 'pophide'">
<view class="line"></view>
<view class="pop-title">{{title}}</view>
<view class="sec_menu_w">
<view class="sec_menu-item" :style="{'background-image': 'url(' + require('../../static/image/menu/' + icon + '.png') + ')'}" v-for="(e, i) in secM" :key="i" @click="toPage2(e)">
<view class="menu-name_inner" :class="'bgc_' + (i + 1)">{{e.title}}</view>
@@ -43,8 +43,8 @@
</template>
<script>
import {authority} from '@/utils/getData2.js'
// import {authority} from '@/utils/mork2.js'
// import {authority} from '@/utils/getData2.js'
import {authority} from '@/utils/mork2.js'
export default {
data() {
return {
@@ -55,7 +55,8 @@
show: false,
secM: [],
icon: '',
tab: 1
title: '',
tab: this.$store.getters.navTab
};
},
created () {
@@ -70,7 +71,11 @@
if (res.code === '1') {
this.menuList1 = [...res.result.rf_menu0.sonTree]
this.menuList2 = [...res.result.rf_menu1.sonTree]
this.menuList = [...this.menuList1]
if (this.tab === 2) {
this.menuList = [...this.menuList2]
} else {
this.menuList = [...this.menuList1]
}
} else {
uni.showToast({
title: res.desc,
@@ -87,12 +92,14 @@
this.menuList = [...this.menuList2]
this.tab = 2
}
this.$store.dispatch('setNavTab', type)
},
toPage1 (e) {
if (e.sonTree.length > 0) {
this.show = true
this.secM = e.sonTree
this.icon = e.path
this.title = e.title
}
},
toPage2 (e) {
@@ -229,11 +236,9 @@
border-radius 10rpx
padding 10rpx
overflow hidden
.line
_wh(90rpx, 10rpx)
background-color #e0e0e1
border-radius 4rpx
margin 20rpx auto 40rpx
.pop-title
margin 60rpx 38rpx 0 38rpx
_font(30rpx, 60rpx, #000,700,center)
.cancel
_wh(calc(100% - 76rpx), 100rpx)
margin 0 auto