<template>
  <div class="function-page">
    <div ref="headerBanner" class="header-banner">
      <!-- <div class="image">
        <img
          src="../../assets/images/function/function.png"
          style="width: 100%; height: 100%; object-fit: cover" />
      </div> -->
      <div class="image">
        <img
          src="../../assets/images/banner-solution.jpg"
          style="width: 100%; height: 100%; object-fit: cover" />
      </div>
      <div class="text">
        <h2>核心功能</h2>
        <p>
          九猫拥有完整的实施和售后体系，秉承“服务为本，客户至上”的理念竭诚为您服务
        </p>
      </div>
      <div class="feature-list" ref="feature">
        <div
          class="feature-item"
          v-for="(f, index) in featureLists"
          :key="index"
          :class="{ active: active === index }"
          @click="onChangePane(index)">
          <span>{{ f }}</span>
        </div>
      </div>
    </div>
    <div class="function-body">
      <div class="tab-content">
        <div class="tab-pane" v-if="active === 0">
          <div class="t-row-1">
            <div class="card-inner">
              <h3 style="text-align: center; font-size: 32px; font-weight: 100;">缺货统计</h3>
              <h4 style="text-align: center">
                打通供应链全流程，派单统计产品缺货数量
              </h4>
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/function/qh.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">多维度数据分析</h4>
                    <p style="text-align: center">
                      SPU、SKU两个维度统计缺货数量
                    </p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-2">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left content-text-wrap">
                  <div class="content-text">
                    <h4>高效采购生产</h4>
                    <p>采购生产双向进行</p>
                  </div>
                </div>
                <div class="right a-img">
                  <img class="t1" src="../../assets/images/function/sx.png" />
                  <img class="t2" src="../../assets/images/function/sx_1.png" />
                  <img class="t3" src="../../assets/images/function/sx-2.png" />
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-3">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/function/cg.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">SKU查询订单</h4>
                    <p style="text-align: center">
                      根据SKU方便快捷的查询要备货的订单
                    </p>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="tab-pane" v-if="active === 1">
          <div class="t-row-1">
            <div class="card-inner">
              <h3 style="text-align: center; font-size: 32px;font-weight: 100;">仓库预警</h3>
              <h4 style="text-align: center">
                各仓库库存状况一目了然，解决库存难管理问题
              </h4>
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/warehouse/kc.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">实时查看产品库存数量</h4>
                    <p style="text-align: center">
                      实时统计产品库存数量、占用数量、可用数量、缺货数量等
                    </p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-2">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left content-text-wrap">
                  <div class="content-text">
                    <h4>订单占用明细</h4>
                    <p>
                      实时统计产品占用的订单明细，交易时间、缺货数量、订单状态等
                    </p>
                  </div>
                </div>
                <div class="right">
                  <img class="t1" src="../../assets/images/warehouse/dd.png" />
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-3">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/warehouse/no.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">采购未入库明细</h4>
                    <p style="text-align: center">
                      实时统计采购未入库的数量、单号，实时掌握采买情况
                    </p>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="tab-pane" v-if="active === 2">
          <div class="t-row-1">
            <div class="card-inner">
              <h3 style="text-align: center; font-size: 32px;font-weight: 100;">采购管理</h3>
              <h4 style="text-align: center">
                运营、采购、仓库等部门高效协同，实时跟踪采购需求
              </h4>
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/warehouse/kc.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">一键生成采购单</h4>
                    <p style="text-align: center">
                      根据缺货数量一键生成采购单，建议补货数量，科学控制备货库存
                    </p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-2">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left content-text-wrap">
                  <div class="content-text">
                    <h4>跨部门高效协同合作</h4>
                    <p>各部门协同合作，轻松掌握库存量、采购量以及到货量</p>
                  </div>
                </div>
                <div class="right">
                  <img class="t1" src="../../assets/images/warehouse/dd.png" />
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-3">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/warehouse/no.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">采购流程方便快捷</h4>
                    <p style="text-align: center">
                      审核、付款、发货、入库一体化操作
                    </p>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="tab-pane" v-if="active === 3">
          <div class="t-row-1">
            <div class="card-inner">
              <h3 style="text-align: center; font-size: 32px;font-weight: 100;">生产管理</h3>
              <h4 style="text-align: center">
                采购与供应商同页面操作，实时沟通，有效缩短收货周期
              </h4>
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/warehouse/kc.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">一键生成采购单</h4>
                    <p style="text-align: center">
                      精准跟踪发货进度，支持分批发货
                    </p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-2">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left content-text-wrap">
                  <div class="content-text">
                    <h4>跨部门高效协同合作</h4>
                    <p>生产单、交货单与财务核算一体化管理</p>
                  </div>
                </div>
                <div class="right">
                  <img class="t1" src="../../assets/images/warehouse/dd.png" />
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-3">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/warehouse/no.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">采购流程方便快捷</h4>
                    <p style="text-align: center">支持发货前修改发货数量</p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-4">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left content-text-wrap">
                  <div class="content-text">
                    <h4>跨部门高效协同合作</h4>
                    <p>全流程日志，方便追溯和分析</p>
                  </div>
                </div>
                <div class="right">
                  <img class="t1" src="../../assets/images/warehouse/dd.png" />
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="tab-pane" v-if="active === 4">
          <div class="t-row-1">
            <div class="card-inner">
              <h3 style="text-align: center; font-size: 32px;font-weight: 100;">收获管理</h3>
              <h4 style="text-align: center">
                采购生产同路径入库，收货信息化管理
              </h4>
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/warehouse/kc.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">一键生成采购单</h4>
                    <p style="text-align: center">入库财务及仓库双重审核</p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-2">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left content-text-wrap">
                  <div class="content-text">
                    <h4>跨部门高效协同合作</h4>
                    <p>允许分批收货，收货后可进行质检</p>
                  </div>
                </div>
                <div class="right">
                  <img class="t1" src="../../assets/images/warehouse/dd.png" />
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-3">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/warehouse/no.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">采购流程方便快捷</h4>
                    <p style="text-align: center">可用其它入库快速入库</p>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="tab-pane" v-if="active === 5">
          <div class="t-row-1">
            <div class="card-inner">
              <h3 style="text-align: center; font-size: 32px;font-weight: 100;">自发货</h3>
              <h4 style="text-align: center">
                采购与供应商同页面操作，实时沟通，有效缩短收货周期
              </h4>
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/warehouse/kc.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">一键生成采购单</h4>
                    <p style="text-align: center">
                      精准跟踪发货进度，支持分批发货
                    </p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-2">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left content-text-wrap">
                  <div class="content-text">
                    <h4>跨部门高效协同合作</h4>
                    <p>生产单、交货单与财务核算一体化管理</p>
                  </div>
                </div>
                <div class="right">
                  <img class="t1" src="../../assets/images/warehouse/dd.png" />
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-3">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/warehouse/no.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">采购流程方便快捷</h4>
                    <p style="text-align: center">支持发货前修改发货数量</p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-4">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left content-text-wrap">
                  <div class="content-text">
                    <h4>跨部门高效协同合作</h4>
                    <p>全流程日志，方便追溯和分析</p>
                  </div>
                </div>
                <div class="right">
                  <img class="t1" src="../../assets/images/warehouse/dd.png" />
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="tab-pane" v-if="active === 6">
          <div class="t-row-1">
            <div class="card-inner">
              <h3 style="text-align: center; font-size: 32px;font-weight: 100;">物流管理</h3>
              <h4 style="text-align: center">
                智能推荐优势物流商，物流轨迹实时查询
              </h4>
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/warehouse/kc.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">全程跟踪包裹状态</h4>
                    <p style="text-align: center">
                      精准跟踪发货进度，支持分批发货
                    </p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-2">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left content-text-wrap">
                  <div class="content-text">
                    <h4>跨部门高效协同合作</h4>
                    <p>发货后的订单，系统自动计算最低物流运费</p>
                  </div>
                </div>
                <div class="right">
                  <img class="t1" src="../../assets/images/warehouse/dd.png" />
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-3">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/warehouse/no.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">采购流程方便快捷</h4>
                    <p style="text-align: center">物流跟踪实时查询包裹状态</p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-4">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left content-text-wrap">
                  <div class="content-text">
                    <h4>跨部门高效协同合作</h4>
                    <p>图表展示物流方式占比，使你更快做出决策</p>
                  </div>
                </div>
                <div class="right">
                  <img class="t1" src="../../assets/images/warehouse/dd.png" />
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="tab-pane" v-if="active === 7">
          <div class="t-row-1">
            <div class="card-inner">
              <h3 style="text-align: center; font-size: 32px;font-weight: 100;">FBA发货</h3>
              <h4 style="text-align: center">
                一表连通装箱、发货、物流，操作流程方便快捷
              </h4>
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/warehouse/kc.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">一键生成采购单</h4>
                    <p style="text-align: center">一键装箱，一键创建物流订单</p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-2">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left content-text-wrap">
                  <div class="content-text">
                    <h4>跨部门高效协同合作</h4>
                    <p>可分批生成跟踪号</p>
                  </div>
                </div>
                <div class="right">
                  <img class="t1" src="../../assets/images/warehouse/dd.png" />
                </div>
              </div>
            </div>
          </div>
          <div class="t-row-3">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/warehouse/no.png" />
                </div>
                <div class="right content-text-wrap">
                  <div class="content-text">
                    <h4 style="text-align: center">采购流程方便快捷</h4>
                    <p style="text-align: center">缺货自动转至待补货</p>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'functionPage',
  inject: {
    scrollParent: 'scrollParent',
    setHeaderShadow: 'setHeaderShadow',
  },
  data() {
    return {
      featureLists: [
        '缺货统计',
        '仓库预警',
        '采购管理',
        '生产管理',
        '收货管理',
        '自发货',
        '物流管理',
        'FBA发货',
      ],
      active: 0,
    }
  },
  mounted() {
    this.setHeaderShadow(false)
    this.scrollParent().addEventListener('scroll', this.onScroll)
  },
  beforeDestroy() {
    this.setHeaderShadow(true)
    this.scrollParent().removeEventListener('scroll', this.onScroll)
  },
  methods: {
    onScroll() {
      const top = this.scrollParent().scrollTop
      if (top >= this.$refs.headerBanner.offsetHeight - 60) {
        this.$refs.feature.classList.add('feature-scrolling')
      } else {
        this.$refs.feature.classList.remove('feature-scrolling')
      }
    },
    onChangePane(index) {
      this.active = index
      this.scrollParent().scrollTo({
        behavior: 'smooth',
        top: this.$refs.headerBanner.offsetHeight - 60,
      })
    },
  },
}
</script>
<style scoped>
.header-banner {
  position: relative;
}

