123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <template>
- <transition appear name="custom-classes-transition" leave-active-class="animated fadeOut faster">
- <div
- v-if="show"
- class="scene-loading"
- :class="{ small: small, thumb: props.thumb }"
- @touchmove.prevent
- :style="metadata.icon && { backgroundImage: `url(${metadata.icon})` }"
- >
- <div class="ui-waiting">
- <div class="icon">
- <img :src="require('@/assets/images/loading.png')" alt="" />
- </div>
- <div class="txt">加载中</div>
- </div>
- </div>
- </transition>
- </template>
- <script setup>
- import { ref, watch, computed, onMounted, defineProps } from "vue";
- import { useStore } from "vuex";
- import { useApp } from "@/app";
- const props = defineProps({
- small: {
- type: Boolean,
- default: false,
- },
- thumb: {
- type: Boolean,
- default: false,
- },
- });
- const store = useStore();
- const show = ref(true);
- const metadata = computed(() => store.getters['scene/metadata'])
- useApp().then((app) => {
- app.Scene.on("ready", () => {
- show.value = false;
- });
- });
- </script>
- <style lang="scss" scoped>
- .scene-loading {
- display: table;
- table-layout: fixed;
- height: 100%;
- width: 100%;
- z-index: 11;
- background-repeat: no-repeat;
- background-position: 50%;
- background-size: cover;
- .ui-waiting {
- color: #fff;
- text-align: center;
- display: table-cell;
- text-align: center;
- vertical-align: middle;
- width: 100%;
- height: 100%;
- .icon {
- width: 60px;
- height: 60px;
- position: relative;
- overflow: hidden;
- margin: 10px auto;
- > img {
- height: 60px;
- position: absolute;
- left: 0;
- top: 0;
- animation: loading 1s steps(15) infinite;
- }
- }
- .txt {
- font-size: 14px;
- }
- .spinner {
- width: 100%;
- text-align: center;
- display: flex;
- justify-content: center;
- align-items: center;
- margin-top: 5px;
- > div {
- width: 5px;
- height: 5px;
- background-color: #fff;
- margin: 5px;
- border-radius: 100%;
- display: inline-block;
- animation: bouncedelay 1.4s infinite ease-in-out;
- animation-fill-mode: both;
- }
- .bounce1 {
- animation-delay: -0.32s;
- }
- .bounce2 {
- animation-delay: -0.16s;
- }
- }
- }
- }
- @keyframes loading {
- 100% {
- left: -900px;
- }
- }
- </style>
|