浇花器

This commit is contained in:
3321822538@qq.com 2025-05-17 12:10:46 +08:00
parent 50ee64fd4b
commit 39f3134e6b
3 changed files with 75 additions and 69 deletions

View File

@ -90,7 +90,7 @@
</view>
</view>
</view>
<view class="baocun" @click="btnbc">
<view class="baocun" v-if="pre != 'WATER'" @click="btnbc">
保存
</view>
<u-picker v-model="showtime" mode="time" :params="paramstime" :default-time="00" @confirm='confirmtime'></u-picker>
@ -281,21 +281,21 @@
//
async btnchange(key, index, values) {
try {
this.showLoading();
this.kgflag = true;
this.btnitem(key, index, values);
this.btnqx();
this.deviceindex = index;
this.devicehour = values[0] || 0; //
this.deviceminute = values[1] || 0;
this.devicemiao = values[2] || 0;
this.showLoading()
// this.kgflag = true
this.btnitem(key, index, values)
this.btnqx()
this.deviceindex = index
this.devicehour = values[0] || 0 //
this.deviceminute = values[1] || 0
this.devicemiao = values[2] || 0
if (this.list.hasOwnProperty(key)) {
const array = this.list[key];
const lastIndex = array.length - 1;
const lastElement = array[lastIndex];
array[lastIndex] = !lastElement;
this.deviceflag = lastElement ? 0 : 1;
const array = this.list[key]
const lastIndex = array.length - 1
const lastElement = array[lastIndex]
array[lastIndex] = !lastElement
this.deviceflag = lastElement ? 0 : 1
}
let flag = values[3] == 0 ? 1 : 0
let cucun = '11p_set' + (Number(this.deviceindex) + 1)+ ':' + this.devicehour + ',' + this.deviceminute + ',' + this.devicemiao + ',' + flag + ',' + this.jgtian + ';'
@ -308,23 +308,23 @@
await this.delay(1000)
xBlufi.notifySendCustomData({
customData: "11get"
});
})
setTimeout(() => {
this.kgflag = false;
this.hideLoading();
}, 2000);
// setTimeout(() => {
// this.kgflag = false
this.hideLoading()
// }, 2000)
} catch (error) {
console.error('btnchange error:', error);
this.retryOperation();
console.error('btnchange error:', error)
this.retryOperation()
}
},
//
btnitem(key, index, values) {
// key 'p_set1' '1'
const indexMatch = key.match(/p_set(\d+)/);
this.deviceindex = indexMatch ? indexMatch[1] : index;
const indexMatch = key.match(/p_set(\d+)/)
this.deviceindex = indexMatch ? indexMatch[1] : index
this.timeflag = true
this.hour = values[0]
this.minutekq = values[1]
@ -350,16 +350,16 @@
formattedTime(minutes, seconds) {
//
const formattedMinutes = String(minutes).padStart(2, '0');
const formattedSeconds = String(seconds).padStart(2, '0');
const formattedMinutes = String(minutes).padStart(2, '0')
const formattedSeconds = String(seconds).padStart(2, '0')
//
return `${formattedMinutes}:${formattedSeconds}`;
return `${formattedMinutes}:${formattedSeconds}`
},
formatTime(seconds) {
const minutes = Math.floor(seconds / 60);
const remainingSeconds = seconds % 60;
return `${minutes}${remainingSeconds < 10 ? '0' : ''}${remainingSeconds}`;
const minutes = Math.floor(seconds / 60)
const remainingSeconds = seconds % 60
return `${minutes}${remainingSeconds < 10 ? '0' : ''}${remainingSeconds}`
},
//
@ -387,21 +387,21 @@
this.lastOperation = () => {
xBlufi.notifySendCustomData({
customData: cucun
});
};
this.lastOperation();
})
}
this.lastOperation()
await this.delay(1000);
await this.delay(1000)
xBlufi.notifySendCustomData({
customData: "11get"
});
setTimeout(() => {
this.hideLoading();
}, 2000);
// setTimeout(() => {
this.hideLoading()
// }, 2000)
} catch (error) {
console.error('btnqd error:', error);
this.retryOperation();
console.error('btnqd error:', error)
this.retryOperation()
}
},
//
@ -412,15 +412,15 @@
title: '最大值为23时',
icon: 'none',
duration:2000
});
return;
})
return
} else if(this.fen >= 60){
uni.showToast({
title: '最大值为59分钟',
icon: 'none',
duration:2000
});
return;
})
return
}
this.showLoading();
@ -429,27 +429,27 @@
this.lastOperation = () => {
xBlufi.notifySendCustomData({
customData: cucun
});
})
};
this.lastOperation();
this.lastOperation()
await this.delay(1000);
await this.delay(1000)
xBlufi.notifySendCustomData({
customData: "11get"
});
})
uni.showToast({
title: '保存成功',
icon: 'success',
duration: 2000
});
})
setTimeout(() => {
this.hideLoading();
}, 2000);
// setTimeout(() => {
this.hideLoading()
// }, 2000)
} catch (error) {
console.error('btnbc error:', error);
this.retryOperation();
console.error('btnbc error:', error)
this.retryOperation()
}
},
//

