<!-- AIGC网络直播实验室 -->
<script setup>
import { ref } from 'vue'

// 核心模块
const mkList = ref([
  {
    icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/mk_1.png',
    title: '嵌入式开发实验平台',
    children: [
      {
        icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/mk_1_1.png',
        title: '集成 30+ 种主流工业级传感器模块',
      },
      {
        icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/mk_1_2.png',
        title: '支持 STM32/ESP32/RISC-V 多架构开发',
      },
      {
        icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/mk_1_3.png',
        title: '提供 PCB 设计与 Altium Designer 课程',
      },
      {
        icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/mk_1_4.png',
        title: 'FreeRTOS/LiteOS 实时操作系统移植实战',
      },
    ],
  },
  {
    icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/mk_2.png',
    title: '无线传感网实训平台',
    children: [
      {
        icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/mk_2_1.png',
        title: 'ZigBee/LoRa/NB-IoT 全场景协议组网',
      },
      {
        icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/mk_2_2.png',
        title: '边缘计算网关配置与 MQTT 协议对接',
      },
      {
        icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/mk_2_3.png',
        title: 'OTA 远程固件升级技术实现',
      },
      {
        icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/mk_2_4.png',
        title: '移动端 APP 与微信小程序开发支持',
      },
    ],
  },
  {
    icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/mk_3.png',
    title: '行业应用与云平台',
    children: [
      {
        icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/mk_3_1.png',
        title: '物联网云平台大数据可视化大屏',
      },
      {
        icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/mk_3_2.png',
        title: '数字孪生(Digital Twin)虚实交互',
      },
      {
        icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/mk_3_3.png',
        title: '完整覆盖智能家居/工业/农业行业案例',
      },
      {
        icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/mk_3_4.png',
        title: '支持物联网职业技能大赛设备标准',
      },
    ],
  },
])

const zyList = ref([
  { title: '案例1:基于 STM32 的智能家居环境监测系统', industry: '传感器/单片机', hours: 16 },
  { title: '案例2:智慧农业大棚 ZigBee 无线组网控制', industry: '无线传感网', hours: 20 },
  { title: '案例3:基于 ESP32 的 Wi-Fi 遥控小车与视频回传', industry: '嵌入式/网络', hours: 16 },
  { title: '案例4:NB-loT智能路灯远程监控与故障上报', industry: '窄带物联网', hours: 12 },
  { title: '案例5:工业 Modbus 协议数据采集与 PLC 通信', industry: '工业互联网', hours: 24 },
  { title: '案例6:基于 RFID 的智能仓储物流追踪系统', industry: '射频识别', hours: 12 },
  { title: '案例7:边缘计算网关 MQTT 协议上云实战', industry: '云平台对接', hours: 16 },
  { title: '案例8:LoRa 远距离山体滑坡监测预警系统', industry: '低功耗广域网', hours: 20 },
  { title: '案例9:Android 端智能门锁蓝牙解锁 App 开发', industry: '移动开发', hours: 16 },
  { title: '案例10:智慧社区垃圾桶满溢检测与路径规划', industry: '综合应用', hours: 24 },
])

const numList = ref([
  { num: '10', desc: '个行业级综合案例' },
  { num: '20', desc: '套硬件实验箱' },
  { num: '200+', desc: '份源码工程' },
  { num: '45', desc: '本实验指导书' },
  { num: '10', desc: '个毕设级项目' },
])

const tabActive = ref(0)

