<template>
	<view class="content">
		<u-image width="60vw" height="60vw" :src="shareUrl" class="share-img"></u-image>
		<u-top-tips ref="uTips"></u-top-tips>
	</view>
</template>

<script>
	import {
		mapGetters
	} from 'vuex'
	const NET = require('@/utils/request')
	const API = require('@/config/api')
	export default {
		computed: {
			...mapGetters([
				'mainColor'
			])
		},
		data() {
			return {
				shareUrl: ''
			}
		},
		onLoad() {
			this.getData()
		},
		onReady() {},
		methods: {
			//  获取数据
			getData() {
				NET.request(API.getShareUrl, {}, 'POST').then(res => {
					this.shareUrl = res.data
				}).catch(error => {
					this.$refs.uTips.show({
						title: error.message,
						type: 'warning',
					})
				})
			}
		},
	}
</script>
<style lang="scss" scoped>
	@import "@/static/css/themes.scss";

	.content {
		width: 100%;
		height: 100vh;
		float: left;
		position: relative;

		.share-img {
			top: 40%;
			left: 50%;
			transform: translate(-50%, -50%);
			position: absolute;
		}
	}
</style>
