privacy.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <!-- 首页隐私政策 -->
  3. <view>
  4. <!-- 背景图 -->
  5. <view class="d-c-c position-absolute " :style="'width: 750rpx;height:'+windowHeight+'px;'">
  6. <view class="d-c bg-white box-shadow rounded-3" style="width: 580rpx;height: 460rpx;">
  7. <view class="d-c-c" style="height: 100rpx;">
  8. <text class="fb f32">服务协议和隐私政策</text>
  9. </view>
  10. <view class="flex-1 my-2 f26 liln-h-40">
  11. <view class="ti2">请你务必审慎阅读、充分理解"用户协议"和"隐私政策"各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。
  12. </view>
  13. <view class="ti2">
  14. <text>你可阅读</text>
  15. <text class="blue" @click="xieyi('service')">《服务协议》</text>
  16. <text class="blue" @click="xieyi('privacy')">《隐私政策》</text>
  17. 了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。
  18. </view>
  19. </view>
  20. <view class="d-c-c d-cr" style="height: 80rpx;">
  21. <view class="d-c-c flex-1 " @click="quit"><text class="text-muted blue f26">暂不同意</text></view>
  22. <view class="d-c-c flex-1 main-bg" @click="submit"><text class="text-white f26">同意并接受</text></view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. windowHeight: 0,
  33. windowWidth: 0,
  34. service: '',
  35. privacy: ''
  36. }
  37. },
  38. onLoad() {
  39. const res = uni.getSystemInfoSync();
  40. this.windowWidth = res.windowWidth;
  41. this.windowHeight = res.windowHeight;
  42. this.getData();
  43. },
  44. methods: {
  45. getData() {
  46. let self = this;
  47. self._get('user.userapple/policy', {
  48. platform: self.getPlatform(),
  49. referee_id: uni.getStorageSync('referee_id')
  50. }, function(res) {
  51. console.log(res);
  52. self.service = res.data.service;
  53. self.privacy = res.data.privacy;
  54. });
  55. },
  56. // 同意隐私
  57. submit() {
  58. uni.setStorageSync('firstEnter', 1);
  59. uni.reLaunch({
  60. url: '/pages/index/index'
  61. })
  62. },
  63. // 退出应用
  64. quit() {
  65. plus.runtime.disagreePrivacy();
  66. //android退出应用
  67. plus.runtime.quit();
  68. //ios退出应用
  69. plus.ios.import("UIApplication").sharedApplication().performSelector("exit");
  70. },
  71. xieyi(type) {
  72. let url = '';
  73. if (type == 'service') {
  74. url = this.service;
  75. } else {
  76. url = this.privacy;
  77. }
  78. uni.navigateTo({
  79. url: '/pages/webview/webview?url=' + url
  80. });
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. .position-absolute {
  87. position: absolute;
  88. background: rgba(0, 0, 0, .6)
  89. }
  90. .d-cr {
  91. display: flex;
  92. flex-direction: row;
  93. }
  94. .ti2 {
  95. text-indent: 2em;
  96. }
  97. .liln-h-40 {
  98. line-height: 40rpx;
  99. }
  100. .box-shadow {
  101. border-radius: 12rpx;
  102. padding: 30rpx;
  103. box-shadow: 0 0 8rpx rgba(0, 0, 0, 0.2);
  104. }
  105. </style>