launch.vue 1.8 KB

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