start.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view>
  3. <image src="../../static/start/start.gif" mode="" :style="{height:QHeight+'px'}"></image>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. time: 3,
  11. QHeight: 0
  12. };
  13. },
  14. onLoad() {
  15. //获取页面高度
  16. uni.getSystemInfo({
  17. success: (res) => {
  18. let height = res.windowHeight - uni.upx2px(0)
  19. console.log(height,'222');
  20. this.QHeight = height
  21. }
  22. })
  23. let times = this.time
  24. this.getTime(times)
  25. },
  26. methods: {
  27. getTime(times) {
  28. let time = setInterval(
  29. function() {
  30. times--;
  31. if (times == 0) {
  32. clearInterval(time)
  33. // uni.redirectTo({
  34. // success: (res) => {
  35. // console.log(res,'dayin');
  36. // },fail: (res) => {
  37. // console.log(res,'错误');
  38. // }
  39. // })
  40. uni.reLaunch({
  41. url:'index',
  42. })
  43. }
  44. console.log(times);
  45. }, 1000)
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="scss">
  51. image {
  52. width: 750rpx;
  53. // height: 1300rpx;
  54. }
  55. </style>