import { webview } from '@kit.ArkWeb'
import { AppStorageKeyFishCollect, avPlayerManager, IBestToast, YTHeader } from 'basic'
import { TextInputCom } from '../component/TextInputCom'

@Builder
function FragranceSettingBuilder() {
  NavDestination() {
    FragranceSettingView()
  }.title("设置")
  .hideTitleBar(true)
}

@Component
struct FragranceSettingView {
  @StorageLink(AppStorageKeyFishCollect.TEXTARR)
  textArr:string[]=[]
  build() {
    Column() {
      YTHeader({title:'设置'})

      //悬浮文字
      Column({space:20}){

        Row() {
          Text('悬浮文字').fontColor(Color.White)
        }.width('100%')
        .justifyContent(FlexAlign.Start)

        ForEach(this.textArr,(item:string,index:number)=>{
          TextInputCom({
            text:item,
            changeText:(value:string)=>{
              this.textArr[index]=value
            }
          })
        })

        //取消
        Column(){

          Image($r('app.media.muyu')).width(20)
        }.width(50)
        .height(50)
        .justifyContent(FlexAlign.Center)
        .backgroundColor('#646561')
        .onClick(()=>{
          if(this.textArr.length>7){
            IBestToast.show({
              message:'最多支持六行文本'
            })
            return
          }
          this.textArr.push('')
        })



      }.width('100%')
      .backgroundColor('#3f3f3f')
      .padding({left:10,right:10,top:20,bottom:20})
      .borderRadius(15)
      .margin({bottom:20})

      //上香数量
      Column({space:20}){

      }.width('100%')
      .backgroundColor('#3f3f3f')
      .padding({left:10,right:10,top:20,bottom:20})
      .borderRadius(15)
      .height(150)
      //燃尽时间
      Column({space:20}){

      }.width('100%')
      .backgroundColor('#3f3f3f')
      .padding({left:10,right:10,top:20,bottom:20})
      .borderRadius(15)
      .height(150)



    }.width('100%')
    .height('100%')
    .backgroundColor(Color.Black)
    .padding({left:20,right:20})
  }
}
