<template>
  <!-- 首页 -->
  <div class="index">
    <div class="wrapper">
      <!-- 分类 -->
      <div class="category acea-row row-middle" @mouseleave="leave()">
        <div class="sort">
          <div
            class="item acea-row row-between-wrapper"
            :class="index === current ? 'bg-color' : ''"
            v-for="(item, index) in categoryList"
            :key="index"
            @mouseenter="enter(item, index)"
          >
            <div class="name line1">{{ item.category_name }}</div>
            <div class="iconfont icon-you"></div>
          </div>
        </div>
        <div class="sortCon" v-if="seen">
          <!--<div class="title">-->
          <!--<span class="font-color">{{ categoryCurrent.cate_name }}</span>-->
          <!--</div>-->
          <div class="erSort acea-row row-top">
            <div
              @click="goCate(v, i)"
              class="item acea-row row-middle"
              v-for="(v, i) in categoryCurrent"
              :key="i"
            >
              <div class="pictrue">
                <img v-lazy="imgUrl + v.sku_image" v-if="v.sku_image" />
                <img src="~assets/images/no_sort.jpg" alt v-else />
              </div>
              <div class="name line1">{{ v.sku_name }}</div>
            </div>
          </div>
        </div>
      </div>
      <!--轮播分类-->
      <div class="slider-banner banner">
        <el-carousel trigger="click" height="380px">
          <el-carousel-item
            :setActiveItem="index"
            v-for="(item, index) in swiperData"
            :key="index"
          >
            <div class="bannerImg">
              <img :src="imgUrl + item.adv_image" />
            </div>
          </el-carousel-item>
        </el-carousel>

        <!-- <client-only>
          <div v-swiper:mySwiper="swiperOption">
            <div class="swiper-wrapper">
              <a
                class="swiper-slide"
                v-for="(item, index) in swiperData"
                :key="index"
                v-if="index < 10"
                @click="jumpTap(item.url)"
              >
                <img :src="item.image" />
              </a>
            </div>
            <div
              class="swiper-pagination paginationBanner"
              slot="pagination"
            ></div>
            <div class="swiper-button-prev" slot="pagination"></div>
            <div class="swiper-button-next" slot="pagination"></div>
          </div>
        </client-only>-->
      </div>
      <!-- 抽奖 -->
      <div class="zbcx">
        <div class="titleMgs">
          <img src="~assets/images/msg.png" alt />
          <span>消息</span>
        </div>
        <ul v-if="msglist.length">
          <li @click="goDetails(topMsg.id)">
            <p :style="{ color: 'var(--themeColor)' }">
              <i>【置顶】 {{ topMsg.title }}</i>
            </p>
          </li>
          <li
            v-for="(item, index) in msglist"
            :key="index"
            @click="clickMore(item.id, false)"
          >
            <div style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
              {{ item.type_name }}【{{
                $dayjs(item.create_time * 1000).format("MM-DD HH:mm")
              }}】
            </div>
          </li>
          <li class="more" @click="clickMore(undefined, true)" v-if="msglist.length > 2">
            查看更多
            <i class="el-icon-arrow-right"></i>
          </li>
        </ul>
        <div class="cjlq">
          <div @click="goLuckDraw">
            <img src="~assets/images/cj.png" alt srcset />
            <p>抽奖转盘</p>
          </div>
          <div @click="goCoupon">
            <img src="~assets/images/lq.png" alt srcset />
            <p>领券中心</p>
          </div>
        </div>
      </div>

      <div class="qd" @click="clickQd">
        <img src="~assets/images/qdbtm.png" alt />
      </div>
    </div>

    <!--首发新品-->
    <div class="newGoods wrapper_1200" v-loading="Goodsloading">
      <div class="publicTitle acea-row row-between-wrapper">
        <div class="title acea-row row-middle">
          <ul>
            <li
              v-for="(item, index) in typeList"
              :key="index"
              @click="clickType(item.typeId)"
            >
              <span>{{ item.title }}</span>
              <div class="bgc" v-if="typeI == item.typeId"></div>
            </li>
          </ul>
        </div>
        <!-- <nuxt-link
          :to="{ path: '/goods_list', query: { type: 3 } }"
          class="more acea-row row-center-wrapper"
        >
          更多<span class="iconfont icon-you"></span>
        </nuxt-link>-->
      </div>
      <div v-if="newGoods.length">
        <!-- newGoods -->
        <div v-if="!(typeI == 5)" class="list acea-row row-middle">
          <div
            class="item"
            v-for="(item, index) in newGoods"
            :key="index"
            @click="goDetail(item.goods_id)"
            style="min-height: 400px"
          >
            <div class="pictrue">
              <img
                v-lazy="imgUrl + item.goods_image.split(',')[0]"
                v-if="item.goods_image"
              />
              <img src="~assets/images/no_goods.jpg" alt v-else />
              <div class="newTag" v-show="typeI == '2'">新品</div>
            </div>
            <div style="padding: 0 15px">
              <div class="name line1">{{ item.goods_name }}</div>

              <div class="kc">
                <span>库存：{{ item.goods_stock }}</span>
                <span> 起订：{{ item.min_buy }} </span>
              </div>
              <div class="kc">
                <span>产地：{{ item.address }}</span>
              </div>
              <div class="kc">
                <span>生产企业：{{ item.business }} </span>
              </div>
              <div class="kc">
                <span>执行标准：{{ item.execu_content.title }}</span>
              </div>

              <div class="jbq" @click.stop.prevent v-if="userInfo.show_price">
                <el-input-number
                  v-if="item.goods_stock"
                  v-model="item.num"
                  size="mini"
                  @keyup.native="number_change($event)"
                  :min="0"
                ></el-input-number>
                <div class="noStock" v-else>库存不足</div>
              </div>

              <div class="stock" v-if="userInfo.show_price">
                <p>
                  <span>{{ showPrice(item) }}</span>
                  /{{ item.unit }}
                </p>

                <img
                  v-if="item.goods_stock"
                  @click.stop.prevent="addCart(item)"
                  src="~assets/images/card.png"
                  alt
                />
              </div>
            </div>
          </div>
        </div>

        <div v-if="typeI == 5" class="list acea-row row-middle">
          <div
            class="item"
            v-for="(item, index) in newGoods"
            :key="index"
            @click="goPackageDetails(item.bl_id)"
            style="height: 350px"
          >
            <div class="pictrue">
              <img v-lazy="imgUrl + item.image" v-if="item.image" />
              <img src="~assets/images/no_goods.jpg" alt v-else />
            </div>
            <div style="padding: 0 15px">
              <div class="name line1">{{ item.bl_name }}</div>
              <!-- <div class="package">
              <span>规格:20g+12g+40g+56g</span>
            </div> -->
              <div class="kc">
                <div v-if="item.shipping_fee_type == 0">运费：自费</div>
                <div v-if="item.shipping_fee_type == 1">运费：包邮</div>
                <!-- <span>
                起订：{{ item.min_buy }}
                {{item.unit}}
              </span> -->
              </div>
              <!-- <div class="jbq" @click.stop.prevent>
              <el-input-number
                v-model="item.num"
                size="mini"
                @keyup.native="number_change($event)"
                :min="item.min_buy"
              ></el-input-number>
            </div> -->

              <div class="stock" v-if="userInfo.show_price">
                <p>
                  <span>￥{{ item.bl_price }}</span>
                  <!-- /{{ item.unit }} -->
                </p>
                <div class="originalPrice">原价¥{{ item.goods_money }}</div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="nothing" v-if="!newGoods.length">
        <img src="@/assets/images/noGoods.png" />
        暂无商品，去看点别的吧
      </div>
    </div>

    <!-- 分页 -->
    <Page
      @currentChange="currentChange"
      :total="total"
      :currentPage="pagequery.page"
      :pageSize="pagequery.limit"
      v-if="newGoods.length"
    ></Page>
    <!-- 签到 -->

    <Sign
      :signVisible.sync="signVisible"
      v-if="signVisible"
      :Signloading.sync="Signloading"
    ></Sign>
    <!-- 下拉加载更多 -->
    <!-- <div
      class="loadingicon acea-row row-center-wrapper"
      v-if="classifyList.length && classifyList.length >= limit"
    >
      <span class="loading iconfont icon-jiazai" v-if="!pullRefreshss"></span
      >{{ title }}
    </div>-->
  </div>
