From 3a05a5631f2aa6bb4ba0df1e6ad69a8200f88ea1 Mon Sep 17 00:00:00 2001 From: "3321822538@qq.com" <3321822538@qq.com> Date: Tue, 13 May 2025 09:17:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=87=E8=8A=B1=E5=99=A8=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- page_user/dingshi.vue | 103 ++++++++++++++++++++++++++++++------------ pages/index/index.vue | 20 ++++---- 2 files changed, 86 insertions(+), 37 deletions(-) diff --git a/page_user/dingshi.vue b/page_user/dingshi.vue index de7ce48..5f99ffa 100644 --- a/page_user/dingshi.vue +++ b/page_user/dingshi.vue @@ -66,23 +66,34 @@ - - 抽水泵启动时间/时: + + 浇水设置 + + + 启动时间: + + {{shi == '' ? '' : shi + ':' + fen}} + - 抽水泵启动时间/分: + 工作时长: + + + 秒 + - - 抽水泵工作时长/秒: - - - 抽水泵间隔时间/天: - - - 保存 + + 间隔时间: + + + 天 + - + + 保存 + + 没有更多定时浇水啦... @@ -94,6 +105,15 @@ export default { data() { return { + showtime: false, + paramstime: { + year: false, + month: false, + day: false, + hour: true, + minute: true, + second: false + }, bgc: { backgroundColor: "#fff", }, @@ -199,6 +219,12 @@ }, methods: { + // 选择启动时间 + confirmtime(e){ + console.log(e); + this.shi = e.hour + this.fen = e.minute + }, // 点击选择浇水时间 btnshowone(){ this.defaultTime = (this.hour.length < 10 ? '0' + this.hour : this.hour) + ':' + (this.minutekq.length < 10 ? '0' + this.minutekq : this.minutekq) @@ -527,30 +553,49 @@ /deep/ .uicon-nav-back { margin-bottom: 22rpx; } + .baocun{ + margin: auto; + width: 680rpx; + height: 94rpx; + background: #48893B; + border-radius: 14rpx 14rpx 14rpx 14rpx; + margin-top: 50rpx; + text-align: center; + line-height: 100rpx; + border-radius: 20rpx; + color: #fff; + font-size: 32rpx; + } .choushuiben{ - .baocun{ - margin: auto; - width: 630rpx; - height: 100rpx; - margin-top: 50rpx; - text-align: center; - line-height: 100rpx; - border-radius: 20rpx; - background-color: #7FAD76; - color: #fff; - font-size: 32rpx; + width: 680rpx; + height: 426rpx; + background: #FFFFFF; + box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0,0,0,0.08); + border-radius: 20rpx; + padding: 36rpx 34rpx; + box-sizing: border-box; + .tit{ + font-weight: 600; + font-size: 36rpx; + color: #3D3D3D; } .name{ display: flex; - height: 100rpx; - line-height: 100rpx; + justify-content: space-between; + align-items: center; + margin-top: 34rpx; + border-bottom: 1px solid #D8D8D8; + padding-bottom: 34rpx; + box-sizing: border-box; + view{ + display: flex; + } text{ - width: 300rpx; + font-size: 32rpx; + color: #3D3D3D; } input{ - border-bottom: 1px solid #ccc; - height: 100rpx; - line-height: 100rpx; + width: 100rpx; } } } diff --git a/pages/index/index.vue b/pages/index/index.vue index e42ba99..9f6ffdc 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -229,10 +229,10 @@ - - 抽水泵启动时间:{{csbobj.hour == undefined ? '--' : csbobj.hour + '时'}}{{csbobj.minute == undefined ? '' : csbobj.minute + '分'}} - 抽水泵工作时长/秒:{{csbobj.second == undefined ? '--' : csbobj.second + '秒'}} - 抽水泵间隔时间/天:{{csbobj.day == undefined ? '--' : csbobj.day + '天'}} + + 抽水泵启动时间:{{csbobj.hour == undefined ? '--' : csbobj.hour + '时'}}{{csbobj.minute == undefined ? '' : csbobj.minute + '分'}} + 抽水泵工作时长/秒:{{csbobj.second == undefined ? '--' : csbobj.second + '秒'}} + 抽水泵间隔时间/天:{{csbobj.day == undefined ? '--' : csbobj.day + '天'}} @@ -1014,7 +1014,7 @@ xBlufi.notifySendCustomData({ customData: "11get" }) - }, 1000) + }, 3000) }else{ this.vardataflag = 1 this.clearDisconnectTimer() @@ -1274,9 +1274,13 @@ }); 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 + // 显式转为字符串 + const yiStr = String(this.showobj.showArray[6]) + const erStr = String(this.showobj.showArray[7]) + // 判断字符串长度是否为1(而不是<10) + let yi = yiStr.length === 1 ? '0' + yiStr : yiStr + let er = erStr.length === 1 ? '0' + erStr : erStr + this.devicetime = yi + ':' + er } }, // 初始化断开蓝牙定时器