This commit is contained in:
sunmeng 2024-11-12 11:32:03 +08:00
parent d2876095d6
commit 5cf5770214

View File

@ -222,7 +222,7 @@
<view class="irrigate_time2"> <view class="irrigate_time2">
轮灌模式开关 轮灌模式开关
<view class="btn" @click="changeIndexOpen(2)" :class="actList1[2]=='1'?'btn-on':'btn-off'"> <view class="btn" @click="changeIndexOpen()" :class="actList1=='1'?'btn-on':'btn-off'">
<span>轮灌模式</span> <span>轮灌模式</span>
</view> </view>
</view> </view>
@ -510,21 +510,19 @@
} }
}) })
}, },
changeIndexOpen(active) { changeIndexOpen() {
if (this.actList1[active] == '1') { if (this.actList1 == '1') {
this.actList1[active] = '0' this.actList1 = '0'
} else { } else {
this.actList1[active] = '1' this.actList1 = '1'
} }
var revList = this.actList1.slice().reverse()
var num = revList.join("");
var dataNum = { var dataNum = {
target: { target: {
value: parseInt(num, 2), value: this.actList1,
}, },
}; };
this.$forceUpdate() this.$forceUpdate()
this.changeBtn('1'+(10 + (this.indexs - 1)) + "59", dataNum); this.changeBtn('1'+(10 + (this.indexs - 1)) + "62", dataNum);
// this.change((10 + (this.indexs - 1)) + "59", dataNum); // this.change((10 + (this.indexs - 1)) + "59", dataNum);
}, },
changeBtn(code, el) { changeBtn(code, el) {
@ -552,15 +550,9 @@
} }
}, 100); }, 100);
}, },
get59(){ get62(){
this.actList1 = [] this.actList1 = this.inputData1['1'+(10 + (this.indexs - 1)) + "62"]
var num = this.inputData1['1'+(10 + (this.indexs - 1)) + "59"]
var num1 = this.padString(num.toString(2), 4)
var openListNew = []
openListNew = num1.split("")
openListNew.forEach((el, index) => {
this.actList1.push(openListNew[openListNew.length - index - 1])
})
}, },
getReg() { getReg() {
uni.showLoading({ uni.showLoading({
@ -584,7 +576,7 @@
// uni.stopPullDownRefresh(); // uni.stopPullDownRefresh();
this.inputData1 = res.data; this.inputData1 = res.data;
// this.getType00(); // this.getType00();
this.get59() this.get62()
this.inputData1['1'+(10 + (this.indexs - 1)) + '01'] = this.countData10(this.inputData1['1'+(10 + (this.indexs - 1)) + '01']) this.inputData1['1'+(10 + (this.indexs - 1)) + '01'] = this.countData10(this.inputData1['1'+(10 + (this.indexs - 1)) + '01'])