
<template>
  <div class="timeline-container">
    <div class="timeline-content">
      <div class="timeline-entry-list">
        <div class="entry-list-container">
          <div class="tab-title">
            <div class="title-box">
              <span class="box-text">积分排行榜</span>
            </div>
          </div>
          <div class="tab-list">
              <div class="list-title">
                <div class="title-left">
                  <div class="left-rank title-text">排名</div>
                  <div class="left-avatar title-text">头像</div>
                  <div class="left-userName title-text">用户名</div>
                </div>
                <div class="title-right">
                  <div class="right-Integral title-text">积分</div>
                </div>
              </div>
              <div v-for="(item,index) in dataList" :key="index" class="list-title list-item">
                <div class="title-left">
                  <div class="left-rank">
                    <img v-if="index==0" style="width: 35px;" :src="firstIcon"/>
                    <img v-else-if="index==1" style="width: 35px;" :src="secondIcon"/>
                    <img v-else-if="index==2" style="width: 35px;" :src="thirdIcon"/>
                    <div v-else>{{ index+1 }}</div>
                  </div>
                  <div class="left-avatar">
                    <img width="35" height="35" style="border-radius: 50%;" :src="httpFile + item.headImage"/>
                  </div>
                  <div class="left-userName item-text">{{ item.userName }}</div>
                </div>
                <div class="title-right">
                  <div class="right-Integral item-text">{{ item.surplusIntegral }}</div>
                </div>
              </div>
            </div>
        </div>
      </div>
      <SiderInfo></SiderInfo>
    </div>
  </div>
</template>
    
  
  <script>
import { integralTop } from "@/api/allApi";
import SiderInfo from "@/components/SiderInfo.vue";
export default {
  components: {
    SiderInfo,
  },
  data() {
    return {
      httpFile:'',
      firstIcon: require('@/assets/image/first.png'),
      secondIcon: require('@/assets/image/second.png'),
      thirdIcon: require('@/assets/image/third.png'),
      dataList: [],
    };
  },
  created() {
    this.getDataList();
  },
  methods: {
    getDataList() {
      let data = {
        type: 1,
      };
      integralTop(data).then((response) => {
        this.httpFile = response.data.data.httpFile;
        this.dataList = response.data.data.items;
      });
    },
  },
};
</script>
  <style scoped>
.timeline-container {
  margin: 0 auto;
}
.timeline-entry-list {
  margin-right: 17.5rem;
  border-radius: 2px;
  width: 720px;
  position: relative;
}
.entry-list-container {
  background-color: #fff;
  border-radius: 4px;
  padding: 20px 20px 16px;
  min-height: 500px;
}
.entry-list-container .tab-title {
  /* margin-bottom: -25px; */
  display: flex;
  justify-content: center;
  align-items: center;
}
.tab-title .title-box {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #1e80ff;
  border-radius: 25px;
}
.title-box .box-text {
  color: #fff;
  padding: 10px 40px;
  font-size: 20px;
}
.entry-list-container .tab-list {
  margin: 0 auto;
  width: 450px;
}
.tab-list .list-title {
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tab-list .list-item{
  border-bottom: 1px solid #e5e6eb;
  padding-bottom: 10px;
}
.list-title .title-left {
  width: 70%;
  display: flex;
  align-items: center;
}
.title-left .left-rank,
.title-left .left-avatar,
.title-left .left-userName,
.title-right .right-Integral {
  display: flex;
  justify-content: center;
  align-items: center;
}
.title-left .left-rank {
  width: 60px;
}
.title-left .left-avatar {
  width: 60px;
}
.title-left .left-userName {
  width: 150px;
}
.title-right .right-Integral {
  width: 60px;
}
.title-text {
  color: #8a919f;
}
.item-text {
  color: #1d2129;
  font-weight: 600;
}
.box-card {
  margin: 0 auto;
  width: 500px;
  border-radius: 10px;
}
</style>