浇花器

This commit is contained in:
3321822538@qq.com 2025-07-07 11:30:32 +08:00
parent 3a672a3795
commit 0c19bc56db
2 changed files with 52 additions and 37 deletions

View File

@ -280,6 +280,9 @@
// //
async btnchange(key, index, values) { async btnchange(key, index, values) {
uni.showLoading({
title: '操作中...'
})
try { try {
this.showLoading() this.showLoading()
// this.kgflag = true // this.kgflag = true
@ -310,10 +313,11 @@
customData: "11get" customData: "11get"
}) })
// setTimeout(() => { setTimeout(() => {
// this.kgflag = false // this.kgflag = false
uni.hideLoading()
this.hideLoading() this.hideLoading()
// }, 2000) }, 1000)
} catch (error) { } catch (error) {
console.error('btnchange error:', error) console.error('btnchange error:', error)
this.retryOperation() this.retryOperation()
@ -425,7 +429,15 @@
this.showLoading(); this.showLoading();
this.timeflag = false; this.timeflag = false;
let cucun = '11pset' + ',' + this.shi + ',' + this.fen + ',' + this.miao + ',' + this.tian; if(this.tian > 99){
uni.showToast({
title: '间隔最大时间为99天',
icon: 'none',
duration:2000
})
}
let tian = this.tian > 99 ? 99 : this.tian
let cucun = '11pset' + ',' + this.shi + ',' + this.fen + ',' + this.miao + ',' + tian + '@'
this.lastOperation = () => { this.lastOperation = () => {
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: cucun customData: cucun

View File

@ -1303,40 +1303,43 @@
} }
}, },
// //
getcsbshuju(){ getcsbshuju() {
const input = this.datalist // 1.
const inputString = this.datalist; const inputString = this.datalist;
const hasAtSymbol = inputString.includes('@');
let processedString; // 2.
let currentDay = 0; const normalizedString = inputString.replace(/;/g, ',');
if (hasAtSymbol) {
const [ver, restOfString] = inputString.split('@'); // 3.
this.ver = ver || ''; const parts = normalizedString.split(':');
processedString = restOfString || ''; console.log('分割结果:', parts); // ["ver3@p_set0", "11,5,603,99,19,9,0,"]
//
const showMatch = processedString.match(/show:([^;]+)/); // 4.
if (showMatch) { let dataPart = parts[1];
const showValues = showMatch[1].split(','); if (dataPart.endsWith(',')) {
currentDay = parseInt(showValues[showValues.length - 1]) || 0; dataPart = dataPart.slice(0, -1);
} }
} else {
processedString = inputString; // 5.
this.ver = ''; const result = [parts[0], dataPart];
} console.log('最终结果:', result); // ["ver3@p_set0", "11,5,603,99,19,9,0"]
const version = this.ver;
const parts = input.replace(";", "").split(":") // 6.
// const timeParts = dataPart.split(',');
const timeParts = parts[1].split(",")
//
this.csbobj = { this.csbobj = {
hour: parseInt(timeParts[0]) < 10 ? '0' + parseInt(timeParts[0]) : parseInt(timeParts[0]), // hour: String(timeParts[0]).padStart(2, '0'),
minute: parseInt(timeParts[1]) < 10 ? '0' + parseInt(timeParts[1]) : parseInt(timeParts[1]), // minute: String(timeParts[1]).padStart(2, '0'),
second: parseInt(timeParts[2]), // second: timeParts[2],
day: parseInt(timeParts[3]) // day: timeParts[3]
} };
this.devicetime = parseInt(timeParts[4]) + ':' + parseInt(timeParts[5])
this.ver_data = this.csbobj const hours = parseInt(timeParts[4]) || 0;
// console.log(this.csbobj); const minutes = parseInt(timeParts[5]) || 0;
this.devicetime = `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`;
this.ver_data = {...this.csbobj};
console.log('设备时间:', this.devicetime);
}, },
// //
getchuli() { getchuli() {