<template>
  <view>
    <view
      class="head-wrapper"
      :style="{
        top: statusHeight + 'px',
      }"
    >
      <view class="head-menu">
        <Left class="iconfont" @click="returns" />
        <Home class="iconfont" @click="goHome" />
      </view>
    </view>
    <nut-swiper
      class="swiper"
      :pagination-visible="true"
      pagination-color="#426543"
      auto-play="3000"
    >
      <nut-swiper-item>
        <image
          src="https://storage.360buyimg.com/jdc-article/NutUItaro34.jpg"
          alt=""
        />
      </nut-swiper-item>
      <nut-swiper-item>
        <image
          src="https://storage.360buyimg.com/jdc-article/NutUItaro2.jpg"
          alt=""
        />
      </nut-swiper-item>
      <nut-swiper-item>
        <image
          src="https://storage.360buyimg.com/jdc-article/welcomenutui.jpg"
          alt=""
        />
      </nut-swiper-item>
      <nut-swiper-item>
        <image
          src="https://storage.360buyimg.com/jdc-article/fristfabu.jpg"
          alt=""
        />
      </nut-swiper-item>
    </nut-swiper>
    <view class="box">
      <view class="line"></view>
      <view class="game-title"></view>
      <view class="game-title"></view>
      <view class="game-title"></view>
      <view class="game-btn" @click="toGame()">开始游戏</view>
    </view>
  </view>
</template>

<script setup lang="ts">
import { ref } from "vue";
import {
  useLoad,
  getSystemInfoSync,
  navigateBack,
  switchTab,
  navigateTo,
} from "@tarojs/taro";
import { Left, Home } from "@nutui/icons-vue-taro";
var statusBarHeight = getSystemInfoSync().statusBarHeight as number;

console.log(statusBarHeight);

const statusHeight = ref<number>(statusBarHeight);

// const swiperList = ref([]);

useLoad((options) => {
  console.log(options);
});

const returns = () => {
  navigateBack();
};

const goHome = () => {
  switchTab({
    url: "/pages/index/index",
  });
};

const toGame = () => {
  navigateTo({
    url: "/pages/game/gameview/index",
  });
};
</script>

<style lang="scss">
.head-wrapper {
  z-index: 999;
  display: flex;
  align-items: center;
  position: fixed;
  left: 30px;
  top: 0;
  height: 100px;
}
.head-menu {
  display: flex;
  align-items: center;
  height: 54px;
  width: 140px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 27px;
  .iconfont {
    flex: 1;
    text-align: center;
    color: #fff;
    box-sizing: border-box;
    &.icon-xiangzuo {
      border-right: 1px solid #fff;
    }
  }
}
.swiper {
  height: 450rpx;
  width: 100vw;
  image {
    width: 100%;
  }
}

.box {
  width: 100%;
  height: 90vh;
  background-color: #fff;
  z-index: 1;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-sizing: border-box;
  position: absolute;
  padding: 20px;
  top: 400px;

  .line {
    width: 90px;
    height: 10px;
    border-radius: 4px;
    background-color: rgba(202, 202, 202, 1);
    margin: auto;
  }
  .game-btn {
    width: 300px;
    height: 75px;
    margin: 50px auto;
    color: #fff;
    background-color: rgba(85, 77, 132, 1);
    border-radius: 50px;
    text-align: center;
    line-height: 75px;
  }
}
</style>
