index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view :style="viewColor">
  3. <view class="mask" @touchmove.prevent :hidden="isShow == false" @click="rejectAgreement"></view>
  4. <view class="product-window" :class="{'on':isShow}">
  5. <view class="mp-data">
  6. <text class="mp-name">{{site_name}}服务与隐私协议</text>
  7. </view>
  8. <view class="trip-msg">
  9. <view class="trip">
  10. 欢迎您使用{{site_name}}!请仔细阅读以下内容,并作出适当的选择:
  11. </view>
  12. </view>
  13. <view class="trip-title">
  14. 隐私政策概要
  15. </view>
  16. <view class="trip-msg">
  17. <view class="trip">
  18. 当您点击同意并开始时用产品服务时,即表示您已理解并同息该条款内容,该条款将对您产生法律约束力。如您拒绝,将无法继续下一步操作。
  19. </view>
  20. </view>
  21. <view class="main-color" @click.stop="privacy(3)">点击阅读{{agreementName}}</view>
  22. <view class="bottom">
  23. <button class="save open" type="default" id="agree-btn" open-type="agreePrivacyAuthorization"
  24. @agreeprivacyauthorization="handleAgree">同意并继续</button>
  25. <button class="reject" @click="rejectAgreement">
  26. 取消
  27. </button>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. // +----------------------------------------------------------------------
  34. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  35. // +----------------------------------------------------------------------
  36. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  37. // +----------------------------------------------------------------------
  38. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  39. // +----------------------------------------------------------------------
  40. // | Author: CRMEB Team <admin@crmeb.com>
  41. // +----------------------------------------------------------------------
  42. const app = getApp();
  43. import { mapGetters } from 'vuex';
  44. import { configMap } from "@/utils";
  45. import Routine from '../../libs/routine';
  46. export default {
  47. data() {
  48. return {
  49. isShow: false,
  50. agreementName: '',
  51. mpData: uni.getStorageSync('copyRight'),
  52. };
  53. },
  54. computed: {
  55. ...configMap({site_name: ''}, mapGetters(['viewColor'])),
  56. },
  57. mounted() {
  58. wx.getPrivacySetting({
  59. success: res => {
  60. console.log(res.needAuthorization)
  61. if (res.needAuthorization) {
  62. // 需要弹出隐私协议
  63. this.isShow = true
  64. this.agreementName = res.privacyContractName
  65. } else {
  66. this.$emit('onAgree');
  67. // 用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用已声明过的隐私接口
  68. }
  69. },
  70. fail: () => {},
  71. complete: () => {}
  72. })
  73. },
  74. methods: {
  75. // 同意
  76. handleAgree() {
  77. this.isShow = false
  78. this.$emit('onclose');
  79. },
  80. // 拒绝
  81. rejectAgreement() {
  82. this.isShow = false
  83. this.$emit('onReject');
  84. },
  85. // 跳转协议
  86. privacy(type) {
  87. uni.navigateTo({
  88. url: "/pages/users/privacy/index?type=" + type
  89. })
  90. },
  91. }
  92. }
  93. </script>
  94. <style>
  95. .pl-sty {
  96. color: #999999;
  97. font-size: 30rpx;
  98. }
  99. </style>
  100. <style scoped lang="scss">
  101. .product-window.on {
  102. transform: translate3d(0, 0, 0);
  103. }
  104. .product-window {
  105. position: fixed;
  106. bottom: 0;
  107. width: 100%;
  108. left: 0;
  109. background-color: #fff;
  110. z-index: 1000;
  111. border-radius: 40rpx 40rpx 0 0;
  112. transform: translate3d(0, 100%, 0);
  113. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  114. padding: 64rpx 40rpx;
  115. padding-bottom: 38rpx;
  116. padding-bottom: calc(38rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  117. padding-bottom: calc(38rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  118. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.06);
  119. .icon-guanbi {
  120. position: absolute;
  121. top: 40rpx;
  122. right: 40rpx;
  123. font-size: 24rpx;
  124. font-weight: bold;
  125. color: #999;
  126. }
  127. .mp-data {
  128. display: flex;
  129. align-items: center;
  130. justify-content: center;
  131. margin-bottom: 40rpx;
  132. .mp-name {
  133. font-size: 34rpx;
  134. font-weight: 500;
  135. color: #333333;
  136. line-height: 48rpx;
  137. }
  138. }
  139. .trip-msg {
  140. padding-bottom: 32rpx;
  141. .title {
  142. font-size: 30rpx;
  143. font-weight: bold;
  144. color: #000;
  145. margin-bottom: 6rpx;
  146. }
  147. .trip {
  148. color: #333333;
  149. font-size: 28rpx;
  150. font-family: PingFang SC-Regular, PingFang SC;
  151. font-weight: 400;
  152. }
  153. }
  154. .trip-title {
  155. font-size: 28rpx;
  156. font-weight: 500;
  157. color: #333333;
  158. margin-bottom: 8rpx;
  159. }
  160. .main-color {
  161. font-size: 28rpx;
  162. font-weight: 400;
  163. color: var(--view-theme);
  164. margin-bottom: 40rpx;
  165. }
  166. .bottom {
  167. display: flex;
  168. align-items: center;
  169. justify-content: center;
  170. flex-direction: column;
  171. .save,
  172. .reject {
  173. display: flex;
  174. align-items: center;
  175. justify-content: center;
  176. width: 670rpx;
  177. height: 80rpx;
  178. border-radius: 80rpx;
  179. background-color: #F5F5F5;
  180. color: #333;
  181. font-size: 30rpx;
  182. font-weight: 500;
  183. }
  184. .save {
  185. background-color: var(--view-theme);
  186. color: #fff;
  187. margin-bottom: 24rpx;
  188. }
  189. }
  190. }
  191. </style>