<script setup lang="ts">
import { useUserStore, useConfigStore } from "@/store";
const userStore = useUserStore();
const configStore = useConfigStore()
const { t } = useI18n();

const allowLocationAccess = () => {
  // 设置标记为已经加载过引导页
  configStore.isShowedGuidePage = true
  // uni.switchTab({
  //   url: '/pages/home/index'
  // })
  uni.navigateTo({
    url: '/pages-user/pages/member-center/index'
  })
};
</script>

<template>
  <view class="bg-white flex flex-col">
    <!-- 主要内容区域 -->
    <view
      class="flex-1 flex flex-col items-center justify-center px-40rpx pt-216rpx pb-120rpx"
    >
      <!-- 位置图标 -->
      <image
        src="@img-login/100220.png"
        class="w-256rpx h-256rpx rounded-full"
      />

      <!-- 标题 -->
      <view class="text-center  text-50-bold mt-84rpx">
        <text class="mr-4rpx">{{ t('pages-login.guide-page.welcome.title') }},</text>
        <text class="">{{ userStore.userInfo.firstName }} {{ userStore.userInfo.surname }}</text>
      </view>

      <!-- 描述文本 -->
      <view class="text-center mt-36rpx mb-113rpx">
        <text class="text-30rpx lh-30rpx text-#999 leading-30rpx">
            {{ t('pages-login.guide-page.welcome.description') }}
        </text>
      </view>

      <!-- 主要按钮 -->
      <view class="w-full">
        <button
          class="w-full h-108rpx bg-#14181B rounded-16rpx border-none"
          @click="allowLocationAccess"
        >
          <text class="text-white text-36rpx lh-108rpx"
            >{{ t('pages-login.guide-page.welcome.next') }}</text
          >
        </button>
      </view>
    </view>
  </view>
</template>

<style lang="scss">
page {
  background-color: #ffffff;
}
</style>
