页面切图

This commit is contained in:
仲么了
2023-02-20 14:19:28 +08:00
parent 7d28b3476a
commit 5e69ab1da6
50 changed files with 1136 additions and 213 deletions

View File

@@ -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>