艺易修小程序24.08.21
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.

140 lines
3.0 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  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 @tap="handleOpenPrivacyContract">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. handleOpenPrivacyContract() {
  79. // 打开隐私协议页面
  80. wx.openPrivacyContract({
  81. success: () => {}, // 打开成功
  82. fail: () => {}, // 打开失败
  83. complete: () => {}
  84. })
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .privacyPopup {
  91. width: 90%;
  92. margin: 0rpx auto;
  93. background: white;
  94. border-radius: 20rpx;
  95. box-sizing: border-box;
  96. padding: 40rpx 30rpx;
  97. .title {
  98. text-align: center;
  99. font-size: 36rpx;
  100. }
  101. .content_pri {
  102. padding: 30rpx 0rpx;
  103. font-size: 28rpx;
  104. }
  105. .config {
  106. font-size: 28rpx;
  107. text-align: center;
  108. line-height: 40rpx;
  109. margin-bottom: 30rpx;
  110. text {
  111. color: #00aaff;
  112. }
  113. .content{
  114. display: flex;
  115. }
  116. }
  117. .pri_btn {
  118. button {
  119. background: #00aaff;
  120. outline: none;
  121. color: white;
  122. font-size: 30rpx;
  123. }
  124. }
  125. }
  126. </style>