187 lines
3.5 KiB
Vue
187 lines
3.5 KiB
Vue
<template>
|
|
<view class="hzIndex">
|
|
<hzHeader title="健康管理"></hzHeader>
|
|
<view class="hzContent">
|
|
<view class="card-box">
|
|
<view class="box box-wrap" style="width: 100%;padding: 40upx 20upx;border-radius: 10upx;">
|
|
<view style="margin-bottom: 50upx;width:25%" @click="navTo(item.pageUrl,item.code,item.children)"
|
|
class="box box-column box-align-center" v-for="(item, index) in permissions" :key="index"
|
|
v-if="item.isOpen == 0">
|
|
<image class="box" style="width: 90upx; height: 90upx;" :src="item.iconUrl"></image>
|
|
<view style="font-size: 26upx;color: grey;">{{item.name}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
getUserPermission3,
|
|
travelPolicyList
|
|
} from '@/common/api.js';
|
|
import {
|
|
callbackRequest,
|
|
formatDate,
|
|
getStorage,
|
|
callbackRequestNoLoading,
|
|
alertTip
|
|
} from '@/common/util.js';
|
|
export default {
|
|
data() {
|
|
return {
|
|
formatDate: formatDate,
|
|
permissions: [],
|
|
travelPolicy: []
|
|
|
|
}
|
|
},
|
|
onLoad(option) {
|
|
this.permissions = JSON.parse(option.permissions) || [];
|
|
},
|
|
methods: {
|
|
getUserPermissions(code) {
|
|
let that = this;
|
|
let userId = getStorage('userInfo').userId;
|
|
callbackRequestNoLoading({
|
|
method: getUserPermission3,
|
|
data: {
|
|
userId: userId,
|
|
parentCode: code
|
|
}
|
|
}).then(res => {
|
|
if (res.data.returnCode == 1) {
|
|
that.permissions = res.data.returnData;
|
|
} else {
|
|
console.log('获取权限失败');
|
|
}
|
|
});
|
|
},
|
|
navTo(url,code,child) {
|
|
if(!url){
|
|
alertTip('敬请期待');
|
|
}
|
|
// console.log(url)
|
|
// console.log(child)
|
|
for(let i = 0;i<child.length;i++){
|
|
if(child[i].type==1){
|
|
if(url.indexOf('?')!=-1){
|
|
url = url+'&'+child[i].pageUrl;
|
|
}else{
|
|
url = url+'?'+child[i].pageUrl;
|
|
}
|
|
}
|
|
}
|
|
if (url && url.startsWith('/')) {
|
|
if (url.indexOf('?') != -1) {
|
|
url = url + '&code=' + code;
|
|
} else {
|
|
url = url + '?code=' + code;
|
|
}
|
|
if (child.length > 0) {
|
|
url = url + '&permissions=' + JSON.stringify(child);
|
|
}
|
|
// console.log(url)
|
|
uni.navigateTo({
|
|
url
|
|
});
|
|
}
|
|
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
uni-page-body {
|
|
background-color: #F5F5F5 !important;
|
|
min-height: 100% !important;
|
|
height: auto !important;
|
|
}
|
|
|
|
.box {
|
|
display: flex;
|
|
display: -webkit-flex;
|
|
}
|
|
|
|
.box-row-reverse {
|
|
flex-direction: row;
|
|
}
|
|
|
|
.box-column {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.box-left {
|
|
justify-content: flex-start;
|
|
}
|
|
|
|
.box-right {
|
|
justify-content: flex-end;
|
|
}
|
|
|
|
.box-center {
|
|
justify-content: center;
|
|
}
|
|
|
|
.box-between {
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.box-around {
|
|
justify-content: space-around;
|
|
}
|
|
|
|
.box-align-center {
|
|
align-items: center;
|
|
}
|
|
|
|
.box-wrap {
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.tab-banner {
|
|
width: 100%;
|
|
|
|
.image2 {
|
|
width: 100%;
|
|
height: 300upx;
|
|
}
|
|
}
|
|
|
|
.list-cell {
|
|
padding: 20upx 20upx;
|
|
box-sizing: border-box;
|
|
background: #fff;
|
|
margin-bottom: 10upx;
|
|
}
|
|
|
|
.cell-title {
|
|
font-size: 28upx;
|
|
/* line-height: 56upx; */
|
|
word-break: break-all;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
display: -webkit-box;
|
|
-webkit-box-orient: vertical;
|
|
-webkit-line-clamp: 3;
|
|
}
|
|
|
|
.sub-title {
|
|
padding-top: 10upx;
|
|
font-size: 28upx;
|
|
color: #bcbcbc;
|
|
}
|
|
|
|
.hzContent {
|
|
margin: 0 24UPX;
|
|
}
|
|
|
|
.card-box {
|
|
margin-top: 80upx;
|
|
background: linear-gradient(180deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);
|
|
border-radius: 12*2upx;
|
|
overflow: hidden;
|
|
}
|
|
</style> |