uniapp微信小程序隐私保护引导新规

1.components中新建组件PrivacyPop.vue

<template><view class="privacy" v-if="showPrivacy"><view class="content"><view class="title">隐私保护指引</view><view class="des">在使用当前小程序服务之前,请仔细阅读<text class="link" @tap="openPrivacyContract">{{ privacyContractName }}</text>。如你同意{{privacyContractName }},请点击“同意”开始使用。</view><view class="btns"><button class="item reject" @tap="exitMiniProgram">拒绝</button><button id="agree-btn" class="item agree" open-type="agreePrivacyAuthorization"@agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button></view></view></view>
</template><script>
export default {data() {return {privacyContractName: '《XXX隐私保护引导》',showPrivacy: true}},// onShow() {//     const version = uni.getSystemInfoSync().SDKVersion//     if (this.compareVersion(version, '2.32.3') >= 0) {//         uni.getPrivacySetting({//             success: (res) => {//                 if (res.errMsg === "getPrivacySetting:ok") {//                     this.privacyContractName = res.privacyContractName//                     this.showPrivacy = res.needAuthorization//                 }//             }//         })//     }// },methods: {openPrivacyContract() {uni.openPrivacyContract({fail: () => {uni.showToast({title: '遇到错误',icon: 'error'})}})},// 拒绝隐私协议exitMiniProgram() {// 直接退出小程序wx.exitMiniProgram()},// 同意隐私协议handleAgreePrivacyAuthorization() {this.showPrivacy = false},compareVersion(v1, v2) {v1 = v1.split('.')v2 = v2.split('.')const len = Math.max(v1.length, v2.length)while (v1.length < len) {v1.push('0')}while (v2.length < len) {v2.push('0')}for (let i = 0; i < len; i++) {const num1 = parseInt(v1[i])const num2 = parseInt(v2[i])if (num1 > num2) {return 1} else if (num1 < num2) {return -1}}return 0}}
}
</script> <style scoped> .privacy {position: fixed;top: 0;right: 0;bottom: 0;left: 0;background: rgba(0, 0, 0, .5);z-index: 9999999;display: flex;align-items: center;justify-content: center;}.content {width: 632rpx;padding: 48rpx;box-sizing: border-box;background: #fff;border-radius: 16rpx;}.content .title {text-align: center;color: #333;font-weight: bold;font-size: 32rpx;}.content .des {font-size: 26rpx;color: #666;margin-top: 40rpx;text-align: justify;line-height: 1.6;}.content .des .link {color: #07c160;text-decoration: underline;}.btns {margin-top: 48rpx;display: flex;}.btns .item {justify-content: space-between;width: 244rpx;height: 80rpx;display: flex;align-items: center;justify-content: center;border-radius: 16rpx;box-sizing: border-box;border: none;}.btns .reject {background: #f4f4f5;color: #909399;}.btns .agree {background: #07c160;color: #fff;}
</style>

2.首页引入
 

import PrivacyPop from '../../components/PrivacyPop/PrivacyPop.vue';components: {PrivacyPop},<PrivacyPop />

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/99851.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

[羊城杯 2020] easyphp

打开题目&#xff0c;源代码 <?php$files scandir(./); foreach($files as $file) {if(is_file($file)){if ($file ! "index.php") {unlink($file);}}}if(!isset($_GET[content]) || !isset($_GET[filename])) {highlight_file(__FILE__);die();}$content $_GE…

C# OpenVinoSharp PP-TinyPose 人体姿态识别

效果 项目 部分代码 using OpenCvSharp; using OpenCvSharp.Extensions; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;name…

msvcp140.dll是什么东西?msvcp140.dll丢失的5个常用解决方法

今天&#xff0c;我将为大家带来计算机丢失msvcp140.dll修复教程。在我们的日常生活和学习中&#xff0c;计算机问题是无处不在的。有时候&#xff0c;我们可能会遇到一些困扰&#xff0c;比如计算机丢失msvcp140.dll文件。msvcp140.dll是Windows系统中非常重要的动态链接库文件…

JVM的故事——垃圾收集器

垃圾收集器 文章目录 垃圾收集器一、serial收集器二、parnew收集器三、parallel scavenge收集器四、serial old收集器五、parallel old收集器六、CMS收集器七、Garbage First收集器八、收集器的权衡 一、serial收集器 新生代收集器&#xff0c;最基础的收集器&#xff0c;单线…

【wireshark抓取数据包-PGSQL协议】

测试查看PGSQL协议的网络流量数据明细 &#xff11;&#xff09;捕获过滤的条件设置&#xff0c;tcp.port5432(数据库的端口&#xff09; &#xff12;&#xff09;上面是wireshark的主窗口&#xff0c;分三大主块&#xff1a;Packlist List&#xff08;数据包列表&#xff09…

SQL语句如何生成PDM文件

首先我们先了解一下什么是PDM 物理数据模型&#xff08;PDM&#xff09;是数据库设计和管理过程中的重要组成部分&#xff0c;具有以下好处&#xff1a; 可视化数据库结构&#xff1a; PDM提供了一个直观的方式来可视化数据库的结构&#xff0c;包括表、列、索引、关系等。这使…

视频监控/视频汇聚/视频云存储EasyCVR平台接入国标GB协议后出现断流情况,该如何解决?

视频监控汇聚平台EasyCVR可拓展性强、视频能力灵活、部署轻快&#xff0c;可支持的主流标准协议有国标GB28181、RTSP/Onvif、RTMP等&#xff0c;以及支持厂家私有协议与SDK接入&#xff0c;包括海康Ehome、海大宇等设备的SDK等。安防监控平台EasyCVR既具备传统安防视频监控的能…

MRI多任务技术及应用

目录 一、定量心血管磁共振成像&#xff08;CMR&#xff09;的改进方法二、磁共振多任务三、磁共振多任务的成像框架四、磁共振多任务的图像模型和采样和重建策略五、利用MR多任务进行快速三维稳态CEST(ss-CEST)成像5.1 利用MR多任务进行快速三维稳态CEST(ss-CEST)成像介绍5.2 …

Python第三方库 - matplotlib库

1 matplotlib了解 Matplotlib 可能是 Python 2D - 绘图领域使用最广泛的套件。它能让使用者很轻松地将数据图形化&#xff0c;并且提供多样化的输出格式。这里将会探索 matplotlib 的常见用法。 2 matplotlib学习 2.1 引用 plt 表示当前子图&#xff0c;若没有就创建一个子图 …

PostgreSQL安装异常,服务无法启动导致创建服务器超时

win上安装pg后无法创建服务器&#xff0c;提示创建超时&#xff0c;发现服务列表里面pg15服务 并没有启动&#xff0c;启动服务器发现服务不了&#xff0c;截图忘记截了&#xff0c;复现不了&#xff0c;解决方法是 换个身份&#xff0c;然后继续启动&#xff0c;然后就可以在…

TCP数据报结构分析(面试重点)

在传输层中有UDP和TCP两个重要的协议&#xff0c;下面将针对TCP数据报的结构进行分析 关于UDP数据报的结构分析推荐看UDP数据报结构分析&#xff08;面试重点&#xff09; TCP结构图示 TCP报头结构的分析 一.16位源端口号 源端口表示发送数据时&#xff0c;发送方的端口号&am…

python实现对excel表中的某列数据进行排序

如下需要对webCms中的B列数据进行升序排序&#xff0c;且不能影响到其他列、工作表中的数据和格式。 import pandas as pd import openpyxl from openpyxl.utils.dataframe import dataframe_to_rows# 读取 Excel 文件 file_path 1.xlsx sheet_name webCms# 读取 Excel 文件并…