隐私安全页面跳转实践

​隐私安全页面跳转实践

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%') 
    } 
  } 
}
分享
微博
QQ
微信
回复
2024-02-20 20:13:07
相关问题
HarmonyOS 跳转页面问题
710浏览 • 1回复 待解决
HarmonyOS 登录页面跳转
471浏览 • 1回复 待解决
HarmonyOS 页面跳转动画
508浏览 • 1回复 待解决
HarmonyOS 跨模块页面跳转
382浏览 • 1回复 待解决
Navigation页面跳转的问题
863浏览 • 1回复 待解决
HarmonyOS 页面底部流出安全区域
261浏览 • 1回复 待解决
HarmonyOS 页面跳转的Demo
400浏览 • 1回复 待解决
HarmonyOS 如何跳转新建指纹页面
329浏览 • 1回复 待解决
HarmonyOS CustomDialog跳转其他页面问题
314浏览 • 1回复 待解决
HarmonyOS 无法跳转电话拨号页面
150浏览 • 1回复 待解决
模块间页面跳转怎么跳
706浏览 • 1回复 待解决
HarmonyOS Navigation动态跳转页面问题
317浏览 • 1回复 待解决
HarmonyOS 跳转应用授权页面白屏
360浏览 • 1回复 待解决