<script setup lang="ts">
import { onMounted, ref } from 'vue';
import { GET_TOKEN } from '@/utils/token';
import { useRouter } from 'vue-router';
import { accountImages } from '@/api/group';
import emitter from '@/eventBus'
import Header from '@/layout/header/index.vue'
const router = useRouter()
const imageList = ref([])

const toDash = () => {
  if (GET_TOKEN()) {
    router.push('/dash')
  } else {
    emitter.emit('userLogin', 1)
  }
}
const getAccoutImages = async () => {
  const res = await accountImages()
  imageList.value = res.list
}
onMounted(() => {
  getAccoutImages()
})

</script>

<template>
    <Header />

  <div class="container">
    <p>一站式公众号订阅</p>

    <div class="start-use">
      <button @click="toDash">开始使用</button>
    </div>
    <div class="account-image">
      <el-row>
        <el-col :span="4" v-for="item in imageList"><img :src="item.hd_head_img" /></el-col>
      </el-row>
      
    </div>
  </div>
</template>

<style scoped lang="scss">
.container {
  height: 100%;
  padding-top: 200px;

  background-color: #fff;
  border-radius: 18px;
  overflow: auto;
  text-align: center;
  font-size: 60px;
  font-weight: bold;

  .start-use {
    text-align: center;
    margin-top: 50px;
    button{
      width: 220px;
      height: 60px;
      color: #fff;
      font-size: 22px;
      background-color: var(--el-color-primary);
      border: 0;
      cursor: pointer;
      border-radius: var(--el-border-radius-base);
      &:hover{
        background-color: var(--el-color-primary-light-3);
      }
    }
  }
  .account-image{
    width: 75%;
    margin: 100px auto;
      img{
        display: block;
        width: 110px;
        margin: auto;
        margin-top: 50px;
        border-radius: 100px;
        box-shadow: var(--el-box-shadow);
      }
  }
}
</style>