浇花器增睡眠命令

This commit is contained in:
3321822538@qq.com 2025-05-14 15:09:02 +08:00
parent 3a05a5631f
commit 50ee64fd4b
2 changed files with 42 additions and 34 deletions

View File

@ -4,7 +4,7 @@
</u-navbar>
<!-- 背景 -->
<view class="img">
<image class="img" src="https://api.ccttiot.com/smartmeter/img/static/uVKucPVDjxjaCDCpFKvw" mode=""></image>
<image class="img" :src="imgpic" mode=""></image>
</view>
<view class="name" @click="btnxianshi">
<view class="">{{user.deviceName == undefined ? '--' : user.deviceName}}</view>
@ -17,9 +17,9 @@
<text class="one" style="margin-right: 124rpx;">MAC</text>
<text>{{user.mac == undefined ? '--' : user.mac}}</text>
</view>
<view class="wifi" style="margin-top: 78rpx;" @click="xpshow = true">
<view class="wifi" style="margin-top: 78rpx;" @click="btnxip">
<view class="">息屏</view>
<view class="flex">{{xptxt}}
<view class="flex">{{xinpin == null ? '--' : xinpin + '秒'}}
<image src="https://api.ccttiot.com/smartmeter/img/static/uiTIUYnR3ClrmqOTyF8F" mode=""></image>
</view>
</view>
@ -40,7 +40,6 @@
</view>
</view>
<!-- 息屏选择器 -->
<u-select v-model="xpshow" :list="xplist" @confirm="xpconfirm"></u-select>
<!-- 固件更新选择器 -->
<u-select v-model="gjshow" :list="gjlist" @confirm="gjconfirm"></u-select>
<!-- 修改设备名称弹框 -->
@ -82,6 +81,9 @@
切记在蓝牙范围内以防升级失败
</view>
</view>
<u-picker v-model="xpshow" mode="time" :default-time="00" :params="params" @confirm="confirm"></u-picker>
</view>
</template>
@ -94,31 +96,14 @@
gjshow: false,
xptxt: '',
nameflag: false,
xplist: [{
value: '1',
label: '30秒'
},
{
value: '2',
label: '一分钟'
},
{
value: '2',
label: '三分钟'
},
{
value: '2',
label: '五分钟'
}
],
gjlist: [{
value: '1',
label: 'v2.1.2'
},
{
value: '2',
label: 'v2.1.3'
}],
params: {
year: false,
month: false,
day: false,
hour: false,
minute: true,
second: true
},
deviceid: '',
user: {},
namesb: '',
@ -128,7 +113,9 @@
progress:0,
shengjiflag:false,
xctime:'--',
version:''
version:'',
xinpin:'',
imgpic:''
}
},
//
@ -149,7 +136,9 @@
onLoad(option) {
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
this.deviceid = option.deviceid
this.imgpic = option.img
if(option.xctime != '--'){
this.xinpin = option.xipin
if(option.xctime != '--' && option.ver){
this.ver = 'V' + option.ver.slice(3)
this.xctime = option.xctime
@ -166,6 +155,24 @@
this.getshebxq()
},
methods: {
btnxip(){
if(this.xinpin == '' || this.xinpin == null){
uni.showToast({
title: '请先连接蓝牙拿取息屏时间',
icon: 'none',
duration: 2000
})
}else{
this.xpshow = true
}
},
//
confirm(e) {
this.xinpin = Number(e.minute * 60) + Number(e.second)
xBlufi.notifySendCustomData({
customData: '11sleep' + this.xinpin + '@'
})
},
//
btnjiebang() {
let that = this

View File

@ -435,7 +435,8 @@
csbobj:{},
disconnectTimer: null,
devicetime:'',
imgpic:''
imgpic:'',
xinp:''
}
},
//
@ -906,7 +907,7 @@
btnsz() {
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent)
uni.navigateTo({
url: '/page_user/upload?deviceid=' + this.shebid + '&ver=' + this.ver + '&xctime=' + this.xctime
url: '/page_user/upload?deviceid=' + this.shebid + '&ver=' + this.ver + '&xctime=' + this.xctime + '&xipin=' + this.xinp + '&img=' + this.imgpic
})
},
//
@ -1206,7 +1207,6 @@
//
this.yschecked = this.showobj.showArray[1] !== 1;
this.etchecked = this.showobj.showArray[0] !== 1;
//
const calculateTimeDifference = (date1, date2) => {
const diffMs = Math.abs(date1 - date2);
@ -1272,7 +1272,8 @@
nextTimeDiff: this.xctime,
prevTime: this.sctimejs
});
console.log(this.showobj.showArray,this.showobj.showArray[6],'02020202020');
this.xinp = this.showobj.showArray[this.showobj.showArray.length - 1]
console.log(this.showobj.showArray,this.showobj.showArray[6],this.showobj.showArray[this.showobj.showArray.length - 1],'02020202020');
if(this.showobj.showArray[6] && this.showobj.showArray[7]){
//
const yiStr = String(this.showobj.showArray[6])