<template>
  <div class="client-platform-page tiyan-center-page">
    <!-- 体验中心 banner栏 --><!--style="url('/static/images/client/exam/exam-banner-background.png')" -->
    <div class="client-platform-banner">
      <div :style="{backgroundImage: `url(${tiyanCenterImg})`}"></div>
    </div>
    <!--  麦塔在线考试系统体验版 -->
    <div class="platform-products-experience client-container">
      <h4 class="client-title">麦塔在线考试系统体验版</h4>
      <ul class="experience-ul-box">
        <li>
          <div>
            <i></i><h4>考试电脑管理端</h4><a>立即体验</a><p><span>{{kaoshiCnt}}</span>人正在体验学员端</p>
          </div>
        </li>
        <li>
          <div>
            <i></i><h4>考试电脑学员端</h4><a>立即体验</a><p><span>{{kaoshiCnt}}</span>人正在体验管理端</p>
          </div>
        </li>
        <li>
          <div>
            <i></i><h4>考试一键安装包</h4><a href="https://mta3.oss-cn-qingdao.aliyuncs.com/kaoshi%20v3.8.3_190618.zip">免费下载</a><p><span>{{ksDownLoadCnt}}</span>人已下载安装</p>
          </div>
        </li>

      </ul>
    </div>
    <!--  麦塔在线培训系统 -->
    <div class="platform-products-experience client-container">
      <h4 class="client-title">麦塔在线培训系统体验版</h4>
      <ul class="experience-ul-box peixun-ul-box">
        <li>
          <div>
            <i></i><h4>考试电脑管理端</h4><a>立即体验</a><p><span>{{kaoshiCnt}}</span>人正在体验学员端</p>
          </div>
        </li>
        <li>
          <div>
            <i></i><h4>考试电脑学员端</h4><a>立即体验</a><p><span>{{kaoshiCnt}}</span>人正在体验管理端</p>
          </div>
        </li>
        <li>
          <div>
            <i></i><h4>考试一键安装包</h4><a href="https://mta3.oss-cn-qingdao.aliyuncs.com/peixun%20v3.8.3_190618.zip">免费下载</a><p><span>{{pxDownLoadCnt}}</span>人已下载安装</p>
          </div>
        </li>

      </ul>
    </div>

    <!--  立即注册弹窗 -->
    <el-dialog
      :close-on-click-modal="false"
      :visible.sync="registerDl"
      class="register-now-dialog"
      center>
      <div class="register-now-box">
        <p>企业考培,就用麦塔</p>
        <p>现在注册立享30人纯免费版本3年使用权限</p>
        <div class="system-box">
          <a href="https://cdnks.mtavip.com/a/register?flug=1" target="_blank"><i></i><p>考试系统</p></a>
          <span></span>
          <a href="https://cdnks.mtavip.com/a/register?flug=2" target="_blank"><i></i><p>培训系统</p></a>
        </div>
        <span>免费咨询电话：<span class="tel-code">400-052-2130</span></span>
      </div>
    </el-dialog>
    <!-- 系统维护-->
    <el-dialog :close-on-click-modal="false" :visible.sync="systemMaintainDl" class="system-maintain-dialog"></el-dialog>
  </div>
</template>

<script>
  import Swiper, {Navigation, Pagination,Autoplay} from 'swiper';
  Swiper.use([Navigation, Pagination,Autoplay]);
  export default {
    name:     'tiyanCenter',
    layout:   'templateB',
    async asyncData({ $axios,store }) {
      // 设置选中菜单
      store.commit('setActiveNav', '/tiyanCenter');
    },
    data() {
      return {
        // 发展现状img
        tiyanCenterImg: require(`~/static/images/client/tiyanCenter/tiyanCenterImg.png`),
        registerDl:false,
        youkeFlag:false,// 控制游客系统是否维护中
        systemMaintainDl:false,// 系统维护弹窗
        kaoshiCnt:0,
        peixunCnt:0,
        ksDownLoadCnt:0,
        pxDownLoadCnt:0,
      };
    },
    head(){
      return {
        title: 'SaaS考试系统_麦塔在线考试系统_麦塔在线培训系统体验版',
        meta:  [
          {
            description: '企业考培,就用麦塔,现在注册立享30人纯免费版本3年使用权限.麦塔在线考试系统体验版-简单好用的SaaS考试系统;麦塔在线培训系统体验版-学练考评一站式培训平台。',
            keywords:    'saas考试系统',
          },
        ],
      };
    },
    computed: {},
    methods:  {
      // 免费试用
      FreeTrial(type){
        var registerType = type;
        if(this.youkeFlag){
            if(registerType===1) {
              window.open('https://youkeksc.mtavip.com/kscmdist/#/youke')
            }else {
              window.open('https://youkepxc.mtavip.com/pxcmdist/#/youke')
            }
        }else{
          // 升级中
          this.$message({customClass:'phone-message-box',type: 'warning',message: '系统升级中，请稍后再试...'});
        }
      },
      // 考试体验按钮
      KsTyBtn(btnUrl){
        if(this.youkeFlag) {
          if(this.SystemWidthFlag){
            this.$router.push({ name: 'copyUrl', query: { url: btnUrl, } });
          }else {
            window.open(btnUrl);
          }
        }else{
          if(this.SystemWidthFlag){
            // 升级中
            this.$message({customClass:'phone-message-box',type: 'warning',message: '系统升级中，请稍后再试...'});
          }else{
            this.systemMaintainDl = true;
          }
        }
      },
      // 培训学员端体验
      pxTyBtn(btnUrl){
        if(this.youkeFlag) {
          if(this.SystemWidthFlag){
            this.$router.push({ name: 'copyUrl', query: { url: btnUrl, } });
          }else {
            window.open(btnUrl);
          }
        }else{
          if(this.SystemWidthFlag){
            // 升级中
            this.$message({customClass:'phone-message-box',type: 'warning',message: '系统升级中，请稍后再试...'});
          }else{
            this.systemMaintainDl = true;
          }

        }
      },

    },
    created() {
      // 页面初始化
      this.$axios.$post('/user/tiyan/info').then(res=>{
          this.kaoshiCnt = res.data.kaoshiCnt;
          this.peixunCnt = res.data.kaoshiCnt;
          this.ksDownLoadCnt = res.data.ksDownLoadCnt;
          this.pxDownLoadCnt = res.data.pxDownLoadCnt;
      });
    },
    mounted() {
    },
    beforeDestroy() {
    },
  };
</script>
