launch.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view class="content">
  3. <view class="loadding" v-if="loadding==true">
  4. <image src="/static/images/logo.jpg"></image>
  5. <text class="text">芳华佳选</text>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import {getDicts} from '@/api/index'
  11. export default {
  12. data() {
  13. return {
  14. loadding:true,
  15. };
  16. },
  17. methods: {
  18. getDicts:function(){
  19. getDicts().then(
  20. res => {
  21. if(res.code==200){
  22. console.log(res)
  23. uni.setStorageSync('dicts',JSON.stringify(res));
  24. }else{
  25. }
  26. this.loadding=false;
  27. this.navigatHandler();
  28. },
  29. rej => {}
  30. );
  31. },
  32. navigatHandler: function() {
  33. uni.reLaunch({
  34. url: '../home/index',
  35. animationType: 'pop-in',
  36. animationDuration: 100
  37. })
  38. },
  39. },
  40. onLoad() {
  41. this.getDicts()
  42. }
  43. };
  44. </script>
  45. .
  46. <style lang="scss">
  47. content {
  48. height: 100%;
  49. width: 100%;
  50. position: relative;
  51. padding-top: 0;
  52. }
  53. .loadding{
  54. background-color: #fff;
  55. display: flex;
  56. flex-direction: column;
  57. align-items: center;
  58. justify-content: center;
  59. position: absolute;
  60. top: 0;
  61. left: 0;
  62. width: 100%;
  63. height: 100%;
  64. z-index: 9999;
  65. image{
  66. border-radius: 50%;
  67. animation: load linear 1s infinite;
  68. width: 120rpx;
  69. height:120rpx;
  70. }
  71. .text{
  72. font-size: 28rpx;
  73. margin-top: 20rpx;
  74. }
  75. }
  76. </style>