隐私安全页面跳转实践

​隐私安全页面跳转实践

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
相关问题
har跳转har自己的页面
618浏览 • 1回复 待解决
模块间页面跳转怎么跳
39浏览 • 1回复 待解决
鸿蒙-如何打开跳转WLAN设置页面
8777浏览 • 1回复 待解决
鸿蒙-如何打开跳转GPS设置页面
16047浏览 • 1回复 待解决
如何跳转系统权限设置页面
420浏览 • 1回复 待解决
路由实现动态页面跳转方案
777浏览 • 1回复 待解决
如何跳转到系统发送短信页面
734浏览 • 1回复 待解决
Swiper轮播图带放大缩小动效实践
599浏览 • 1回复 待解决
本地收发消息实践,谁有好的方案?
283浏览 • 1回复 待解决
hilog如何打印{private}隐私标志的内容
1125浏览 • 1回复 待解决
ArkTs如何跳转当前应用的设置页面
1103浏览 • 1回复 待解决
页面之间的跳转方式怎么设置的
5114浏览 • 1回复 待解决
Text模拟隐私协议,有好的方案吗?
421浏览 • 1回复 待解决
如何跳转到应用市场app下载页面
5951浏览 • 1回复 待解决
服务卡片如何跳转到指定的页面呢?
4773浏览 • 1回复 待解决
工具类里 怎么跳转或打开页面呢?
2551浏览 • 1回复 待解决
外部调用har里的方法,如何跳转页面
848浏览 • 1回复 待解决
api8如何实现异步线程跳转页面?
1366浏览 • 1回复 待解决