const tabList = ref([
  {
    title: '硬件接线图',
    tag: '硬件连接',
    name: '高清实物接线图解',
    items: [
      '提供 Fritzing 风格的实物连线图，降低硬件入门门槛；',
      '标注引脚定义（VCC/GND/IO），防止短路与接错；',
      '包含原理图与 PCB 布局文件，支持深入电路分析。',
    ],
    img: 'https://webapp-pub.ezijing.com/www/pc/next/platform/new-engineering/5/tab1.png',
  },
  {
    title: '嵌入式源码',
    tag: '核心代码',
    name: '驱动与应用层源码',
    items: [
      '提供标准 C 语言驱动库（HAL库/标准库），注释详尽；',
      '封装 MQTT/TCP 通信接口，简化网络编程难度；',
      '包含 Android/微信小程序端源码，打通端到端链路。',
    ],
    img: 'https://webapp-pub.ezijing.com/www/pc/next/platform/new-engineering/5/tab2.png',
  },
  {
    title: '物联网云平台',
    tag: '数据可视化',
    name: '云平台数据交互',
    items: [
      '支持对接阿里云 IoT、腾讯云、OneNET 等主流平台；',
      '零代码拖拽生成数据可视化大屏，实时监控设备状态；',
      '支持云端规则引擎配置，实现远程反向控制与报警。',
    ],
    img: 'https://webapp-pub.ezijing.com/www/pc/next/platform/new-engineering/5/tab3.png',
  },
  {
    title: '实验指导书',
    tag: '教学文档',
    name: '保姆级实验指导',
    items: [
      '步骤详尽，包含环境搭建、代码烧录、现象观察全流程；',
      '常见问题（FAQ）速查，快速解决驱动安装与编译报错；',
      '提供配套教学 PPT 与 1080P 实操演示视频。',
    ],
    img: 'https://webapp-pub.ezijing.com/www/pc/next/platform/new-engineering/5/tab4.png',
  },
])

// 标准服务
const bzfwList = ref([
  {
    icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/bzfw_1.png',
    title: '产品服务',
    desc: `硬件设备安装调试
开发环境(Keil/IAR)部署
云平台账号开通
硬件质保与维修`,
  },
  {
    icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/bzfw_2.png',
    title: '资源服务',
    desc: `项目源码库更新
新技术(鸿蒙/RISC-V)案例
行业应用案例升级
课程题库资源同步`,
  },
  {
    icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/bzfw_3.png',
    title: '培训服务',
    desc: `嵌入式讲师师资培训
物联网技能大赛指导
硬件焊接与调试培训
1+X 证书考证培训`,
  },
  {
    icon: 'https://webapp-pub.ezijing.com/www/pc/digital/yx_1_1/bzfw_4.png',
    title: '技术支持',
    desc: `PCB 定制设计支持
毕设项目技术辅导
远程代码调试协助
平台日常管理维护`,
  },
])

// 增值服务
const zzfwList = ref(['物联网专业建设规划', '创客空间/实验室设计', '企业工程师进校讲座', '校企合作项目孵化'])
</script>
<!-- 引产入校 -->
<template>
  <div>
    <div class="banner">
      <img src="https://webapp-pub.ezijing.com/www/pc/next/platform/new-engineering/5/banner.jpg" />
      <div class="cover">
        <div class="cover-inner">
          <h2>物联网实验室</h2>
          <span></span>
          <h6>感知 · 连接 · 智能 · 融合</h6>
          <p>
            面向物联网工程专业，构建“端-边-管-云-用”全栈式实训体系。平台涵盖传感器技术、嵌入式系统开发、无线通信协议（ZigBee/NB-IoT）、边缘计算网关及物联网云平台开发，助力培养具备软硬结合能力的复合型人才。
          </p>
        </div>
      </div>
    </div>
    <section class="section">
      <div class="section-inner">
        <h2 class="section-title">核心模块</h2>
        <div class="mk-list">
          <div class="mk-item" v-for="item in mkList" :key="item.title">
            <div class="box">
              <img :src="item.icon" />
              <p>{{ item.title }}</p>
            </div>
            <ul>
              <li v-for="item in item.children" :key="item.title">
                <img :src="item.icon" />
                <p>{{ item.title }}</p>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </section>
    <section class="section">
      <div class="section-inner">
        <h2 class="section-title">案例资源介绍</h2>
        <p class="section-info">源自真实行业应用，覆盖从底层驱动编写到上层云端开发的完整链路</p>
        <div class="zy">
          <table class="table">
            <thead>
              <tr>
                <th>场景名称</th>
                <th>所属行业</th>
                <th>学时</th>
              </tr>
            </thead>
            <tbody>
              <tr v-for="item in zyList" :key="item.title">
                <td>{{ item.title }}</td>
                <td>{{ item.industry }}</td>
                <td>{{ item.hours }}</td>
              </tr>
            </tbody>
          </table>
          <ul class="num">
            <li v-for="item in numList" :key="item.desc">
              <span>{{ item.num }}</span>
              <em>{{ item.desc }}</em>
            </li>
          </ul>
        </div>
        <div class="tab">
          <ul class="tab-header">
            <li
              v-for="(item, index) in tabList"
              :class="{ 'is-active': index === tabActive }"
              :key="index"
              @mouseover="tabActive = index">
              {{ item.title }}
            </li>
          </ul>
          <div class="tab-body" v-for="(item, index) in tabList" :key="index" v-show="index === tabActive">
            <div class="tab-body-pic">
              <img :src="item.img" :alt="item.title" />
            </div>
            <div class="tab-body-content">
              <span>{{ item.tag }}</span>
              <h4>{{ item.title }}</h4>
              <ul>
                <li v-for="subItem in item.items" :key="subItem">{{ subItem }}</li>
              </ul>
            </div>
          </div>
        </div>
        <h2 class="section-title">产品配套服务</h2>
        <h3 class="section-subtitle">标准服务</h3>
        <ul class="bz-list">
          <li v-for="item in bzfwList" :key="item.title">
            <img :src="item.icon" />
            <div class="cover">
              <h4>{{ item.title }}</h4>
              <p v-html="item.desc"></p>
            </div>
          </li>
        </ul>
        <h3 class="section-subtitle">增值服务</h3>
        <ul class="zz-list">
          <li v-for="item in zzfwList" :key="item">{{ item }}</li>
        </ul>
      </div>
    </section>
  </div>
