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