From c571372e424f286f159f02b7bfc56e072f259448 Mon Sep 17 00:00:00 2001 From: "3321822538@qq.com" <3321822538@qq.com> Date: Sat, 10 May 2025 15:08:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=87=E8=8A=B1=E5=99=A8=E6=8A=BD=E6=B0=B4?= =?UTF-8?q?=E6=B3=B5=E4=BF=AE=E6=94=B9=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- page_user/dingshi.vue | 2 +- pages/index/index.vue | 120 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 117 insertions(+), 5 deletions(-) diff --git a/page_user/dingshi.vue b/page_user/dingshi.vue index bc5249c..de7ce48 100644 --- a/page_user/dingshi.vue +++ b/page_user/dingshi.vue @@ -399,7 +399,7 @@ this.showLoading(); this.timeflag = false; - let cucun = '11p_set0' + ',' + this.shi + ',' + this.fen + ',' + this.miao + ',' + this.tian + ',' + this.jgtian; + let cucun = '11pset' + ',' + this.shi + ',' + this.fen + ',' + this.miao + ',' + this.tian; this.lastOperation = () => { xBlufi.notifySendCustomData({ customData: cucun diff --git a/pages/index/index.vue b/pages/index/index.vue index 7b38107..e42ba99 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -57,7 +57,7 @@ - + 型号:{{user.model == undefined ? '--' : user.model}} MAC:{{user.mac == undefined ? '--' : user.mac}} @@ -236,6 +236,22 @@ + + + + + + 当前时间 + + + 点击可再次设置当前时间 + + + + {{devicetime == '' ? '--' : devicetime}} + + + @@ -310,7 +326,7 @@ MAC:{{item.mac}} - + @@ -341,7 +357,8 @@ - + + @@ -352,6 +369,7 @@ export default { data() { return { + timeflag:false, one: false, ones: true, two: false, @@ -375,6 +393,14 @@ minute: true, second: true }, + paramss: { + year: false, + month: false, + day: false, + hour: true, + minute: true, + second: false + }, minute: '--', second: '--', hasShownVersionAlert: false, @@ -408,6 +434,8 @@ pre:'', csbobj:{}, disconnectTimer: null, + devicetime:'', + imgpic:'' } }, // 分享到好友(会话) @@ -530,6 +558,7 @@ if(res.data.length > 0 || res.data != ''){ this.bjflag = false this.devicelist = res.data + this.imgpic = res.data[0].modelPicture this.mac = res.data[0].mac this.pre = res.data[0].pre this.deviceId = res.data[0].mac.match(/.{2}/g).reverse().join(':') @@ -620,6 +649,46 @@ }, 1500) } }, + // 点击显示设置时间 + btnsztime(){ + this.handleUserAction() + if(this.vardataflag != 3){ + uni.showToast({ + title: '设备未连接', + icon: 'none', + duration:2000 + }) + }else{ + this.timeflag = true + } + }, + // 点击设置当前时间 + confirmtime(e){ + if(this.pre == 'WATER'){ //单阀 + uni.showLoading({ + title: '设置中...' + }) + console.log(e.hour,e.minute); + setTimeout(() => { + this.devicetime = e.hour + ':' + e.minute + xBlufi.notifySendCustomData({ + customData: '11date' + e.hour + ':' + e.minute + ';' + }) + uni.hideLoading() + }, 1500) + }else{ //抽水泵 + uni.showLoading({ + title: '设置中...' + }) + console.log(e.hour,e.minute); + setTimeout(() => { + xBlufi.notifySendCustomData({ + customData: '11hour' + e.hour + '@' + e.minute + '@', + }) + uni.hideLoading() + }, 1500) + } + }, // 雨水感应关闭 btnyushuis() { this.handleUserAction() @@ -890,6 +959,7 @@ if(res.code == 200){ this.mac = res.data.mac this.pre = res.data.pre + this.imgpic = res.data.modelPicture this.deviceId = res.data.mac.match(/.{2}/g).reverse().join(':') this.user = res.data } @@ -1202,6 +1272,12 @@ nextTimeDiff: this.xctime, prevTime: this.sctimejs }); + console.log(this.showobj.showArray,this.showobj.showArray[6],'02020202020'); + if(this.showobj.showArray[6] && this.showobj.showArray[7]){ + let yi = this.showobj.showArray[6].length < 10 ? '0' + this.showobj.showArray[6] : this.showobj.showArray[6] + let er = this.showobj.showArray[7].length < 10 ? '0' + this.showobj.showArray[7] : this.showobj.showArray[7] + this.devicetime = yi + ':' + er + } }, // 初始化断开蓝牙定时器 initDisconnectTimer() { @@ -1211,7 +1287,7 @@ console.log('一分钟无操作,断开蓝牙连接') this.disconnectBluetooth() } - }, 60000) // 60秒 = 1分钟 + }, 600000) }, // 重置断开蓝牙定时器 @@ -1262,6 +1338,41 @@