<template>
  <div class="contentBody">
    <div class="left">
      <img
        @click="previousPage"
        :src="getAssets('base/doubleleft.png')"
      />
    </div>
    <h-game-provedor ref="provedor" :providerList="providerList">
    </h-game-provedor>
    <div class="right">
      <img
        @click="nextPage"
        :src="getAssets('base/doubleright.png')"
      />
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { getAssets } from "@/utils";
const provedor = ref();
onMounted(async () => {});
const props = defineProps({
  providerList: {
    type: Array<any>,
    default: "",
    required: true,
  },
});
const emit = defineEmits(["on-previous", "on-nextPage"]);

function previousPage() {
  // 上一页
  provedor.value.prevSwiper();
}
function nextPage() {
  // 下一页
  provedor.value.nextSwiper();
}
</script>
<style lang="scss" scoped>
.contentBody {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin: 0 auto;
  width: 100%;
  .left {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    z-index: 10;
    display: flex;
    align-items: center;
    cursor: pointer;
  }
  .right {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    z-index: 10;
    cursor: pointer;
  }
  .top {
    width: 100%;
    background-image: url("https://cdn.18n.com/home/bj_yixing.png");
    background-size: 100% 190%;
    background-repeat: no-repeat;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .left {
      font-size: 0.4rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      justify-content: left;
    }
    .right {
      display: flex;
      padding: 0.2rem 0 0.2rem 20px !important;
      .page {
        background-color: #21212a;
        padding: 0.2rem;
        font-size: 0.3rem;
        border-radius: $border-radius;
        cursor: pointer;
        margin: 0 2px;
      }
    }
  }
}
</style>
