页面切图
This commit is contained in:
@@ -14,10 +14,10 @@
|
||||
<div class="header-item-label">离线设备</div>
|
||||
</div>
|
||||
</div>
|
||||
<view style="padding:30rpx 30rpx 0">
|
||||
<view style="padding:20rpx 20rpx 0">
|
||||
<Cn-grid title="注册">
|
||||
<Cn-grid-item src="/static/device2.png" text="设备"></Cn-grid-item>
|
||||
<Cn-grid-item src="/static/gateway2.png" text="网关"></Cn-grid-item>
|
||||
<Cn-grid-item src="/static/device2.png" text="设备" @click="registerDevice"></Cn-grid-item>
|
||||
<Cn-grid-item src="/static/gateway2.png" text="网关" @click="registerGateway"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff"></Cn-grid-item>
|
||||
</Cn-grid>
|
||||
@@ -27,12 +27,14 @@
|
||||
v-for="(item, index) in navMenuList" :key="index" @click="navMenuClick(index)">{{ item.text }}
|
||||
</view>
|
||||
</view>
|
||||
<uni-card :title="item.name" :sub-title="item.project" :extra="item.type" v-for="item in deviceListFilter"
|
||||
:key="item" style="margin-top:4rpx" @click="jump(item)" thumbnail="/static/device.png">
|
||||
<text>{{ item.project }} {{ item.type }}</text>
|
||||
</uni-card>
|
||||
|
||||
<uni-load-more status="nomore"></uni-load-more>
|
||||
<view class="content" :style="{ minHeight: minHeight }">
|
||||
<uni-card :title="item.name" :sub-title="item.project" :extra="item.type"
|
||||
v-for="(item, index) in deviceListFilter" :key="index" style="margin-top:4rpx" @click="jump(item)"
|
||||
thumbnail="/static/device.png">
|
||||
<text>{{ item.project }} {{ item.type }}</text>
|
||||
</uni-card>
|
||||
<uni-load-more status="nomore"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
@@ -48,6 +50,8 @@ export default {
|
||||
text: '治理'
|
||||
}],
|
||||
navMenuActive: 0,
|
||||
navHeight: 0,
|
||||
minHeight: '',
|
||||
deviceList: [
|
||||
{
|
||||
name: '设备1',
|
||||
@@ -60,6 +64,30 @@ export default {
|
||||
des: '设备描述2',
|
||||
type: 'DVR',
|
||||
project: '治理'
|
||||
},
|
||||
{
|
||||
name: '设备3',
|
||||
des: '设备描述3',
|
||||
type: 'DVR',
|
||||
project: '治理'
|
||||
},
|
||||
{
|
||||
name: '设备4',
|
||||
des: '设备描述4',
|
||||
type: 'DVR',
|
||||
project: '治理'
|
||||
},
|
||||
{
|
||||
name: '设备5',
|
||||
des: '设备描述5',
|
||||
type: 'APF',
|
||||
project: '治理'
|
||||
},
|
||||
{
|
||||
name: '设备6',
|
||||
des: '设备描述6',
|
||||
type: 'APF',
|
||||
project: '治理'
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -74,11 +102,36 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
registerDevice () {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请选择设备类型',
|
||||
confirmText: '直连装置',
|
||||
cancelText: '网关接入',
|
||||
cancelColor: '#007aff',
|
||||
success: ({ confirm, cancel }) => {
|
||||
if (confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/new'
|
||||
})
|
||||
} else if (cancel) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/gateway/list'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
registerGateway () {
|
||||
uni.navigateTo({
|
||||
url: '/pages/gateway/new'
|
||||
})
|
||||
},
|
||||
navMenuClick (index) {
|
||||
this.navMenuActive = index
|
||||
},
|
||||
jump (item) {
|
||||
if (item % 2) {
|
||||
if (item.type == 'APF') {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/APF/detail'
|
||||
})
|
||||
@@ -88,6 +141,21 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
setTimeout(() => {
|
||||
// 获取nav高度
|
||||
uni.createSelectorQuery().select('.nav').boundingClientRect((rect) => {
|
||||
this.navHeight = rect.height
|
||||
// #ifdef H5
|
||||
this.minHeight = 'calc(100vh - env(safe-area-inset-bottom) - ' + (50 + this.navHeight) + 'px)'
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.minHeight = 'calc(100vh - ' + this.navHeight + 'px)'
|
||||
// #endif
|
||||
|
||||
}).exec()
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading">
|
||||
<Cn-page :loading="loading" noPadding>
|
||||
<view slot="body">
|
||||
<view class="index">
|
||||
<!-- 运维 -->
|
||||
@@ -12,12 +12,11 @@
|
||||
<ZhuYongHu v-if="userInfo.role == 4" />
|
||||
<!-- 子用户 -->
|
||||
<ZiYongHu v-if="userInfo.role == 5" />
|
||||
|
||||
<uni-fab ref="fab" direction="vertical" horizontal="right" vertical="bottom" :content="content"
|
||||
@trigger="trigger" />
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import YunWei from "./comp/indexYunWei.vue";
|
||||
@@ -37,7 +36,7 @@ export default {
|
||||
return {
|
||||
loading: false,
|
||||
userInfo: {
|
||||
role: 1
|
||||
role: 4
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -61,15 +60,15 @@ export default {
|
||||
text: '子用户',
|
||||
}
|
||||
]
|
||||
if (arr.indexOf(this.userInfo.role) > -1) {
|
||||
content.push({
|
||||
iconPath: '/static/device.png',
|
||||
text: '添加设备',
|
||||
}, {
|
||||
iconPath: '/static/gateway.png',
|
||||
text: '添加网关',
|
||||
})
|
||||
}
|
||||
// if (arr.indexOf(this.userInfo.role) > -1) {
|
||||
// content.push({
|
||||
// iconPath: '/static/device.png',
|
||||
// text: '添加设备',
|
||||
// }, {
|
||||
// iconPath: '/static/gateway.png',
|
||||
// text: '添加网关',
|
||||
// })
|
||||
// }
|
||||
return content
|
||||
}
|
||||
},
|
||||
@@ -128,13 +127,13 @@ export default {
|
||||
this.loading = false
|
||||
},
|
||||
onShow () {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo) || { role: 1 }
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo) || { role: 4 }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.index {
|
||||
padding: 34rpx 0;
|
||||
padding: 34rpx 0 0;
|
||||
}
|
||||
|
||||
/deep/ .uni-card {
|
||||
|
||||
@@ -108,7 +108,7 @@ export default {
|
||||
}
|
||||
|
||||
.message-nav {
|
||||
padding: 34rpx;
|
||||
padding: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
<view>灿能电力</view>
|
||||
<view class="tag">{{ roleName }}</view>
|
||||
</view>
|
||||
<image
|
||||
src="/static/erweima.png"
|
||||
style="height: 50rpx;width: 50rpx;border-radius:12rpx"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<!-- <view class="mine-nav" @click="jump('upgrade')">
|
||||
@@ -15,13 +20,13 @@
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view> -->
|
||||
|
||||
<view class="mine-nav" @click="jump('user')" v-if="userInfo.role == 4">
|
||||
<!-- <view class="mine-nav" @click="jump('user')" v-if="userInfo.role == 4">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/subordinate.png" />
|
||||
<view class="mine-nav-label">子用户列表</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="mine-nav" @click="jump('project')" v-if="userInfo.role == 4">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/subordinate.png" />
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
|
||||
<view class="mine-nav-label">项目管理</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
@@ -109,6 +114,11 @@ export default {
|
||||
url: `/pages/user/basic`
|
||||
})
|
||||
break;
|
||||
case 'project':
|
||||
uni.navigateTo({
|
||||
url: `/pages/project/list`
|
||||
})
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
uni.navigateTo({
|
||||
@@ -158,7 +168,7 @@ export default {
|
||||
}
|
||||
|
||||
.mine-nav {
|
||||
padding: 34rpx;
|
||||
padding: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
|
||||
Reference in New Issue
Block a user