hz-zhhq-app/pages/malfunc-repair/malfunc-index.vue

160 lines
3.4 KiB
Vue

<template>
<view class="hzIndex">
<hzHeader title="物业服务"></hzHeader>
<!-- <view class="tab-banner">
<image class="image2" src="/static/images/malfunc/malfunc-banner.jpg" ></image>
</view> -->
<view class="hzContent" style="padding-top: 200upx;">
<view style="padding: 20upx;">
<view class="box box-wrap" style="width: 100%;padding: 20upx 20upx;border-radius: 10upx;background-color: white;">
<view style=" margin-bottom: 30upx;width:33%" @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) {
// console.log(option.permissions)
this.permissions = JSON.parse(option.permissions) ||[];
// console.log(this.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;
}
</style>