</template>

<script>
import Setting from "~/setting";
import Sign from "@/components/sign.vue";
import countDown from "@/components/countDown";
export default {
  name: "index",
  auth: false,
  components: {
    countDown,
    Sign,
  },
  data() {
    return {
      imgUrl: Setting.uplodBaseURL,
      signVisible: false,
      Signloading: false,
      isSignin: localStorage.getItem("token") ? true : false,
      userInfo: {},
      isSign: false,
      Goodsloading: false,
      num: 0,
      typeI: 1,
      pagequery: { page: 1, limit: 8 },
      total: 0,

      typeList: [
        { title: "为你推荐", typeId: 1 },
        { title: "新品首发", typeId: 2 },
        { title: "套餐组合", typeId: 5 },
      ],
      seen: false,
      current: -1,
      swiperData: [],
      categoryList: [],
      categoryCurrent: [],
      datatime: 0,
      dataStatus: 0,
      currentTime: "00:00",
      seckillList: [],
      boutiqueOne: {},
      boutiqueTwo: [],
      newGoods: [],
      classifyList: [], //初始数据代码
      pullRefreshss: true,
      page: 1, //代表页面的初始页数
      limit: 8,
      scollY: null, // 离底部距离有多少
      pageTotal: 0, //总页数
      title: "下拉加载更多",
      swiperOption: {
        pagination: {
          el: ".paginationBanner",
          clickable: true,
        },
        navigation: {
          nextEl: ".swiper-button-next",
          prevEl: ".swiper-button-prev",
        },
        autoplay: {
          disableOnInteraction: false,
          delay: 5000,
        },
        loop: true,
        speed: 1000,
        observer: true,
        observeParents: true,
      },
      swiperScroll: {
        navigation: {
          nextEl: ".swiper-button-next",
          prevEl: ".swiper-button-prev",
        },
        freeMode: true,
        freeModeMomentum: false,
        slidesPerView: "auto",
        observer: true,
        observeParents: true,
      },
      typeI: 0,
      //消息
      msglist: [],
      // 置顶消息
      topMsg: [],
    };
  },
  async asyncData({ app }) {
    let [bannerMsg, commodityMsg, commodityTree] = await Promise.all([
      app.$axios.post("/adv/advhomepcbannerlist"), //轮播图
      app.$axios.post("/goodssku/pagecomponents", {
        page: 1,
        page_size: 8,
        cate_name: 1,
        province_name: "成都",
      }), //为你推荐
      app.$axios.post("/goodscategory/tree"), //商品分类
      // app.$axios.post("/notice/page"), //公告
    ]);
    commodityMsg.data.list.forEach((item) => {
      item["num"] = 0;
    });
    console.log(bannerMsg);
    return {
      swiperData: bannerMsg.data.data,
      newGoods: [],
      total: [],
      newGoods: commodityMsg.data.list,
      total: commodityMsg.data.count,
      categoryList: commodityTree.data,
    };
  },
  watch: {
    "$store.state.typeI"(newVal, oldVal) {
      this.typeI = newVal;
      //对数据执行操作
      // console.log(newVal, oldVal, "--");
    },
  },
  fetch({ store }) {
    store.commit("isHeader", true);
    store.commit("isFooter", true);
  },
  head() {
    return {
      title: "首页-" + this.$store.state.titleCon,
    };
  },
  created() {
    this.getNoticeList();
    // this.getCopyright();
    this.getIsSign();
    this.getTopMsg();
    // 已登录
    if (this.isSignin) {
      this.userInfo = JSON.parse(localStorage.getItem("userInfo"));
    }
  },
  mounted() {},
  beforeDestroy() {
    window.onscroll = null;
  },
  methods: {
    getCopyright() {
      this.msglist = [];
      this.$axios.post("/config/copyright").then((res) => {
        console.log(res, "copyright");
      });
    },
    getNoticeList() {
      this.msglist = [];
      this.$axios.post("/notice/typelists").then((res) => {
        this.msglist = res.data;
      });
    },
    getTopMsg() {
      this.$axios.post(`/notice/lists`).then((res) => {
        this.topMsg = res.data[0];
      });
    },
    // 是否已签到
    getIsSign() {
      this.$axios
        .post(`/membersignin/issign`)
        .then((res) => {
          // true 已签到 false 未签到
          this.isSign = res.data ? true : false;
        })
        .catch((err) => {});
    },
    // 点击签到
    clickQd() {
      // 未签到 点击签到
      if (!this.isSign) {
        this.$axios
          .post(`/membersignin/signin`)
          .then((res) => {
            this.$message.success("签到成功");

            this.signVisible = true;
          })
          .catch((err) => {
            this.$message.error(err);
          });
      }
      // 已签到
      else {
        this.signVisible = true;
      }
    },
    number_change(e) {
      e.target.value = e.target.value.replace(/[^0-9]/g, "");
    },
    addCart(row) {
      if (row.num < row.min_buy) {
        this.$message({
          message: "最少不低于起订数量",
          type: "warning",
        });
      } else if (row.num == 0) {
        this.$message({
          message: "至少添加一件商品",
          type: "warning",
        });
      } else {
        let { num, sku_id } = { ...row };
        let obj = { num, sku_id };
        this.$axios
          .post(`/cart/add`, obj)
          .then((res) => {
            this.$message({
              message: "成功添加购物车",
              type: "success",
              offset: 100,
            });
          })
          .catch((err) => {
            this.$message.error(err);
          });
      }
    },

    clickType(i) {
      if (this.typeI != i) {
        this.pagequery.page = 1;
      }
      this.typeI = i;
      this.$store.commit("typeIndex", i);
      this.newGoods = [];
      this.Goodsloading = true;
      this.$axios
        .post(`/goodssku/pagecomponents`, {
          page: this.pagequery.page,
          page_size: this.pagequery.limit,
          cate_name: !i ? 1 : i,
          province_name: "成都",
        })
        .then((res) => {
          res.data.list.forEach((item) => {
            item["num"] = 0;
          });
          this.newGoods = res.data.list;
          this.total = res.data.count;
          this.Goodsloading = false;
          console.log(this.newGoods);
        })
        .catch((err) => {
          this.$message.error(err);
          this.Goodsloading = false;
        });
    },
    // 分页
    currentChange(e) {
      this.pagequery.page = e;
      this.clickType(this.typeI);
    },
    jumpTap(url) {
      url = url === undefined ? "" : url;
      if (url.indexOf("http") != -1) {
        location.href = url;
      } else {
        this.$router.push({ path: url });
      }
    },

    goCate() {
      this.$router.push({
        path: "/goods_cate",
        query: {
          current: this.current,
        },
      });
    },

    // 移入商品分类列表时显示分类下商品
    enter(item, index) {
      this.seen = true;
      this.current = index;
      let { category_id } = { ...item };
      let obj = {
        category_id,
        page: this.page,
        page_size: this.limit,
      };
      this.$axios
        .post(`/goodssku/page`, obj)
        .then((res) => {
          this.categoryCurrent = res.data.list;
        })
        .catch((err) => {
          this.$message.error(err);
        });
    },
    leave() {
      this.seen = false;
      this.current = -1;
    },
    getClassifyList() {
      let _this = this,
        currentPage = { page: this.page, limit: this.limit };
      _this.$axios
        .get("/pc/get_category_product", {
          params: currentPage,
        })
        .then(function (res) {
          _this.pageTotal = res.data.count;
          // 请求完成后，把得到的数据拼接到当前dom里面
          _this.classifyList = _this.classifyList.concat(res.data.list);
        })
        .catch(function (err) {
          _this.$message.error(err);
        });
    },
    // 下拉加载ajax
    pullRefresh: function () {
      let _this = this;
      window.onscroll = function () {
        _this.scrollChange();
      };
    },
    scrollChange: function () {
      var _this = this;
      this.scollY =
        this.comsys.getScrollTop() +
        this.comsys.getWindowHeight() -
        this.comsys.getScrollHeight();
      // 把下拉刷新置为false，防止多次请求
      if (this.scollY >= -50) {
        if (this.page > Math.ceil(this.pageTotal / this.limit)) {
          this.title = "已没有更多数据";
          this.pullRefreshss = true;
          return false;
        }
        if (!this.pullRefreshss) {
          return false;
        }
        _this.pullRefreshss = false;
        this.title = "正在加载中....";
        // 加页码数
        this.page++;
        _this.getClassifyList();
      } else {
        // 其他时候把下拉刷新置为true
        _this.pullRefreshss = true;
        this.title = "下拉加载更多";
      }
    },
    goDetail: function (id) {
      this.$router.push({ path: `/goods_detail/${id}` });
    },
    goPackageDetails(id) {
      this.$router.push({
        path: `/packageDetails`,
        query: {
          id,
          isSeckill: false,
          isCollage: false,
          isSetMeal: true,
        },
      });
    },
    goSeckillDetail: function (id, productId, time, status) {
      this.$router.push({
        path: "/goods_seckill_detail",
        query: { id: id, productId: productId, time: time, status: status },
      });
    },
    goDetails(id) {
      this.$router.push({
        path: "/message_details",
        query: { id },
      });
    },
    clickMore(id, isMore) {
      console.log(id, isMore);
      // 查看更多公告类型
      if (isMore) {
        this.$router.push({
          path: "/noticeType",
        });
      }
      // 查询公告类型
      else {
        this.$router.push({
          path: "/message",
          query: {
            id,
          },
        });
      }
    },

    goLuckDraw() {
      this.$router.push({
        path: "/luck_draw",
      });
    },
    goCoupon() {
      this.$router.push({
        path: "/coupon",
      });
    },
    showPrice(data) {
      let price = data.price;
      if (data.discount_price && parseFloat(data.discount_price) < parseFloat(price))
        price = data.discount_price;
      if (data.member_price && parseFloat(data.member_price) < parseFloat(price))
        price = data.member_price;
      return price;
    },
  },
};
</script>

