launch.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="content">
  3. <view class="loadding" v-if="loadding==true">
  4. <view class="circlebox">
  5. <view class="circle"></view>
  6. <image :src="logoimg"></image>
  7. </view>
  8. <text class="text">德信小站 </text>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import {getDicts} from '@/api/index'
  14. import { mapGetters } from 'vuex';
  15. export default {
  16. data() {
  17. return {
  18. loadding:true,
  19. };
  20. },
  21. computed: {
  22. ...mapGetters(['logoimg']),
  23. },
  24. watch: {
  25. logoimg: {
  26. immediate: true, // 页面一进入就检查一次
  27. handler(val) {
  28. return val
  29. }
  30. },
  31. },
  32. onLoad() {
  33. this.getDicts()
  34. console.log('123123',this.logoimg)
  35. },
  36. methods: {
  37. getDicts:function(){
  38. getDicts().then(
  39. res => {
  40. if(res.code==200){
  41. uni.setStorageSync('dicts',JSON.stringify(res));
  42. }else{
  43. }
  44. this.loadding=false;
  45. this.navigatHandler();
  46. },
  47. rej => {}
  48. );
  49. },
  50. navigatHandler: function() {
  51. uni.reLaunch({
  52. url: '../home/index',
  53. animationType: 'pop-in',
  54. animationDuration: 100
  55. })
  56. },
  57. },
  58. };
  59. </script>
  60. <style lang="scss">
  61. content {
  62. height: 100%;
  63. width: 100%;
  64. position: relative;
  65. padding-top: 0;
  66. }
  67. .circlebox {
  68. position: relative;
  69. width: 132rpx;
  70. height:132rpx;
  71. }
  72. .circle {
  73. width: 120rpx;
  74. height:120rpx;
  75. border: 6rpx solid #00c250;
  76. border-radius: 50%;
  77. border-right-color: transparent;
  78. animation: progress linear 1s infinite;
  79. }
  80. @keyframes progress {
  81. 0% {
  82. transform: rotate(0);
  83. }
  84. 100% {
  85. transform: rotate(360deg);
  86. }
  87. }
  88. .loadding{
  89. background-color: #fff;
  90. display: flex;
  91. flex-direction: column;
  92. align-items: center;
  93. justify-content: center;
  94. position: absolute;
  95. top: 0;
  96. left: 0;
  97. width: 100%;
  98. height: 100%;
  99. z-index: 9999;
  100. image{
  101. border-radius: 50%;
  102. // animation: load linear 1s infinite;
  103. width: 120rpx;
  104. height:120rpx;
  105. position: absolute;
  106. top: 6rpx;
  107. left: 6rpx;
  108. }
  109. .text{
  110. font-size: 28rpx;
  111. margin-top: 20rpx;
  112. }
  113. }
  114. </style>