导航页
This commit is contained in:
@@ -1,69 +1,70 @@
|
||||
<template>
|
||||
<view class="zd_content">
|
||||
<view class="header">首页</view>
|
||||
<view class="userInfo-wrap">
|
||||
<view class="userInfo">
|
||||
<text class="p1">{{$store.getters.userInfo !== '' ? JSON.parse($store.getters.userInfo).user_name : ''}}</text>
|
||||
<text class="p2">欢迎进入铜箔手持系统!</text>
|
||||
</view>
|
||||
<view class="exit" @tap="Quit">
|
||||
<view class="icon-exit"></view>
|
||||
<view class="exit-text">退出</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd_wrapper">
|
||||
<view class="menu-wrap">
|
||||
<view class="menu-item" v-for="(e, i) in menuList" :key="i" @tap="toPage1(e)">
|
||||
<image class="menu-img" :src="require('../../static/image/menu/' + e.path + '.png')" alt="">
|
||||
<view class="menu-name">{{e.title}}</view>
|
||||
<view class="home_wraper">
|
||||
<view class="zd_content">
|
||||
<view class="header">首页</view>
|
||||
<view class="userInfo-wrap">
|
||||
<view class="userInfo">
|
||||
<text v-if="userName !== ''" class="p1">{{userName}}</text>
|
||||
<text class="p2">欢迎进入铜箔手持系统!</text>
|
||||
</view>
|
||||
<view class="exit" @tap="Quit">
|
||||
<view class="icon-exit"></view>
|
||||
<view class="exit-text">退出</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="show === true" class="sec_menu_wraper">
|
||||
<view class="sec_menu_w">
|
||||
<view class="menu-item" v-for="(e, i) in secM" :key="i" @click="toPage2(e)">
|
||||
<view class="sec_menu-col_inner">
|
||||
<view class="menu-name menu-name_inner">{{e.title}}</view>
|
||||
<view class="zd_home_wrapper">
|
||||
<view class="menu-wrap">
|
||||
<view class="menu-item" v-for="(e, i) in menuList" :key="i" @tap="toPage1(e)">
|
||||
<image class="menu-img" :src="require('../../static/image/menu/' + e.path + '.png')" alt="">
|
||||
<view class="menu-name">{{e.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cancel">
|
||||
</view>
|
||||
<view class="sec_menu_wraper" :class="show ? 'popshow' : 'pophide'">
|
||||
<!-- <view class="cancel">
|
||||
<view class="iconfont cancel_icon" @tap="show = false"></view>
|
||||
</view> -->
|
||||
<view class="line"></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>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="show" class="modal" @click.stop="show = false"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {authority1} from '@/utils/getData2.js'
|
||||
// import {authority} from '@/utils/getData2.js'
|
||||
import {authority} from '@/utils/mork2.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userName: '',
|
||||
menuList: [],
|
||||
show: false,
|
||||
secM: []
|
||||
secM: [],
|
||||
icon: ''
|
||||
};
|
||||
},
|
||||
created () {
|
||||
if (this.$store.getters.userInfo) {
|
||||
this.userName = JSON.parse(this.$store.getters.userInfo).username
|
||||
}
|
||||
this._authority()
|
||||
},
|
||||
methods: {
|
||||
async _authority () {
|
||||
let res = await authority1()
|
||||
if (res.code === '1') {
|
||||
this.menuList = [...res.result.sonTree]
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
let res = await authority()
|
||||
this.menuList = [...res.result.sonTree]
|
||||
},
|
||||
toPage1 (e) {
|
||||
if (e.sonTree.length > 0) {
|
||||
this.show = true
|
||||
this.secM = e.sonTree
|
||||
this.icon = e.path
|
||||
}
|
||||
},
|
||||
toPage2 (e) {
|
||||
@@ -84,11 +85,23 @@
|
||||
|
||||
<style lang="stylus">
|
||||
@import '../../common/style/mixin.styl';
|
||||
.home_wraper
|
||||
_wh(100%, 100%)
|
||||
overflow: hidden
|
||||
.zd_content
|
||||
padding-top 0
|
||||
padding 0 20rpx
|
||||
height calc(100% - var(--status-bar-height) - 72rpx)
|
||||
// background linear-gradient(to bottom, #f8e6db 0%, #f6f6f6 30%, #f6f6f6 100%)
|
||||
margin-top calc(var(--status-bar-height) + 72rpx)
|
||||
.header
|
||||
height 86rpx
|
||||
_font(36rpx,86rpx,#333,,center)
|
||||
position fixed
|
||||
left 0
|
||||
top 0
|
||||
padding-top var(--status-bar-height)
|
||||
z-index 100
|
||||
_wh(100%, calc(var(--status-bar-height) + 72rpx))
|
||||
// background-color #f8e6db
|
||||
_font(36rpx,72rpx,#333,,center)
|
||||
.userInfo-wrap
|
||||
_fj()
|
||||
_wh(100%,160rpx)
|
||||
@@ -96,27 +109,36 @@
|
||||
background-color $red
|
||||
_bis('../../static/image/info_bg.png',auto,100%,right,bottom)
|
||||
border-radius 12rpx
|
||||
margin-bottom 20rpx
|
||||
margin-bottom 24rpx
|
||||
.userInfo
|
||||
_fj(,flex-start,column)
|
||||
.p1
|
||||
_font(34rpx,1,#fff)
|
||||
_font(32rpx,1,#fff)
|
||||
padding-bottom 18rpx
|
||||
.p2
|
||||
_font(26rpx,1,#fff)
|
||||
_font(28rpx,1,#fff)
|
||||
.exit
|
||||
_fj()
|
||||
height 47rpx
|
||||
padding 0 15rpx
|
||||
height 48rpx
|
||||
padding 0 20rpx
|
||||
border 1px solid #FF967C
|
||||
border-radius 20rpx
|
||||
.icon-exit
|
||||
_wh(22rpx, 22rpx)
|
||||
_bis('../../static/image/exit.png',22rpx)
|
||||
.exit-text
|
||||
_font(24rpx,47rpx,#fff,,right)
|
||||
_font(28rpx,48rpx,#fff,,right)
|
||||
padding-left 10rpx
|
||||
.zd_home_wrapper
|
||||
_wh(100%, calc(100% - 208rpx))
|
||||
background-color #fff
|
||||
border-radius: 12rpx;
|
||||
padding: 24rpx 14rpx;
|
||||
margin-bottom: 24rpx;
|
||||
overflow-y auto
|
||||
box-shadow 0 4rpx 10rpx 2rpx rgba(0,0,0,.1)
|
||||
.menu-wrap
|
||||
_wh(100%, auto)
|
||||
_fj(flex-start,flex-start,,wrap)
|
||||
align-content: flex-start
|
||||
.menu-item
|
||||
@@ -124,54 +146,87 @@
|
||||
flex-direction column
|
||||
_wh(30%, auto)
|
||||
margin-bottom 40rpx
|
||||
_font(26rpx, 60rpx,#e74f1a,,center)
|
||||
_font(26rpx, 28rpx,#e74f1a,,center)
|
||||
&:nth-child(3n+2)
|
||||
margin-left 5%
|
||||
margin-right 5%
|
||||
::v-deep .menu-img
|
||||
_wh(100%, auto)
|
||||
margin-bottom 16rpx
|
||||
img
|
||||
position relative
|
||||
opacity 1
|
||||
_wh(55%, auto)
|
||||
background-color: #f3f5f8
|
||||
box-shadow 8rpx 6rpx 10rpx 0px rgba(0,0,0,0.1)
|
||||
padding 16rpx
|
||||
border-radius 50%
|
||||
margin 0 auto 0.2rpx
|
||||
.menu-name
|
||||
_font(28rpx, 38rpx, #444,,center)
|
||||
_font(28rpx, 30rpx, #444,,center)
|
||||
.sec_menu_wraper
|
||||
position fixed
|
||||
top 0
|
||||
bottom 0
|
||||
left 0
|
||||
width 100%
|
||||
background-color #f4f5f5
|
||||
box-shadow 0 -8px 16px 0 rgba(28,31,33,.1)
|
||||
border-top-left-radius 20rpx
|
||||
border-top-right-radius 20rpx
|
||||
z-index 2017
|
||||
transition all .3s
|
||||
.modal
|
||||
position fixed
|
||||
bottom 0
|
||||
left 0
|
||||
_wh(100%, 100%)
|
||||
background-color rgba(0, 0, 0, .9)
|
||||
z-index 2017
|
||||
flex-direction column
|
||||
background-color rgba(0,0,0,0.8)
|
||||
z-index 2010
|
||||
.sec_menu_w
|
||||
_fj()
|
||||
_wh(100%, calc(100% - 100rpx))
|
||||
padding 0 24rpx
|
||||
width calc(100% - 76rpx)
|
||||
margin 30rpx auto 60rpx auto
|
||||
_fj(flex-start)
|
||||
flex-wrap wrap
|
||||
align-content center
|
||||
&::after
|
||||
content ''
|
||||
display block
|
||||
_wh(30%,0)
|
||||
.sec_menu-col
|
||||
background-color transparent
|
||||
border none
|
||||
height auto
|
||||
.sec_menu-col_inner
|
||||
_fj(center)
|
||||
_wh(160rpx, 160rpx)
|
||||
border-radius 50%
|
||||
background-color $yellow
|
||||
margin 0 auto
|
||||
.sec_menu-item
|
||||
_wh(30%, 120rpx)
|
||||
margin-bottom 20rpx
|
||||
border-radius 10rpx
|
||||
background-size 40% auto
|
||||
background-position right 90%
|
||||
background-repeat no-repeat
|
||||
&:nth-child(3n+2)
|
||||
margin-left 5%
|
||||
margin-right 5%
|
||||
.menu-name_inner
|
||||
color #fff
|
||||
padding 0 20rpx
|
||||
_wh(100%, 100%)
|
||||
_fj(center)
|
||||
_font(28rpx, 30rpx, #fff,,center)
|
||||
border-radius 10rpx
|
||||
padding 10rpx
|
||||
overflow hidden
|
||||
.line
|
||||
_wh(90rpx, 10rpx)
|
||||
background-color #e0e0e1
|
||||
border-radius 4rpx
|
||||
margin 20rpx auto 40rpx
|
||||
.cancel
|
||||
_wh(100%, 100rpx)
|
||||
padding 0 24rpx
|
||||
overflow hidden
|
||||
background-color rgba(255, 255, 255, .3)
|
||||
box-shadow 0 1rpx 4rpx 0 rgba(160,160,160,0.9)
|
||||
_wh(calc(100% - 76rpx), 100rpx)
|
||||
margin 0 auto
|
||||
padding 20rpx 0
|
||||
overflow hidden
|
||||
border-bottom 1px solid #c5c6c7
|
||||
.bgc_1
|
||||
background linear-gradient(to right, rgba(73,102,255,0.8) 0%, rgba(117,142,255,0.8) 100%)
|
||||
.bgc_2
|
||||
background linear-gradient(to right, rgba(254, 168, 20,0.8) 0%, rgba(255, 177, 1,0.8) 100%)
|
||||
.bgc_3
|
||||
background linear-gradient(to right, rgba(0, 228, 153,0.8) 0%, rgba(0, 241, 197,0.8) 100%)
|
||||
.bgc_4
|
||||
background linear-gradient(to right, rgba(162, 86, 171,0.8) 0%, rgba(183,120,190,0.8) 100%)
|
||||
.bgc_5
|
||||
background linear-gradient(to right, rgba(146, 94, 52,0.8) 0%, rgba(162, 116, 79,0.8) 100%)
|
||||
.bgc_6
|
||||
background linear-gradient(to right, rgba(83, 191, 194,0.8) 0%, rgba(119, 198, 201,0.8) 100%)
|
||||
.bgc_7
|
||||
background linear-gradient(to right, rgba(244, 97, 61,0.8) 0%, rgba(245, 130, 102,0.8) 100%)
|
||||
</style>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="header">首页</view>
|
||||
<view class="userInfo-wrap">
|
||||
<view class="userInfo">
|
||||
<text class="p1">{{$store.getters.userName}}</text>
|
||||
<text class="p1">{{$store.getters.userInfo !== '' ? JSON.parse($store.getters.userInfo).user_name : ''}}</text>
|
||||
<text class="p2">欢迎进入铜箔手持系统!</text>
|
||||
</view>
|
||||
<view class="exit" @tap="Quit">
|
||||
@@ -15,7 +15,7 @@
|
||||
<view class="menu-wrap">
|
||||
<view class="menu-item" v-for="(e, i) in menuList" :key="i" @tap="toPage1(e)">
|
||||
<image class="menu-img" :src="require('../../static/image/menu/' + e.path + '.png')" alt="">
|
||||
<view class="menu-name">{{e.name}}</view>
|
||||
<view class="menu-name">{{e.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -23,7 +23,7 @@
|
||||
<view class="sec_menu_w">
|
||||
<view class="menu-item" v-for="(e, i) in secM" :key="i" @click="toPage2(e)">
|
||||
<view class="sec_menu-col_inner">
|
||||
<view class="menu-name menu-name_inner">{{e.name}}</view>
|
||||
<view class="menu-name menu-name_inner">{{e.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -35,7 +35,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {authority} from '@/utils/getData2.js'
|
||||
// import {authority} from '@/utils/getData2.js'
|
||||
import {authority} from '@/utils/mork2.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -50,7 +51,14 @@
|
||||
methods: {
|
||||
async _authority () {
|
||||
let res = await authority()
|
||||
this.menuList = [...res.sonTree]
|
||||
if (res.code === '1') {
|
||||
this.menuList = [...res.result.sonTree]
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
toPage1 (e) {
|
||||
@@ -66,7 +74,7 @@
|
||||
})
|
||||
},
|
||||
Quit () {
|
||||
this.$store.dispatch('delUserInfo')
|
||||
this.$store.dispatch('delUserInfo', '')
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="submit-bar">
|
||||
<button class="submit-button" @click="_submit">确认</button>
|
||||
<button class="submit-button" @click="_virtualprintType">查询</button>
|
||||
<view class="zd-row submitbar">
|
||||
<button class="zd-col-11 btn-submit btn-success letter-30" @click="_submit">确认</button>
|
||||
<button class="zd-col-11 btn-submit btn-success letter-30" @click="_virtualprintType">查询</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user