<style scoped lang="scss">
.index {
  .publicTitle {
    margin-top: 60px;
    ul {
      display: flex;
      align-items: center;
      li {
        margin-right: 70px;
        position: relative;
        cursor: pointer;
        span {
          font-size: 22px;
          font-family: PingFangSC-Medium, PingFang SC;
          font-weight: 500;
          color: #333333;
          line-height: 40px;
        }
        .bgc {
          position: absolute;
          bottom: 2px;
          right: -3px;
          z-index: -1;
          width: 100px;
          height: 12px;
          background: linear-gradient(90deg, rgba(0, 224, 253, 0) 0%, #91e5ff 100%);
        }
      }
    }

    .more {
      width: 58px;
      height: 24px;
      border: 1px solid #c6c6c6;
      color: #818181;
      font-size: 12px;
      cursor: pointer;
      .iconfont {
        font-size: 10px;
      }
    }
  }
  .wrapper {
    width: 1200px;
    display: flex;

    height: 380px;
    margin: 0 auto;
    position: relative;
    .qd {
      width: 60px;
      height: 60px;
      background: #00c594;
      border: 1px solid rgba(255, 255, 255, 0.54);
      border-radius: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      position: absolute;
      bottom: -30px;
      right: 380px;
      z-index: 999;
      img {
        width: 30px;
        height: 30px;
      }
    }
    cursor: pointer;
    .banner {
      width: 800px;
      height: 100%;
      .bannerImg {
        width: 100%;
        img {
          width: 100%;
          height: 380px;
        }
      }
      img {
        width: 100%;
        height: 100%;
      }
    }

    .category {
      z-index: 9;
      height: 380px;
      // position: absolute;
      // top: 0;
      // left: 50%;
      // height: 100%;
      // transform: translateX(-50%);
    }
    .sort {
      width: 230px;
      height: 100%;
      overflow-y: scroll;
      // background-color: rgba(0, 0, 0, 0.4);
      background-color: #fff;

      padding: 14px 0;
      .item {
        height: 39px;
        padding: 0 21px;
        .name {
          width: 150px;
          font-size: 16px;
          font-family: PingFangSC-Medium, PingFang SC;
          font-weight: 500;
          color: #222222;
        }
        .iconfont {
          font-size: 10px;
          color: #999;
        }
      }
    }
    ::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }
    ::-webkit-scrollbar-thumb {
      border-radius: 10px;
      background-color: var(--themeColor);
    }
    ::-webkit-scrollbar-track {
      background-color: #ffffff;
    }
    .sortCon {
      position: absolute;
      left: 230px;

      width: 710px;
      height: 100%;
      background-color: #fff;
      box-shadow: 5px 1px 10px rgba(0, 0, 0, 0.2);
      border: 1px solid #f2f2f2;
      border-left: 0;
      border-right: 0;
      padding: 0 5px 20px 29px;
      .title {
        padding-bottom: 8px;
        border-bottom: 1px solid #f1f1f1;
        .font-color {
          padding-bottom: 8px;
          font-size: 16px;
          border-bottom: 2px solid #e93323;
        }
      }
      .erSort {
        overflow-x: hidden;
        overflow-y: auto;
        max-height: 400px;
        .item {
          margin-top: 30px;
          width: 25%;

          &:hover {
            .name {
              color: #e93323;
            }
          }
          .name {
            color: #282828;
            margin-left: 14px;
            width: 82px;
          }
          .pictrue {
            width: 50px;
            height: 50px;
            img {
              width: 100%;
              height: 100%;
            }
          }
        }
      }
    }

    .zbcx {
      width: 260px;
      min-height: 250px;
      background: #ffffff;
      border-radius: 5px;
      margin-left: 30px;
      margin-top: 10px;
      padding: 5px 10px;
      box-shadow: 0px 0px 10px 0px rgba(102, 102, 102, 0.2);
      .titleMgs {
        display: flex;
        align-items: center;
        margin-bottom: 20px;
        img {
          width: 15px;
          height: 18px;
          margin-right: 6px;
        }
        span {
          font-size: 16px;
          font-family: PingFangSC-Medium, PingFang SC;
          font-weight: 500;
          color: #222222;
          line-height: 22px;
        }
      }
      ul {
        .notice {
          width: 1200px;
          height: 100%;
          left: 50%;
          transform: translate(-50%);
          position: absolute;
          z-index: 2;
          padding: 0;
        }
        .notice /deep/ .el-card__body {
          padding: 0;
        }
        /*使文字和公告图片在一行*/
        .notice_item {
          background-color: #fff;
          display: flex;
          flex-direction: row;
          align-items: center;
        }
        .notice_item img {
          width: 40px;
        }

        li {
          font-size: 14px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: #666666;
          line-height: 20px;
          margin-bottom: 10px;
          cursor: pointer;
        }
        .more {
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 14px;
          margin: 10px 0 5px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: #666666;
          line-height: 20px;
          cursor: pointer;
          .el-icon-arrow-right {
            font-size: 16px;
          }
        }
      }
      .cjlq {
        border-top: 1px solid #efefef;
        margin-top: 2px;
        margin-bottom: 10px;
        padding-top: 17px;
        display: flex;
        justify-content: space-between;
        div {
          cursor: pointer;
        }
        img {
          width: 88px;
          height: 88px;
        }
        p {
          font-size: 16px;
          font-family: PingFangSC-Medium, PingFang SC;
          font-weight: 500;
          color: #222222;
          line-height: 22px;
          text-align: center;
          margin-top: 15px;
        }
      }
    }
  }
  .seckill {
    margin-top: 30px;
    .header {
      background: url("../assets/images/skillBg.jpg") no-repeat;
      background-size: 100% 100%;
      width: 208px;
      height: 266px;
      color: #fff;
      text-align: center;
      padding: 44px 0;
      font-size: 16px;
      .title {
        font-size: 28px;
        font-weight: bold;
      }
      .timeCurrent {
        margin-top: 20px;
        span {
          font-weight: bold;
        }
      }
      .lines {
        width: 17px;
        height: 2px;
        background: #ffffff;
        margin: 10px auto 0 auto;
      }
      .tip {
        margin-top: 10px;
      }
      .time {
        margin-top: 20px;
      }
    }
    .seckillList {
      width: 992px;
      height: 266px;
      background-color: #fff;
      position: relative;
      .item {
        cursor: pointer;
        display: inline-block;
        width: 248px;
        min-height: 345px;
        position: relative;
        padding: 21px 0;
        .picTxt {
          width: 164px;
          margin: 0 auto;
        }
        & ~ .item:before {
          content: " ";
          position: absolute;
          width: 1px;
          height: 98px;
          background-color: #f4f4f4;
          top: 50%;
          margin-top: -49px;
        }
        .pictrue {
          width: 164px;
          height: 164px;
          margin: 0 auto;
          img {
            width: 100%;
            height: 100%;
          }
        }
        .name {
          color: #282828;
          text-align: center;
          width: 164px;
          margin: 10px auto 0 auto;
        }
        .money {
          text-align: center;
          width: 164px;
          margin: 12px auto 0 auto;
          .font-color {
            font-weight: bold;
            font-size: 16px;
          }
          .y_money {
            color: #a3a3a3;
            text-decoration: line-through;
            margin-left: 6px;
          }
        }
      }
    }
  }
  .boutique {
    .list {
      margin-top: 14px;
      .oneItem {
        padding: 28px;
        width: 586px;
        height: 250px;
        background: url("../assets/images/boutique1.jpg") no-repeat;
        background-size: 100% 100%;
        cursor: pointer;
        &:hover {
          box-shadow: 0 3px 20px rgba(0, 0, 0, 0.06);
        }
        .text {
          width: 310px;
          .name {
            font-size: 18px;
            color: #282828;
          }
          .info {
            font-size: 16px;
            color: #a3a3a3;
            margin-top: 8px;
          }
          .money {
            margin-top: 26px;
            .font-color {
              font-size: 20px;
              font-weight: bold;
            }
            .y_money {
              color: #a3a3a3;
              margin-left: 12px;
              text-decoration: line-through;
            }
          }
        }
        .pictrue {
          width: 194px;
          height: 194px;
          img {
            width: 100%;
            height: 100%;
          }
        }
      }
      .item {
        width: 287px;
        height: 250px;
        background: url("../assets/images/boutique2.jpg") no-repeat;
        background-size: 100% 100%;
        padding: 28px;
        position: relative;
        margin-left: 20px;
        cursor: pointer;
        &:hover {
          box-shadow: 0 3px 20px rgba(0, 0, 0, 0.06);
        }

        .name {
          font-size: 18px;
        }
        .font-color {
          font-size: 20px;
          font-weight: bold;
          margin-top: 12px;
        }
        .y_money {
          color: #a3a3a3;
          text-decoration: line-through;
          margin-top: 4px;
        }
        .pictrue {
          width: 130px;
          height: 130px;
          position: absolute;
          right: 28px;
          bottom: 28px;
          img {
            width: 100%;
            height: 100%;
          }
        }
      }
    }
  }
  .newGoods {
    .list {
      margin-top: -10px;
      .item {
        width: 260px;
        background-color: #fff;
        cursor: pointer;
        margin: 40px 53px 0px 0;
        box-shadow: 0px 0px 10px 0px rgba(102, 102, 102, 0.2);
        border-radius: 8px;
        overflow: hidden;
        box-sizing: border-box;
        &:hover {
          box-shadow: 0 3px 20px rgba(0, 0, 0, 0.06);
        }

        .pictrue {
          width: 100%;
          height: 202px;
          position: relative;
          img {
            width: 100%;
            height: 100%;
          }
          .newTag {
            color: white;
            width: 60px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            background: #ff7d02;
            position: absolute;
            top: 0px;
            left: 0px;
            border-bottom-right-radius: 15px;
          }
        }
        .package {
          width: 230px;
          height: 30px;
          background: #d8f6ff;
          border-radius: 3px;
          line-height: 30px;
          span {
            width: 142px;
            height: 17px;
            font-size: 12px;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #222222;
            padding-left: 10px;
          }
        }
        .name {
          margin-top: 10px;
          font-size: 16px;
          font-family: PingFangSC-Medium, PingFang SC;
          font-weight: 500;
          color: #222222;
          line-height: 28px;
        }
        .kc {
          margin-top: 10px;

          span {
            font-size: 13px;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #666666;
            line-height: 20px;
            margin-right: 20px;
          }
        }
        .jbq {
          margin-top: 10px;

          /deep/ .el-input-number {
            .el-input-number__decrease {
              width: 26px;
              height: 26px;
              border: none;
              border-radius: 16px;
              background: #d8f6ff;
              .el-icon-minus {
                color: var(--themeColor);
                font-weight: 900;
              }
            }
            .el-input-number__increase {
              width: 26px;
              height: 26px;
              border: none;
              border-radius: 16px;
              background: var(--themeColor);
              .el-icon-plus {
                color: #fff;
                font-weight: 900;
              }
            }
            .el-input {
              .el-input__inner {
                border: none;
              }
            }
          }
          .noStock {
            color: #666666;
            height: 28px;
            font-size: 13px;
            font-family: PingFangSC-Regular, PingFang SC;
          }
        }
        .stock {
          display: flex;
          justify-content: space-between;
          align-items: center;
          margin: 10px 0;
          img {
            width: 24px;
            height: 24px;
          }

          p {
            font-size: 12px;
            font-family: PingFangSC-Medium, PingFang SC;
            font-weight: 500;
            color: #999;
            span {
              font-size: 18px;
              font-family: PingFangSC-Medium, PingFang SC;
              font-weight: 500;
              color: #ff1d1d;

              line-height: 25px;
            }
          }
          .originalPrice {
            color: #999999;
            text-decoration: line-through;
          }
        }
      }
      .item:nth-of-type(4n) {
        margin-right: 0px;
      }
    }
  }
  .classify {
    width: 1250px;
    .list {
      margin-top: 30px;
      .title {
        .name {
          font-size: 22px;
          color: #333333;
          font-weight: bold;
        }
        .more {
          width: 58px;
          height: 24px;
          border: 1px solid #c6c6c6;
          font-size: 12px;
          color: #818181;
          margin-right: 50px;
          cursor: pointer;
          .iconfont {
            font-size: 10px;
          }
        }
      }
      .itemOne {
        width: 468px;
        height: 340px;
        margin: 20px 20px 0 0;
        cursor: pointer;
        &:hover {
          box-shadow: 0 3px 20px rgba(0, 0, 0, 0.06);
        }

        img {
          width: 100%;
          height: 100%;
        }
      }
      .item {
        width: 224px;
        height: 340px;
        background-color: #fff;
        padding: 16px;
        margin: 20px 20px 0 0;
        cursor: pointer;
        &:hover {
          box-shadow: 0 3px 20px rgba(0, 0, 0, 0.06);
        }

        .pictrue {
          width: 192px;
          height: 192px;
          img {
            width: 100%;
            height: 100%;
          }
        }
        .money {
          margin-top: 12px;
          .font-color {
            font-size: 22px;
            font-weight: bold;
          }
          .y_money {
            color: #aaaaaa;
            font-size: 12px;
            text-decoration: line-through;
            margin-left: 8px;
          }
          .label {
            width: 20px;
            height: 20px;
            background: linear-gradient(
              330deg,
              rgba(231, 85, 67, 0.15) 0%,
              rgba(244, 103, 83, 0.15) 100%
            );
            font-size: 12px;
            text-align: center;
            line-height: 20px;
          }
        }
        .name {
          margin-top: 8px;
          color: #5a5a5a;
          height: 37px;
        }
        .payment {
          font-size: 12px;
          color: #aaaaaa;
          margin-top: 10px;
        }
      }
    }
  }
  .nothing {
    padding-top: 200px;
    padding-bottom: 150px;
    font-size: 16px;
    text-align: center;
    color: #969696;

    img {
      margin: 0 auto;
    }
  }
}
</style>
