1. Download the plug-in and import HbuilderX
2. Find manifest.json》Source code view》"mp-weixin" ==》" usePrivacyCheck ": true, //Open the privacy pop-up window
3. [WeChat backend user privacy protection guidelines must be reviewed and approved before debugging]
(https://mp.weixin.qq.com/wxamp/basicprofile/index?token=1956320193&lang=zh_CN)
4. Change the debugging basic library to 3.0.0 or above. WeChat Developer Tools->Details->Local Settings->Debug Basic Library
5. Page Usage Example
<template>
<view>
<!-- #ifdef MP-WEIXIN -->
<ws-wx-privacy
id="privacy-popup"
@disagree="handleDisagree"
@agree="handleAgree"
title="用户隐私保护提示"
desc="感谢您使用本应用,您使用本应用的服务之前请仔细阅读并同意"
protocol="《用户隐私保护指引》"
subDesc="。当您点击同意并开始时用产品服务时,即表示你已理解并同意该条款内容,该条款将对您产生法律约束力。如您拒绝,将无法使用相应服务。"
></ws-wx-privacy>
<!-- #endif -->
</view>
</template>
<script>
import wsWxPrivacy from '@/uni_modules/ws-wx-privacy/components/ws-wx-privacy/ws-wx-privacy.vue'
export default {
components: {
wsWxPrivacy
},
methods: {
handleDisagree() {
// 处理用户不同意隐私协议的逻辑
},
handleAgree() {
// 处理用户同意隐私协议的逻辑
}
}
}
</script>
Precautions
- Only if the user information processed is declared in the guidelines , the corresponding interface or component provided by the platform can be called. If not declared, the corresponding interface or component will be disabled directly.
- The user privacy protection guidelines in the WeChat backend must be reviewed and approved before they can be debugged. They must be reviewed and passed ! Reviewed and passed! Reviewed and passed
- If the application must be authorized before it can be used, you can only add this privacy pop-up component on the entrance page. If not, you need to add it on every page that uses the privacy interface.
- Change the debugging base library to 3.0.0 or above. WeChat Developer Tools->Details->Local Settings->Debug Basic Library