pageLoading.vue 1.3 KB
Newer Older
李嘉林 committed
1
<template>
李嘉林 committed
2
  <div class="loadings" v-if="shopLogo">
李嘉林 committed
3 4 5 6 7 8 9 10 11
    <div class="img flex">
      <image :src="shopLogo" alt="" mode="aspectFill"></image>
      <van-loading color="black" size="60px" />
    </div>
  </div>
</template>

<script>
import { DFSImg } from "@/utils/index";
李嘉林 committed
12
const app = getApp();
李嘉林 committed
13 14 15 16 17 18 19 20 21 22 23 24
export default {
  props: {
    toHide: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {};
  },
  computed: {
    shopLogo() {
李嘉林 committed
25
      let logoUrl = app.globalData && app.globalData.shopInfo && app.globalData.shopInfo.logoUrl;
李嘉林 committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
      return logoUrl?DFSImg(logoUrl):"";
    },
  },
  created() { },
  mounted() { }
};
</script>

<style lang="scss" scoped>
.loadings {
  position: fixed;
  background: #fafafa;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3000;
  .img{
    width: 50px;
    height: 50px;
    position: relative;
    padding: 2px;
    margin: 60% auto 0;
    justify-content: center;
    align-items: center;
    image{
      width: 50px;
      height: 50px;
李嘉林 committed
54
      border-radius: 50%;
李嘉林 committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
      position: relative;
      z-index: 1;
    }
  }
  ._van-loading{
    position: absolute;
  }
  .van-loading {
    position: absolute;
    top: -2px;
    left: -2px;

    .van-loading__spinner {
      display: block;
      margin: 0 auto;
      color: #333 !important;
    }
  }
}
</style>