<template>
    <div>
        {{ userInfo.name }}
        <uqrcode ref="uQRCode" :text="qrContent" />

        <button type="default" @click="saveToPhoto">保存到相册</button>
    </div>
</template>

<script>
    import {
        getUserInfo
    } from '@/apis/interfaces/im'

    export default {
        data() {
            return {
                qrContent: 'ADDFRIEND|'
            }
        },
        onLoad() {
            this.qrContent += this.userInfo.userId
        },
        computed: {
            userInfo() {
                return this.$store.getters.sender
            }
        },
        methods: {
            saveToPhoto() {
                uni.switchTab({
                    url: '/pages/im/index'
                })
            }
        }
    }
</script>

<style lang="scss" scoped>
</style>
