splash.vue 1.21 KB
<template>
	<view class="container">
		<view class="container-box">
			<image :src="mpOwnConfig.logo ? mpOwnConfig.logo : staticLogo"></image>
			<text class="splash-text-muted">连接世界 创造价值</text>
		</view>
	</view>
</template>

<script>
import { mapState } from 'vuex';
export default {
	data() {
		return {
			staticLogo: '../../static/logo.png',
			mpOwnConfig: {}
		};
	},
	onLoad() {
		this.getPlateForm();
		if (!this.userInfo.isToken) {
			setTimeout(() => {
				uni.reLaunch({
					url: '/publicLoginSubPage/public/login'
				});
			}, 2500);
		} else {
			setTimeout(() => {
				uni.reLaunch({
					url: '/pages/index/index'
				});
			}, 2500);
		}
	},
	computed: {
		...mapState(['userInfo'])
	},
	methods: {
		getPlateForm() {
			uni.$u.http.get('/yt/app_design/get').then(res => {
				if (res) {
					this.mpOwnConfig = {
						bg: res.background,
						logo: res.logo,
						name: res.name
					};
				}
			});
		}
	}
};
</script>

<style lang="less">
.container {
	width: 100%;
	height: 100%;
	margin-top: 300rpx;
	.container-box {
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex-direction: column;
		image {
			width: 100rpx;
			height: 100rpx;
		}
		text {
		}
	}
}
</style>