.text {
  position: absolute;
  top: 30%;
  left: 5%;
}

.text h2 {
  color: #fff;
  font-size: 48px;
  margin-bottom: 20px;
}

.text p {
  color: #fff;
  font-size: 24px;
}
.image {
  height: 33.333vw;
}

.feature-list {
  display: flex;
  position: absolute;
  left: 50%;
  bottom: -30px;
  transform: translateX(-50%);
  box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.3);
  width: 1150px;
  background-color: #fff;
  border-radius: 6px;
  transition: all 0.3s;
}

.feature-item {
  flex: 1;
  text-align: center;
  padding: 20px;
  cursor: pointer;
}

.active {
  background-color: #0089ff;
  color: #fff;
}

.function-body {
}

.t-row-1 {
  padding-top: 70px;
  padding-bottom: 80px;
}

.t-row-2,
.t-row-4 {
  padding: 75px 0;
  background-color: #f7f8fa;
}

.t-row-3,
.t-row-5 {
  padding: 75px 0;
}

.t-row-2 .a-img {
  position: relative;
}

.t-row-2 .t1 {
  width: 100%;
}

.t-row-2 .t2 {
  position: absolute;
  width: 150px;
  left: 33px;
  top: 130px;
}

.t-row-2 .t3 {
  position: absolute;
  width: 160px;
  left: 290px;
  top: 80px;
}

.card-inner {
  margin: 0 auto;
  width: 1150px;
}

.card-inner h4 {
  color: #777;
  font-weight: 100;
  margin-top: 10px;
  margin-bottom: 80px;
}

.card-inner-content {
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-inner-content .content-text h4 {
  margin-bottom: 16px;
  line-height: 48px;
  font-weight: 500;
  font-size: 32px;
  position: relative;
}

.card-inner-content .content-text p {
  margin-bottom: 40px;
  color: #4e5969;
  line-height: 24px;
  font-size: 16px;
}

.card-inner-content .content-text h4::before {
  content: '';
  position: absolute;
  top: -16px;
  width: 34px;
  height: 6px;
  background-color: #0089ff;
  border-radius: 3px;
}

.left {
  flex: 1;
}

.left img {
  width: 100%;
}

.right img {
  width: 100%;
}

.right {
  flex: 1;
}

.feature-scrolling {
  position: fixed;
  top: 60px;
  left: 0;
  bottom: unset;
  width: 100%;
  transform: translateX(0);
  border-radius: 0;
  box-shadow: none;
  z-index: 2;
}
</style>
