launch.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="launch-bg" :style="[background]" >
  3. <image class="launch-img" mode="widthFix" :src="appConfig.mobile_start_page"></image>
  4. <view class="flex-col col-center fixed w-full">
  5. <image src="/static/images/map_bg.png" mode="widthFix" @tap="launchApp('/pages/index/index', 'map')"></image>
  6. <image src="/static/images/policy_bg.png" mode="widthFix" style="margin-top: 150rpx;" @tap="launchApp('/pages/policy/index', 'policy')"></image>
  7. </view>
  8. <!-- <view class="img-datu">
  9. <view class="jishi" :style="{ top: (sysInfo.statusBarHeight + 60) + 'px' }">
  10. <text>跳过</text>
  11. <text>{{countDownNum}}秒</text>
  12. </view>
  13. </view> -->
  14. </view>
  15. </template>
  16. <script>
  17. import {
  18. mapGetters
  19. } from 'vuex'
  20. const app = getApp()
  21. const homeItem = {
  22. name: '启动页'
  23. }
  24. export default {
  25. data() {
  26. return {
  27. countDownNum: 5,
  28. timer: null,
  29. }
  30. },
  31. onLoad(options) {
  32. // console.log('token' + this.appConfig.token)
  33. // this.timer = setInterval(() => {
  34. // if (this.countDownNum == 0) {
  35. // clearInterval(this.timer)
  36. // this.launchApp()
  37. // } else {
  38. // this.countDownNum = this.countDownNum - 1;
  39. // }
  40. // }, 1000)
  41. },
  42. onUnload() {},
  43. onShow() {},
  44. onHide() {},
  45. methods: {
  46. launchApp(url, type) {
  47. // if (this.timer) {
  48. // clearInterval(this.timer)
  49. // }
  50. uni.setStorageSync('TABBAR_TYPE', type);
  51. uni.switchTab({
  52. url: url
  53. })
  54. },
  55. },
  56. computed: {
  57. ...mapGetters(['sysInfo', 'inviteCode', 'appConfig']),
  58. background() {
  59. const {
  60. mobile_start_bg
  61. } = this.appConfig
  62. return mobile_start_bg ? {
  63. 'background-image': `url(${mobile_start_bg})`,
  64. 'background-size': 'cover'
  65. } : {}
  66. },
  67. }
  68. }
  69. </script>
  70. <style lang="scss">
  71. page {
  72. padding: 0;
  73. height: 100%;
  74. }
  75. .fixed {
  76. position: fixed;
  77. top: 660rpx;
  78. image {
  79. border-radius: 10px 10px 10px 10px;
  80. }
  81. }
  82. .launch-bg {
  83. height: 100%;
  84. }
  85. .launch-img {
  86. width: 100%;
  87. }
  88. .img-datu .jishi {
  89. background-color: rgba(0, 0, 0, 0.4);
  90. position: fixed;
  91. top: 200rpx;
  92. right: 50rpx;
  93. border-radius: 50%;
  94. width: 100rpx;
  95. height: 100rpx;
  96. display: flex;
  97. flex-direction: column;
  98. justify-content: center;
  99. align-items: center;
  100. }
  101. .img-datu .jishi text {
  102. color: #fff;
  103. font-size: 24rpx;
  104. }
  105. </style>