浇花器

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) {
uni.showLoading({
title: '操作中...'
})
try {
this.showLoading()
// this.kgflag = true
@ -310,10 +313,11 @@
customData: "11get"
})
// setTimeout(() => {
setTimeout(() => {
// this.kgflag = false
uni.hideLoading()
this.hideLoading()
// }, 2000)
}, 1000)
} catch (error) {
console.error('btnchange error:', error)
this.retryOperation()
@ -425,7 +429,15 @@
this.showLoading();
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 = () => {
xBlufi.notifySendCustomData({
customData: cucun

View File

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