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

147 lines
3.1 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 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. 欢迎来到车队佳油!我们根据最新的法律法规监管政策要求更新了用户协议隐私政策,请您认真阅读
  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 @click="goToPrivacy">车队佳油隐私政策</text>
  18. </view>
  19. <view class="">
  20. 以及<text @click="goToPrivacy">用户协议</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
  28. class="confirm_btn" id="agree-btn"
  29. open-type="agreePrivacyAuthorization"
  30. @agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
  31. </view>
  32. </view>
  33. </uv-popup>
  34. </template>
  35. <script>
  36. export default {
  37. name: 'PrivacyAgreementPoup',
  38. data() {
  39. return {
  40. resolvePrivacyAuthorization: {},
  41. checkboxValue : false
  42. }
  43. },
  44. mounted() {
  45. if(wx.getPrivacySetting){
  46. wx.getPrivacySetting({
  47. success: res => {
  48. console.log(res)
  49. if (res.needAuthorization) {
  50. // 需要弹出隐私协议
  51. this.init()
  52. }
  53. },
  54. fail: () => {}
  55. })
  56. }
  57. },
  58. methods: {
  59. //初始化
  60. init(resolve) {
  61. this.$refs.popup.open('center')
  62. this.resolvePrivacyAuthorization = resolve
  63. },
  64. // 打开隐私协议
  65. goToPrivacy() {
  66. wx.openPrivacyContract({
  67. success: () => {
  68. console.log('打开成功');
  69. }, // 打开成功
  70. fail: () => {
  71. uni.showToast({
  72. title: '打开失败,稍后重试',
  73. icon: 'none'
  74. })
  75. } // 打开失败
  76. })
  77. },
  78. // 拒绝
  79. confusePrivacy() {
  80. this.$refs.popup.close()
  81. this.resolvePrivacyAuthorization({
  82. event: 'disagree'
  83. })
  84. },
  85. // 同意
  86. handleAgreePrivacyAuthorization() {
  87. // 告知平台用户已经同意,参数传同意按钮的id
  88. // this.resolvePrivacyAuthorization({
  89. // buttonId: 'agree-btn',
  90. // event: 'agree'
  91. // })
  92. this.$refs.popup.close()
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. .privacyPopup {
  99. width: 90%;
  100. margin: 0rpx auto;
  101. background: white;
  102. border-radius: 20rpx;
  103. box-sizing: border-box;
  104. padding: 40rpx 30rpx;
  105. .title {
  106. text-align: center;
  107. font-size: 36rpx;
  108. }
  109. .content_pri {
  110. padding: 30rpx 0rpx;
  111. font-size: 28rpx;
  112. }
  113. .config {
  114. font-size: 28rpx;
  115. text-align: center;
  116. line-height: 40rpx;
  117. margin-bottom: 30rpx;
  118. text {
  119. color: #00aaff;
  120. }
  121. .content{
  122. display: flex;
  123. }
  124. }
  125. .pri_btn {
  126. button {
  127. background: #00aaff;
  128. outline: none;
  129. color: white;
  130. font-size: 30rpx;
  131. }
  132. }
  133. }
  134. </style>