<template>
  <view class="loginContainer">
    <!-- prompt -->
    <view class="prompt"></view>
    <!-- logo -->
    <view class="logo"></view>

    <view class="bottom_btn" @click="goIndex"> 立即进入 </view>
    <!-- 登录表单 -->
    <!-- <view class="loginForm">
      <u--form :model="state.model1" ref="uForm">
        <u-form-item style="padding: 0" class="loginFormItem" prop="userInfo.name" borderBottom ref="item1">
          <u--input class="loginFormInput" placeholder="请输入您的手机号" v-model="state.model1.phone" border="none"></u--input>
        </u-form-item>
        <u-form-item class="loginFormItem" prop="userInfo.name" borderBottom ref="item1">
          <u--input class="loginFormInput" placeholder="请输入短信验证码" v-model="state.model1.code" border="none"></u--input>
          <view class="getCode">获取验证码</view>
        </u-form-item>
      </u--form>
      <u-button class="loginFormBtn" text="登录" @click="goIndex"></u-button>
      <u--text class="loginFormTips" align="center" margin="[6,0,0,0]" text="初次登录手机号将默认创建新账号" size="12" color="#717171"></u--text>
    </view> -->
    <!-- 用户协议 -->
    <!-- <view class="tips">登录即代表已经阅读并同意 <view class="userAgreement">《用户协议》</view></view> -->
  </view>
</template>

<script setup lang="ts">
import { onMounted, ref, reactive, watch, nextTick, onActivated } from "vue";
import {
  onLaunch,
  onShow,
  onLoad,
  onShareAppMessage,
  onShareTimeline,
  onUnload,
} from "@dcloudio/uni-app";

import { onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app";
import { useShareStore } from "@/stores/shareStore";
const stores = useShareStore();

let timer = ref();

function goIndex() {
  const subStatus = {
    overseas: false, // 海外
    domestic: false, // 国内
    chinaSecurities: false, // 中证
  };
  uni.setStorageSync("subStatus", subStatus);

  // 清空缓存数据
  uni.removeStorageSync("tabValue");
  uni.removeStorageSync("colTypeValue");

  uni.navigateTo({
    url: "/pages/home/index",
  });
}

onShareAppMessage((res) => {
  return {};
});
// onReachBottom(() => {
//   console.log("🚀 ~ onReachBottom ~ onReachBottom:");
// });

// 当进入页面时
onLoad((option) => {
  // timer.value = setTimeout(() => {
  //   uni.navigateTo({
  //     url: "/pages/home/index",
  //   });
  // }, 2000)
});

// 当离开页面时
onUnload(() => {
  clearTimeout(timer.value);
});

onShow(() => {
  stores.initWxConfig();
});
</script>

<style lang="scss" scoped>
.loginContainer {
  height: 100vh;
  overflow-y: auto;
  background-image: url(@/assets/images/loginBg.png);
  background-size: cover;
  position: relative;
  box-sizing: border-box;
  padding:176rpx 0;
  .prompt {
    width: 80rpx;
    height: 596rpx;
    position: absolute;
    left: 50%;
    top: 0;
    margin-top: 176rpx;
    transform: translateX(-50%);
    background-image: url(@/assets/images/new_logo.png);
    background-size: contain;
  }
  .logo {
    width: 292rpx;
    height: 68rpx;
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    margin-bottom: 176rpx;
    background-image: url(@/assets/images/logo.png);
    background-size: cover;
  }
}

.bottom_btn {
  width: 360rpx;
  height: 80rpx;
  background: linear-gradient(to right, #fc5c69, #e7303f);
  border-radius: 100rpx;
  position: fixed;
  bottom: 270rpx;
  left: 50%;
  transform: translate(-50%, 0);
  box-shadow: 0 0 10rpx rgba($color: #000000, $alpha: 0.1);

  display: flex;
  color: white;
  font-size: 32rpx;
  text-align: center;
  justify-content: center;
  align-items: center;
}
</style>
