launch.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <view class="content">
  3. <image src="../../static/img/banner1.png" mode="widthFix" />
  4. <view class="img-skip" @tap="goindex()" v-if="showtime">
  5. 跳过{{time}}
  6. </view>
  7. <!-- <view class="modalhtml" v-if="showModal">
  8. <view class="modal">
  9. <view class="title">
  10. 个人信息保护指南
  11. </view>
  12. <view class="content">
  13. 请充分阅读并理解<br> 《<view class="rule" @tap="go_rule(0)">用户协议</view>》及《<view class="rule"
  14. @tap="go_rule(1)">隐私条款</view>》<br>
  15. <view>
  16. 1.在您使用本应用时,我们可能会申请系统设备权限收集设备信息、日志信息,用于推送和安全风控,并申请存储权限,用于下载及缓存相关文件<br>
  17. 2.您使用发布视频、语音、图片等功能时候,我们会请求您授权相机、照片、麦克风的权限。您如果拒绝授权提供,将无法使用此功能,但不影响您使用本应用的其他功能。 <br>
  18. 3.在您使用本应用网络服务,本应用自动接收并记录您的设备信息,包括但不限于您的IP地址、使用的语言、访问日期和时间、软硬件特征信息等数据;
  19. </view>
  20. </view>
  21. <view class="btns" style="display: flex;">
  22. <view class="" @tap="jujue()">
  23. 不同意
  24. </view>
  25. <view class="" @tap="readrule()">
  26. 同意并继续
  27. </view>
  28. </view>
  29. </view>
  30. </view> -->
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. data() {
  36. return {
  37. time: 5,
  38. timer: null,
  39. showtime: false,
  40. showModal: false,
  41. }
  42. },
  43. methods: {
  44. readrule() {
  45. try {
  46. uni.setStorageSync('readrule', 1);
  47. this.showModal = false;
  48. this.goindex()
  49. } catch (e) {
  50. console.log(e, 'eeee');
  51. }
  52. },
  53. go_rule(type) {
  54. console.log(type)
  55. uni.navigateTo({
  56. url: '/pages/login/rule?type=' + type
  57. })
  58. },
  59. jujue() {
  60. if (uni.getSystemInfoSync().platform === 'ios') {
  61. plus.runtime.launchApplication({
  62. action: 'QUIT'
  63. });
  64. } else {
  65. plus.runtime.quit();
  66. }
  67. },
  68. daojishi() {
  69. var that = this
  70. this.timer = setInterval(function() {
  71. that.time--;
  72. if (that.time <= 0) {
  73. clearInterval(that.timer);
  74. // that.goindex();
  75. }
  76. }, 1000)
  77. },
  78. goindex() {
  79. clearInterval(this.timer);
  80. var userid = uni.getStorageSync('access_token');
  81. if (userid > 0) {
  82. uni.reLaunch({
  83. url: '/pages/index/index'
  84. })
  85. } else {
  86. uni.reLaunch({
  87. url: '/pages/login/index'
  88. })
  89. }
  90. }
  91. },
  92. onLoad() {
  93. // #ifdef APP-PLUS
  94. this.$action.bindcid();
  95. if (!uni.getStorageSync('readrule')) {
  96. this.showModal = true;
  97. } else {
  98. // uni.removeStorageSync('readrule')
  99. this.goindex()
  100. }
  101. console.log(this.showModal, 'this.showModal');
  102. // #endif
  103. // this.goindex()
  104. },
  105. onShow() {
  106. this.$action.init();
  107. this.goindex();
  108. // #ifdef APP-PLUS
  109. var that = this;
  110. plus.runtime.getProperty(plus.runtime.appid, function(info) {
  111. if (uni.getStorageSync('app_version') == info.version) {
  112. that.goindex();
  113. } else {
  114. that.showtime = true;
  115. that.daojishi();
  116. uni.setStorageSync('app_version', info.version);
  117. if (uni.getStorageSync('access_token')) {
  118. uni.setStorageSync('shownote', true);
  119. }
  120. }
  121. });
  122. // #endif
  123. // #ifndef APP-PLUS
  124. this.goindex()
  125. // #endif
  126. },
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. @import '../../static/css/uni.css';
  131. .rule {
  132. color: #2da2fd;
  133. display: inline-block;
  134. }
  135. .img-skip {
  136. position: absolute;
  137. width: 60px;
  138. height: 30px;
  139. padding: 5px 5px;
  140. background-color: rgba(0, 0, 0, 0.6);
  141. color: #fff;
  142. border-radius: 5px;
  143. z-index: 100;
  144. top: 30px;
  145. right: 10px;
  146. ;
  147. text-align: center;
  148. line-height: 30px;
  149. font-size: 14px;
  150. }
  151. .img-skip>.title {
  152. color: #666;
  153. height: 18px;
  154. }
  155. .img-skip>.title2 {
  156. color: #999;
  157. height: 18px;
  158. }
  159. .content,
  160. ,
  161. image {
  162. overflow: hidden;
  163. width: 100vw;
  164. vertical-align: middle;
  165. }
  166. .modalhtml {
  167. position: fixed;
  168. z-index: 999;
  169. top: 0px;
  170. width: 100%;
  171. left: 0px;
  172. height: 100vh;
  173. background-color: rgba(0, 0, 0, 0.7);
  174. }
  175. .modalhtml .modal {
  176. background-color: #fff;
  177. border-radius: 10px;
  178. ;
  179. top: 30vh;
  180. width: 80vw;
  181. left: 10vw;
  182. position: fixed;
  183. border: 1px #ddd solid;
  184. }
  185. .modalhtml .modal .title {
  186. text-align: center;
  187. height: 35px;
  188. line-height: 35px;
  189. color: #000;
  190. font-size: 16px;
  191. font-weight: 600;
  192. margin-top: 5px;
  193. }
  194. .modalhtml .modal .content {
  195. padding: 5px 10px;
  196. max-height: 160px;
  197. min-height: 65px;
  198. line-height: 30px;
  199. overflow-y: scroll;
  200. font-size: 14px;
  201. // color: red;
  202. width: 90%;
  203. }
  204. .modalhtml .modal .btns {
  205. text-align: center;
  206. height: 35px;
  207. line-height: 35px;
  208. color: #000;
  209. font-size: 16px;
  210. font-weight: 600;
  211. border-top: #eee 1px solid;
  212. width: 100%;
  213. view {
  214. flex-grow: 1;
  215. width: 50%;
  216. }
  217. }
  218. .notehtml {
  219. position: fixed;
  220. z-index: 999;
  221. top: 0px;
  222. width: 100%;
  223. left: 0px;
  224. height: 100vh;
  225. background-color: rgba(0, 0, 0, 0.7);
  226. }
  227. </style>