import { webview } from '@kit.ArkWeb'
import { router } from '@kit.ArkUI'
import { YTAvoid } from '../utils/YTAvoid'

@Entry
@Component
struct UserAgreementPage {
  private webviewController: WebviewController = new webview.WebviewController()
  @StorageProp(YTAvoid.SAFE_TOP_KEY)
  top:number=0
  @StorageProp(YTAvoid.SAFE_BOTTOM_KEY)
  bottom:number=0

  build() {
    Column() {
      Row() {
        Image($r('app.media.ic_back'))
          .width(24)
          .margin({ left: 16 })
          .onClick(()=>{
            // yTRouter.routerBack()
            router.back()

          })
        Text('用户协议').fontColor(Color.Black)
        Column(){

        }.width(24)
        .height(24)
      }
      .width('100%')
      .justifyContent(FlexAlign.SpaceBetween)
      .height(44)

      Web({
        src: $rawfile('userAgreement.html'),
        controller: this.webviewController,
        renderMode: RenderMode.ASYNC_RENDER // 设置渲染模式
      })
        .padding(40)
        .width('100%')
        .layoutWeight(1)
    }.width('100%').height('100%')
    .backgroundColor(Color.White)
    .padding({bottom: this.bottom,top:this.top})

  }
}