Compare commits
3 Commits
bff0f7867f
...
022b21facd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
022b21facd | ||
|
|
45a5cfb8c7 | ||
|
|
14e403d8ea |
79
components/Privacy/index.vue
Normal file
79
components/Privacy/index.vue
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
<template>
|
||||||
|
<view class="privacy" v-if="showPrivacy">
|
||||||
|
<view class="content">
|
||||||
|
<view class="title">隐私保护指引</view>
|
||||||
|
<view class="des">
|
||||||
|
请您仔细阅读并充分理解<text class="link" @click="handleOpenPrivacyContract">{{ privacyContractName }}</text>
|
||||||
|
,如您同意前述协议的全部内容,请点击“同意”开始使用。<text class="cancel">如您不同意,将被限制使用部分功能,或将在您使用具体功能前再次询问以取得您的授权同意。</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="btns">
|
||||||
|
<button class="reject" @click="handleDisagree">拒绝</button>
|
||||||
|
<button class="agree" open-type="agreePrivacyAuthorization"
|
||||||
|
@agreeprivacyauthorization="handleAgreePrivacyAuthorization">
|
||||||
|
同意
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue'
|
||||||
|
import { onShow } from "@dcloudio/uni-app";
|
||||||
|
|
||||||
|
const showPrivacy = ref(true)
|
||||||
|
const privacyContractName = ref('隐私保护指引')
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
// 条件编译微信小程序
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
|
||||||
|
wx.getPrivacySetting({
|
||||||
|
success: (res) => {
|
||||||
|
console.log("cj隐私配置", res);
|
||||||
|
if (res.errMsg == "getPrivacySetting:ok" && res.needAuthorization) {
|
||||||
|
privacyContractName.value = res.privacyContractName;
|
||||||
|
showPrivacy.value = res.needAuthorization
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// 条件编译抖音小程序
|
||||||
|
// #ifdef MP-TOUTIAO
|
||||||
|
uni.getPrivacySetting({
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 拒绝
|
||||||
|
const handleDisagree = () => {
|
||||||
|
showPrivacy.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 同意
|
||||||
|
const handleAgreePrivacyAuthorization = () => {
|
||||||
|
showPrivacy.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开隐私保护指引
|
||||||
|
const handleOpenPrivacyContract = () => {
|
||||||
|
// 条件编译微信小程序
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
wx.openPrivacyContract({
|
||||||
|
fail: () => { }
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
@import './styles/index.scss'
|
||||||
|
</style>
|
||||||
66
components/Privacy/styles/index.scss
Normal file
66
components/Privacy/styles/index.scss
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
.privacy {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
|
z-index: 9999;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #000;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
position: relative;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 20px 20px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.des {
|
||||||
|
line-height: 21px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link {
|
||||||
|
color: #007aff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btns {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 20px 0 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reject,
|
||||||
|
.agree {
|
||||||
|
border-radius: 50px;
|
||||||
|
width: 45%;
|
||||||
|
border: none;
|
||||||
|
font-size: 18px;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.reject {
|
||||||
|
color: #000;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border-radius: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agree {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #007aff;
|
||||||
|
}
|
||||||
@ -73,7 +73,8 @@
|
|||||||
"version": "0.3.6",
|
"version": "0.3.6",
|
||||||
"provider": "wx069ba97219f66d99"
|
"provider": "wx069ba97219f66d99"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"__usePrivacyCheck__": true
|
||||||
},
|
},
|
||||||
"mp-alipay": {
|
"mp-alipay": {
|
||||||
"usingComponents": true
|
"usingComponents": true
|
||||||
@ -82,7 +83,8 @@
|
|||||||
"usingComponents": true
|
"usingComponents": true
|
||||||
},
|
},
|
||||||
"mp-toutiao": {
|
"mp-toutiao": {
|
||||||
"usingComponents": true
|
"usingComponents": true,
|
||||||
|
"usePrivacyCheck": true
|
||||||
},
|
},
|
||||||
"uniStatistics": {
|
"uniStatistics": {
|
||||||
"enable": false
|
"enable": false
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user