需要如何修改

@Builder bottom_img(item:bottom_img_text, index:number){
    Column(){
      if(4<index&&index<8)
      {
        if(index==6)
        {
          Image(item.bt_img_false)
            .width(100)
            .height(60)
        }else {
          Image(this.set_img_off? item.bt_img_true:item.bt_img_false)
            .width(30)
            .height(60)
        }
      }else {
        Image(this.set_img_off? item.bt_img_true:item.bt_img_false)
          .width(50)
          .height(60)
          .borderRadius({topLeft:10,topRight:10})
        Text(item.bt_text)
          .fontSize(16)
          .fontColor(Color.White)
          .margin({top:-20})
      }
    }
    .height('100%')
    .backgroundColor("#ff00172d")
    .onTouch((event: TouchEvent)=>{
      if(this.off === index){
        this.set_img_off = !this.set_img_off
      }
    })

  }

  build() {
    Row(){
      ForEach(this.bt_array_list,(item:bottom_img_text,index:number)=>{
        this.bottom_img(item,index)
      })
    }
    .width('100%')
    .height('100%')
    .justifyContent(FlexAlign.SpaceBetween)
    .padding({left:10,right:10,top:1})
  }
}
Logo

讨论HarmonyOS开发技术,专注于API与组件、DevEco Studio、测试、元服务和应用上架分发等。

更多推荐