<template>
    <hc-sys class="hc-config-page" :isNavBar="false">
        <view class="cu-list menu sm-border mt-1">
            <view class="cu-item arrow" @click="toPageClick('/pages/my/info')">
                <view class="content hc-flex">
                    <text class="i-ri-user-3-fill text-blue text-32 mr-1"/>
                    <text class="text-gray-4">个人资料</text>
                </view>
                <view class="action">{{userInfo.real_name}}</view>
            </view>
        </view>
        <view class="cu-list menu sm-border">
            <view class="cu-item">
                <view class="content hc-flex">
                    <text class="i-ri-pantone-fill text-purple text-32 mr-1"/>
                    <text class="text-gray-4">当前版本</text>
                </view>
                <view class="action text-gray-5">v{{appInfo.version}}</view>
            </view>
            <view class="cu-item">
                <view class="content hc-flex">
                    <text class="i-ri-rocket-fill text-cyan text-32 mr-1"/>
                    <text class="text-gray-4">检测升级</text>
                </view>
                <view class="action">
                    <!--view class="cu-tag round bg-blue light">有新版本</view-->
                    <text class="text-26 text-gray-5">暂无新版本</text>
                </view>
            </view>
        </view>
    </hc-sys>
</template>

<script setup>
import {ref} from "vue";
import {onLoad} from '@dcloudio/uni-app'
import {useAppStore} from "@/store";

//初始变量
const store = useAppStore()
const userInfo = ref(store.userInfo);
const appInfo = ref({version: '-', wgt: '-'});

//渲染完成
onLoad(() => {
    const {appVersion, appWgtVersion} = uni.getSystemInfoSync();
    appInfo.value = {version: appVersion, wgt: appWgtVersion}
})

const toPageClick = (url) => {
    uni.navigateTo({url: url});
}
</script>
