<template>
	<view class="content">
		<view class="loadding" v-if="loadding==true">
			<view class="circlebox">
				<view class="circle"></view>
				<image :src="logoimg"></image>
			</view>
			<text class="text">德信小站 </text>
		</view>
	</view>
</template>

<script>
	import {getDicts} from '@/api/index'
	import { mapGetters } from 'vuex';
	export default {
		data() {
			return {
				loadding:true,
			};
		},
		computed: {
			...mapGetters(['logoimg']),
		},
		watch: {
		    logoimg: {
		      immediate: true,          // 页面一进入就检查一次
		      handler(val) {
				  return val
		      }
		    },
		},
		onLoad() {
			this.getDicts()
			console.log('123123',this.logoimg)
		},
		methods: {
			getDicts:function(){
				getDicts().then(
					res => {
						if(res.code==200){
							uni.setStorageSync('dicts',JSON.stringify(res));
							
						}else{
							 
						}
						this.loadding=false;
						this.navigatHandler();
					},
					rej => {}
				);
			},
			navigatHandler: function() {
				uni.reLaunch({
					url: '../home/index',
					animationType: 'pop-in',
					animationDuration: 100
				})
			},
			
		},
		
	};
 
</script>

<style lang="scss">
	content {
		height: 100%;
		width: 100%;
		position: relative;
		padding-top: 0;
		
	}
	.circlebox {
		position: relative;
		width: 132rpx;
		height:132rpx;
	}
	.circle {
		width: 120rpx;
		height:120rpx;
		border: 6rpx solid #00c250;
		border-radius: 50%;
		border-right-color: transparent;
		animation: progress linear 1s infinite;
	}

	@keyframes progress {
		0% {
			transform: rotate(0);
		}

		100% {
			transform: rotate(360deg);
		}
	}
	.loadding{
		background-color: #fff;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: 9999;
		image{
			border-radius: 50%;
			// animation: load linear 1s infinite;
			width: 120rpx;
			height:120rpx;
			position: absolute;
			top: 6rpx;
			left: 6rpx;
		}
		.text{
			font-size: 28rpx;
			margin-top: 20rpx;
		}
	}
</style>
