隐私安全页面跳转实践

​隐私安全页面跳转实践

HarmonyOS
2024-02-20 15:04:28
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
okmwq
1

应用首次进入时,会有弹窗 请求安全隐私信息,用户可点击对应的隐藏协议跳转到 对应隐藏协议的详情页面。期望:从详情页面返回时,安全隐私的弹窗依然存在,用户可以继续进行授权/查看的操作。

示例代码

@Entry 
@Component 
struct First { 
  @State textValue: string = '输入' 
  @State visible: Visibility = Visibility.Visible 
 
  build() { 
    Stack() { 
      Row() { 
        Column() { 
          Text('我是第一个页面') 
            .fontSize(30) 
            .fontWeight(FontWeight.Bold) 
          Button('按钮') 
            .onClick(() => { 
              console.log('hit me!') 
              if (this.visible == Visibility.Visible) { 
                this.visible = Visibility.None 
              } else { 
                this.visible = Visibility.Visible 
              } 
            }) 
            .backgroundColor(0x777474) 
            .fontColor(0x000000) 
        } 
        .height('100%') 
        .width('100%') 
        .justifyContent(FlexAlign.Start) 
        .alignItems(HorizontalAlign.Center) 
      } 
      .height('100%') 
      .backgroundColor('#FFF') 
 
      //蒙层效果 
      Text('') 
        .onClick(() => { 
          if (this.visible == Visibility.Visible) { 
            this.visible = Visibility.None 
          } else { 
            this.visible = Visibility.Visible 
          } 
        }) 
        .width('100%') 
        .height('100%') 
        .opacity(0.5) 
        .backgroundColor(Color.Black) 
        .visibility(this.visible) 
 
      Column() { 
        GridRow({ 
          columns: { xs: 1, sm: 4, md: 8, lg: 12 }, 
          breakpoints: { 
            value: ['400vp', '600vp', '800vp'], 
            reference: BreakpointsReference.WindowSize 
          }, 
        }) { 
          GridCol({ 
            span: { xs: 1, sm: 2, md: 4, lg: 8 }, 
            offset: { xs: 0, sm: 1, md: 2, lg: 2 } 
          }) { 
            Column() { 
              Text('安全隐私').fontSize(20).margin({ top: 10, bottom: 10 }) 
              Text('是否跳转到隐私详情页面?').fontSize(16).margin({ bottom: 10 }) 
              Flex({ justifyContent: FlexAlign.SpaceAround }) { 
                Button('取消') 
                  .onClick(() => { 
                    if (this.visible == Visibility.Visible) { 
                      this.visible = Visibility.None 
                    } else { 
                      this.visible = Visibility.Visible 
                    } 
 
                  }).backgroundColor(0xffffff).fontColor(Color.Black) 
                Button('确定') 
                  .onClick(() => { 
                    router.pushUrl({ 
                      url: 'pages/Second' 
                    }) 
                  }).backgroundColor(0xffffff).fontColor(Color.Red) 
              }.margin({ bottom: 10 }) 
            } 
            .backgroundColor(0xffffff) 
            .visibility(this.visible) 
            .clip(true) 
            .borderRadius(20) 
          } 
        } 
      }.width('95%') 
    } 
  } 
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
分享
微博
QQ
微信
回复
2024-02-20 20:13:07


相关问题
HarmonyOS 跳转页面问题
847浏览 • 1回复 待解决
HarmonyOS 登录页面跳转
670浏览 • 1回复 待解决
HarmonyOS 页面底部流出安全区域
502浏览 • 1回复 待解决
HarmonyOS 跨模块页面跳转
570浏览 • 1回复 待解决
HarmonyOS 页面跳转动画
659浏览 • 1回复 待解决
Navigation页面跳转的问题
1055浏览 • 1回复 待解决
HarmonyOS 页面跳转的Demo
554浏览 • 1回复 待解决
HarmonyOS 跳转应用授权页面白屏
525浏览 • 1回复 待解决
HarmonyOS 如何跳转新建指纹页面
472浏览 • 1回复 待解决
HarmonyOS Navigation动态跳转页面问题
512浏览 • 1回复 待解决
HarmonyOS CustomDialog跳转其他页面问题
486浏览 • 1回复 待解决
HarmonyOS 无法跳转电话拨号页面
354浏览 • 1回复 待解决
模块间页面跳转怎么跳
891浏览 • 1回复 待解决
HarmonyOS jsBridge 最佳实践
884浏览 • 1回复 待解决