<template>
	<view class="account">
		<image show-menu-by-longpress="true" mode="widthFix" :src="qrurl" ></image>
		<view class="accountText">
		    长按二维码，可保存图片，或直接分享。
		</view>
	</view>
</template>

<script>
		import { mapMutations, mapState } from 'vuex'
		
	export default {
		computed: {
			...mapState('m_user', ['userinfo'])
		},
		data() {
			return {
				qrurl: ''
			};
		},
		created() {
			this.getOwnQRCodeUrl();
		},
		methods: {
			async getOwnQRCodeUrl() {
				const {
					data: result
				} = await uni.$http.get('/ucenter/mini-program-openid-uid/getOwnQRcodeUrl?uid='+ this.userinfo.uid)
			//	console.log(result.data.QRurl)
				if (result.data.QRurl != undefined) {
					if (result.data.QRurl != "0") {
						this.qrurl = result.data.QRurl
					}
				}
			
			},
		}
	}
</script>

<style>
page{
	height: 100%;
	/* background-color: #FFF; */
}
.account{
	/* background-color: #FFF2CC; */
    width: 100%;
    height: 100%;
    justify-content: center;
    text-align: center;
    /* margin-top: 40rpx; */
	padding-top: 40rpx;
}
.accountText{
    margin: 40rpx;
	color: gray;
}
</style>
