<template>
  <div class="point-index">
    <div class="bg">
      <div class="top">
        <nuxt-link class="text" to="/point/list" tag="h4">我的积分</nuxt-link>
        <h2 class="point">{{this.pointInfo.points}}</h2>
        <div class="earn">
          <div>赚积分</div>
        </div>
      </div>
    </div>
    <div class="container">
      <div class="menu">
        <nuxt-link class="item item1" to="/point/shop" tag="div">
          <img src="../../static/point/shangcheng.png" alt="" />
          <span>积分商城</span>
        </nuxt-link>
        <nuxt-link class="item item2" to="/point/bill" tag="div">
          <img src="../../static/point/mingxi.png" alt="" />
          <span>积分明细</span>
        </nuxt-link>
        <nuxt-link class="item item3" to="/point/list" tag="div">
          <img src="../../static/point/dingdan.png" alt="" />
          <span>积分订单</span>
        </nuxt-link>
      </div>
      <nuxt-link class="news" to="/point/shop" tag="div">
        <span class="title">积分商城上线啦！</span>
        <span class="des">多重好礼等着你</span>
      </nuxt-link>
      <div class="show">
        <product-list />
      </div>
    </div>
  </div>
</template>

<script>
import ProductList from "../../components/ProductList";
import { mapState, mapActions } from "vuex"
export default {
  head() {
    return {
      title: "积分主页",
    };
  },
  data() {
    return {
      images: [],
      list: [],
      loading: false, //加载状态
      finished: false, //是否完成加载
      refreshing: false, //是否正在上拉刷新
    };
  },
  components: {
    ProductList,
  },
  computed:{
    ...mapState({
      pointInfo:state=>state.point.pointInfo
    })
  },
  mounted() {
    this.getPointInfo();
  },
  methods: {
    ...mapActions({
      getPointInfo:"point/getPointInfo"
    })
  },
};
</script>

<style>
.point-index {
  position: relative;
}
.point-index .bg {
  background-color: #f3b335;
  width: 7.5rem;
  height: 3.72rem;
  position: relative;
  background: url("../../static/point/bj.png") no-repeat 0px 0px;
  background-size: 100% 100%;
  z-index: -1;
}
.point-index .bg .top .text {
  position: absolute;
  left: 4vw;
  top: 8vw;
  margin: 0;
  padding: 0;
  height: 0.4rem;
  font-size: 0.28rem;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #ffffff;

  line-height: 0.4rem;
}
.point-index .bg .top .point {
  position: absolute;
  margin: 0;
  padding: 0;
  left: 4vw;
  top: 15.33vw;
  width: 36vw;
  height: 16.8vw;
  font-size: 12vw;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #ffffff;
  line-height: 14vw;
}
.point-index .bg .earn {
  position: absolute;
  right: 0;
  top: 20.66vw;
  width: 1.6rem;
  height: 0.55rem;
  font-size: 3.46vw;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  background: url("../../static/point/jifen.png") no-repeat;
  background-size: cover;
  box-sizing: border-box;
}
.point-index .bg .earn div {
  position: absolute;
  top: 1.5vw;
  right: 2vw;
  height: 4.93vw;
  font-size: 3.46vw;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #f3b235;
  line-height: 4.93vw;
}
.point-index .container {
  margin-top: -13.33vw;
  width: 100%;
  padding: 0 4vw;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  z-index: 99;
}
.point-index .container .menu {
  width: 100%;
  height: 26.66vw;
  background: #ffffff;
  box-shadow: 0px 2px 10px 5px rgba(227, 227, 227, 0.5);
  border-radius: 20px;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
}
.point-index .container .menu .item {
  width: 14.93vw;
  height: 14.93vw;
}
.point-index .container .menu .item img {
  display: block;
  width: 12vw;
  height: 12vw;
  margin: 0 auto;
}
.point-index .container .menu .item span {
  display: inline-block;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #666666;
  text-align: center;
  margin-top: 3vw;
  width: 1.3rem;
  height: 0.4rem;
  font-size: 0.28rem;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #666666;
  line-height: 0.4rem;
}

.point-index .container .news {
  margin-top: 4vw;
  width: 100%;
  height: 21.33vw;
  background: url("../../static/point/banner.png") no-repeat;
  background-size: 100% 100%;
  position: relative;
}
.point-index .container .news img {
  width: 100%;
  height: 100%;
}
.point-index .container .news .title{
  font-size:.4rem;
  color:#f9f9e5;
  font-weight:700;
  position: absolute;
  left:.75rem;
  top:.38rem;
}
.point-index .container .news .des{
  font-size:.24rem;
  color:#f9d996;
  font-weight:600;
  position: absolute;
  left:2.2rem;
  top:.9rem;
}
</style>
