网站域名类型,安装 wordpress,宝坻建设路小学网站,邢台市网站制作1、manifest.json 配置修改
在mp-weixin: 参数修改#xff08;没有就添加#xff09;
__usePrivacyCheck__: true,
***2、注意 微信开发者工具调整 不然一直报错 找不到 getPrivacySetting
废话不多说 上代码
3、 编辑首页 或者用户授权界面
uni-popup…
1、manifest.json 配置修改
在mp-weixin: 参数修改没有就添加
__usePrivacyCheck__: true,
***2、注意 微信开发者工具调整 不然一直报错 找不到 getPrivacySetting
废话不多说 上代码
3、 编辑首页 或者用户授权界面
uni-popup refpopupview classpopupWrapview classpopupTxt在你使用【********】之前请仔细阅读text classblueColor clickhandleOpenPrivacyContract《隐私保护指引》/text。如你同意《******隐私保护指引》,请点击“同意”开始使用【******】。/viewview classpopupBotbutton iddisagree-btn typedefault clickhandleDisagree拒绝/buttonbutton idagree-btn typeprimary open-typeagreePrivacyAuthorization agreeprivacyauthorizationhandleAgreePrivacyAuthorization同意/button/view/view
/uni-popup
// onload 代码
// #ifdef MPwx.getPrivacySetting({success: res {console.log(是否需要授权,res, res.needAuthorization, 隐私协议的名称为, res.privacyContractName)//如果需要授权的话 显示弹窗if(res.needAuthorization){this.$refs.popup.open(center) }},fail: () {},complete: () {},})
// #endif
methods: {// 用户隐私handleDisagree(e) {this.$refs.popup.close()},handleAgreePrivacyAuthorization(res) {// 用户同意隐私协议事件回调// 用户点击了同意之后所有已声明过的隐私接口和组件都可以调用了this.$refs.popup.close()console.log(res,handleAgreePrivacyAuthorization);},handleOpenPrivacyContract(){// 打开隐私协议页面wx.openPrivacyContract({success: () {}, // 打开成功fail: () {}, // 打开失败complete: (res) {console.log(res,openPrivacyContract complete);}})},// end用户隐私
}
css
.popupWrap{width: 540rpx;box-sizing: border-box;padding:42rpx;background:white;border-radius: 30rpx;.blueColor{color: rgba(39, 152, 240, 1);}.popupTxt{line-height: 48rpx;}.popupBot{display: flex;justify-content: space-around;align-items: center;margin-top: 30rpx;}}