AgreementPage.ets 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import {YtAvoid, YTHeader, yTRouter } from 'basic'
  2. import { webview } from '@kit.ArkWeb'
  3. @Builder
  4. function agreementBuilder() {
  5. NavDestination() {
  6. AgreementPage()
  7. }
  8. .hideTitleBar(true)
  9. }
  10. @Component
  11. struct AgreementPage {
  12. @State title: '隐私政策' | '关于我们' | '用户协议' = '隐私政策'
  13. @StorageProp(YtAvoid.safeTopKey) safeTop: number = 0
  14. @StorageProp(YtAvoid.safeBottomKey) safeBottom: number = 0
  15. controller: webview.WebviewController = new webview.WebviewController()
  16. aboutToAppear(): void {
  17. this.title = yTRouter.getAgreementPageParam()
  18. // IBestToast.showLoading({
  19. // message: '加载中...'
  20. // })
  21. }
  22. build() {
  23. Column({ space: 12 }) {
  24. YTHeader({ title: this.title })
  25. Column() {
  26. Web({ src: 'https://www.baidu.com', controller: this.controller })
  27. .width('100%')
  28. .layoutWeight(1)
  29. .onPageEnd(() => {
  30. // IBestToast.hide()
  31. })
  32. }
  33. .padding({ left: 16, right: 16 })
  34. }
  35. .padding({ top: this.safeTop, bottom: this.safeBottom })
  36. }
  37. }