View File

@ -154,6 +154,12 @@
this.getshebxq()
},
onUnload() {
this.ver = ''
},
onHide() {
this.ver = ''
},
methods: {
btnxip(){
if(this.xinpin == '' || this.xinpin == null){

View File

@ -641,13 +641,13 @@
uni.showLoading({
title: '开启中...'
})
setTimeout(() => {
// setTimeout(() => {
this.yschecked = false
xBlufi.notifySendCustomData({
customData: '11yudi'
})
uni.hideLoading()
}, 1500)
// }, 1500)
}
},
//
@ -670,24 +670,24 @@
title: '设置中...'
})
console.log(e.hour,e.minute);
setTimeout(() => {
// setTimeout(() => {
this.devicetime = e.hour + ':' + e.minute
xBlufi.notifySendCustomData({
customData: '11date' + e.hour + ':' + e.minute + ';'
})
uni.hideLoading()
}, 1500)
// }, 1500)
}else{ //
uni.showLoading({
title: '设置中...'
})
console.log(e.hour,e.minute);
setTimeout(() => {
// setTimeout(() => {
xBlufi.notifySendCustomData({
customData: '11hour' + e.hour + '@' + e.minute + '@',
})
uni.hideLoading()
}, 1500)
// }, 1500)
}
},
//
@ -705,13 +705,13 @@
uni.showLoading({
title: '关闭中...'
})
setTimeout(() => {
// setTimeout(() => {
this.yschecked = true
xBlufi.notifySendCustomData({
customData: '11unyudi'
})
uni.hideLoading()
}, 1500)
// }, 1500)
}
},
//
@ -729,13 +729,13 @@
uni.showLoading({
title: '开启中...'
})
setTimeout(() => {
// setTimeout(() => {
this.etchecked = false
xBlufi.notifySendCustomData({
customData: '11lock'
})
uni.hideLoading()
}, 1500)
// }, 1500)
}
},
//
@ -753,13 +753,13 @@
uni.showLoading({
title: '关闭中...'
})
setTimeout(() => {
// setTimeout(() => {
this.etchecked = true
xBlufi.notifySendCustomData({
customData: '11unlock'
})
uni.hideLoading()
}, 1500)
// }, 1500)
}
},
@ -822,14 +822,14 @@
uni.showLoading({
title: '开启中...'
})
setTimeout(() => {
// setTimeout(() => {
xBlufi.notifySendCustomData({
customData: "11time@" + this.jstime + '@'
})
uni.hideLoading()
this.startTimer(this.jstime)
this.sdjsflag = false
}, 1500)
// }, 1500)
}
},
@ -871,7 +871,7 @@
uni.showLoading({
title: '关闭中...'
})
setTimeout(() => {
// setTimeout(() => {
xBlufi.notifySendCustomData({
customData: "11close"
})
@ -882,7 +882,7 @@
this.jsked = true
this.jskeds = false
uni.hideLoading()
}, 1500)
// }, 1500)
}
},
//
@ -1015,7 +1015,7 @@
xBlufi.notifySendCustomData({
customData: "11get"
})
}, 3000)
}, 2000)
}else{
this.vardataflag = 1
this.clearDisconnectTimer()