知识付费微信小程序
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.

131 lines
2.8 KiB

  1. <template>
  2. <uv-popup ref="popup" z-index="99999" :closeOnClickOverlay="false" :customStyle="{ backgroundColor: 'transparent' }">
  3. <view class="privacyPopup">
  4. <view class="title">
  5. <view>协议与隐私政策</view>
  6. </view>
  7. <view class="content_pri">
  8. <view class="text">
  9. 欢迎来到xx加油!我们根据最新的法律法规监管政策要求更新了用户协议隐私政策,请您认真阅读
  10. </view>
  11. </view>
  12. <view class="config">
  13. <uv-checkbox-group v-model="checkboxValue" shape="circle">
  14. <view class="content">
  15. <view style="display: flex;">
  16. <uv-checkbox size="30rpx" :name="1"></uv-checkbox>
  17. 同意<text>xx加油隐私政策</text>
  18. </view>
  19. <view class="">
  20. 以及<text>用户协议</text>
  21. </view>
  22. </view>
  23. </uv-checkbox-group>
  24. </view>
  25. <view class="pri_btn">
  26. <!-- <button class="confuse_btn" @click="confusePrivacy">拒绝</button> -->
  27. <button class="confirm_btn" id="agree-btn" open-type="agreePrivacyAuthorization"
  28. @agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
  29. </view>
  30. </view>
  31. </uv-popup>
  32. </template>
  33. <script>
  34. export default {
  35. name: 'PrivacyAgreementPoup',
  36. data() {
  37. return {
  38. resolvePrivacyAuthorization: {},
  39. checkboxValue : false
  40. }
  41. },
  42. methods: {
  43. //初始化
  44. init(resolve) {
  45. this.$refs.popup.open('center')
  46. this.resolvePrivacyAuthorization = resolve
  47. },
  48. // 打开隐私协议
  49. goToPrivacy() {
  50. wx.openPrivacyContract({
  51. success: () => {
  52. console.log('打开成功');
  53. }, // 打开成功
  54. fail: () => {
  55. uni.showToast({
  56. title: '打开失败,稍后重试',
  57. icon: 'none'
  58. })
  59. } // 打开失败
  60. })
  61. },
  62. // 拒绝
  63. confusePrivacy() {
  64. this.$refs.popup.close()
  65. this.resolvePrivacyAuthorization({
  66. event: 'disagree'
  67. })
  68. },
  69. // 同意
  70. handleAgreePrivacyAuthorization() {
  71. // 告知平台用户已经同意,参数传同意按钮的id
  72. this.resolvePrivacyAuthorization({
  73. buttonId: 'agree-btn',
  74. event: 'agree'
  75. })
  76. this.$refs.popup.close()
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. .privacyPopup {
  83. width: 90%;
  84. margin: 0rpx auto;
  85. background: white;
  86. border-radius: 20rpx;
  87. box-sizing: border-box;
  88. padding: 40rpx 30rpx;
  89. .title {
  90. text-align: center;
  91. font-size: 36rpx;
  92. }
  93. .content_pri {
  94. padding: 30rpx 0rpx;
  95. font-size: 28rpx;
  96. }
  97. .config {
  98. font-size: 28rpx;
  99. text-align: center;
  100. line-height: 40rpx;
  101. margin-bottom: 30rpx;
  102. text {
  103. color: #00aaff;
  104. }
  105. .content{
  106. display: flex;
  107. }
  108. }
  109. .pri_btn {
  110. button {
  111. background: #00aaff;
  112. outline: none;
  113. color: white;
  114. font-size: 30rpx;
  115. }
  116. }
  117. }
  118. </style>