<template>
	<view class="loading-wrap" v-if="status">
		<image
			class="load-icon"
			src="data:image/png;base64,[encoded data, 5728 characters]"
		></image>
		<text class="load-text">{{ text }}</text>
	</view>
</template>

<script>
export default {
	name: 'loading',
	props: {
		status: {
			type: Boolean,
			default: true
		},
		text: {
			type: String,
			default: '加载中…'
		}
	}
};
</script>

<style>
.loading-wrap {
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	height: 90rpx;
	padding-top: 10rpx;
}
.load-icon {
	display: block;
	width: 45rpx;
	height: 45rpx;
	margin-right: 12rpx;
	-webkit-animation: load 1s steps(12) infinite;
	animation: load 1s steps(12) infinite;
}
.load-text {
	font-size: 28rpx;
	color: #848c98;
}

@-webkit-keyframes load {
	0% {
		-webkit-transform: rotate(0deg);
		transform: rotate(0deg);
	}

	to {
		-webkit-transform: rotate(1turn);
		transform: rotate(1turn);
	}
}

@keyframes load {
	0% {
		-webkit-transform: rotate(0deg);
		transform: rotate(0deg);
	}

	to {
		-webkit-transform: rotate(1turn);
		transform: rotate(1turn);
	}
}
</style>