</template>

<style lang="scss" scoped>
.banner {
  position: relative;
  img {
    width: 100%;
    height: 650px;
    object-fit: cover;
  }
  .cover {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    line-height: 1;
    color: #ffffff;
    h2 {
      font-size: 60px;
      font-family:
        Source Han Sans CN-Bold,
        Source Han Sans CN;
      font-weight: bold;
      line-height: 1;
    }
    h3 {
      margin-bottom: 20px;
      font-size: 24px;
      font-family:
        Source Han Sans CN-Medium,
        Source Han Sans CN;
      font-weight: 500;
      line-height: 1;
      letter-spacing: 4px;
    }
    span {
      margin: 46px 0;
      width: 60px;
      height: 6px;
      background: #ffffff;
    }
    h6 {
      font-size: 24px;
      font-family:
        Source Han Sans CN-Medium,
        Source Han Sans CN;
      font-weight: 500;
      line-height: 1;
    }
    p {
      margin-top: 30px;
      max-width: 600px;
      font-size: 18px;
      font-family:
        Source Han Sans CN-Regular,
        Source Han Sans CN;
      line-height: 30px;
    }
    a {
      margin-top: 28px;
      width: 112px;
      height: 36px;
      font-size: 16px;
      font-family:
        Source Han Sans CN-Regular,
        Source Han Sans CN;
      font-weight: 400;
      color: #ffffff;
      line-height: 36px;
      background: #aa1941;
      text-align: center;
    }
  }
  .cover-inner {
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-direction: column;
  }
}

.section-inner {
  width: 1200px;
  margin: 90px auto;
}
.section-title {
  margin-bottom: 40px;
  font-size: 30px;
  font-family: Source Han Sans CN;
  font-weight: bold;
  line-height: 32px;
  color: #333333;
  text-align: center;
}
.section-title-desc {
  margin-bottom: 50px;
  font-family:
    Source Han Sans CN,
    Source Han Sans CN;
  font-weight: 400;
  font-size: 18px;
  color: #666666;
  line-height: 30px;
  text-align: center;
}
.section-subtitle {
  display: inline-block;
  margin: 36px 0;
  font-size: 20px;
  line-height: 32px;
  color: #424242;
  border-bottom: 1px solid var(--main-color);
}
.section-desc {
  font-size: 16px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  line-height: 34px;
  color: #666666;
}
.section-info {
  margin: 40px 0 70px;
  font-size: 18px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  line-height: 34px;
  color: #666666;
  text-align: center;
}

