<template>
  <div class="demand-page">
    <div ref="headerBanner" class="header-banner">
      <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>
          九猫ERP处理订单更加智捷、高效；供货承诺数据详实，生产进度一目了然；在线设计器一键合成，文创产品轻松出单
        </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"
                :style="$isMobile ? 'flex-direction:column-reverse' : ''">
                <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"
                :style="$isMobile ? 'flex-direction:column-reverse' : ''">
                <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/cg/01.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"
                :style="$isMobile ? 'flex-direction:column-reverse' : ''">
                <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/cg/02.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/cg/03.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/sc/01.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"
                :style="$isMobile ? 'flex-direction:column-reverse' : ''">
                <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/sc/02.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/sc/03.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"
                :style="$isMobile ? 'flex-direction:column-reverse' : ''">
                <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/sc/04.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/sh/01.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"
                :style="$isMobile ? 'flex-direction:column-reverse' : ''">
                <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/sh/02.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/sh/03.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/fh/01.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"
                :style="$isMobile ? 'flex-direction:column-reverse' : ''">
                <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/fh/02.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/fh/03.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"
                :style="$isMobile ? 'flex-direction:column-reverse' : ''">
                <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/fh/04.png" />
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="tab-pane" v-if="active === 6">
          <div class="t-row-1">
            <div class="card-inner">
              <div class="card-inner-content">
                <div class="left">
                  <img src="../../assets/images/fh/wl.png" />
                </div>
                <div class="right content-text-wrap">
                  <div
                    class="content-text"
                    :style="$isMobile ? 'margin-left: 0' : 'margin-left: 40px'">
                    <h4
                      :style="`
                        ${$isMobile ? 'font-size: 22px' : 'font-size: 32px'}
                        font-weight: 100;
                        margin: 0;
                      `">
                      物流管理
                    </h4>
                    <h5
                      style="
                        font-size: 14px;
                        margin-bottom: 16px;
                        margin-top: 6px;
                        font-weight: 100;
                      ">
                      智能推荐优势物流商，物流轨迹实时查询
                    </h5>
                    <div class="text-des">
                      <p>精准跟踪发货进度，支持分批发货</p>
                      <p>发货后的订单，系统自动计算最低物流运费</p>
                      <p>物流跟踪实时查询包裹状态</p>
                      <p>图表展示物流方式占比，使你更快做出决策</p>
                    </div>
                  </div>
                </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/fh/05.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"
                :style="$isMobile ? 'flex-direction:column-reverse' : ''">
                <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/fh/06.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/fh/07.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: 'demandPage',
  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 (this.$isMobile) {
        if (top >= this.$refs.headerBanner.offsetHeight - 30) {
          this.$refs.feature.style.position = 'fixed'
          this.$refs.feature.style.top = '50px'
          this.$refs.feature.style.left = '0'
          this.$refs.feature.style.right = '0'
          this.$refs.feature.style.height = '40px'
          this.$refs.feature.style.zIndex = '100'
        } else {
          this.$refs.feature.style.position = ''
          this.$refs.feature.style.top = ''
          this.$refs.feature.style.left = ''
          this.$refs.feature.style.right = ''
          this.$refs.feature.style.height = ''
          this.$refs.feature.style.zIndex = ''
        }
        return
      }

      this.$refs.feature.style.position = ''
      this.$refs.feature.style.top = ''
      this.$refs.feature.style.left = ''
      this.$refs.feature.style.right = ''
      this.$refs.feature.style.height = ''
      this.$refs.feature.style.zIndex = ''

      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
      if (this.$isMobile) return
      this.scrollParent().scrollTo({
        behavior: 'smooth',
        top: this.$refs.headerBanner.offsetHeight - 0,
      })
    },
  },
}
</script>
<style scoped lang="scss">
.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;
  gap: 40px;
}

.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: 50%;
    transform: translate(-20px,-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(37, 84, 254, 0.1);
    background-color: #0089ff;
}

.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;
}

.card-inner-content .content-text .text-des p {
  margin-bottom: 12px;
}

@media screen and (max-width: 1100px) {
  .text {
    top: 20px !important;
    left: 20px !important;
    right: 20px !important;
  }

  .text h2 {
    font-size: 20px !important;
    margin-bottom: 10px !important;
  }

  .text p {
    font-size: 12px !important;
  }

  .feature-list {
    width: unset;
    overflow-x: auto;
    font-size: 14px;
    transform: unset;
    position: unset;
    border-radius: 0;
    transition: none;
  }

  .feature-item {
    padding: 10px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .card-inner {
    width: 100vw;

    h3 {
      font-size: 24px !important;
    }

    h4 {
      font-size: 14px;
      margin-bottom: 40px;
    }
  }

  .card-inner-content {
    flex-direction: column;
    padding: 0 20px;
    align-items: flex-start;
    gap: 10px;
  }

  .t-row-1 {
    padding-top: 40px;
    padding-bottom: 50px;
  }

  .content-text-wrap {
    margin-top: 20px;
  }

  .card-inner-content .content-text h4 {
    line-height: 28px;
    font-size: 22px;
    text-align: left !important;
  }

  .card-inner-content .content-text p {
    margin-bottom: 0px;
    line-height: 12px;
    font-size: 12px;
    text-align: left !important;
  }

  .t-row-2 .t2 {
    width: 100px;
    left: 20px;
    top: 80px;
  }

  .t-row-2 .t3 {
    width: 70px;
    left: 240px;
    top: 75px;
  }

  .t-row-2 {
    padding: 40px 0;
  }

  .t-row-3 {
    padding: 40px 0;
  }

  .card-inner-content .content-text h4::before {
    content: "";
    position: unset;
    top: unset;
    transform: unset;
    width: unset;
    height: unset;
    border-radius: unset;
    box-shadow: unset;
    background-color: #0089ff;
}
}
</style>
