加油站付款小程序,打印小票
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

142 lines
2.8 KiB

<template>
<uni-popup ref="privacyPopup" type="center" :is-mask-click="true">
<view class="privacyPopup">
<view class="title">
<view class="title_circle"></view>
<view>惠享服务圈</view>
</view>
<view class="content_pri">
<text>在你使用惠享服务圈服务之前请仔细阅读</text>
<text style="color: #1793ee;" @click="goToPrivacy">惠享服务圈小程序隐私保护指引</text>
<text>如你同意惠享服务圈小程序隐私保护指引请点击同意开始使用惠享服务圈</text>
</view>
<view class="pri_btn">
<button class="confuse_btn" @click="confusePrivacy">拒绝</button>
<button class="confirm_btn" id="agree-btn" open-type="agreePrivacyAuthorization"
@agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
</view>
</view>
</uni-popup>
</template>
<script setup>
import {
onShow
} from "@dcloudio/uni-app"
import {
reactive,
ref,
defineExpose
} from 'vue';
const privacyPopup = ref()
let resolvePrivacyAuthorization
//初始化
function init(resolve) {
privacyPopup.value.open()
resolvePrivacyAuthorization = resolve
}
// 打开隐私协议
function goToPrivacy() {
wx.openPrivacyContract({
success: () => {
console.log('打开成功');
}, // 打开成功
fail: () => {
uni.showToast({
title: '打开失败,稍后重试',
icon: 'none'
})
} // 打开失败
})
}
// 拒绝
function confusePrivacy() {
privacyPopup.value.close()
resolvePrivacyAuthorization({
event: 'disagree'
})
}
// 同意
function handleAgreePrivacyAuthorization() {
// 告知平台用户已经同意,参数传同意按钮的id
resolvePrivacyAuthorization({
buttonId: 'agree-btn',
event: 'agree'
})
privacyPopup.close()
}
defineExpose({
init
});
</script>
<style lang="scss" scoped>
// *{
// box-sizing: border-box;
// }
.privacyPopup {
width: 520rpx;
/* height: 500rpx; */
background-color: #fff;
border-radius: 50rpx;
padding: 20rpx 40rpx;
}
.title {
display: flex;
align-items: center;
justify-content: start;
margin: 20rpx 0;
font-size: 38rpx;
font-weight: 600;
}
.title .title_circle {
width: 60rpx;
height: 60rpx;
background-color: #efefef;
border-radius: 50%;
margin-right: 20rpx;
}
.content_pri {
width: 480rpx;
margin: 0 auto;
font-size: 34rpx;
line-height: 1.5;
}
.pri_btn {
width: 100%;
height: 158rpx;
display: flex;
align-items: center;
justify-content: space-evenly;
}
.pri_btn .confuse_btn,
.pri_btn .confirm_btn {
width: 200rpx;
height: 90rpx;
border-radius: 20rpx;
font-size: 34rpx;
}
.pri_btn .confuse_btn {
background-color: #eee;
color: #52bf6b;
}
.pri_btn .confirm_btn {
background-color: #52bf6b;
color: #fff;
}
</style>