.section-pic {
  text-align: center;
  img {
    max-width: 100%;
  }
}
.mk-list {
  display: flex;
  gap: 60px;
  .mk-item {
    flex: 1;
  }
  .box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 260px;
    background-color: var(--main-color);
    color: #fff;
    p {
      margin-top: 40px;
      font-size: 18px;
      font-family:
        Source Han Sans CN-Medium,
        Source Han Sans CN;
      font-weight: 500;
      color: #ffffff;
    }
    span {
      margin-top: 15px;
    }
  }
  ul {
    margin-top: 40px;
  }
  li {
    margin-top: 25px;
    img {
      margin: 0 18px;
    }
    display: flex;
    align-items: center;
    height: 60px;
    background: #f2f2f2;
    font-size: 15px;
    font-family:
      Source Han Sans CN-Medium,
      Source Han Sans CN;
    font-weight: 500;
    color: #424242;
  }
}
.bz-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 38px;
  li {
    position: relative;
    transition: all 0.3s;
    &:hover {
      transform: scale(1.06);
    }
  }
  .cover {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
  }
  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  h4 {
    padding: 64px 0 45px;
    font-size: 24px;
    font-family:
      Source Han Sans CN-Medium,
      Source Han Sans CN;
    font-weight: 500;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  p {
    font-size: 16px;
    font-family:
      Source Han Sans CN-Regular,
      Source Han Sans CN;
    font-weight: 400;
    color: #ffffff;
    line-height: 40px;
    text-align: center;
    white-space: pre-wrap;
  }
}
.zz-list {
  display: flex;
  gap: 25px;
  li {
    flex: 1;
    font-size: 22px;
    font-family:
      Source Han Sans CN-Medium,
      Source Han Sans CN;
    font-weight: 500;
    color: #333333;
    line-height: 80px;
    text-align: center;
    border: 1px solid var(--main-color);
    border-left-width: 10px;
  }
}
.al-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  li {
    img {
      width: 100%;
    }
    transition: all 0.3s;
    &:hover {
      transform: scale(1.06);
    }
  }
}
.zy {
  display: flex;
  .table {
    flex: 1;
  }
  .num {
    margin-left: 35px;
  }
}
.num {
  width: 320px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  li {
    padding: 20px;
    height: 130px;
    background: #ffffff;
    box-shadow: 0px 0px 8px 1px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    &:first-child {
      grid-column: span 2;
    }
    &:hover {
      color: #fff;
      background-color: var(--main-color);
      span {
        color: #fff;
      }
    }
    span {
      font-size: 30px;
      font-weight: bold;
      font-family: SourceHanSansCN-Bold;
      color: var(--main-color);
    }
    em {
      font-style: normal;
      font-size: 14px;
      font-family: Source Han Sans CN;
    }
  }
}
.table {
  thead {
    th {
      padding: 20px;
      font-size: 18px;
      font-family: Source Han Sans CN;
      font-weight: bold;
      line-height: 1;
      color: #fff;
      background-color: #aa1941;
      border: 1px solid #aa1941;
    }
    th:nth-child(2) {
      background: #931638;
    }
  }
  tbody {
    td {
      font-size: 16px;
      font-family: Source Han Sans CN;
      font-weight: 400;
      line-height: 1;
      color: #262626;
      padding: 10px;
      border: 1px solid #8b8b8b;
    }
    td:nth-child(1) {
      padding-left: 40px;
    }
    td:nth-child(2),
    td:nth-child(3) {
      text-align: center;
    }
  }
}
.tab {
  display: flex;
  margin: 60px 0 90px;
}
.tab-header {
  margin-right: 38px;
  li {
    width: 270px;
    height: 70px;
    font-size: 18px;
    font-family:
      Source Han Sans CN-Medium,
      Source Han Sans CN;
    font-weight: 500;
    line-height: 70px;
    color: #333333;
    background: #fff;
    text-align: center;
    border: 1px solid #d5d5d5;
    cursor: pointer;
    &.is-active {
      color: #fff;
      background-color: var(--main-color);
      border: 1px solid var(--main-color);
    }
    & + li {
      margin-top: 22px;
    }
  }
}
.tab-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  background-color: #fff;
  box-shadow: 0px 0px 8px 1px rgba(0, 0, 0, 0.1);
  &-pic {
    position: relative;

    margin: 0 90px;
    width: 200px;
    height: 240px;
    img {
      position: relative;
      max-width: 100%;
      height: auto;
      z-index: 10;
    }
    &::before {
      z-index: 1;
      content: '';
      position: absolute;
      left: 10px;
      top: 10px;
      width: 100%;
      height: 100%;
      background: #ededed;
    }
  }
  &-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    span {
      width: 80px;
      height: 30px;
      font-size: 12px;
      line-height: 30px;
      text-align: center;
      color: var(--main-color);
      background: #f8e9ed;
      border-radius: 8px 8px 8px 8px;
    }
    h4 {
      margin: 20px 0 40px;
      font-weight: bold;
      font-size: 22px;
    }
    li {
      position: relative;
      font-size: 16px;
      color: #333333;
      line-height: 36px;
      padding-left: 20px;
      &::after {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 8px;
        height: 8px;
        background-color: var(--main-color);
        border-radius: 50%;
      }
    }
  }
}
</style>
