<template>
  <div>
    <van-nav-bar
      :title="title"
      right-text="名额变动"
      @click-left="onClickLeft"
      @click-right="onClickRight"
    >
      <template #left>
        <van-icon name="wap-home-o" size="22" />
      </template>
    </van-nav-bar>
    <div class="listContent">
      <scroller ref="scroller" :on-infinite="onscrollB" :isInitRefresh="false">
        <courseList
          :dataList="courseMap"
          :showNum="1"
        ></courseList>
      </scroller>
    </div>
  </div>
</template>

<script>
import courseList from "../components/courseList.vue";
export default {
  name: "",
  components: { courseList },
  props: [],
  data() {
    return {
      title: "我的推广",
      courseMap: [
        {
          id: 123,
          surplus: 120,
          sale: 341,
          title:
            "大撒大声地大萨达大萨达撒大声地的撒旦撒旦撒打算打算大萨达萨达大萨达",
          price: 598,
          courseNum: 14,
          url: "/static/img/course.f1777cf.jpg"
        },
        {
          id: 124,
          surplus: 120,
          sale: 341,
          title:
            "大撒大声地大萨达大萨达撒大声地的撒旦撒旦撒打算打算大萨达萨达大萨达",
          price: 598,
          courseNum: 14,
          url: "/static/img/course.f1777cf.jpg"
        },
        {
          id: 125,
          surplus: 120,
          sale: 341,
          title:
            "大撒大声地大萨达大萨达撒大声地的撒旦撒旦撒打算打算大萨达萨达大萨达",
          price: 598,
          courseNum: 14,
          url: "/static/img/course.f1777cf.jpg"
        }
      ]
    };
  },
  created() {},
  methods: {
    onscrollB() {
      console.log("触底了");
    },
    onClickLeft() {
      this.$router.push("/courseHome");
    },
    onClickRight() {
      this.$router.push(`/course/limitChange`);
    }
  },
  computed: {}
};
</script>
<style scoped lang="scss">
*{
    margin: 0;
    padding: 0;
}
img{
    display: block;
}
.listContent{
    height: calc(100vh - .9rem);
    position: relative;
}
</style>
