<template>
  <div class="app-container">
    <div class="card-panel surplus-currency" :class="flag ? 'vip-box' : ''">
      <div class="_tit">
        <span style="visibility: hidden"> 会员banner图 </span>
        <div class="fr">
          <!-- <div class="text-right">
            {{ vipData.vipType == 1 ? "VIP" : "SVIP" }}
          </div> -->
          <!-- <div class="text-right">续期</div> -->
          <div v-if="vipData.vipType == 1">
            <div>VIP</div>
            <div>升级SVIP</div>
          </div>
          <div v-else-if="!vipData.vipType">普通会员</div>
        </div>
        <div
          class="text-right"
          style="margin-top: 50px"
          v-if="vipData.vipType == 1 || vipData.vipType == 2"
        >
          {{ vipData.vipType == 1 ? "VIP" : "SVIP" }}到期时间：{{
            vipData.expireTime
          }}
        </div>
      </div>
      <span class="pointer" style="font-size: 14px" @click="vipBenefits">
        查看会员权益
      </span>
      <p class="text-center pointer" v-if="!vipData.vipType">开通VIP</p>
    </div>
    <!-- 
    <div class="card-panel surplus-currency">
      <span style="margin-right: 50px; font-size: 16px; font-weight: 700"
        >剩余创新币：98</span
      >
      <el-button class="x_btns">创新币充值</el-button>
    </div> -->
    <!--    <statistics-panel :list="statisticsList"/>-->

    <el-card style="margin-top: 20px">
      <template #header>
        <div>快捷功能</div>
      </template>
      <el-row :gutter="20">
        <el-col :span="4">
          <router-link to="/extension/release">
            <div class="menu-item">
              <el-avatar :icon="Box" />
              <div class="title">发布产品</div>
            </div>
          </router-link>
        </el-col>
        <el-col :span="4">
          <router-link to="/demand/releaseService">
            <div class="menu-item">
              <el-avatar :icon="Help" />
              <div class="title">发布服务需求</div>
            </div>
          </router-link>
        </el-col>
        <el-col :span="4">
          <router-link to="/demand/releaseTechnology">
            <div class="menu-item">
              <el-avatar :icon="Goods" />
              <div class="title">发布技术需求</div>
            </div>
          </router-link>
        </el-col>
      </el-row>
    </el-card>
    <!-- <el-card style="margin-top: 20px">
      <template #header>
        <div>快捷功能</div>
      </template>
      <el-row :gutter="20">
        <el-col :span="3">
          <router-link to="/extension/release">
            <el-card shadow="never" class="text-center pointer">
              发布产品
            </el-card>
          </router-link>
        </el-col>
        <el-col :span="21">
          <el-card shadow="never" class="text-center">文字简介</el-card>
        </el-col>
      </el-row>
      <el-row :gutter="20" class="mt20">
        <el-col :span="3">
          <router-link to="/demand/released">
            <el-card shadow="never" class="text-center pointer">
              发布需求
            </el-card>
          </router-link>
        </el-col>
        <el-col :span="21">
          <el-card shadow="never" class="text-center">（技术需求）</el-card>
        </el-col>
      </el-row>
    </el-card> -->
  </div>
</template>

<script setup>
import { reactive, ref, toRefs } from "vue";
import { getInfo } from "@/api/login";
import { useRouter } from "vue-router";
import { Box, Help, Goods } from "@element-plus/icons-vue";
import StatisticsPanel from "@/views/components/StatisticsPanel.vue";
const router = useRouter();
const flag = ref(false);
// const vip
let data = reactive({
  vipData: {},
});
const { vipData } = toRefs(data);
const getVipData = async () => {
  const { data } = await getInfo();
  if (data.vip) {
    flag.value = true;
    vipData.value = data.vip;
  } else {
    flag.value = false;
  }
};

getVipData();
const vipBenefits = () => {
  router.push({
    path: "/account/joinMembership",
  });
};
</script>

<style lang="scss" scoped>
:deep(el-card__header) {
  padding-top: 0;
  padding-bottom: 0;
  div {
    height: 40px;
    line-height: 40px;
  }
}
.surplus-currency {
  background-image: url("@/assets/index_banner.png");
  margin-bottom: 20px;
  height: 150px;
  color: white;
  background-color: #f2f2f2;
  padding: 20px 50px;
  ._tit {
    font-size: 24px;
    font-weight: 700;
    color: #bebebe;
    div {
      font-size: 18px;
      // color: #000;
    }
  }
}
.vip-box {
  height: auto;
  // background-color: yellow;
}
.menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  :deep(.el-avatar--icon) {
    background-color: #409eff;
  }
  .title {
    margin-top: 20px;
  }
}
</style>
