Files
app-govern/pages/index/index.vue

109 lines
3.3 KiB
Vue
Raw Normal View History

2023-01-11 16:33:13 +08:00
<template>
2023-01-13 16:32:56 +08:00
<Cn-page :loading="loading">
<view slot="body">
<view class="index">
2023-02-01 16:59:32 +08:00
<div class="header">
<div class="header-content">
<div class="header-content-item">
<div class="header-content-item-value">38</div>
<div class="header-content-item-label">正常设备</div>
</div>
<div class="header-content-item">
<div class="header-content-item-value">5</div>
<div class="header-content-item-label">报警设备</div>
</div>
<div class="header-content-item">
<div class="header-content-item-value">3</div>
<div class="header-content-item-label">离线设备</div>
</div>
</div>
</div>
2023-02-06 13:34:15 +08:00
<uni-card title="基础设备" sub-title="副标题" extra="APF" v-for="item in 3" :key="item" @click="jump"
thumbnail="/static/device.png">
<text>设备基础信息 </text>
</uni-card>
<uni-load-more status="nomore"></uni-load-more>
<uni-fab ref="fab" horizontal="right" vertical="bottom" :content="content" @trigger="trigger" />
2023-01-13 16:32:56 +08:00
</view>
2023-01-13 13:23:25 +08:00
</view>
2023-01-13 16:32:56 +08:00
</Cn-page>
2023-01-11 16:33:13 +08:00
</template>
<script>
2023-01-13 13:23:25 +08:00
export default {
data () {
return {
2023-02-06 13:34:15 +08:00
loading: false,
content: [{
iconPath: '/static/device.png',
text: '添加设备',
}, {
iconPath: '/static/wangguan.png',
text: '添加网关',
},
]
2023-01-13 13:23:25 +08:00
}
},
methods: {
2023-02-01 16:59:32 +08:00
send () {
uni.createPushMessage({
title: '灿能',
content: '灿能推送',
success: function (res) {
console.log('推送成功')
},
fail: function (res) {
console.log('推送失败')
}
})
},
2023-02-06 13:34:15 +08:00
jump () {
2023-01-13 16:32:56 +08:00
uni.navigateTo({
2023-02-06 13:34:15 +08:00
url: '/pages/device/detailAPF'
2023-01-13 16:32:56 +08:00
})
},
2023-02-06 13:34:15 +08:00
trigger (e) {
if (e.index === 0) {
uni.navigateTo({
url: '/pages/device/new'
})
}
}
2023-01-13 16:32:56 +08:00
},
onShow () {
setTimeout(() => {
this.loading = false
}, 500);
2023-01-13 13:23:25 +08:00
}
}
2023-01-11 16:33:13 +08:00
</script>
2023-01-13 16:32:56 +08:00
<style lang="scss">
.index {
2023-02-06 13:34:15 +08:00
padding: 34rpx 0;
2023-02-01 16:59:32 +08:00
.header {
2023-02-06 13:34:15 +08:00
margin: 0 30rpx;
2023-02-01 16:59:32 +08:00
background: #fff;
border-radius: 12rpx;
background: $uni-color-primary;
padding: 30rpx 10rpx 40rpx;
.header-content {
display: flex;
justify-content: space-around;
.header-content-item {
display: flex;
flex-direction: column;
align-items: center;
color: #fff;
font-size: 28rpx;
.header-content-item-value {
margin-bottom: 10rpx;
}
}
}
}
2023-01-13 13:23:25 +08:00
}
2023-01-11 16:33:13 +08:00
</style>