Privacy.ets 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { YTAvoid, YTHeader, yTRouter } from 'basic';
  2. import { webview } from '@kit.ArkWeb';
  3. @Builder
  4. function PrivacyBuilder() {
  5. NavDestination() {
  6. Privacy()
  7. }.title("隐私政策")
  8. .hideTitleBar(true)
  9. }
  10. @Component
  11. export struct Privacy {
  12. @State content: string = '';
  13. @StorageProp(YTAvoid.SAFE_BOTTOM_KEY) safeBottom: number = 0
  14. @StorageProp(YTAvoid.SAFE_TOP_KEY) safeTop:number=0
  15. private webviewController: WebviewController = new webview.WebviewController()
  16. build() {
  17. Column() {
  18. Row() {
  19. Image($r('app.media.ic_back'))
  20. .width(24)
  21. .margin({ left: 16 })
  22. .onClick(()=>{
  23. yTRouter.routerBack()
  24. })
  25. Text('隐私政策')
  26. Column(){
  27. }.width(24)
  28. .height(24)
  29. }
  30. .width('100%')
  31. .justifyContent(FlexAlign.SpaceBetween)
  32. .height(44 + this.safeTop)
  33. .padding({ top: this.safeTop })
  34. Web({
  35. src: "https://hm-test.ytpm.net/woodenfishPrivatePolicy",
  36. controller: this.webviewController,
  37. renderMode: RenderMode.ASYNC_RENDER // 设置渲染模式
  38. }).margin({bottom:40})
  39. }
  40. .width('100%')
  41. .height('100%')
  42. .padding({left:20,right:20,bottom:40})
  43. }
  44. }