launch.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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="/static/logo.png"></image>
  7. </view>
  8. <text class="text">云联商城</text>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import {getDicts} from '@/api/index'
  14. export default {
  15. data() {
  16. return {
  17. loadding:true,
  18. };
  19. },
  20. methods: {
  21. getDicts:function(){
  22. getDicts().then(
  23. res => {
  24. if(res.code==200){
  25. uni.setStorageSync('dicts',JSON.stringify(res));
  26. }else{
  27. }
  28. this.loadding=false;
  29. this.navigatHandler();
  30. },
  31. rej => {}
  32. );
  33. },
  34. navigatHandler: function() {
  35. uni.reLaunch({
  36. url: '../home/index',
  37. animationType: 'pop-in',
  38. animationDuration: 100
  39. })
  40. },
  41. },
  42. onLoad() {
  43. this.getDicts()
  44. }
  45. };
  46. </script>
  47. <style lang="scss">
  48. content {
  49. height: 100%;
  50. width: 100%;
  51. position: relative;
  52. padding-top: 0;
  53. }
  54. .circlebox {
  55. position: relative;
  56. width: 132rpx;
  57. height:132rpx;
  58. }
  59. .circle {
  60. width: 120rpx;
  61. height:120rpx;
  62. border: 6rpx solid #00c250;
  63. border-radius: 50%;
  64. border-right-color: transparent;
  65. animation: progress linear 1s infinite;
  66. }
  67. @keyframes progress {
  68. 0% {
  69. transform: rotate(0);
  70. }
  71. 100% {
  72. transform: rotate(360deg);
  73. }
  74. }
  75. .loadding{
  76. background-color: #fff;
  77. display: flex;
  78. flex-direction: column;
  79. align-items: center;
  80. justify-content: center;
  81. position: absolute;
  82. top: 0;
  83. left: 0;
  84. width: 100%;
  85. height: 100%;
  86. z-index: 9999;
  87. image{
  88. border-radius: 50%;
  89. // animation: load linear 1s infinite;
  90. width: 120rpx;
  91. height:120rpx;
  92. position: absolute;
  93. top: 6rpx;
  94. left: 6rpx;
  95. }
  96. .text{
  97. font-size: 28rpx;
  98. margin-top: 20rpx;
  99. }
  100. }
  101. </style>