|
|
@ -42,9 +42,11 @@
|
|
|
|
v-for="(item, index) in recommendArray"
|
|
|
|
v-for="(item, index) in recommendArray"
|
|
|
|
:key="index"
|
|
|
|
:key="index"
|
|
|
|
@click="onJumpGoodsDetail(item.id)"
|
|
|
|
@click="onJumpGoodsDetail(item.id)"
|
|
|
|
class="recommend-products-right__item"
|
|
|
|
class="recommend-products-right__item flex flex-column"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<strong class="home-pick-recommend--title">{{ item.title }}</strong>
|
|
|
|
<strong class="home-pick-recommend--title2">{{
|
|
|
|
|
|
|
|
item.title
|
|
|
|
|
|
|
|
}}</strong>
|
|
|
|
<p class="home-pick-recommend--subtitle">
|
|
|
|
<p class="home-pick-recommend--subtitle">
|
|
|
|
{{ recommendGoodsOne.subtitle }}
|
|
|
|
{{ recommendGoodsOne.subtitle }}
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
@ -68,43 +70,70 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 新品上架 -->
|
|
|
|
<!-- 新品上架 -->
|
|
|
|
<div v-if="showNew" class="home-pick-new">
|
|
|
|
<div v-if="showNew" class="home-pick-recommend">
|
|
|
|
<div class="home-pick--label flex flex-middle">
|
|
|
|
<div class="home-pick--label flex flex-middle">
|
|
|
|
<strong>新品上架</strong>
|
|
|
|
<strong>新品上架</strong>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="home-pick-new__products flex">
|
|
|
|
<div class="home-pick-recommend__products flex flex-middle flex-between">
|
|
|
|
<!-- 左侧商品 -->
|
|
|
|
<!-- 左侧商品一 -->
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
@click="onJumpGoodsDetail(newGoodsOne.id)"
|
|
|
|
@click="onJumpGoodsDetail(newGoodsOne.id)"
|
|
|
|
class="pick-new-products__left"
|
|
|
|
class="pick-recommend-products__left"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
<strong class="home-pick-recommend--title">
|
|
|
|
:src="newGoodsOne.mainPicture"
|
|
|
|
{{ newGoodsOne.name }}
|
|
|
|
class="new-products-left__cover"
|
|
|
|
</strong>
|
|
|
|
/>
|
|
|
|
<!-- 商品标签 -->
|
|
|
|
<div class="new-products-left__wrap">
|
|
|
|
<div
|
|
|
|
<p>{{ newGoodsOne.name }}</p>
|
|
|
|
v-for="item in newGoodsOne.labelList"
|
|
|
|
<strong class="home-pick--price__16">{{
|
|
|
|
:key="item.code"
|
|
|
|
newGoodsOne.startingPrice
|
|
|
|
class="home-pick-recommend--tag-wrap flex"
|
|
|
|
}}</strong>
|
|
|
|
>
|
|
|
|
|
|
|
|
<div :class="`tag-wrap__item tag-wrap__item--${item.code}`">
|
|
|
|
|
|
|
|
{{ item.text }}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<p class="home-pick-recommend--subtitle">
|
|
|
|
|
|
|
|
{{ newGoodsOne.subtitle }}
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<strong class="home-pick--price__18">{{
|
|
|
|
|
|
|
|
newGoodsOne.startingPrice
|
|
|
|
|
|
|
|
}}</strong>
|
|
|
|
|
|
|
|
<div class="recommend-products-left__cover">
|
|
|
|
|
|
|
|
<img :src="newGoodsOne.mainPicture" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="pick-new-products__right flex flex-wrap flex-between">
|
|
|
|
<!-- 右侧商品 -->
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="pick-recommend-products__right flex flex-column flex-between"
|
|
|
|
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-for="(item, index) in newArray"
|
|
|
|
v-for="(item, index) in newArray"
|
|
|
|
:key="index"
|
|
|
|
:key="index"
|
|
|
|
@click="onJumpGoodsDetail(item.id)"
|
|
|
|
@click="onJumpGoodsDetail(item.id)"
|
|
|
|
class="new-products-right__wrap flex flex-middle"
|
|
|
|
class="recommend-products-right__item flex flex-column"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div class="products-right-wrap__cover">
|
|
|
|
<strong class="home-pick-recommend--title2">{{ item.name }}</strong>
|
|
|
|
<img :src="item.mainPicture" />
|
|
|
|
<p class="home-pick-recommend--subtitle">
|
|
|
|
|
|
|
|
{{ item.subtitle }}
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<!-- 商品标签 -->
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
v-for="itemLabel in item.labelList"
|
|
|
|
|
|
|
|
:key="itemLabel.code"
|
|
|
|
|
|
|
|
class="home-pick-recommend--tag-wrap flex"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div :class="`tag-wrap__item tag-wrap__item--${itemLabel.code}`">
|
|
|
|
|
|
|
|
{{ itemLabel.text }}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="products-right-wrap__info">
|
|
|
|
<strong class="home-pick--price__18">{{
|
|
|
|
<p>{{ item.name }}</p>
|
|
|
|
item.startingPrice
|
|
|
|
<strong class="home-pick--price__14">{{
|
|
|
|
}}</strong>
|
|
|
|
item.startingPrice
|
|
|
|
<div class="recommend-products-right__cover flex-1">
|
|
|
|
}}</strong>
|
|
|
|
<img :src="item.mainPicture" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -114,7 +143,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
const RECOMMEND_MIN_COUNT = 3; // 甄选推荐商品数
|
|
|
|
const RECOMMEND_MIN_COUNT = 3; // 甄选推荐商品数
|
|
|
|
const NEW_MIN_COUNT = 5; // 新品上架商品数
|
|
|
|
const NEW_MIN_COUNT = 3; // 新品上架商品数
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "HomePick",
|
|
|
|
name: "HomePick",
|
|
|
@ -156,6 +185,7 @@ export default {
|
|
|
|
deep: true,
|
|
|
|
deep: true,
|
|
|
|
handler(val) {
|
|
|
|
handler(val) {
|
|
|
|
if (val && val.length >= NEW_MIN_COUNT) {
|
|
|
|
if (val && val.length >= NEW_MIN_COUNT) {
|
|
|
|
|
|
|
|
console.log("新品上架", val);
|
|
|
|
this.showNew = true;
|
|
|
|
this.showNew = true;
|
|
|
|
this.newGoodsOne = val[0];
|
|
|
|
this.newGoodsOne = val[0];
|
|
|
|
this.newArray = val.slice(1, NEW_MIN_COUNT);
|
|
|
|
this.newArray = val.slice(1, NEW_MIN_COUNT);
|
|
|
@ -176,7 +206,7 @@ export default {
|
|
|
|
margin-top: 30px;
|
|
|
|
margin-top: 30px;
|
|
|
|
&--label {
|
|
|
|
&--label {
|
|
|
|
font-size: 24px;
|
|
|
|
font-size: 24px;
|
|
|
|
margin-bottom: 16px;
|
|
|
|
margin-bottom: 30px;
|
|
|
|
img {
|
|
|
|
img {
|
|
|
|
width: 16px;
|
|
|
|
width: 16px;
|
|
|
|
height: 16px;
|
|
|
|
height: 16px;
|
|
|
@ -185,6 +215,7 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&--price {
|
|
|
|
&--price {
|
|
|
|
&__18 {
|
|
|
|
&__18 {
|
|
|
|
|
|
|
|
margin-top: auto;
|
|
|
|
font-size: 18px;
|
|
|
|
font-size: 18px;
|
|
|
|
color: #ff512b;
|
|
|
|
color: #ff512b;
|
|
|
|
&::before {
|
|
|
|
&::before {
|
|
|
@ -211,10 +242,9 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-pick-recommend {
|
|
|
|
.home-pick-recommend {
|
|
|
|
width: 590px;
|
|
|
|
width: 50%;
|
|
|
|
min-height: 340px;
|
|
|
|
min-height: 340px;
|
|
|
|
padding: 16px 20px 20px;
|
|
|
|
padding: 16px 20px 20px;
|
|
|
|
background: #ffffff;
|
|
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
border-radius: 4px;
|
|
|
|
&--tag-wrap {
|
|
|
|
&--tag-wrap {
|
|
|
|
margin-bottom: 8px;
|
|
|
|
margin-bottom: 8px;
|
|
|
@ -240,7 +270,14 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&--title {
|
|
|
|
&--title {
|
|
|
|
display: block;
|
|
|
|
display: block;
|
|
|
|
width: 140px;
|
|
|
|
width: 200px;
|
|
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
|
|
margin-bottom: 6px;
|
|
|
|
|
|
|
|
@include ellipsis;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
&--title2 {
|
|
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
|
|
width: 150px;
|
|
|
|
font-size: 16px;
|
|
|
|
font-size: 16px;
|
|
|
|
margin-bottom: 6px;
|
|
|
|
margin-bottom: 6px;
|
|
|
|
@include ellipsis;
|
|
|
|
@include ellipsis;
|
|
|
@ -251,18 +288,25 @@ export default {
|
|
|
|
margin-bottom: 8px;
|
|
|
|
margin-bottom: 8px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&__products {
|
|
|
|
&__products {
|
|
|
|
height: 264px;
|
|
|
|
// height: 264px;
|
|
|
|
cursor: pointer;
|
|
|
|
cursor: pointer;
|
|
|
|
.pick-recommend-products__left {
|
|
|
|
.pick-recommend-products__left {
|
|
|
|
position: relative;
|
|
|
|
position: relative;
|
|
|
|
width: 264px;
|
|
|
|
width: 292px;
|
|
|
|
height: 100%;
|
|
|
|
height: 302px;
|
|
|
|
background: #f8f8f9;
|
|
|
|
background: #fff;
|
|
|
|
padding: 12px 0 0 20px;
|
|
|
|
padding: 20px;
|
|
|
|
|
|
|
|
margin-right: 16px;
|
|
|
|
|
|
|
|
transition: all 0.3s;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
|
|
box-shadow: 0px 4px 40px 1px rgba(0, 0, 0, 0.10000000149011612);
|
|
|
|
|
|
|
|
margin-top: -3px;
|
|
|
|
|
|
|
|
}
|
|
|
|
.recommend-products-left__cover {
|
|
|
|
.recommend-products-left__cover {
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
|
right: 0;
|
|
|
|
right: 18px;
|
|
|
|
bottom: 0;
|
|
|
|
bottom: 18px;
|
|
|
|
width: 170px;
|
|
|
|
width: 170px;
|
|
|
|
height: 170px;
|
|
|
|
height: 170px;
|
|
|
|
img {
|
|
|
|
img {
|
|
|
@ -275,11 +319,21 @@ export default {
|
|
|
|
width: 266px;
|
|
|
|
width: 266px;
|
|
|
|
height: 100%;
|
|
|
|
height: 100%;
|
|
|
|
.recommend-products-right__item {
|
|
|
|
.recommend-products-right__item {
|
|
|
|
width: 100%;
|
|
|
|
width: 284px;
|
|
|
|
height: 122px;
|
|
|
|
height: 144px;
|
|
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
position: relative;
|
|
|
|
position: relative;
|
|
|
|
background: #f8f7f8;
|
|
|
|
background: #fff;
|
|
|
|
padding: 10px 0 10px 20px;
|
|
|
|
padding: 20px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
transition: all 0.3s;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
|
|
box-shadow: 0px 4px 40px 1px rgba(0, 0, 0, 0.10000000149011612);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
&:nth-child(1) {
|
|
|
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.recommend-products-right__cover {
|
|
|
|
.recommend-products-right__cover {
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
@ -296,63 +350,5 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.home-pick-new {
|
|
|
|
|
|
|
|
width: 590px;
|
|
|
|
|
|
|
|
min-height: 340px;
|
|
|
|
|
|
|
|
padding: 16px 20px 20px;
|
|
|
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
|
|
&__products {
|
|
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
.pick-new-products__left {
|
|
|
|
|
|
|
|
width: 170px;
|
|
|
|
|
|
|
|
height: 264px;
|
|
|
|
|
|
|
|
background: #f8f8f9;
|
|
|
|
|
|
|
|
margin-right: 20px;
|
|
|
|
|
|
|
|
.new-products-left__cover {
|
|
|
|
|
|
|
|
width: 170px;
|
|
|
|
|
|
|
|
height: 170px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.new-products-left__wrap {
|
|
|
|
|
|
|
|
padding: 10px 0;
|
|
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
|
|
p {
|
|
|
|
|
|
|
|
width: 140px;
|
|
|
|
|
|
|
|
margin: 0 auto 12px auto;
|
|
|
|
|
|
|
|
@include ellipsis;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.pick-new-products__right {
|
|
|
|
|
|
|
|
.new-products-right__wrap {
|
|
|
|
|
|
|
|
width: 170px;
|
|
|
|
|
|
|
|
height: 100px;
|
|
|
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
|
|
|
padding: 16px 8px 16px 0;
|
|
|
|
|
|
|
|
&:nth-child(-n + 2) {
|
|
|
|
|
|
|
|
margin-bottom: 40px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.products-right-wrap__cover {
|
|
|
|
|
|
|
|
width: 68px;
|
|
|
|
|
|
|
|
height: 68px;
|
|
|
|
|
|
|
|
margin-right: 16px;
|
|
|
|
|
|
|
|
img {
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.products-right-wrap__info {
|
|
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
|
|
p {
|
|
|
|
|
|
|
|
width: 78px;
|
|
|
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
|
|
|
@include ellipses(2);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|