<!--
 * @Author: PoJun
 * @Date: 2023-09-14 13:43:13
 * @LastEditors: PoJun
 * @LastEditTime: 2023-09-14 15:47:28
 * @Message: 登录
-->
<template>
    <view class="page">
        <view class="title uv-p-60">
            <text>欢迎使用</text>
            <text class="title-main">乌龟艾泽拉斯之谜资料站</text>
        </view>

        <view class="uv-p-60">
            <uv-button
                type="primary"
                shape="circle"
                icon="weixin-fill"
                text="授权微信一键登录"
                open-type="getPhoneNumber"
                iconColor="#fff"
                @getphonenumber="decryptPhoneNumber"
            ></uv-button>
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {};
    },
    methods: {
        async decryptPhoneNumber(e) {
            await uni.$uv.sleep(30);
            console.log(e);

            // if (e.detail.code) {
            //     const data = await loginByCode({
            //         code: e.detail.code,
            //         id: this.openId,
            //     });

            //     this.$uv.vuex("vJWT", data);

            //     this.setUserInfo();
            // } else {
            //     uni.$uv.toast("授权手机号失败，请重试");
            // }
        },
    },
    onLoad() {},
    onReady() {},
    onUnload() {},
    watch: {},
};
</script>

<style lang="scss">
.page {
    .title {
        font-size: 48rpx;
        &-main {
            font-weight: bold;
            margin-top: 14rpx;
        }
    }
}
</style>
