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

const allowLocationAccess = () => {
  // 开启通知--获取通知权限
  // #ifdef APP-PLUS
  plus.push.getClientInfoAsync(
      (info) => {
        console.log('当前的推送信息', info)
      },
      (err) => {
        console.log('err', err)
      },
  )
  // #endif
  uni.navigateTo({
    url: '/pages-login/pages/guide-page/welcome'
  })
};

// 手动选择位置
const selectLocation = () => {
  uni.navigateTo({
    url: '/pages-login/pages/guide-page/welcome'
  })
};
</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/100219.png"
        class="w-256rpx h-256rpx rounded-full"
      />

      <!-- 标题 -->
      <view class="text-center mt-84rpx">
        <text class="text-50-bold">{{ t('pages-login.guide-page.notice.title') }}</text>
      </view>

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

      <!-- 主要按钮 -->
      <view class="mb-46rpx 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.notice.activateNotification') }}</text
          >
        </button>
      </view>

      <!-- 次要链接 -->
      <view class="text-center">
        <text class="text-36rpx text-#333" @click="selectLocation">
            {{ t('pages-login.guide-page.notice.continueLater') }}
        </text>
      </view>
    </view>
  </view>
</template>

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