123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- <template>
- <view>
- <view class="wrap">
- <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" v-for="(item, index) in menuList" key="index" @click="navTo(item.path)">
- <view class="menu-img">
- <!-- <image src="../../static/icon/user.png"></image> -->
- <u-icon :name="item.icon" color="#2979ff" size="50"></u-icon>
- </view>
- <view class="menu-text">{{item.menuName}}</view>
- </view>
- <!-- <view class="menu-item">
- <view class="menu-img">
- <image src="../../static/icon/user.png"></image>
- </view>
- <view class="menu-text">购买确认确</view>
- </view>
- <view class="menu-item">
- <view class="menu-img">
- <image src="../../static/icon/user.png"></image>
- </view>
- <view class="menu-text">购买确认确</view>
- </view>
- <view class="menu-item">
- <view class="menu-img">
- <image src="../../static/icon/user.png"></image>
- </view>
- <view class="menu-text">购买确认确</view>
- </view>
- <view class="menu-item">
- <view class="menu-img">
- <image src="../../static/icon/user.png"></image>
- </view>
- <view class="menu-text">购买确认确</view>
- </view>
- <view class="menu-item">
- <view class="menu-img">
- <image src="../../static/icon/user.png"></image>
- </view>
- <view class="menu-text">购买确认确</view>
- </view>
- <view class="menu-item">
- <view class="menu-img">
- <image src="../../static/icon/user.png"></image>
- </view>
- <view class="menu-text">购买确认确</view>
- </view>
- <view class="menu-item">
- <view class="menu-img">
- <image src="../../static/icon/user.png"></image>
- </view>
- <view class="menu-text">购买确认确</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" :key="index">
- <view class="news-img">
- <image src="https://www.leezon.net/uploads/news/20200314160130384800.jpg"></image>
- </view>
- <view class="news-item">
- <view class="new-title">{{item.title}}</view>
- <view class="news-notice">
- <view style="flex: 1;display: flex;"><u-icon name="eye-fill"></u-icon>12</view>
- <view style="flex: 3;text-align: right;">2023-12-34 22:00:00</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- bannerList: [],
- newsList: [],
- roleMenu: [],
- menuList: [],
- }
- },
- onLoad() {
- this.getBannerList();
- this.getNewsList();
- this.getRoleMenu();
- //this.getMenu();
- },
- methods: {
- getBannerList() {
- this.$api.getBannerList().then(resp => {
- 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)
- }
- })
- })
- this.getMenu();
- })
-
- },
- 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)
- }
- })
- this.$forceUpdate()
- })
- })
- },
- 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;
- }
- .menu-box {
- height: 300rpx;
- display: flex;
- flex-wrap: wrap;
- gap: 20rpx 40rpx;
- .menu-item {
- width: 128rpx;
- height: 128rpx;
- position: relative;
- text-align: center;
- .menu-img {
- display: flex;
- align-items: center;
- justify-content: center;
- image {
- height: 64rpx;
- width: 64rpx;
- }
- }
- .menu-text {
- font-size: 16rpx;
- }
- }
- }
- .box {
- padding: 20rpx 40rpx;
- width: 90%;
- // margin: auto;
- margin-top: 10rpx;
- background: #fff;
- border-radius: 30rpx;
- }
- .msg-box {
- height: 600rpx;
- margin-top: 10rpx;
- .title {
- font-size: 30rpx;
- line-height: 60rpx;
- display: flex;
- width: 30%;
- border-bottom: 1px solid #e2e2e2;
- }
- }
- .news-box {
- margin-top: 20rpx;
- display: flex;
- height: 140rpx;
- widows: 100vw;
- padding-bottom: 20rpx;
- border-bottom: 1px solid #e2e2e2;
- .news-img image {
- width: 140rpx;
- height: 100%;
- }
- .news-item {
- width: 100vw;
- word-break: break-all;
- .new-title {
- font-size: 28rpx;
- padding: 10rpx 20rpx;
- }
- .news-notice {
- display: flex;
- font-size: 28rpx;
- color: #9e9b9b;
- padding: 20rpx 20rpx 0 20rpx;
- }
- }
- }
- </style>
|