PrivacyPopup }, data() {return{showPrivacyPopup:false, }; },onLaunch:function(){ }, onShow() {// #ifdef MP-WEIXIN// 在设置 showPrivacyPopup = true 后使用 $nextTick,if(wx.getPrivacySetting) { wx.getPrivacySetting({success:(res) =>{if(res.needAuthorization) {this.showPrivacyPopup =t...
},lifetimes: {attached:function(){if(wx.getPrivacySetting) { wx.getPrivacySetting({success:res=>{console.log("是否需要授权:", res.needAuthorization,"隐私协议的名称为:", res.privacyContractName)this.setData({privacyContractName: res.privacyContractName })if(res.needAuthorization) {this.popUp() }...
"mp-weixin": {//小程序隐私协议"__usePrivacyCheck__":true}, 注:小程序运行会报无效的 app.json ["__usePrivacyCheck__"],有说切换基础库调试,但是这个提示一直在,不影响代码的运行 2.创建协议弹窗 创建components文件夹下,创建privacy-popup文件夹与privacy-popup.vue。 主要通过wx.onNeedPrivacyAuthorizati...
-- #ifdef MP-WEIXIN --><ws-wx-privacyid="privacy-popup"@disagree="handleDisagree"@agree="hand...
// components/privacyPopup/index.jsComponent({/** * 组件的属性列表 */properties:{},/** * 组件的初始数据 */data:{show:false,obj:{},},/** * 组件的方法列表 */methods:{//查看用户隐私保护指引openPrivacyContract(){wx.openPrivacyContract({success:res=>{console.log('openPrivacyContract succes...
console.log(res,'***getPrivacySetting***')if(res.needAuthorization) {//需要弹出隐私协议that.privacyPopupShow =true}else{//用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用隐私接口} } }) 04 注意更新小程序公众平台的用户隐私保护指引 ...
uni.getPrivacySetting({ success: res => { console.log("隐私协议结果===>",res) if (!res.needAuthorization) { // 同意触发事件 agree() }else{ // 未同意打开弹窗 openPopup() } } }) } onBeforeMount(() => { // 组件挂载前检测是否授权 ...
</uni-popup> 1. 2. 3. 4. 5. 6. 7. 8. 在下方data中定义:privacyContractName:'' 3,在页面的onLoad中,添加查询是否需要授权的检测(小程序中用即可,其他端不需要) // #ifdef MP-WEIXIN wx.getPrivacySetting({ success: res => { console.log("是否需要授权:", res.needAuthorization, "隐私协议...
{ name: "Privacypopup", data() { return { show: false, resolvePrivacyAuthorization: null, privacyContractName: '', }; }, created() { wx.getPrivacySetting({ success: res => { console.log( res if (res.needAuthorization === false) { reqIndexList() } if (res.needAuthorization) { /...
error[Resolve]: companents\privacyPopup\privacyPopup.axnlcannot resolve module Bvant/weapp/image/...