pageLoading.vue 1.52 KB
Newer Older
李嘉林 committed
1
<template>
李嘉林 committed
2
  <div class="loadings">
李嘉林 committed
3 4
    <div class="img flex">
      <image :src="shopLogo" alt="" mode="aspectFill"></image>
李嘉林 committed
5
      <van-loading color="#333" size="60px" />
李嘉林 committed
6 7 8 9 10 11
    </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 = "";
李嘉林 committed
26 27 28
      if (process.env.SHOP_LOGO) {
        logoUrl = process.env.SHOP_LOGO;
      } else if (wx.getStorageSync("logoUrl")) {
李嘉林 committed
29 30 31 32
        logoUrl = wx.getStorageSync("logoUrl");
      } else {
        logoUrl = app.globalData && app.globalData.shopInfo && app.globalData.shopInfo.logoUrl;
      }
李嘉林 committed
33 34 35 36
      return logoUrl?DFSImg(logoUrl):"";
    },
  },
  created() { },
李嘉林 committed
37 38 39 40
  mounted() { },
  methods: {
    
  }
李嘉林 committed
41 42 43 44 45 46 47 48 49 50 51
};
</script>

<style lang="scss" scoped>
.loadings {
  position: fixed;
  background: #fafafa;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
李嘉林 committed
52
  z-index: 9999;
李嘉林 committed
53 54 55 56 57
  .img{
    width: 50px;
    height: 50px;
    position: relative;
    padding: 2px;
李嘉林 committed
58
    margin: 40vh auto 0;
李嘉林 committed
59 60 61 62 63
    justify-content: center;
    align-items: center;
    image{
      width: 50px;
      height: 50px;
李嘉林 committed
64
      border-radius: 50%;
李嘉林 committed
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
      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>