<template>
  <div class="main_content">
    <img src="https://webapp-pub.ezijing.com/www/pc/practice/study/banner.png" class="banner" />
    <div class="content_part">
      <div class="part_title">{{ $t('study.tit') }}</div>
      <div class="part_desc">
        {{ $t('study.desc') }}
      </div>
    </div>
    <div class="content_part1">
      <img src="https://webapp-pub.ezijing.com/www/pc/practice/study/study_advantage.png" class="part_img" />
      <div class="part_con">
        <div class="con_tit">
          <span>
            {{ $t('study.positive_tit') }}
          </span>
        </div>
        <ul class="con_list">
          <li>
            <p>{{ $t('study.positive_desc1') }}</p>
          </li>
          <li>
            <p>{{ $t('study.positive_desc2') }}</p>
          </li>
          <li>
            <p>{{ $t('study.positive_desc3') }}</p>
          </li>
          <li>
            <p>
              {{ $t('study.positive_desc4') }}
            </p>
          </li>
          <li>
            <p>
              {{ $t('study.positive_desc5') }}
            </p>
          </li>
        </ul>
      </div>
    </div>
    <div class="content_part2">
      <div class="part_tit">{{ $t('study.map_tit') }}</div>
      <div class="part_con">
        <img
          :src="
            $cookies.get('lang') == 'en-US'
              ? 'https://webapp-pub.ezijing.com/www/pc/practice/study/map1_en.png'
              : 'https://webapp-pub.ezijing.com/www/pc/practice/study/map1.png'
          "
          class=""
        />
        <img
          :src="
            $cookies.get('lang') == 'en-US'
              ? 'https://webapp-pub.ezijing.com/www/pc/practice/study/map2_en.png'
              : 'https://webapp-pub.ezijing.com/www/pc/practice/study/map2.png'
          "
          class=""
        />
      </div>
    </div>
    <div class="content_part3">
      <img
        :src="
          $cookies.get('lang') == 'en-US'
            ? 'https://webapp-pub.ezijing.com/www/pc/practice/study/part3_bg_en.png'
            : 'https://webapp-pub.ezijing.com/www/pc/practice/study/part3_bg.png'
        "
        alt=""
      />
    </div>
    <div class="content_part4">
      <div class="mask"></div>
      <div class="part_con">
        <div
          :class="$cookies.get('lang') == 'en-US' ? 'con_left_en' : 'con_left'"
          v-html="$t('study.contact_tit')"
        ></div>
        <div class="con_right">
          <el-form :model="form" :rules="rules" ref="form">
            <!-- <el-form-item prop="name">
              <el-input type="text" v-model="form.name" placeholder="企业名称"></el-input>
            </el-form-item> -->
            <el-form-item prop="name">
              <el-input type="text" v-model="form.name" :placeholder="$t('study.name_placeholer')"></el-input>
            </el-form-item>
            <!-- <el-form-item prop="project_id">
              <el-input type="text" v-model="form.name" placeholder="您的职务（自行填写）"></el-input>

              
            </el-form-item> -->
            <el-form-item prop="phone">
              <el-input type="text" v-model="form.phone" :placeholder="$t('study.phone_placeholder')"></el-input>
            </el-form-item>
            <el-button type="primary" @click="handleSubmit">
              {{ $t('study.submit_btn') }}
            </el-button>
          </el-form>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { postNes } from '@/api/index'

