|
@@ -3,9 +3,7 @@
|
|
|
<div class="container">
|
|
|
<el-row class="mt2rem" :gutter="20">
|
|
|
<el-col :span="4">
|
|
|
- <category
|
|
|
- @change="({ id, pid }) => $router.push(`/mall/-${id}-${pid}`)"
|
|
|
- />
|
|
|
+ <category @change="id => $router.push(`/mall/-${id}`)" />
|
|
|
</el-col>
|
|
|
<el-col :span="14">
|
|
|
<el-carousel class="bannerD marquee">
|
|
@@ -18,7 +16,7 @@
|
|
|
<user-info />
|
|
|
<div class="noticeDiv">
|
|
|
<div class="noticeTitle">
|
|
|
- 通知公告
|
|
|
+ {{ $t("page.views.home.noticeTitle") }}
|
|
|
<router-link to="/news">
|
|
|
<span class="more"
|
|
|
>more<i class="el-icon-d-arrow-right"></i
|
|
@@ -33,7 +31,9 @@
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <div class="partTitle"><span class="orangeLine"></span>服务能力</div>
|
|
|
+ <div class="partTitle">
|
|
|
+ <span class="orangeLine"></span> {{ $t("page.views.home.fwTitle") }}
|
|
|
+ </div>
|
|
|
<div class="fwnl">
|
|
|
<div
|
|
|
class="fwnlItem"
|
|
@@ -46,7 +46,7 @@
|
|
|
</div>
|
|
|
<div class="titleDiv">
|
|
|
<span>{{ num }}</span>
|
|
|
- {{ text }}
|
|
|
+ {{ $t(text) }}
|
|
|
</div>
|
|
|
<div class="line" v-if="index < fwList.length - 1"></div>
|
|
|
</div>
|
|
@@ -56,60 +56,79 @@
|
|
|
<img src="@assets/home_ggw1.png" alt />
|
|
|
</div>
|
|
|
<div class="partTitle">
|
|
|
- <span class="orangeLine"></span>产品中心
|
|
|
+ <span class="orangeLine"></span>{{ $t("page.views.home.productTitle") }}
|
|
|
<router-link to="/mall">
|
|
|
<span class="more">more<i class="el-icon-d-arrow-right"></i></span>
|
|
|
</router-link>
|
|
|
</div>
|
|
|
- <div class="categoryList bg-F5">
|
|
|
- <el-carousel
|
|
|
- :autoplay="false"
|
|
|
- arrow="always"
|
|
|
- indicator-position="none"
|
|
|
- ref="carousel"
|
|
|
- class=" marquee"
|
|
|
- >
|
|
|
- <el-carousel-item
|
|
|
- v-for="(items, index) in categoryList"
|
|
|
- :key="`carousel-categoryList-${index}`"
|
|
|
- >
|
|
|
- <div
|
|
|
- v-for="({ title, remake, id }, index) in items"
|
|
|
- :key="`categoryList${index}`"
|
|
|
- class="item"
|
|
|
- :class="{ curr: params.typeId === id }"
|
|
|
- @click="params.typeId = params.typeId === id ? 0 : id"
|
|
|
+ <div class="categoryList">
|
|
|
+ <el-row class="dalei">
|
|
|
+ <el-col :span="2">
|
|
|
+ <div class="slide left">
|
|
|
+ <img src="@assets/slideLeft.png" @click="prev" />
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="20">
|
|
|
+ <el-carousel
|
|
|
+ :autoplay="false"
|
|
|
+ arrow="never"
|
|
|
+ indicator-position="none"
|
|
|
+ ref="carousel"
|
|
|
+ class="marquee"
|
|
|
>
|
|
|
- <div class="img">
|
|
|
- <img :src="`${$basePath}${remake}`" alt="" srcset="" />
|
|
|
- </div>
|
|
|
- <h3>{{ title }}</h3>
|
|
|
+ <el-carousel-item
|
|
|
+ v-for="(arr, index) in categoryList"
|
|
|
+ :key="`carousel-list-${index}`"
|
|
|
+ >
|
|
|
+ <el-row class="items">
|
|
|
+ <el-col
|
|
|
+ :span="4"
|
|
|
+ class="item"
|
|
|
+ :class="{ curr: cIndex === index * 6 + i }"
|
|
|
+ @click.native="cIndex = index * 6 + i"
|
|
|
+ v-for="({ title, remake }, i) in arr"
|
|
|
+ :key="`carousel-list-item-${i}`"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <img :src="`${$basePath}${remake}`" alt />
|
|
|
+
|
|
|
+ <div>{{ title }}</div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-carousel-item>
|
|
|
+ </el-carousel>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ <div class="slide right">
|
|
|
+ <img src="@assets/slideRight.png" @click="next" />
|
|
|
</div>
|
|
|
- </el-carousel-item>
|
|
|
- </el-carousel>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div class="xiaolei">
|
|
|
+ <div
|
|
|
+ class="item"
|
|
|
+ v-for="({ title, remake, id }, index) in currCategorySub"
|
|
|
+ :key="`categoryList-xiaolei-${index}`"
|
|
|
+ @click="() => $router.push(`/mall/-${id}`)"
|
|
|
+ >
|
|
|
+ <div class="img">
|
|
|
+ <img :src="`${$basePath}${remake}`" alt />
|
|
|
+ </div>
|
|
|
+ <div class="tit">{{ title }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="categoryMore"
|
|
|
+ v-if="categorySub.length > 10 && !categoryMore"
|
|
|
+ @click="categoryMore = true"
|
|
|
+ >
|
|
|
+ <span>更多分类</span>
|
|
|
+ <img src="@assets/more.png" alt />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
- <load-more
|
|
|
- class="productList"
|
|
|
- url="/goods/info/page"
|
|
|
- pageType="increase"
|
|
|
- :params="params"
|
|
|
- v-slot="{
|
|
|
- item: { id, name, companyId, price, cover, companyName }
|
|
|
- }"
|
|
|
- >
|
|
|
- <router-link :to="`/shop/${companyId}/${id}`" class="product">
|
|
|
- <div class="imgDiv">
|
|
|
- <img :src="`${$basePath}${cover}`" />
|
|
|
- </div>
|
|
|
- <a :title="name" class="name">{{ name }}</a>
|
|
|
- <div class="money">
|
|
|
- ¥
|
|
|
- <span>{{ price }}</span>
|
|
|
- </div>
|
|
|
- <div class="company ">{{ companyName }}</div>
|
|
|
- </router-link>
|
|
|
- </load-more>
|
|
|
<el-row :gutter="20">
|
|
|
<el-col
|
|
|
:span="12"
|
|
@@ -119,12 +138,9 @@
|
|
|
>
|
|
|
<div class="partTitle">
|
|
|
<span class="orangeLine"></span
|
|
|
- >{{ index ? "热门商品" : "新品推荐" }}
|
|
|
- <router-link :to="`/mall`">
|
|
|
- <span class="more"
|
|
|
- >more<i class="el-icon-d-arrow-right"></i
|
|
|
- ></span>
|
|
|
- </router-link>
|
|
|
+ >{{
|
|
|
+ $t(`page.views.home.${index ? "hotProducts" : "newsProducts"}`)
|
|
|
+ }}
|
|
|
</div>
|
|
|
|
|
|
<router-link
|
|
@@ -147,7 +163,7 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<div class="partTitle ppsj">
|
|
|
- <span class="orangeLine"></span>品牌商家
|
|
|
+ <span class="orangeLine"></span>{{ $t("page.views.home.ppTitle") }}
|
|
|
<router-link to="/shops" class="more"
|
|
|
>more<i class="el-icon-d-arrow-right"></i
|
|
|
></router-link>
|
|
@@ -165,11 +181,15 @@
|
|
|
<img :src="`${$basePath}${defaultImgUrl}`" alt />
|
|
|
</div>
|
|
|
<div class="name">{{ companyName }}</div>
|
|
|
- <div class="company">主营商品:{{ primaryBusiness }}</div>
|
|
|
+ <div class="company">
|
|
|
+ {{ $t("page.views.home.primaryBusiness") }}:{{ primaryBusiness }}
|
|
|
+ </div>
|
|
|
</router-link>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="partTitle"><span class="orangeLine"></span>需求供应</div>
|
|
|
+ <div class="partTitle">
|
|
|
+ <span class="orangeLine"></span>{{ $t("page.views.home.xqTitle") }}
|
|
|
+ </div>
|
|
|
<div class="xqgy">
|
|
|
<template v-for="(info, index) in infos">
|
|
|
<div :key="`info${index}`" class="xqDiv">
|
|
@@ -179,7 +199,7 @@
|
|
|
require(`@assets/${index ? 'gongyingshang' : 'xuqiu'}.png`)
|
|
|
"
|
|
|
alt
|
|
|
- />{{ index ? "供应商" : "需求" }}
|
|
|
+ />{{ $t(`page.views.home.${index ? "gys" : "xq"}`) }}
|
|
|
<router-link :to="`/info/${index}`">
|
|
|
<span class="more"
|
|
|
>more<i class="el-icon-d-arrow-right"></i
|
|
@@ -194,7 +214,7 @@
|
|
|
>
|
|
|
<div class="xq">
|
|
|
<div class="con">
|
|
|
- 【{{ index ? "供应" : "求购" }}】{{
|
|
|
+ 【{{ $t(`page.views.home.${index ? "gy" : "qg"}`) }}】{{
|
|
|
index ? item.supplyTitle : item.purchaseTitle
|
|
|
}}
|
|
|
</div>
|
|
@@ -219,7 +239,7 @@
|
|
|
>
|
|
|
<div class="partTitle">
|
|
|
<span class="orangeLine"></span
|
|
|
- >{{ index ? "家具保养" : "行业资讯" }}
|
|
|
+ >{{ $t(`page.views.home.${index ? "furniture" : "industry"}`) }}
|
|
|
<router-link :to="`/news/${index + 1}`">
|
|
|
<span class="more"
|
|
|
>more<i class="el-icon-d-arrow-right"></i
|
|
@@ -259,41 +279,26 @@
|
|
|
import { Component, Vue, Watch, Prop } from "vue-property-decorator";
|
|
|
import menu from "@/store/modules/menu";
|
|
|
import { chunk } from "lodash";
|
|
|
+import i18n from "@/lang";
|
|
|
+import { ElCarousel } from "element-ui/types/carousel";
|
|
|
@Component
|
|
|
export default class extends Vue {
|
|
|
private params = {
|
|
|
typeId: 0
|
|
|
};
|
|
|
+ private cIndex = 0;
|
|
|
+ private categoryMore = false;
|
|
|
private products: IAny[][] = [];
|
|
|
private notices: IAny[] = [];
|
|
|
private infos: IAny[] = [];
|
|
|
private shops: IAny[] = [];
|
|
|
- private fwList: Array<{
|
|
|
- img: string;
|
|
|
- num: number;
|
|
|
- text: string;
|
|
|
- }> = [
|
|
|
- {
|
|
|
- img: "qiyeruzhu",
|
|
|
- num: 0,
|
|
|
- text: "家钢制家具生产企业入驻"
|
|
|
- },
|
|
|
- {
|
|
|
- img: "chanpin",
|
|
|
- num: 0,
|
|
|
- text: "个钢制家具产品入驻"
|
|
|
- },
|
|
|
- {
|
|
|
- img: "huiyuan",
|
|
|
- num: 0,
|
|
|
- text: "位平台会员注册"
|
|
|
- },
|
|
|
- {
|
|
|
- img: "yingyee",
|
|
|
+ private fwList = "qiyeruzhu,chanpin,huiyuan,yingyee"
|
|
|
+ .split(",")
|
|
|
+ .map((img, index) => ({
|
|
|
+ img,
|
|
|
num: 0,
|
|
|
- text: "万在线电商营业额"
|
|
|
- }
|
|
|
- ];
|
|
|
+ text: `page.views.home.fwListText${++index}`
|
|
|
+ }));
|
|
|
async created() {
|
|
|
const arr = `/goods/info/hotlist,
|
|
|
/demand/info/getDemandInfoTenList,
|
|
@@ -329,6 +334,20 @@ export default class extends Vue {
|
|
|
get categoryList() {
|
|
|
return chunk(menu.pList, 6);
|
|
|
}
|
|
|
+ get categorySub() {
|
|
|
+ if (!menu.pList.length) return [];
|
|
|
+ return menu.subList(menu.pList[this.cIndex].id);
|
|
|
+ }
|
|
|
+ get currCategorySub() {
|
|
|
+ return this.categoryMore ? this.categorySub : this.categorySub.slice(0, 10);
|
|
|
+ }
|
|
|
+
|
|
|
+ prev() {
|
|
|
+ (this.$refs.carousel as ElCarousel).prev();
|
|
|
+ }
|
|
|
+ next() {
|
|
|
+ (this.$refs.carousel as ElCarousel).next();
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|
|
@@ -371,43 +390,103 @@ export default class extends Vue {
|
|
|
}
|
|
|
}
|
|
|
.categoryList {
|
|
|
- height: 100px;
|
|
|
overflow: hidden;
|
|
|
- margin-bottom: 20px;
|
|
|
- .item {
|
|
|
- width: 180px;
|
|
|
- height: 100%;
|
|
|
- float: left;
|
|
|
- overflow: hidden;
|
|
|
- box-sizing: border-box;
|
|
|
- background: #fff;
|
|
|
- padding: 10px;
|
|
|
- margin-left: 16px;
|
|
|
- &:first-child {
|
|
|
- margin-left: 0;
|
|
|
+ margin-bottom: 30px;
|
|
|
+ background: #fff;
|
|
|
+ .dalei {
|
|
|
+ height: 108px;
|
|
|
+ border-bottom: 1px solid #f5f5f5;
|
|
|
+ > div {
|
|
|
+ height: 100%;
|
|
|
}
|
|
|
- &.curr {
|
|
|
- border: 1px solid red;
|
|
|
+ .items {
|
|
|
+ height: 100%;
|
|
|
+ .item {
|
|
|
+ height: 100%;
|
|
|
+ position: relative;
|
|
|
+ cursor: pointer;
|
|
|
+ &.curr {
|
|
|
+ border-bottom: 2px solid #ff3800;
|
|
|
+ }
|
|
|
+ > div {
|
|
|
+ text-align: center;
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- .img {
|
|
|
- height: 60px;
|
|
|
+ .slide {
|
|
|
+ margin-top: 29px;
|
|
|
position: relative;
|
|
|
- cursor: pointer;
|
|
|
+ height: 50px;
|
|
|
+ &.left {
|
|
|
+ border-right: 1px solid #f5f5f5;
|
|
|
+ }
|
|
|
+ &.right {
|
|
|
+ border-left: 1px solid #f5f5f5;
|
|
|
+ }
|
|
|
img {
|
|
|
+ text-align: center;
|
|
|
position: absolute;
|
|
|
- left: 50%;
|
|
|
top: 50%;
|
|
|
+ left: 50%;
|
|
|
transform: translate(-50%, -50%);
|
|
|
- max-width: 80%;
|
|
|
- max-height: 80%;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
- h3 {
|
|
|
- line-height: 20px;
|
|
|
- text-align: center;
|
|
|
- font-size: 16px;
|
|
|
+ }
|
|
|
+ .xiaolei {
|
|
|
+ overflow: hidden;
|
|
|
+ padding: 30px;
|
|
|
+ padding-bottom: 10px;
|
|
|
+ .item {
|
|
|
+ height: 250px;
|
|
|
+ width: 202px;
|
|
|
+ cursor: pointer;
|
|
|
+ float: left;
|
|
|
+ border: 1px solid #e5e5e5;
|
|
|
+ margin-right: 20px;
|
|
|
+ border-radius: 6px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ &:nth-child(5n + 5) {
|
|
|
+ margin-right: 0;
|
|
|
+ }
|
|
|
+ &:hover {
|
|
|
+ border: 1px solid #ff3700;
|
|
|
+ color: #ff3700;
|
|
|
+ .tit {
|
|
|
+ background: #ffdbd0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .img {
|
|
|
+ height: 200px;
|
|
|
+ position: relative;
|
|
|
+ img {
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ max-width: 80%;
|
|
|
+ max-height: 80%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .tit {
|
|
|
+ height: 50px;
|
|
|
+ line-height: 50px;
|
|
|
+ background: #f5f5f5;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ .categoryMore {
|
|
|
+ color: #999999;
|
|
|
+ text-align: center;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ font-size: 12px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
}
|
|
|
.partTitle {
|
|
|
padding: 3rem 0 2rem 0;
|