|
@@ -1,16 +1,17 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
<view class="wrap">
|
|
|
- <u-swiper :list="bannerList" keyName="image" img-mode="scaleToFill" :effect3d="true"></u-swiper>
|
|
|
+ <u-swiper height="200" :list="bannerList" keyName="image" img-mode="scaleToFill" :effect3d="true"></u-swiper>
|
|
|
</view>
|
|
|
<view class="box menu-box">
|
|
|
- <view class="menu-item">
|
|
|
+ <view class="menu-item" v-for="(item, index) in menuList" key="index" @click="navTo(item.path)">
|
|
|
<view class="menu-img">
|
|
|
- <image src="../../static/icon/user.png"></image>
|
|
|
+ <!-- <image src="../../static/icon/user.png"></image> -->
|
|
|
+ <u-icon :name="item.icon" color="#2979ff" size="50"></u-icon>
|
|
|
</view>
|
|
|
- <view class="menu-text">购买确认</view>
|
|
|
+ <view class="menu-text">{{item.menuName}}</view>
|
|
|
</view>
|
|
|
- <view class="menu-item">
|
|
|
+ <!-- <view class="menu-item">
|
|
|
<view class="menu-img">
|
|
|
<image src="../../static/icon/user.png"></image>
|
|
|
</view>
|
|
@@ -51,14 +52,14 @@
|
|
|
<image src="../../static/icon/user.png"></image>
|
|
|
</view>
|
|
|
<view class="menu-text">购买确认确</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
<view class="box msg-box">
|
|
|
<view class="title">
|
|
|
<u-icon name="calendar" color="#ff0000" size="28"></u-icon>
|
|
|
<text>最新资讯</text>
|
|
|
</view>
|
|
|
- <view class="news-box" v-for="(item,index) in newsList">
|
|
|
+ <view class="news-box" v-for="(item,index) in newsList" :key="index">
|
|
|
<view class="news-img">
|
|
|
<image src="https://www.leezon.net/uploads/news/20200314160130384800.jpg"></image>
|
|
|
</view>
|
|
@@ -79,12 +80,16 @@
|
|
|
data() {
|
|
|
return {
|
|
|
bannerList: [],
|
|
|
- newsList: []
|
|
|
+ newsList: [],
|
|
|
+ roleMenu: [],
|
|
|
+ menuList: [],
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
this.getBannerList();
|
|
|
this.getNewsList();
|
|
|
+ this.getRoleMenu();
|
|
|
+ this.getMenu();
|
|
|
},
|
|
|
methods: {
|
|
|
getBannerList() {
|
|
@@ -92,20 +97,45 @@
|
|
|
this.bannerList = resp.data;
|
|
|
})
|
|
|
},
|
|
|
+ getRoleMenu() {
|
|
|
+ let menu = uni.getStorageSync("menu")
|
|
|
+ this.$api.getRoleMenu().then(res => {
|
|
|
+ res.data.map((item1,index) => {
|
|
|
+ menu.map((item2,index1) => {
|
|
|
+ if(item1.appRoleId == item2){
|
|
|
+ this.roleMenu.push(item1.appMenuId)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getMenu() {
|
|
|
+ this.$api.getMenu().then(res => {
|
|
|
+ this.roleMenu.map((item2,index1) => {
|
|
|
+ res.data.map((item1,index) => {
|
|
|
+ if(parseInt(item1.id) == parseInt(item2)){
|
|
|
+ this.menuList.push(item1)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
getNewsList() {
|
|
|
this.$api.getNewestList({
|
|
|
limit: 4
|
|
|
}).then(resp => {
|
|
|
this.newsList = resp.data;
|
|
|
})
|
|
|
+ },
|
|
|
+ navTo(path) {
|
|
|
+ this.$common.to(path)
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
.wrap {
|
|
|
- padding: 10rpx;
|
|
|
+ // padding: 10rpx;
|
|
|
}
|
|
|
|
|
|
.menu-box {
|
|
@@ -121,6 +151,9 @@
|
|
|
text-align: center;
|
|
|
|
|
|
.menu-img {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
image {
|
|
|
height: 64rpx;
|
|
|
width: 64rpx;
|
|
@@ -136,7 +169,8 @@
|
|
|
.box {
|
|
|
padding: 20rpx 40rpx;
|
|
|
width: 90%;
|
|
|
- margin: auto;
|
|
|
+ // margin: auto;
|
|
|
+ margin-top: 10rpx;
|
|
|
background: #fff;
|
|
|
border-radius: 30rpx;
|
|
|
}
|