开锁开灯初始状态修改

master
zhaotianci 2 months ago
parent 7528da037b
commit a3c796d832

@ -60,21 +60,21 @@
<div class="experiment-msg">
<CommonButton
class="btn"
:msg="!lockState ? '关锁' : '开锁'"
:msg="lockState ? '关锁' : '开锁'"
size="default"
paddingLeft="33"
paddingRight="33"
height="60"
:type=" !lockState ? 'info' : 'danger' "
:type=" lockState ? 'info' : 'danger' "
@click="setLock"></CommonButton>
<CommonButton
class="btn"
:msg="!lightState ? '关灯' : '开灯'"
:msg="lightState ? '关灯' : '开灯'"
size="default"
paddingLeft="33"
paddingRight="33"
height="60"
:type=" !lightState ? 'info' : 'danger' "
:type=" lightState ? 'info' : 'danger' "
@click="setLight"></CommonButton>
<CommonButton
v-if="!startStatus"
@ -145,13 +145,13 @@ const confirm = () =>{
}
let lightState = ref(false)
const setLight = () =>{
sendMsgApi({name:'LED',status: lightState.value ? 1:0,tmp:'',})
sendMsgApi({name:'LED',status: !lightState.value ? 1:0,tem:0,})
lightState.value = !lightState.value
}
let lockState = ref(false)
const setLock = () =>{
sendMsgApi({name:'LOCK',status: lockState.value ? 1:0,tmp:'',})
sendMsgApi({name:'LOCK',status: !lockState.value ? 1:0,tem:0,})
lockState.value = !lockState.value
}

Loading…
Cancel
Save