uni-agree.nvue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view class="page">
  3. <view>
  4. <text class="title">个人信息保护指引</text>
  5. </view>
  6. <view class="text-item">
  7. <text class="tl">1.在浏览使用时,我们会收集、使用设备标识信息用于推荐。</text>
  8. </view>
  9. <view class="text-item">
  10. <text class="tl">2.我们可能会申请位置权限,用于演示 uni-app 的地图、定位能力。</text>
  11. </view>
  12. <view class="text-item">
  13. <text class="tl">3.你可以查看完整版</text>
  14. </view>
  15. <view class="text-item flex-r">
  16. <text class="tl hl" @click="openprotocol">《用户协议》</text>
  17. <text class="tl"> 和 </text>
  18. <text class="tl hl" @click="openPrivacyPolicy">《隐私政策》</text>
  19. </view>
  20. <view class="text-item">
  21. <text class="tl">以便了解我们收集、使用、共享、存储信息的情况,以及对信息的保护措施。</text>
  22. </view>
  23. <view class="text-item">
  24. <text class="service">如果你同意请点击下面的按钮以接受我们的服务</text>
  25. </view>
  26. <view class="text-item confirm">
  27. <button class="btn-privacy" type="primary" @click="agree">同意</button>
  28. <button class="btn-privacy btn-disagree" @click="disagree">暂不使用</button>
  29. </view>
  30. <view class="exit-area">
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import config from '@/uni-starter.config.js';
  36. const { about } = config
  37. export default {
  38. data() {
  39. return {
  40. }
  41. },
  42. onLoad() {
  43. this._canBack = false;
  44. },
  45. onBackPress() {
  46. return !this._canBack;
  47. },
  48. methods: {
  49. openprotocol(e) {
  50. uni.navigateTo({
  51. url: "/subpages/common/webview/webview?url="+about.agreements[0].url
  52. })
  53. },
  54. openPrivacyPolicy(e) {
  55. uni.navigateTo({
  56. url: "/subpages/common/webview/webview?url="+about.agreements[1].url
  57. })
  58. },
  59. agree(e) {
  60. var saveStatus = uni.setStorageSync("userprotocol", 1);
  61. this._canBack = true;
  62. setTimeout(() => {
  63. uni.navigateBack({
  64. animationDuration: 0
  65. });
  66. }, 100)
  67. },
  68. disagree() {
  69. // #ifdef APP-PLUS
  70. plus.runtime.quit();
  71. // #endif
  72. // #ifdef H5
  73. uni.showModal({
  74. content: '确定退出本应用?',
  75. cancelText:"退出",
  76. confirmText:"取消",
  77. success: (e) => {
  78. if(!e.confirm){
  79. window.location.href="about:blank";
  80. window.close();
  81. }
  82. }
  83. });
  84. // #endif
  85. }
  86. }
  87. }
  88. </script>
  89. <style>
  90. .page {
  91. padding: 80px 30px;
  92. }
  93. .title {
  94. font-size: 18px;
  95. line-height: 30px;
  96. margin-bottom: 20px;
  97. }
  98. .flex-r {
  99. flex-direction: row;
  100. flex-wrap: wrap;
  101. }
  102. .text-item {
  103. margin-bottom: 5px;
  104. }
  105. .tl {
  106. font-size: 14px;
  107. line-height: 20px;
  108. }
  109. .hl {
  110. color: #007AFF;
  111. }
  112. .service {
  113. font-size: 16px;
  114. line-height: 20px;
  115. margin-top: 20px;
  116. }
  117. .confirm {
  118. margin-top: 50px;
  119. flex-direction: row;
  120. }
  121. .btn-privacy {
  122. flex: 1;
  123. }
  124. .btn-disagree {
  125. margin-left: 20px;
  126. }
  127. </style>