congming_huose-apk/pages/device/yanganedit.vue

538 lines
12 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('setuptitle') }}</view>
<view style="width: 36rpx;"></view>
</view>
<view class="" style="width: 100%;height: 204rpx;"></view>
<view class="onebox">
<view class="devicename">
<view class="xi">
{{ $i18n.t('deviceName') }}
</view>
<view class="cu">
{{ $i18n.t('smokeDetector') }}
</view>
</view>
<view class="room">
<view class="lt">
<view class="xi">
{{ $i18n.t('room') }}
</view>
<view class="">
{{ $i18n.t('office') }}
</view>
</view>
<view class="rt">
<image src="https://api.ccttiot.com/smartmeter/img/static/uySh70FcAiX0ip7K2fPO" mode=""></image>
</view>
</view>
</view>
<view class="namesz">
{{ $i18n.t('smokeDetectorSettings') }}
</view>
<view class="mckaiguan">
<view class="lt">
{{ $i18n.t('protectionMode') }}
</view>
<view class="rt">
<switch checked="true" color="#000000"/>
</view>
</view>
<view class="mckaiguan">
<view class="lt">
{{ $i18n.t('notificationMode') }}
</view>
<view class="rt">
<switch checked="true" color="#000000"/>
</view>
</view>
<view class="mckaiguan">
<view class="lt">
{{ $i18n.t('smokeDetectorStatus') }}
</view>
<view class="rt">
<switch checked="true" color="#000000"/>
</view>
</view>
<view class="mckaiguan">
<view class="lt">
{{ $i18n.t('temperatureFire') }}
</view>
<view class="rt">
<switch checked="true" color="#000000"/>
</view>
</view>
<view class="mckaiguan">
<view class="lt">
{{ $i18n.t('coPpm') }}
</view>
<view class="rt">
<switch checked="true" color="#000000"/>
</view>
</view>
<view class="mckaiguan">
<view class="lt">
{{ $i18n.t('voc') }}
</view>
<view class="rt">
<switch checked="true" color="#000000"/>
</view>
</view>
<view class="mckaiguan">
<view class="lt">
{{ $i18n.t('speaker') }}
</view>
<view class="rt">
<switch checked="true" color="#000000"/>
</view>
</view>
<view class="mckaiguan">
<view class="lt">
{{ $i18n.t('ambientTemperature') }}
</view>
<view class="rt">
<switch checked="true" color="#000000"/>
</view>
</view>
<view class="" style="width: 100%;background-color: #fff;margin-top: 32rpx;padding: 36rpx 32rpx;box-sizing: border-box;color: #3d3d3d;font-size: 30rpx;padding-bottom: 0;">
{{ $i18n.t('temperatureCondition') }}
</view>
<view class="dlyanchi">
<view class="lt">
<view class="">
{{ $i18n.t('time') }}
</view>
<view class="" style="margin-top: 12rpx;">
12:00
</view>
</view>
<view class="rt">
<image src="https://api.ccttiot.com/smartmeter/img/static/uBGHYzuIqjyZXGHiTT8q" mode=""></image>
</view>
</view>
<view class="dlyanchi" style="border-top: 1px solid #d8d8d8;">
<view class="lt">
<view class="">
{{ $i18n.t('temperature') }}
</view>
<view class="" style="margin-top: 12rpx;">
80
</view>
</view>
<view class="rt">
<image src="https://api.ccttiot.com/smartmeter/img/static/uBGHYzuIqjyZXGHiTT8q" mode=""></image>
</view>
</view>
<view class="accel-card">
<view class="accel-title">{{ $i18n.t('temperatureFire') }}</view>
<view class="accel-slider-wrap">
<view class="accel-cap left" @click="decAccels"></view>
<view class="accel-track">
<view class="accel-indicator" :style="{ left: `${accelValues}%` }">{{accelValues}}</view>
<slider class="accel-slider" min="0" max="100" step="1" :value="accelValues" activeColor="#3D3D3D" backgroundColor="#D8D8D8" block-size="36" @changing="accelChangings" @change="accelChanges"/>
</view>
<view class="accel-cap right" @click="incAccels"></view>
<view class="accel-scale l">0</view>
<view class="accel-scale r">100</view>
</view>
<view class="accel-desc">{{ $i18n.t('temperatureFireAlertDesc') }}</view>
</view>
<view class="mckaiguan" style="margin-top: 68rpx;">
<view class="lt">
{{ $i18n.t('independentMode') }}
</view>
<view class="rt">
<switch checked="true" color="#000000"/>
</view>
</view>
<view class="onebox" style="max-height: 152rpx;">
<view class="devicename">
<view class="xi">
{{ $i18n.t('deviceName') }}
</view>
<view class="cu">
{{ $i18n.t('smokeDetector') }}
</view>
</view>
</view>
<view class="mckaiguan" style="margin-top: 32rpx;">
<view class="lt">
{{ $i18n.t('ledDisplay') }}
</view>
<view class="rt">
<switch checked="true" color="#000000"/>
</view>
</view>
<view class="mckaiguan">
<view class="lt">
{{ $i18n.t('autoInstallSoftware') }}
</view>
<view class="rt">
<switch checked="true" color="#000000"/>
</view>
</view>
<view class="mckaiguan">
<view class="lt">
{{ $i18n.t('loraTransmitPower') }}
</view>
<view class="rt">
<switch checked="true" color="#000000"/>
</view>
</view>
<view class="mckaiguan">
<view class="lt">
{{ $i18n.t('bleTransmitPower') }}
</view>
<view class="rt">
<switch checked="true" color="#000000"/>
</view>
</view>
<view class="mckaiguan">
<view class="lt">
{{ $i18n.t('otherSmokeDetectorAlarm') }}
</view>
<view class="rt">
<switch checked="true" color="#000000"/>
</view>
</view>
<view class="moshi">
<view class="lt">
<view class="xi">
{{ $i18n.t('speakerAlarm') }}
</view>
<view class="cu">
{{ $i18n.t('whenTemperatureRises') }}
</view>
</view>
<view class="rt">
<image src="https://api.ccttiot.com/smartmeter/img/static/uySh70FcAiX0ip7K2fPO" mode=""></image>
</view>
</view>
<view class="mckaiguan" style="margin-top: 32rpx;">
<view class="lt">
{{ $i18n.t('powerSavingBatteryMode') }}
</view>
<view class="rt">
<switch checked="true" color="#000000"/>
</view>
</view>
<view class="shuom">
<view class="lt">
<image src="https://api.ccttiot.com/smartmeter/img/static/uYaNZmHzfJpDCDPkwIen" mode=""></image> {{ $i18n.t('userGuide') }}
</view>
<image src="https://api.ccttiot.com/smartmeter/img/static/uBGHYzuIqjyZXGHiTT8q" mode=""></image>
</view>
<view class="anniu">
{{ $i18n.t('deldev') }}
</view>
</view>
</template>
<script>
export default {
data() {
return {
id:'',
xqobj:{},
accelValues:0,
}
},
onLoad(option) {
},
methods: {
// 进行设备详情请求
getxq(){
this.$http.get(`/bst/device/detail?id=${this.id}`).then(res => {
if(res.code == 200){
this.xqobj = res.data
}
})
},
// 点击返回上一级
btnback(){
uni.navigateBack()
},
accelChangings(e){
this.accelValues = e.detail.value
},
accelChanges(e){
this.accelValues = e.detail.value
},
incAccels(){
const next = this.accelValues + 1
this.accelValues = next > 100 ? 100 : next
},
decAccels(){
const next = this.accelValues - 1
this.accelValues = next < 0 ? 0 : next
},
}
}
</script>
<style scoped lang="less">
.shuom{
width: 750rpx;
height: 128rpx;
background: #FFFFFF;
border-radius: 0rpx 0rpx 0rpx 0rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 32rpx;
padding: 0 32rpx;
box-sizing: border-box;
.lt{
display: flex;
align-items: center;
image{
width: 80rpx;
height: 80rpx;
margin-right: 40rpx;
}
}
image{
width: 56rpx;
height: 56rpx;
}
}
.moshi{
width: 750rpx;
height: 164rpx;
background: #FFFFFF;
border-radius: 0rpx 0rpx 0rpx 0rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 32rpx;
padding: 0 32rpx;
box-sizing: border-box;
.lt{
.xi{
font-size: 26rpx;
color: #7F7F7F;
}
.cu{
font-size: 30rpx;
color: #3D3D3D;
margin-top: 12rpx;
}
}
.rt{
image{
width: 28rpx;
height: 42rpx;
}
}
}
.accel-card{
width: 750rpx;
background: #FFFFFF;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin-top: 32rpx;
padding: 28rpx 32rpx 36rpx 32rpx;
box-sizing: border-box;
}
.accel-title{
font-size: 30rpx;
color: #3D3D3D;
margin-bottom: 50rpx;
}
.accel-slider-wrap{
position: relative;
display: flex;
align-items: center;
}
.accel-track{ flex: 1; position: relative; }
.accel-slider{}
.accel-cap{
width: 44rpx;
height: 44rpx;
border: 2rpx solid #D8D8D8;
border-radius: 6rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
color: #3D3D3D;
background: #FFFFFF;
}
.accel-cap.left{ margin-right: 18rpx; }
.accel-cap.right{ margin-left: 18rpx; }
.accel-indicator{
position: absolute;
top: -34rpx;
transform: translateX(-50%);
font-size: 22rpx;
color: #3D3D3D;
}
.accel-scale{
position: absolute;
bottom: -26rpx;
font-size: 20rpx;
color: #7F7F7F;
}
/* 与左右按钮中心对齐:按钮宽 44rpx因此取 22rpx 并用 translate 居中 */
.accel-scale.l{ left: 22rpx; transform: translateX(-50%); }
.accel-scale.r{ right: 22rpx; transform: translateX(50%); }
.accel-desc{
margin-top: 40rpx;
font-size: 24rpx;
color: #7F7F7F;
line-height: 38rpx;
}
.dlyanchi{
width: 750rpx;
height: 164rpx;
background: #FFFFFF;
border-radius: 0rpx 0rpx 0rpx 0rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
box-sizing: border-box;
.lt{
view{
font-size: 26rpx;
color: #7F7F7F;
}
}
.rt{
image{
width: 56rpx;
height: 56rpx;
}
}
}
.namesz{
font-size: 32rpx;
color: #7F7F7F;
margin-top: 68rpx;
width: 100%;
padding: 0 32rpx;
box-sizing: border-box;
margin-bottom: 16rpx;
}
.mckaiguan{
width: 750rpx;
height: 116rpx;
background: #FFFFFF;
border-radius: 0rpx 0rpx 0rpx 0rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
box-sizing: border-box;
border-top: 1px solid #D8D8D8;
.lt{
font-size: 30rpx;
color: #3D3D3D;
}
}
.anniu{
width: 750rpx;
height: 118rpx;
background: #FFFFFF;
border-radius: 0rpx 0rpx 0rpx 0rpx;
font-size: 36rpx;
color: #FF5353;
text-align: center;
line-height: 118rpx;
position: fixed;
left: 0;
bottom: 0;
z-index: 999;
box-shadow: 0rpx 20rpx 26rpx 4rpx #000;
}
.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;
}
}
}
}
.tabback{
width: 750rpx;
height: 204rpx;
background: #FCFCFC;
border-radius: 0rpx 0rpx 0rpx 0rpx;
position: fixed;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 28rpx;
box-sizing: border-box;
border-bottom: 1px solid #D8D8D8;
padding-top: 52rpx;
z-index: 999;
.name{
font-size: 36rpx;
color: #3D3D3D;
}
.rtjt {
font-size: 36rpx;
}
}
.device-detail{
background-color: #F3F5F6;
height: 100vh;
overflow: scroll;
padding-bottom: 186rpx;
box-sizing: border-box;
}
</style>