Files
app-govern/pages/gateway/list.vue

79 lines
2.6 KiB
Vue
Raw Permalink Normal View History

2023-02-07 17:59:54 +08:00
<template>
<Cn-page :loading='loading'>
<view slot='body'>
2023-07-03 20:29:24 +08:00
<view class='index' :class="{ 'device': userInfo.authorities == '5' || userInfo.authorities == '2' }">
2023-02-23 08:44:46 +08:00
<uni-card title="监测网关" sub-title="监测" @click="look" thumbnail="/static/gateway.png"
2023-07-03 20:29:24 +08:00
:padding="userInfo.authorities == '5' || userInfo.authorities == '2' ? 0 : '10px'">
<view class="footer" v-if="userInfo.authorities != 5 && userInfo.authorities != 2">
2023-02-23 08:44:46 +08:00
<text style="flex:1"> </text>
<view class="footer-btn" @click.stop="newDevice">注册设备</view>
<view class="footer-btn ml20">查看</view>
</view>
</uni-card>
<uni-card title="用能网关" sub-title="用能" @click="look" thumbnail="/static/gateway.png"
2023-07-03 20:29:24 +08:00
:padding="userInfo.authorities == '5' || userInfo.authorities == '2' ? 0 : '10px'">
<view class="footer" v-if="userInfo.authorities != 5 && userInfo.authorities != 2">
2023-02-23 08:44:46 +08:00
<text style="flex:1"> </text>
<view class="footer-btn" @click.stop="newDevice">注册设备</view>
<view class="footer-btn ml20">查看</view>
2023-02-07 17:59:54 +08:00
</view>
</uni-card>
<uni-load-more status="nomore"></uni-load-more>
</view>
</view>
</Cn-page>
</template>
<script>
export default {
data () {
return {
2023-02-23 08:44:46 +08:00
loading: false,
userInfo: {}
2023-02-07 17:59:54 +08:00
}
},
2023-02-23 08:44:46 +08:00
onLoad (options) {
this.userInfo = uni.getStorageSync('userInfo')
},
2023-02-07 17:59:54 +08:00
methods: {
newDevice () {
2023-02-14 13:34:00 +08:00
// uni.scanCode({
// success: function (res) {
// console.log('条码类型:' + res.scanType);
// console.log('条码内容:' + res.result);
2023-02-07 17:59:54 +08:00
2023-02-14 13:34:00 +08:00
// }
// });
uni.navigateTo({
url: '/pages/gateway/newDevice'
})
2023-02-07 17:59:54 +08:00
},
2023-02-23 08:44:46 +08:00
look () {
uni.navigateTo({
url: '/pages/gateway/detail'
})
}
2023-02-07 17:59:54 +08:00
}
}
</script>
<style lang='scss'>
.index {
2023-02-23 08:44:46 +08:00
padding-top: 20rpx;
2023-03-01 08:48:52 +08:00
2023-02-07 17:59:54 +08:00
.footer {
display: flex;
justify-content: space-between;
align-items: center;
.footer-btn {
padding: 0 20rpx;
height: 50rpx;
background-color: #007aff;
font-size: 24rpx;
color: #fff;
text-align: center;
line-height: 50rpx;
border-radius: 10rpx;
}
}
}
</style>