加油站付款小程序,打印小票
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.

136 lines
2.8 KiB

9 months ago
  1. <template>
  2. <uni-popup ref="privacyPopup" type="center" :is-mask-click="true">
  3. <view class="privacyPopup">
  4. <view class="title">
  5. <view class="title_circle"></view>
  6. <view>惠享服务圈</view>
  7. </view>
  8. <view class="content_pri">
  9. <text>在你使用惠享服务圈服务之前请仔细阅读</text>
  10. <text style="color: #1793ee;" @click="goToPrivacy">惠享服务圈小程序隐私保护指引</text>
  11. <text>如你同意惠享服务圈小程序隐私保护指引请点击同意开始使用惠享服务圈</text>
  12. </view>
  13. <view class="pri_btn">
  14. <button class="confuse_btn" @click="confusePrivacy">拒绝</button>
  15. <button class="confirm_btn" id="agree-btn" open-type="agreePrivacyAuthorization"
  16. @agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
  17. </view>
  18. </view>
  19. </uni-popup>
  20. </template>
  21. <script setup>
  22. export default {
  23. name: 'PrivacyAgreementPoup',
  24. data() {
  25. return {
  26. resolvePrivacyAuthorization: {},
  27. }
  28. },
  29. methods: {
  30. //初始化
  31. init(resolve) {
  32. this.$refs.privacyPopup.open()
  33. this.resolvePrivacyAuthorization = resolve
  34. },
  35. // 打开隐私协议
  36. goToPrivacy() {
  37. wx.openPrivacyContract({
  38. success: () => {
  39. console.log('打开成功');
  40. }, // 打开成功
  41. fail: () => {
  42. uni.showToast({
  43. title: '打开失败,稍后重试',
  44. icon: 'none'
  45. })
  46. } // 打开失败
  47. })
  48. },
  49. // 拒绝
  50. confusePrivacy() {
  51. this.$refs.privacyPopup.close()
  52. this.resolvePrivacyAuthorization({
  53. event: 'disagree'
  54. })
  55. },
  56. // 同意
  57. handleAgreePrivacyAuthorization() {
  58. // 告知平台用户已经同意,参数传同意按钮的id
  59. this.resolvePrivacyAuthorization({
  60. buttonId: 'agree-btn',
  61. event: 'agree'
  62. })
  63. this.$refs.privacyPopup.close()
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. // *{
  70. // box-sizing: border-box;
  71. // }
  72. .privacyPopup {
  73. width: 520rpx;
  74. /* height: 500rpx; */
  75. background-color: #fff;
  76. border-radius: 50rpx;
  77. padding: 20rpx 40rpx;
  78. }
  79. .title {
  80. display: flex;
  81. align-items: center;
  82. justify-content: start;
  83. margin: 20rpx 0;
  84. font-size: 38rpx;
  85. font-weight: 600;
  86. }
  87. .title .title_circle {
  88. width: 60rpx;
  89. height: 60rpx;
  90. background-color: #efefef;
  91. border-radius: 50%;
  92. margin-right: 20rpx;
  93. }
  94. .content_pri {
  95. width: 480rpx;
  96. margin: 0 auto;
  97. font-size: 34rpx;
  98. line-height: 1.5;
  99. }
  100. .pri_btn {
  101. width: 100%;
  102. height: 158rpx;
  103. display: flex;
  104. align-items: center;
  105. justify-content: space-evenly;
  106. }
  107. .pri_btn .confuse_btn,
  108. .pri_btn .confirm_btn {
  109. width: 200rpx;
  110. height: 90rpx;
  111. border-radius: 20rpx;
  112. font-size: 34rpx;
  113. }
  114. .pri_btn .confuse_btn {
  115. background-color: #eee;
  116. color: #52bf6b;
  117. }
  118. .pri_btn .confirm_btn {
  119. background-color: #52bf6b;
  120. color: #fff;
  121. }
  122. </style>