<template>
  <view>
    <!--    <app-loading v-if="loading" />-->
    <unitv-zone
      id="mine_curriculum_all_first_zone"
      class="mine_curriculum_all_first_zone"
      left="tabs_zone"
      :values="list"
      :column="4"
      @scrolltolower="fnScrollToLower"
    >
      <unitv-item
        v-for="(item, index) in list"
        :key="index"
        :item="index"
        class="item"
        @click="fnCurriculumDetails"
      >
        <image :src="item.img" mode="widthFix" />
        <view class="title line-1">{{ item.title }}</view>
      </unitv-item>
    </unitv-zone>
  </view>
</template>

<script>
export default {
  data() {
    return {
      list: [],
      pagination: {
        currentPage: 1,
        pageSize: 10,
        total: 10,
      },
    };
  },
  created() {
    this.fnGetData();
  },
  methods: {
    async fnGetData() {
      // setTimeout(() => {
      this.list.push({
        img: require(`../../../static/public_images/video_bg1.jpg`),
        title: "气体基础知识",
      });
      this.list.push({
        img: require(`../../../static/public_images/video_bg2.jpg`),
        title: "现场一线员工全面安全培训",
      });
      this.list.push({
        img: require(`../../../static/public_images/video_bg3.jpg`),
        title: "出差人员基础安全知识与应急处置",
      });
      this.list.push({
        img: require(`../../../static/public_images/video_bg4.jpg`),
        title: "现场安全负责人全面安全培训",
      });
      this.list.push({
        img: require(`../../../static/public_images/video_bg5.jpg`),
        title: "《四川省安全生产条例》特色解读",
      });
      this.list.push({
        img: require(`../../../static/public_images/video_bg6.jpg`),
        title: "企业贯彻落实《四川省安全生产条例》精要",
      });
      this.list.push({
        img: require(`../../../static/public_images/video_bg7.jpg`),
        title: "《四川省安全生产举报奖励办法》解读",
      });
      this.list.push({
        img: require(`../../../static/public_images/video_bg8.jpg`),
        title: "应急管理部关于进一步加强安全生产举报工作的指导意见",
      });
      this.list.push({
        img: require(`../../../static/public_images/video_bg9.jpg`),
        title: "危险货物运输包装-气瓶",
      });
      this.list.push({
        img: require(`../../../static/public_images/video_bg10.jpg`),
        title: "职业病危害专项治理",
      });
      //   this.loading = false;
      // }, 5000);
    },
    fnScrollToLower() {
      this.pagination.currentPage++;
      if (this.pagination.currentPage <= this.pagination.total)
        this.fnGetData();
    },
    fnCurriculumDetails() {
      uni.navigateTo({
        url: "/pages/curriculum/details",
      });
    },
  },
};
</script>

<style scoped lang="scss">
.mine_curriculum_all_first_zone {
  display: flex;
  flex-wrap: wrap;

  .item {
    width: 130rpx;
    position: relative;
    border: 2px solid transparent;
    border-radius: 4rpx;
    font-size: 0;
    height: 117rpx;
    margin-top: 14rpx;
    margin-left: 10rpx;

    &:not(:nth-child(n + 5)) {
      margin-top: 0;
    }

    &:nth-child(4n + 1) {
      margin-left: 0;
    }

    image {
      width: 100%;
      height: 100% !important;
      border-radius: 4rpx;
    }

    .title {
      width: 80%;
      font-size: 12rpx;
      color: #fff;
      position: absolute;
      bottom: 9rpx;
      left: 7rpx;
    }

    &.hover {
      border: 2rpx solid rgba(0, 180, 255, 0.79);
    }
  }
}
</style>
