congming_huose-apk/subpackage/device/rentiredwai/index.vue

591 lines
24 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="device-detail">
<!-- 自定义导航栏 -->
<view class="tabback">
<view class="rtjt" @click="btnback"></view>
<view class="name">{{ $i18n.t('deviceDetail') }}</view>
<view style="width: 36rpx;"></view>
</view>
<scroll-view style="height: 90vh;" scroll-y refresher-enabled @refresherrefresh="onRefresh" :refresher-triggered="isRefreshing" refresher-default-style="black">
<!-- 头像和扫码按钮悬浮 -->
<view class="avatar-box">
<image class="avatar" :src="xqobj.productPicture || 'https://api.ccttiot.com/smartmeter/img/static/uZiAQwh3lTliRkGXV3R0'" mode="aspectFill"></image>
<view class="scan-btn" @click="btnrdit">
<image src="https://api.ccttiot.com/smartmeter/img/static/uZiAQwh3lTliRkGXV3R0" mode="aspectFill"></image>
</view>
</view>
<!-- 信息列表卡片 -->
<view class="info-card">
<!-- 红外传感器 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/ukzZfb8DtiZUiftqgoM9" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('infraredSensor') }}</view>
<view class="info-status-row">
<text class="info-status" :class="infraredSensorValueClass">{{ xqobj.iotData.hy.desc == undefined ? '--' : xqobj.iotData.hy.desc}}</text>
</view>
</view>
<image v-if="infraredSensorValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- 红外传感器灵敏度 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/u6q70tcwtAsIxGf8ZGzB" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('infraredSensorSensitivity') }}</view>
<view class="info-status-row">
<text class="info-status" :class="infraredSensorSensitivityValueClass">{{ infraredSensorSensitivityValue }}</text>
</view>
</view>
<image v-if="infraredSensorSensitivityValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- 麦克风启用 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/uKdJLzFcx2Rh7QwyOnZA" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('micEnabled') }}</view>
<view class="info-status-row">
<text class="info-status" :class="micEnabledValueClass">{{ xqobj.iotData.mic.desc == undefined ? '--' : xqobj.iotData.mic.desc }}</text>
</view>
</view>
<image v-if="micEnabledValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- 麦克风灵敏度 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/uTmzWm51X4xEUaiC2glU" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('micSensitivity') }}</view>
<view class="info-status-row">
<text class="info-status" :class="micSensitivityValueClass">{{ micSensitivityValue }}</text>
</view>
</view>
<image v-if="micSensitivityValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- 加速度计振动 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/u3PJBIdISoAn3xxbeQLb" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('accelerometerVibration') }}</view>
<view class="info-status-row">
<text class="info-status" :class="accelerometerVibrationValueClass">{{ xqobj.iotData.zd.value == undefined ? '--' : xqobj.iotData.zd.value }}</text>
</view>
</view>
<image v-if="accelerometerVibrationValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- 加速度计角度 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/uiIpGnaiS9TPMWEVa1DJ" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('accelerometerAngle') }}</view>
<view class="info-status-row">
<text class="info-status" :class="accelerometerAngleValueClass">{{ xqobj.iotData.jd.value == undefined ? '--' : xqobj.iotData.jd.value }}</text>
</view>
</view>
<image v-if="accelerometerAngleValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- 环境温度 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/umkBDcKkMqkd6MvEMyMn" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('ambientTemperature') }}</view>
<view class="info-status-row">
<text class="info-status" :class="ambientTemperatureValueClass">{{ xqobj.iotData.wd.value == undefined ? '--' : xqobj.iotData.wd.value }}</text>
</view>
</view>
<image v-if="ambientTemperatureValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- 电池电量 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/u3kuDU7QtC5DCwxF7OMn" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('batteryLevel') }}</view>
<view class="info-status-row">
<text class="info-status" :class="batteryLevelValueClass">{{ xqobj.iotData.bat.value == undefined ? '--' : xqobj.iotData.bat.value + '%'}}</text>
</view>
</view>
<image v-if="batteryLevelValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- 设备覆盖 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/uo5bYrOx2j9XcB93OgnB" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('deviceCover') }}</view>
<view class="info-status-row">
<text class="info-status" :class="deviceCoverValueClass">{{ xqobj.iotData.fx.desc == undefined ? '--' : xqobj.iotData.fx.desc }}</text>
</view>
</view>
<image v-if="deviceCoverValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- 设备支架 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/u53l4w8N03RKfVCJJW6u" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('deviceBracket') }}</view>
<view class="info-status-row">
<text class="info-status" :class="deviceBracketValueClass">{{ xqobj.iotData.zj.desc == undefined ? '--' : xqobj.iotData.zj.desc }}</text>
</view>
</view>
<image v-if="deviceBracketValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- 外部电源 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/u53l4w8N03RKfVCJJW6u" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('externalPower') }}</view>
<view class="info-status-row">
<text class="info-status" :class="externalPowerValueClass">{{ xqobj.iotData.pow.desc == undefined ? '--' : xqobj.iotData.pow.desc }}</text>
</view>
</view>
<image v-if="externalPowerValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- 集线器连接 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/uRgW826i9UFnVQCKe3cW" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('hubConnection') }}</view>
<view class="info-status-row">
<text class="info-status" :class="hubConnectionValueClass">{{ hubConnectionValue }}</text>
</view>
</view>
<image v-if="hubConnectionValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- 集线器信号强度 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/u8HbiP9EXs21YZ5g8iK2" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('hubSignalStrength') }}</view>
<view class="info-status-row">
<view class="signal-bar">
<view v-for="n in 4" :key="n" class="signal-block" :class="{active: n <= hubSignalStrengthLevel}"></view>
</view>
</view>
</view>
<image v-if="hubSignalStrengthValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- 连接模式 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/uwxenGFFOlLOJ395ya0K" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('connectionMode') }}</view>
<view class="info-status-row">
<text class="info-status" :class="connectionModeValueClass">{{ connectionModeValue }}</text>
</view>
</view>
<image v-if="connectionModeValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- LORA信号强度 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/u8HbiP9EXs21YZ5g8iK2" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('loraSignalStrength') }}</view>
<view class="info-status-row">
<view class="signal-bar">
<view v-for="n in 4" :key="n" class="signal-block" :class="{active: n <= loraSignalStrengthLevel}"></view>
</view>
</view>
</view>
<image v-if="loraSignalStrengthValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- BLE信号强度 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/u8HbiP9EXs21YZ5g8iK2" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('bleSignalStrength') }}</view>
<view class="info-status-row">
<view class="signal-bar">
<view v-for="n in 4" :key="n" class="signal-block" :class="{active: n <= bleSignalStrengthLevel}"></view>
</view>
</view>
</view>
<image v-if="bleSignalStrengthValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- LORA发射功率 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/uHNVHl1QFKt7swCSxCYO" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('loraTransmitPower') }}</view>
<view class="info-status-row">
<view class="signal-bar">
<view v-for="n in 4" :key="n" class="signal-block" :class="{active: n <= loraTransmitPowerLevel}"></view>
</view>
</view>
</view>
<image v-if="loraTransmitPowerValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- BLE发射功率 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/uHNVHl1QFKt7swCSxCYO" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('bleTransmitPower') }}</view>
<view class="info-status-row">
<view class="signal-bar">
<view v-for="n in 4" :key="n" class="signal-block" :class="{active: n <= bleTransmitPowerLevel}"></view>
</view>
</view>
</view>
<image v-if="bleTransmitPowerValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- 中继器 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/ufzGmkXJW0w9zRvfdJyr" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('repeater') }}</view>
<view class="info-status-row">
<text class="info-status" :class="repeaterValueClass">{{ repeaterValue }}</text>
</view>
</view>
<image v-if="repeaterValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
<view class="divider"></view>
</view>
<!-- NC接口 -->
<view class="info-item">
<image class="iconfont info-icon" src="https://api.ccttiot.com/smartmeter/img/static/uyL4a9nUNUwip156myrH" mode="aspectFill"></image>
<view class="info-content">
<view class="info-title">{{ $i18n.t('ncInterface') }}</view>
<view class="info-status-row">
<text class="info-status" :class="ncInterfaceValueClass">{{ ncInterfaceValue }}</text>
</view>
</view>
<image v-if="ncInterfaceValueClass == 'red'" style="width: 60rpx;height: 60rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uw31nuDEs8OOlS36kYE3" mode=""></image>
</view>
</view>
<!-- 底部摘要 -->
<view class="device-summary">
<view>{{xqobj.productName}}{{$i18n.t('deviceModel')}}</view>
<view>{{ $i18n.t('hardware') }} {{ xqobj.hardwareVersion || '' }}</view>
<view>{{ $i18n.t('firmware') }} {{ xqobj.firmwareVersion || '' }}</view>
<view>{{$i18n.t('deviceMac')}}{{xqobj.mac}}</view>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
// 红外传感器
infraredSensorValue: this.$i18n.t('normalOpen'),
infraredSensorValueClass: '',
// 红外传感器灵敏度
infraredSensorSensitivityValue: this.$i18n.t('enabled'),
infraredSensorSensitivityValueClass: '',
// 麦克风启用
micEnabledValue: this.$i18n.t('enabled'),
micEnabledValueClass: '',
// 麦克风灵敏度
micSensitivityValue: this.$i18n.t('temperatureChange'),
micSensitivityValueClass: '',
// 加速度计振动
accelerometerVibrationValue: '100%',
accelerometerVibrationValueClass: '',
// 加速度计角度
accelerometerAngleValue: '45%',
accelerometerAngleValueClass: '',
// 环境温度
ambientTemperatureValue: this.$i18n.t('temperatureChangeDisplay'),
ambientTemperatureValueClass: '',
// 电池电量
batteryLevelValue: '100%',
batteryLevelValueClass: '',
// 设备覆盖
deviceCoverValue: this.$i18n.t('open'),
deviceCoverValueClass: 'red',
// 设备支架
deviceBracketValue: this.$i18n.t('normal'),
deviceBracketValueClass: '',
// 外部电源
externalPowerValue: this.$i18n.t('no'),
externalPowerValueClass: '',
// 集线器连接
hubConnectionValue: this.$i18n.t('connected'),
hubConnectionValueClass: '',
// 集线器信号强度
hubSignalStrengthLevel: 4,
hubSignalStrengthValueClass: '',
// 连接模式
connectionModeValue: this.$i18n.t('wired'),
connectionModeValueClass: '',
// LORA信号强度
loraSignalStrengthLevel: 4,
loraSignalStrengthValueClass: '',
// BLE信号强度
bleSignalStrengthLevel: 4,
bleSignalStrengthValueClass: '',
// LORA发射功率
loraTransmitPowerLevel: 4,
loraTransmitPowerValueClass: '',
// BLE发射功率
bleTransmitPowerLevel: 4,
bleTransmitPowerValueClass: '',
// 中继器
repeaterValue: this.$i18n.t('none'),
repeaterValueClass: '',
// NC接口
ncInterfaceValue: this.$i18n.t('enabled'),
ncInterfaceValueClass: '',
id:'',
xqobj:{},
isRefreshing:false,
}
},
onLoad(option) {
this.id = option.id
this.getxq()
},
methods: {
// 下拉刷新
onRefresh() {
this.isRefreshing = true
setTimeout(()=>{
this.isRefreshing = false
this.getxq()
},1000)
},
// 点击进行设备修改
btnrdit(){
uni.navigateTo({
url:'/subpackage/device/rentiredwai/xq'
})
},
// 进行设备详情请求
getxq(){
this.$http.get(`/bst/device/detail?id=${this.id}`).then(res => {
if(res.code == 200){
this.xqobj = res.data
}
})
},
// 点击返回上一级
btnback(){
uni.navigateBack()
}
}
}
</script>
<style scoped lang="less">
.tabback {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 160rpx;
padding: 0 20rpx;
padding-top: 80rpx;
box-sizing: border-box;
position: fixed;
top: 0;
left: 0;
z-index: 999 !important;
background-color: #fff;
.rtjt {
font-size: 36rpx;
}
}
.device-detail {
padding-top: 150rpx;
background-color: #F3F5F6;
}
.onebox {
width: 750rpx;
height: 288rpx;
background: #FFFFFF;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin-top: 32rpx;
.devicename {
padding: 24rpx 32rpx;
box-sizing: border-box;
border-bottom: 1px solid #D8D8D8;
.xi {
font-size: 28rpx;
color: #7F7F7F;
}
.cu {
font-size: 32rpx;
color: #3D3D3D;
margin-top: 10rpx;
border-bottom: 1px solid #D8D8D8;
padding-bottom: 18rpx;
box-sizing: border-box;
}
}
.room {
padding: 18rpx 32rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 18rpx;
.lt {
.xi {
font-size: 28rpx;
color: #7F7F7F;
}
.cu {
font-size: 32rpx;
color: #3D3D3D;
margin-top: 10rpx;
}
}
.rt {
image {
width: 28rpx;
height: 42rpx;
}
}
}
}
.avatar-box {
position: relative;
display: flex;
justify-content: center;
margin-top: 60rpx;
padding-bottom: 74rpx;
border-bottom: 1rpx solid #f2f2f2;
.avatar {
width: 278rpx;
height: 278rpx;
background: #e0e0e0;
border-radius: 24rpx;
box-shadow: 0 2rpx 8rpx #eee;
}
.scan-btn {
image{
width: 48rpx;
height: 48rpx;
}
position: absolute;
right: 26rpx;
top: -36rpx;
width: 48rpx;
height: 48rpx;
background: #fff;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
box-shadow: 0 2rpx 8rpx #eee;
border: 1rpx solid #eee;
}
}
.info-card {
background: #fff;
.info-item {
display: flex;
align-items: flex-start;
padding: 0 24rpx 0 32rpx;
position: relative;
min-height: 80rpx;
image{
width: 50rpx;
height: 50rpx;
margin-top: 30rpx;
}
.info-icon {
font-family: 'iconfont' !important;
font-size: 32rpx;
margin-right: 18rpx;
color: #222;
line-height: 80rpx;
}
.info-content {
flex: 1;
padding: 18rpx 0;
.info-title {
font-size: 28rpx;
color: #333;
font-weight: 500;
}
.info-status-row {
display: flex;
align-items: center;
margin-top: 6rpx;
min-height: 32rpx;
.info-status {
font-size: 26rpx;
color: #666;
&.red {
color: #e74c3c;
}
&.green {
color: #27ae60;
}
}
.signal-bar {
display: flex;
align-items: center;
.signal-block {
width: 62rpx;
height: 6rpx;
margin-right: 6rpx;
border-radius: 2rpx;
background: #e0e0e0;
&.active {
background: #4cd964;
}
}
}
}
}
.divider {
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 1rpx;
background: #f2f2f2;
}
}
}
.device-summary {
background: #f7f7f7;
text-align: center;
color: #888;
font-size: 24rpx;
line-height: 1.8;
border-radius: 0 0 20rpx 20rpx;
padding-top: 40rpx;
box-sizing: border-box;
padding-bottom: 30rpx;
}
</style>