瀏覽代碼

bug修改

cjb 1 周之前
父節點
當前提交
ab39bd045e
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      entry/src/main/ets/pages/Index.ets

+ 4 - 4
entry/src/main/ets/pages/Index.ets

@@ -300,6 +300,7 @@ struct WorkshopPage {
         this.toggleIsOn = !this.toggleIsOn
         console.log('hhtest', JSON.stringify(this.toggleIsOn))
         this.stationArray =[...this.stationArray]
+        console.log('hhtest', JSON.stringify(this.stationArray))
         // for (let i = 0; i < this.stationArray.length; i++) {
         //   if (this.stationArray[i].stationName! === this.clickStation.stationName) {
         //     this.stationArray[i] = ...this.clickStation
@@ -455,7 +456,7 @@ struct WorkshopPage {
                           .fontColor($r('app.color.FFFFFF'))
                           .fontWeight(FontWeight.Regular)
                           .opacity(0.6)
-                        Toggle({ type: ToggleType.Switch, isOn: (this.clickStation.stationType! === 1 && item.controlPowerStatus! === 0) || (this.clickStation.stationType! === 2 && item.controlPowerStatus! === 1) ? true : false })
+                        Toggle({ type: ToggleType.Switch, isOn: ((item.stationType! === 1 && item.controlPowerStatus! === 0) || (item.stationType! === 2 && item.controlPowerStatus! === 1)) ? true : false })
                           .width('67%')
                           .height('46%')
                           .selectedColor($r('app.color.30D158'))
@@ -988,7 +989,6 @@ struct WorkshopPage {
           this.stationArray[6] = device7;
           this.robotArray[0] = device8
         }
-        console.info('hhtest', '---------robotArray ' + JSON.stringify(this.robotArray))
       } else {
         console.info('hhtest', "messageArrived error:" + JSON.stringify(err));
       }
@@ -1480,8 +1480,8 @@ struct confirmDialog {
         .height('100%')
         .justifyContent(FlexAlign.Center)
         .onClick(()=>{
-          if (this.cancel() != undefined) {
-            this.cancel
+          if (this.cancel != undefined) {
+            this.cancel()
           }
           if (this.controller != undefined) {
             this.controller.close()