|
|
@@ -2,8 +2,8 @@
|
|
|
<view class="container">
|
|
|
<swiper class="swiper square-dot" indicator-color="#D7E3FD" indicator-active-color="#3874F6" :indicator-dots="true"
|
|
|
:circular="true" duration="500">
|
|
|
- <swiper-item class="swiper-item" v-for="(it, i) in apps" key="i">
|
|
|
- <navigator url="#" class="app" v-for="item in it" key="label">
|
|
|
+ <swiper-item class="swiper-item" v-for="(it, i) in apps" :key="i">
|
|
|
+ <navigator :url="item.path" open-type="navigate" class="app" v-for="item in it" :key="item.label">
|
|
|
<view class="icon" :style="{ backgroundColor: item.color }">
|
|
|
<text class="iconfont" :class="item.icon" style="font-size: 6.400vw;" />
|
|
|
</view>
|
|
|
@@ -21,75 +21,41 @@ export default {
|
|
|
name: 'workbench',
|
|
|
data() {
|
|
|
return {
|
|
|
- apps: [
|
|
|
- [{
|
|
|
- label: "巡检中心",
|
|
|
- icon: "icon-xunjianzhongxin",
|
|
|
- color: "#5487F7"
|
|
|
- }, {
|
|
|
- label: "巡检中心1",
|
|
|
- icon: "icon-xunjianzhongxin",
|
|
|
- color: "#5487F7"
|
|
|
- }, {
|
|
|
- label: "巡检中心12",
|
|
|
- icon: "icon-xunjianzhongxin",
|
|
|
- color: "#5487F7"
|
|
|
- }, {
|
|
|
- label: "巡检中心123",
|
|
|
- icon: "icon-xunjianzhongxin",
|
|
|
- color: "#5487F7"
|
|
|
- }, {
|
|
|
- label: "巡检中心1234",
|
|
|
- icon: "icon-xunjianzhongxin",
|
|
|
- color: "#5487F7"
|
|
|
- }], [{
|
|
|
- label: "巡检中心",
|
|
|
- icon: "icon-xunjianzhongxin",
|
|
|
- color: "#5487F7"
|
|
|
- }, {
|
|
|
- label: "巡检中心1",
|
|
|
- icon: "icon-xunjianzhongxin",
|
|
|
- color: "#5487F7"
|
|
|
- }, {
|
|
|
- label: "巡检中心12",
|
|
|
- icon: "icon-xunjianzhongxin",
|
|
|
- color: "#5487F7"
|
|
|
- }, {
|
|
|
- label: "巡检中心123",
|
|
|
- icon: "icon-xunjianzhongxin",
|
|
|
- color: "#5487F7"
|
|
|
- }, {
|
|
|
- label: "巡检中心1234",
|
|
|
- icon: "icon-xunjianzhongxin",
|
|
|
- color: "#5487F7"
|
|
|
- }], [{
|
|
|
+ apps: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.rander();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ rander() {
|
|
|
+ const clist = ['#5487F7', '#F29C37', '#9A6FF8', '#5AB73F', '#5487F7']
|
|
|
+ let authList = uni.getStorageSync('authList'),
|
|
|
+ list = [{
|
|
|
label: "巡检中心",
|
|
|
- icon: "icon-xunjianzhongxin",
|
|
|
- color: "#5487F7"
|
|
|
+ icon: "icon-xunjianzhongxin"
|
|
|
}, {
|
|
|
- label: "巡检中心1",
|
|
|
- icon: "icon-xunjianzhongxin",
|
|
|
- color: "#5487F7"
|
|
|
+ label: "警告中心",
|
|
|
+ icon: "icon-xunjianzhongxin"
|
|
|
}, {
|
|
|
- label: "巡检中心12",
|
|
|
+ label: "设备中心",
|
|
|
icon: "icon-xunjianzhongxin",
|
|
|
- color: "#5487F7"
|
|
|
+ path: "/packageA/facility/index"
|
|
|
}, {
|
|
|
- label: "巡检中心123",
|
|
|
- icon: "icon-xunjianzhongxin",
|
|
|
- color: "#5487F7"
|
|
|
+ label: "取水系统",
|
|
|
+ icon: "icon-xunjianzhongxin"
|
|
|
}, {
|
|
|
- label: "巡检中心1234",
|
|
|
- icon: "icon-xunjianzhongxin",
|
|
|
- color: "#5487F7"
|
|
|
- }]
|
|
|
- ]
|
|
|
- };
|
|
|
- },
|
|
|
- created() { },
|
|
|
- methods: {
|
|
|
- rander() {
|
|
|
- let colorList = ['x']
|
|
|
+ label: "雨洪系统",
|
|
|
+ icon: "icon-xunjianzhongxin"
|
|
|
+ }].filter(v => authList[v.label]),
|
|
|
+ apps = [];
|
|
|
+ for (let i = list.length / 5; i > 0; i--) {
|
|
|
+ apps[apps.length] = list.splice(0, 5).map((v, i) => {
|
|
|
+ v.color = clist[i]
|
|
|
+ return v
|
|
|
+ })
|
|
|
+ };
|
|
|
+ this.apps = apps;
|
|
|
}
|
|
|
}
|
|
|
}
|