页面切图
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="index-yunwei">
|
||||
<view class="index-zhuyonghu">
|
||||
<div class="header">
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">3</div>
|
||||
@@ -14,24 +14,124 @@
|
||||
<div class="header-item-label">离线设备</div>
|
||||
</div>
|
||||
</div>
|
||||
<uni-card title="基础设备" sub-title="副标题" :extra="item % 2 ? 'APF' : 'DVR'" v-for="item in 3" :key="item"
|
||||
@click="jump(item)" thumbnail="/static/device.png">
|
||||
<text>设备基础信息 </text>
|
||||
</uni-card>
|
||||
<uni-load-more status="nomore"></uni-load-more>
|
||||
<view style="padding:20rpx 20rpx 0">
|
||||
<Cn-grid title="注册">
|
||||
<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>
|
||||
</view>
|
||||
<view class="nav">
|
||||
<view class="nav-menu" :class="{ 'nav-menu-active': navMenuActive == index }"
|
||||
v-for="(item, index) in navMenuList" :key="index" @click="navMenuClick(index)">{{ item.text }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="content device" :style="{ minHeight: minHeight }">
|
||||
<uni-card :title="item.name" :sub-title="item.project" :extra="item.type" padding="0"
|
||||
v-for="(item, index) in deviceListFilter" :key="index" @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>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
loading: false
|
||||
loading: false,
|
||||
navMenuList: [{
|
||||
text: '全部'
|
||||
}, {
|
||||
text: '监测'
|
||||
}, {
|
||||
text: '治理'
|
||||
}],
|
||||
navMenuActive: 0,
|
||||
navHeight: 0,
|
||||
minHeight: '',
|
||||
deviceList: [
|
||||
{
|
||||
name: '设备1',
|
||||
des: '设备描述1',
|
||||
type: 'APF',
|
||||
project: '监测',
|
||||
},
|
||||
{
|
||||
name: '设备2',
|
||||
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: '治理'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
deviceListFilter () {
|
||||
if (this.navMenuActive == 0) {
|
||||
return this.deviceList
|
||||
} else {
|
||||
return this.deviceList.filter(item => item.project == this.navMenuList[this.navMenuActive].text)
|
||||
}
|
||||
}
|
||||
},
|
||||
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) {
|
||||
uni.navigateTo({
|
||||
if (item.type == 'APF') {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/APF/detail'
|
||||
})
|
||||
} else {
|
||||
@@ -40,9 +140,23 @@ 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>
|
||||
<style lang='scss'>
|
||||
.index-yunwei {}
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user