This commit is contained in:
SelfRidicule 2024-08-16 14:51:54 +08:00
parent 4a7ca87407
commit 70559fbf50
3 changed files with 17 additions and 6 deletions

View File

@ -1,5 +1,7 @@
const app = getApp()
import Notify from '@vant/weapp/notify/notify';
Page({
/**
@ -52,9 +54,14 @@ Page({
jumpMenu(e) {
console.log('jumpMenu', e);
let obj = e.currentTarget.dataset.obj
if (obj.visible) {
wx.navigateTo({
url: obj.path,
})
} else {
app.vantNotifyErrTop(Notify, `"${obj.name}"无权限访问!`)
return
}
},
// 展示模块

View File

@ -1,6 +1,7 @@
{
"navigationStyle": "custom",
"usingComponents": {
"van-icon": "@vant/weapp/icon/index"
"van-icon": "@vant/weapp/icon/index",
"van-notify": "@vant/weapp/notify/index"
}
}

View File

@ -18,7 +18,7 @@
</view>
<view class="menuContainerView">
<view class="menuView" wx:for="{{menuList}}" wx:key="*this" bind:tap="jumpMenu" data-obj="{{item}}" wx:if="{{item.visible}}">
<view class="menuView" wx:for="{{menuList}}" wx:key="*this" bind:tap="jumpMenu" data-obj="{{item}}">
<view class="menuImg" style="background: no-repeat center/cover url({{IMG_NAME + item.img}});"></view>
<view class="menuTitle">{{item.name}}</view>
</view>
@ -27,3 +27,6 @@
<!-- <view class="ownership">{{ownership}}</view> -->
</view>
<!-- 消息通知 -->
<van-notify id="van-notify" />