Privacy.ets 800 B

123456789101112131415161718192021222324252627282930313233
  1. import { YTAvoid, YTHeader } 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. private webviewController: WebviewController = new webview.WebviewController()
  15. build() {
  16. Column() {
  17. YTHeader({ defaultStyle: { title: '隐私政策' } })
  18. Web({
  19. src: "https://hm-test.ytpm.net/babyfoodAgreement",
  20. controller: this.webviewController,
  21. renderMode: RenderMode.ASYNC_RENDER // 设置渲染模式
  22. }).padding(20)
  23. }
  24. .width('100%')
  25. .height('100%')
  26. .padding({ bottom: this.safeBottom })
  27. }
  28. }