<template>
  <div class="client-platform-page client-exam-page">
    <!--  广告  -->
    <div class="client-banner-box">
      <div
        :style="{backgroundImage: `url(${bannerList[0].pic || require(`~/static/images/client/train/train-banner-background.png`)})`}"
        class="client-platform-banner"></div>
    </div>

    <!--  岗位职责  -->
    <gangweiList label="岗位职责" :list="gangwei" :pc-num="4" :h5-num="2"></gangweiList>

    <!--  部分课程列表  -->
    <div class="platform-course-list client-container">
      <h4>部分课程列表</h4>
      <mtaTable :data="tableData" :config="tableConfig" @shi-kan="shiKan"></mtaTable>
      <div class="btn-groups center">
        <applyBtn class="btn-item" @active-pc="onApplyBtnActive" @active-h5="onApplyBtnActiveH5"/>
        <onlineInformationBtn/>
      </div>
    </div>

    <videoDialog :source="curVideo" :visible.sync="visible"></videoDialog>
    <!--  申请方案  -->
    <applicationDialog :visible.sync="telDl"></applicationDialog>
  </div>
</template>

<script>
import mtaTable from "~/components/common/mtaTable";
import videoDialog from "~/components/common/videoDialog";
import freeTrialBtn from "~/components/common/freeTrialBtn";
import onlineInformationBtn from "~/components/common/onlineInformationBtn";
import gangweiList from "@/components/common/layout/desComp/gangweiList";
import {BannerImgs, shengchancaigou} from "~/defaultConfig";
import applicationDialog from "~/components/common/applicationDialog";
import applyBtn from "~/components/common/applyBtn";

/**
 * @ 产品与服务 -> 课程资源 -> 生产采购
 */
export default {
  name: "professionalQuality",
  layout: 'templateB',
  async asyncData({$axios}) {
    const arr = [
      $axios.$post(`/home/banner/list`, {'code': BannerImgs.shengcancaigou}),
    ]
    const [res1] = await Promise.all(arr);
    return {
      bannerList: res1.data.data || [],
    }
  },
  components: {
    mtaTable, videoDialog, applicationDialog, applyBtn,
    freeTrialBtn, onlineInformationBtn, gangweiList
  },
  head() {
    return {
      title: '在线考试平台_在线考试软件_试卷软件系统',
      meta: [
        {
          name: 'keywords',
          content: '考试平台,试卷系统,试卷软件'
        },
        {
          name: 'description',
          content: '麦塔考试系统具有良好高并发性和访问安全部署、严格的考试监控防作弊功能、PC移动支持多终端，随时随地考试、丰富的考试管理功能。'
        }
      ],
    }
  },
  data() {
    return {
      tableConfig: [
        {
          label: '课程名称',
          key: 'name'
        },
        {
          label: '使用行业',
          key: 'hangye'
        },
        {
          label: '使用人群',
          key: 'renqun'
        }
      ],
      tableData: [
        {
          name: '企业中常见的质量管理问题',
          shikanUrl: 'https://spdb.mtavip.com/b5881822ee4644cb842dccd9993f8c8b/6c0cffcc55e348e48e56b3b75f10fa9f-d8b032061a1306cf1c52a43031edb9cd-fd.mp4',
          hangye: '全行业',
          renqun: '质量主管'
        },
        {
          name: '安全生产职业适应性管理',
          shikanUrl: '',
          hangye: '全行业',
          renqun: '安全生产主管'
        },
        {
          name: '安全生产中的过程管理',
          shikanUrl: '',
          hangye: '全行业',
          renqun: '安全生产主管'
        },
        {
          name: '7S管理',
          shikanUrl: '',
          hangye: '全行业',
          renqun: '生产主管'
        },
        {
          name: '生产现场实战管理',
          shikanUrl: '',
          hangye: '全行业',
          renqun: '生产主管'
        },
        {
          name: '供应商管理实战技能',
          shikanUrl: '',
          hangye: '全行业',
          renqun: '采购经理'
        },
        {
          name: '企业采购招标管理',
          shikanUrl: '',
          hangye: '全行业',
          renqun: '采购经理'
        },
        {
          name: '班组长的挫折管理',
          shikanUrl: '',
          hangye: '全行业',
          renqun: '班组长'
        },
        {
          name: '工作调配与进度跟催',
          shikanUrl: '',
          hangye: '全行业',
          renqun: '班组长'
        },
      ],
      curVideo: '',
      visible: false,
      telDl: false,
    }
  },
  computed: {
    gangwei() {
      return shengchancaigou
    }
  },
  methods: {
    shiKan({url}) {
      this.visible = true;
      this.curVideo = url;
    },
    onApplyBtnActive() {
      this.telDl = true;
    },
    onApplyBtnActiveH5() {
      this.$router.push({name: 'CourseDevelopPhone', query: {redirectUrl: '/product/shengChangCaiGou',}});
    },
  }
}
</script>

<style lang="scss" scoped>

.platform-course-list {

  h4 {
    font-size: 30px;
    font-weight: 800;
    color: #333;
    text-align: center;
    margin-bottom: 68px;
  }
}

@media (max-width: 768px) {

  .platform-course-list {
    h4 {
      font-size: 18px;
      font-weight: 800;
      color: #333;
      text-align: center;
      margin-bottom: 10%;
      margin-top: 15%;
    }
  }
  .client-nengli-box {
    margin-bottom: 5%;
  }
}
</style>
