<template>
    <app-view>
        <template #header>
            <app-navbar title="个人信息" />
        </template>
        <CellGroup>
            <Cell title="发票信息" :to="{ name: 'mine-invoice' }" is-link />
            <Cell title="收货地址" :to="{ name: 'mine-address' }" is-link />
            <Cell title="微信" :to="{ name: 'mine-wechat' }" :value="decryptAES(userStore.userInfo.wechat ?? '')" is-link />
            <Cell title="邮箱" :to="{ name: 'mine-email' }" :value="decryptAES(userStore.userInfo.email ?? '')" is-link />
        </CellGroup>
    </app-view>
</template>

<script lang="ts" setup>
import { Cell, CellGroup } from 'vant'
import { useUserStore } from '@/stores'
import { decryptAES } from '@/services/websocket/package/crypto'
import { onActivated } from 'vue';

// userStore
const userStore = useUserStore()

onActivated(() => {
    userStore.getUserData()
})
</script>