<script setup>
	/**
	 * 我的分享
	 */
	import {
		onMounted,
		ref,
		reactive,
		computed,
		getCurrentInstance,
		watch,
		defineExpose,
	} from 'vue';
	
	import {
		useStore,
	} from 'vuex'
	
	import intergralApi from '@/api/intergral.js';
		const store = useStore()
		const userinfo = computed(() => {
			let result = store.state.userinfo
			return result
		})
		myQrcode()
	const viewData=ref("")
	// 查看二维码
	function myQrcode() {
		intergralApi.myQrcode({
		}).then(rs => {
			console.log(rs)
			if(rs.code==200 && rs.data){
				viewData.value=rs.data
			}
		})
	}
	
</script>

<template>
	<view class="appbw df fdc aic">
		<view class="qrBox pr">
			<image src="/static/myShare.png" mode="aspectFill" />
			
			<image class="qr pmid" :src="viewData" mode="aspectFill" />
		</view>
		<view class="button btn lg colourful mt60">推荐码： {{userinfo.userRecommend}}</view>
	</view>
</template>

<style lang="scss">
	// 二维码
	.qrBox {
		margin-top: 10vh;
		width: 606rpx;
		height: 606rpx;

		// 二维码
		.qr {
			width: 374rpx;
			height: 374rpx;
		}
	}

	// 按钮
	.button {
		width: 310rpx;
	}
</style>