刘翔宇-旅管家 3 years ago
parent 76136edf86
commit 8e51cfad02

@ -8,30 +8,30 @@
</u-row> </u-row>
<u-row gutter="16"> <u-row gutter="16">
<u-col span="6"> <u-col span="6" v-if="isshowxc">
<view class="demo-layout bg-purple-light" @click="toview(5)"> <view class="demo-layout bg-purple-light" @click="toview(5)">
<text class="iconfont icon-guanxianxuncha"></text> <text class="iconfont icon-guanxianxuncha"></text>
<text class="navtxt">雨管巡查</text> <text class="navtxt">雨管巡查</text>
</view> </view>
</u-col> </u-col>
<u-col span="6"> <u-col span="6" v-if="isshowyh">
<view class="demo-layout bg-purple" @click="toview(4)"> <view class="demo-layout bg-purple" @click="toview(4)">
<text class="iconfont icon-guanxianyanghu"></text> <text class="iconfont icon-guanxianyanghu"></text>
<text class="navtxt">雨管养护</text> <text class="navtxt">雨管养护</text>
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
<!-- <u-row gutter="16"> <!-- <u-row gutter="16">
<u-col span="12"> <u-col span="12">
<view class="demo-layout bg-purple-light" @click="toview(6)"> <view class="demo-layout bg-purple-light" @click="toview(6)">
<text class="iconfont icon-gongnengxingquexianshuju"></text> <text class="iconfont icon-gongnengxingquexianshuju"></text>
<text class="navtxt">工单执行</text> <text class="navtxt">工单执行</text>
</view> </view>
</u-col> </u-col>
</u-row> --> </u-row> -->
<u-row gutter="16"> <u-row gutter="16" v-if="isshowrc">
<u-col span="12"> <u-col span="12">
@ -42,7 +42,7 @@
</u-col> </u-col>
</u-row> </u-row>
<u-row gutter="16" justify="space-between"> <u-row gutter="16" justify="space-between">
<u-col span="8"> <u-col span="8" v-if="isshowty">
<view class="demo-layout bg-purple" @click="toview(1)"> <view class="demo-layout bg-purple" @click="toview(1)">
<text class="iconfont icon-caidanguanli"></text> <text class="iconfont icon-caidanguanli"></text>
<text class="navtxt">通用巡查</text> <text class="navtxt">通用巡查</text>
@ -62,20 +62,54 @@
data() { data() {
return { return {
title: '', title: '',
userInfo: {} userInfo: {
allow_menu_list: -1
},
isshowty: false,
isshowxc: false,
isshowyh: false,
isshowrc: false
} }
}, },
onLoad() { onLoad() {
this.loadInfo(); this.loadInfo();
}, },
mounted() { mounted() {
var a = document.getElementsByClassName('uni-page-head-btn')[0] var a = document.getElementsByClassName('uni-page-head-btn')[0]
a.style.display = 'none'; a.style.display = 'none';
}, },
onNavigationBarButtonTap(val) { watch: {
window.android.finish(); userInfo: {
//
handler(newVal, oldVal) {
this.isshowty = this.hasMenu(4);
this.isshowxc = this.hasMenu(1);
this.isshowyh = this.hasMenu(2);
this.isshowrc = this.hasMenu(3);
},
//
immediate: true,
//
deep: true
}
},
onNavigationBarButtonTap(val) {
window.android.finish();
}, },
methods: { methods: {
hasMenu(menu_id) {
if (this.userInfo.allow_menu_list == -1) return false;
if (this.userInfo.allow_menu_list.length == 0) {
return true;
} else {
let list = this.userInfo.allow_menu_list.filter((item) => {
return item == menu_id;
});
return list > 0;
}
},
loadInfo() { loadInfo() {
let that = this; let that = this;
this.util.request({ this.util.request({
@ -90,25 +124,25 @@
}); });
}, },
toview(type) { toview(type) {
// let url = "/packageA/pages/generalPatrol/generalPatrol"; // let url = "/packageA/pages/generalPatrol/generalPatrol";
let url = "/road/road/road?type=general" let url = "/road/road/road?type=general"
if (type == 2) { if (type == 2) {
url = "/pages/mine/mine" url = "/pages/mine/mine"
} }
if (type == 3) { if (type == 3) {
// url = "/road/road/road?type=daily" // url = "/road/road/road?type=daily"
url = "/packageB/pages/dailyInspection/dailyInspection" url = "/packageB/pages/dailyInspection/dailyInspection"
} }
if (type == 4) { if (type == 4) {
url = "/road/road/road?type=rainmaintain" url = "/road/road/road?type=rainmaintain"
// url = "/rainmaintain/rainmaintain/rainmaintain" // url = "/rainmaintain/rainmaintain/rainmaintain"
} }
if (type == 5) { if (type == 5) {
url = "/road/road/road?type=raininspection" url = "/road/road/road?type=raininspection"
// url = "/raininspection/raininspection/raininspection" // url = "/raininspection/raininspection/raininspection"
} }
// if (type == 6) { // if (type == 6) {
// url = "/order/order/order/order" // url = "/order/order/order/order"
// } // }
uni.navigateTo({ uni.navigateTo({
url: url url: url

@ -8,40 +8,40 @@
</u-row> </u-row>
<u-row gutter="16"> <u-row gutter="16">
<u-col span="6"> <u-col span="6" v-if="isshowxc">
<view class="demo-layout bg-purple-light" @click="toview(4)"> <view class="demo-layout bg-purple-light" @click="toview(4)">
<text class="iconfont icon-guanxianxuncha"></text> <text class="iconfont icon-guanxianxuncha"></text>
<text class="navtxt">我的巡查</text> <text class="navtxt">我的巡查</text>
</view> </view>
</u-col> </u-col>
<u-col span="6"> <u-col span="6" v-if="isshowyh">
<view class="demo-layout bg-purple" @click="toview(3)"> <view class="demo-layout bg-purple" @click="toview(3)">
<text class="iconfont icon-guanxianyanghu"></text> <text class="iconfont icon-guanxianyanghu"></text>
<text class="navtxt">我的养护</text> <text class="navtxt">我的养护</text>
</view> </view>
</u-col> </u-col>
</u-row>
<u-row gutter="16">
<u-col span="12">
<view class="demo-layout bg-purple-light" @click="toview(5)">
<text class="iconfont icon-gongnengxingquexianshuju"></text>
<text class="navtxt">我的工单</text>
</view>
</u-col>
</u-row> </u-row>
<u-row gutter="16"> <u-row gutter="16">
<u-col span="12"> <u-col span="12">
<view class="demo-layout bg-purple-light" @click="toview(5)">
<text class="iconfont icon-gongnengxingquexianshuju"></text>
<text class="navtxt">我的工单</text>
</view>
</u-col>
</u-row>
<u-row gutter="16" v-if="isshowrc">
<u-col span="12" >
<view class="demo-layout bg-purple-light" @click="toview(2)"> <view class="demo-layout bg-purple-light" @click="toview(2)">
<text class="iconfont icon-zaixianjiance"></text> <text class="iconfont icon-zaixianjiance"></text>
<text class="navtxt">我的日常监督巡查</text> <text class="navtxt">我的日常监督巡查</text>
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
<u-row gutter="16" justify="space-between"> <u-row gutter="16" justify="space-between" v-if="isshowty">
<u-col span="8"> <u-col span="8">
<view class="demo-layout bg-purple" @click="toview(1)"> <view class="demo-layout bg-purple" @click="toview(1)">
<text class="iconfont icon-caidanguanli"></text> <text class="iconfont icon-caidanguanli"></text>
@ -56,13 +56,47 @@
data() { data() {
return { return {
title: '', title: '',
userInfo: {} userInfo: {
allow_menu_list: -1
},
isshowty: false,
isshowxc: false,
isshowyh: false,
isshowrc: false
} }
}, },
onLoad() { onLoad() {
this.loadInfo(); this.loadInfo();
}, },
watch: {
userInfo: {
//
handler(newVal, oldVal) {
this.isshowty = this.hasMenu(4);
this.isshowxc = this.hasMenu(1);
this.isshowyh = this.hasMenu(2);
this.isshowrc = this.hasMenu(3);
},
//
immediate: true,
//
deep: true
}
},
methods: { methods: {
hasMenu(menu_id) {
if (this.userInfo.allow_menu_list == -1) return false;
if (this.userInfo.allow_menu_list.length == 0) {
return true;
} else {
let list = this.userInfo.allow_menu_list.filter((item) => {
return item == menu_id;
});
return list > 0;
}
},
loadInfo() { loadInfo() {
let that = this; let that = this;
this.util.request({ this.util.request({
@ -80,15 +114,15 @@
let url = "/packageA/pages/generalList/generalList"; let url = "/packageA/pages/generalList/generalList";
if (type == 2) { if (type == 2) {
url = "/packageB/pages/dailyList/dailyList" url = "/packageB/pages/dailyList/dailyList"
} }
if (type == 3) { if (type == 3) {
url = "/rainmaintain/rainmaintainlist/rainmaintainList" url = "/rainmaintain/rainmaintainlist/rainmaintainList"
} }
if (type == 4) { if (type == 4) {
url = "/raininspection/raininspectionlist/raininspectionList" url = "/raininspection/raininspectionlist/raininspectionList"
} }
if (type == 5) { if (type == 5) {
url = "/order/order/orderList/orderList" url = "/order/order/orderList/orderList"
} }
uni.navigateTo({ uni.navigateTo({
url: url url: url

Loading…
Cancel
Save