export default {
  data() {
    return {
      form: {
        name: '',
        phone: '',
        project_id: '5004',
        channel: this.$route.query.channel_num || 19962
      },
      rules: {
        name: [
          {
            required: true,
            message: this.$t('study.name1_placeholder'),
            trigger: 'blur'
          }
        ],
        phone: [
          {
            required: true,
            message: this.$t('study.phone2_placeholder'),
            trigger: 'blur'
          },
          {
            pattern: /^1[3-9]\d{9}$/,
            message: this.$t('study.phone2_placeholder'),
            trigger: 'blur'
          }
        ]
        // project_id: [{ required: true, message: '请选择项目', trigger: 'change' }]
      }
    }
  },
  methods: {
    handleSubmit() {
      this.$refs.form.validate().then(() => {
        const params = { ...this.form }
        // if (params.project_id === '9999') {
        //   params.project_id = '1016'
        // }
        postNes(params)
          .then(res => {
            // if (res && res.status === 200 && res.error === 0) {
            //   this.$message.success('报名提交成功')
            // } else {
            //   this.$message.error('报名提交失败')
            // }
            this.$message.warning('暂无开通')
          })
          .catch(() => {
            this.$message.error('报名提交失败')
          })
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.main_content {
  background: #ffff;
  width: 100%;
  .banner {
    width: 100%;
    height: 580px;
  }
  .content_part {
    width: 100%;
    padding-bottom: 102px;
    background: #f9f8f8;
    padding: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    .part_title {
      font-size: 30px;
      font-weight: bold;
      color: #333333;
    }
    .part_desc {
      width: 1200px;
      margin-top: 36px;
      font-size: 18px;
      font-weight: 400;
      line-height: 34px;
      color: #666666;
      text-align: center;
    }
  }
  .content_part1 {
    width: 1200px;
    margin: 120px auto;
    display: flex;
    .part_img {
      width: 500px;
      height: 345px;
      margin: 60px -66px 0 0;
      z-index: 100;
    }
    .part_con {
      width: 767px;
      height: 467px;
      background: rgba(249, 248, 248, 0.39);
      padding: 61px 0 61px 94px;
      .con_tit {
        text-align: left;
        span {
          font-size: 20px;
          font-weight: 400;
          color: #424242;
          padding-bottom: 7px;
          box-sizing: content-box;
          border-bottom: 2px solid #aa1941;
        }
      }
      .con_list {
        margin: 11px 0 0 15px;
        li {
          font-size: 16px;
          font-weight: 400;
          line-height: 2;
          list-style-type: disc;
          color: #aa1941;
          p {
            color: #424242 !important;
          }
        }
      }
    }
  }
  .content_part2 {
    width: 100%;
    height: 835px;
    background: #f9f8f8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    .part_tit {
      font-size: 30px;
      font-weight: bold;
      color: #333333;
    }
    .part_con {
      display: flex;
      justify-content: center;
      img {
        width: 625px;
      }
    }
  }
  .content_part3 {
    width: 100%;
    height: 860px;
    // background: url('https://webapp-pub.ezijing.com/www/pc/practice/study/part3_bg.png')
    //   no-repeat center;
    // background-size: 100% 100%;
    margin-top: 0;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .content_part4 {
    width: 1200px;
    height: 540px;
    margin: 120px auto;
    margin-bottom: 120px;
    background: url('https://webapp-pub.ezijing.com/www/pc/practice/study/part4_bg.png') no-repeat center;
    background-size: 100% 100%;
    position: relative;
    .mask {
      position: absolute;
      background: rgba(255, 255, 255, 0.09);
      top: 0;
      right: 0;
      width: 100%;
      height: 100%;
      z-index: 100;
    }
    .part_con {
      display: flex;
      justify-content: space-between;
      .con_left {
        margin-top: 127px;
        padding-top: 47px;
        width: 592px;
        height: 223px;
        background: #aa1941;
        box-shadow: 0px 0px 122px rgba(0, 0, 0, 0.07);
        opacity: 0.63;
        z-index: 200;
        position: relative;
        font-size: 48px;
        font-weight: 500;
        color: #ffffff;
        text-align: center;
      }
      .con_left_en {
        margin-top: 127px;
        padding-top: 27px;
        width: 592px;
        height: 223px;
        background: #aa1941;
        box-shadow: 0px 0px 122px rgba(0, 0, 0, 0.07);
        opacity: 0.63;
        z-index: 200;
        position: relative;
        font-size: 40px;
        font-weight: 500;
        color: #ffffff;
        text-align: center;
        line-height: 1;
      }
      .con_right {
        margin: 110px 136px 104px 87px;
        padding: 63px 56px 56px 64px;
        width: 401px;
        background: #ffffff;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 300;
        .el-input__inner {
          border: 1px solid #999999;
          border-radius: 2px;
        }
        .el-input {
          width: 280px;
          font-size: 14px;
          font-weight: 300;
          color: #999999;
        }
        .el-button {
          width: 281px;
          background: #aa1941;
          border-radius: 4px;
          text-align: center;
          font-size: 18px;
          font-weight: 400;
          color: #ffffff;
        }
      }
    }
  }
}
</style>
