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

View File

@ -1,6 +1,7 @@
{ {
"navigationStyle": "custom", "navigationStyle": "custom",
"usingComponents": { "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>
<view class="menuContainerView"> <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="menuImg" style="background: no-repeat center/cover url({{IMG_NAME + item.img}});"></view>
<view class="menuTitle">{{item.name}}</view> <view class="menuTitle">{{item.name}}</view>
</view> </view>
@ -26,4 +26,7 @@
<!-- <view class="ownership">{{ownership}}</view> --> <!-- <view class="ownership">{{ownership}}</view> -->
</view> </view>
<!-- 消息通知 -->
<van-notify id="van-notify" />