-
BINsrc/assets/images/icon_add.png
-
BINsrc/assets/images/icon_love.png
-
BINsrc/assets/images/icon_star.png
-
65src/components/base/footer.vue
-
6src/components/base/homHeader.vue
-
92src/components/base/topNav.vue
-
64src/components/canvasShow/basics/classifyheader/app/index.vue
-
59src/components/canvasShow/basics/classifyheader/mixin.js
-
326src/components/canvasShow/basics/classifyheader/pc/index.vue
-
12src/components/canvasShow/basics/product/mixin.js
-
326src/components/canvasShow/basics/product/pc/index.vue
-
10src/components/canvasShow/basics/text.vue
-
7src/components/canvasShow/canvasShowPage.vue
-
1src/components/canvasShow/componentMap.js
-
BINsrc/components/canvasShow/static/images/product/icon_add.png
-
BINsrc/components/canvasShow/static/images/product/icon_index_1.png
-
BINsrc/components/canvasShow/static/images/product/icon_index_2.png
-
BINsrc/components/canvasShow/static/images/product/icon_index_3.png
-
BINsrc/components/canvasShow/static/images/product/icon_love.png
-
BINsrc/components/canvasShow/static/images/product/icon_right_arrow.png
-
BINsrc/components/canvasShow/static/images/product/icon_star.png
-
3src/locales/en.json
-
3src/locales/zh-CN.json
-
2src/views/home/index.vue
-
2src/views/layout.vue
-
BINstatic/image/share_aaa.png
-
BINstatic/image/share_bbb.png
-
BINstatic/image/share_douyin.png
-
BINstatic/image/share_facebook.png
-
BINstatic/image/share_twitter.png
After Width: 114 | Height: 114 | Size: 16 KiB |
After Width: 105 | Height: 105 | Size: 9.9 KiB |
After Width: 50 | Height: 50 | Size: 1.7 KiB |
@ -0,0 +1,64 @@ |
|||
<template> |
|||
<div class="header"> |
|||
<div class="tabs-nav-warp"> |
|||
<div class="tabs-nav" scroll-x="true"> |
|||
<div class="ul"> |
|||
<div class="li" :class="{'on':activeTab===0}" @click="tabChange(0)" v-if="componentContent.firstClassify">{{componentContent.firstClassify}}</div> |
|||
<div class="li" :class="{'on':activeTab===index+beginIndex}" v-for="(item,index) in classifyData" :key="index"> |
|||
{{item.categoryName}} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import {commonMixin} from '../mixin' |
|||
export default { |
|||
mixins: [commonMixin], |
|||
data () { |
|||
return { |
|||
beginIndex:(this.componentContent.firstClassify && this.componentContent.firstClassify.length ) ? 1 : 0, |
|||
activeTab: 0 |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
|
|||
.tabs-nav-warp{ |
|||
margin-top: 20px; |
|||
padding:0 30px; |
|||
overflow: hidden; |
|||
.tabs-nav{ |
|||
.ul{ |
|||
display: flex; |
|||
padding-left: 20px; |
|||
padding-right: 20px; |
|||
.li{ |
|||
flex: 1 0 auto; |
|||
margin-left: 5px; |
|||
margin-right: 5px; |
|||
font-size: 30px; |
|||
color: #252744; |
|||
position: relative; |
|||
padding-bottom: 15px; |
|||
padding-left: 27px; |
|||
padding-right: 27px; |
|||
padding-top: 15px; |
|||
&:first-child{ |
|||
margin-left: 0; |
|||
} |
|||
&.on{ |
|||
background: #252744; |
|||
box-shadow: 0px 7px 14px 0px #C5C8ED; |
|||
border-radius: 40px; |
|||
color: white; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,59 @@ |
|||
import {funMixin} from '../../config/mixin' |
|||
import { getClassify,getProducts } from '../../config/api' |
|||
|
|||
export const commonMixin = { |
|||
name: 'classifyheaderComponent', |
|||
mixins: [funMixin], |
|||
props: { |
|||
terminal: { |
|||
type: Number, |
|||
default: 4 |
|||
}, |
|||
typeId: { |
|||
type: Number, |
|||
default: 1 |
|||
}, |
|||
shopId: { |
|||
type: Number, |
|||
default: 0 |
|||
}, |
|||
componentContent: { |
|||
type: Object |
|||
} |
|||
}, |
|||
data () { |
|||
return { |
|||
classifyData: [], |
|||
productData:[], |
|||
activeTab : 0, |
|||
beginIndex: 0 |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.getData() |
|||
}, |
|||
methods: { |
|||
async getData() { |
|||
const response = await getClassify() |
|||
const res = response.data |
|||
this.classifyData = res.data |
|||
this.activeTab = 0 |
|||
this.getProducts(this.classifyData[this.activeTab].id) |
|||
}, |
|||
classifyChange(item, index){ |
|||
this.activeTab = index |
|||
this.getProducts(item.id) |
|||
}, |
|||
async getProducts(classifyId){ |
|||
let params = { |
|||
page: 1, |
|||
pageSize: 20, |
|||
classifyId : classifyId |
|||
} |
|||
const response = await getProducts(params) |
|||
const res = response.data |
|||
this.productData = res.data.list |
|||
this.$forceUpdate() |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,326 @@ |
|||
<template> |
|||
<div class="tabs-nav-warp"> |
|||
<div class="nav-warp"> |
|||
<div class="ul"> |
|||
<div class="li" :class="{ 'on': activeTab === index + beginIndex }" v-for="(item, index) in classifyData" |
|||
:key="index"> |
|||
<div class="classify-item" @click="classifyChange(item,index + beginIndex)"> |
|||
<img class="classify-img" :src="item.classifyImage"> |
|||
<span class="classify-name">{{ item.categoryName }}</span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="hom-pro-list" v-if="productData.length > 0"> |
|||
<div class="product-swiper"> |
|||
<div class="product-swiper-box"> |
|||
<div class="product-swiper-warp" v-for="(item, index) in productData" :key="index"> |
|||
<div class="product-swiper-item" @click="jumpProductDetail(item)"> |
|||
<div class="product-swiper-img"> |
|||
<img class="img pic-img default-img" :src="item.image" |
|||
onerror="this.src='url(https://ceres.zkthink.com/static/root/default.png) no-repeat center';this.οnerrοr=null"> |
|||
</div> |
|||
<div class="product-swiper-info"> |
|||
<div class="product-info-content"> |
|||
<div class="product-name-row"> |
|||
<label class="product-name">{{ item.productName }}</label> |
|||
<img class="product-star" src="../../../../../assets/images/icon_star.png"> |
|||
|
|||
<label class="product-star-text">{{ item.qaNum || 3.5 }}</label> |
|||
</div> |
|||
<div class="product-price-row"> |
|||
<div class="price-warp"> |
|||
¥ {{ item.price }} |
|||
</div> |
|||
<img class="product-add" src="../../../../../assets/images/icon_add.png"> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="pagination new-pagination"></div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { commonMixin } from '../mixin' |
|||
export default { |
|||
mixins: [commonMixin], |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.tabs-nav-warp { |
|||
display: flex; |
|||
flex-direction: column; |
|||
flex-wrap: nowrap; |
|||
align-content: center; |
|||
justify-content: center; |
|||
align-items: center; |
|||
|
|||
.nav-warp { |
|||
width: 1200px; |
|||
margin: 0 auto; |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
flex-wrap: nowrap; |
|||
|
|||
.ul { |
|||
width: 760px; |
|||
display: flex; |
|||
flex-direction: row; |
|||
flex-wrap: nowrap; |
|||
align-content: center; |
|||
justify-content: center; |
|||
align-items: center; |
|||
|
|||
.li { |
|||
font-size: 16px; |
|||
line-height: 21px; |
|||
padding-bottom: 24px; |
|||
color: #333; |
|||
cursor: pointer; |
|||
border-bottom: 3px solid #fff; |
|||
|
|||
&.on, |
|||
&:hover { |
|||
transform: scale(1.2); |
|||
} |
|||
|
|||
.classify-item { |
|||
width: 126px; |
|||
height: 204px; |
|||
background: #F6F6F8; |
|||
box-shadow: 0rpx 12rpx 27rpx 0rpx #E2E2E2; |
|||
border-radius: 8rpx; |
|||
border: 1px solid #FFFFFF; |
|||
display: flex; |
|||
flex-direction: column; |
|||
flex-wrap: nowrap; |
|||
align-content: center; |
|||
justify-content: center; |
|||
align-items: center; |
|||
|
|||
.classify-img { |
|||
height: 100px; |
|||
} |
|||
|
|||
.classify-name { |
|||
margin-top: 48px; |
|||
font-family: Microsoft YaHei; |
|||
font-weight: bold; |
|||
font-size: 12px; |
|||
color: #252744; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
.hom-pro-list { |
|||
display: flex; |
|||
flex-direction: row; |
|||
flex-wrap: nowrap; |
|||
align-content: center; |
|||
justify-content: center; |
|||
align-items: center; |
|||
|
|||
::v-deep .swiper-wrapper { |
|||
position: static; |
|||
} |
|||
|
|||
/**横向滑动**/ |
|||
.product-swiper { |
|||
height: auto; |
|||
overflow: hidden; |
|||
margin: 5px 34px; |
|||
|
|||
&+.btn-more { |
|||
margin-top: 20px; |
|||
} |
|||
|
|||
.title { |
|||
padding: 22px 0px 0 0; |
|||
|
|||
label { |
|||
background-image: none; |
|||
color: #A56C4C; |
|||
font-style: italic; |
|||
padding: 0; |
|||
} |
|||
} |
|||
|
|||
&-box { |
|||
margin-top: 18px; |
|||
margin-bottom: 18px; |
|||
margin-left: 18px; |
|||
margin-right: 18px; |
|||
height: 100%; |
|||
width: 100%; |
|||
display: flex; |
|||
overflow-x: auto; |
|||
} |
|||
|
|||
&-warp { |
|||
height: 320px; |
|||
width: 242px !important; |
|||
margin-left: 18px; |
|||
margin-right: 18px; |
|||
} |
|||
|
|||
.product-swiper-item { |
|||
height: 320px; |
|||
width: 242px !important; |
|||
position: relative; |
|||
|
|||
.product-swiper-img { |
|||
width: 210px; |
|||
height: 220px; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
background: #F6F6F8; |
|||
border: 2px solid #FFFFFF; |
|||
border-radius: 16px; |
|||
position: relative; |
|||
padding: 20px; |
|||
z-index: 2; |
|||
|
|||
.img { |
|||
width: 100%; |
|||
height: 100%; |
|||
object-fit: contain; |
|||
} |
|||
} |
|||
|
|||
.product-swiper-info { |
|||
width: 242px; |
|||
height: 210px; |
|||
position: absolute; |
|||
top: 110px; |
|||
background: #FDFDFD; |
|||
box-shadow: 0px 16px 24px 0px #F6F6F6; |
|||
border-radius: 16px; |
|||
text-align: center; |
|||
|
|||
.product-info-content { |
|||
margin-top: 125px; |
|||
|
|||
.product-name-row { |
|||
width: 100%; |
|||
height: 22px; |
|||
line-height: 22px; |
|||
display: flex; |
|||
flex-direction: row; |
|||
flex-wrap: nowrap; |
|||
align-content: center; |
|||
justify-content: flex-start; |
|||
align-items: center; |
|||
|
|||
.product-name { |
|||
width: 100%; |
|||
height: auto; |
|||
font-size: 16px; |
|||
font-family: Source Han Sans CN; |
|||
font-weight: bold; |
|||
color: #252744; |
|||
display: block; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
white-space: nowrap; |
|||
line-height: 28px; |
|||
margin-left: 24px; |
|||
text-align: left; |
|||
} |
|||
|
|||
.product-star { |
|||
width: 22px; |
|||
height: 22px; |
|||
} |
|||
|
|||
.product-star-text { |
|||
width: auto; |
|||
height: 28px; |
|||
line-height: 28px; |
|||
font-size: 14px; |
|||
font-family: Source Han Sans CN; |
|||
font-weight: bold; |
|||
color: #A5A5AD; |
|||
margin-right: 20px; |
|||
margin-left: 5px; |
|||
} |
|||
} |
|||
|
|||
.product-sku-row { |
|||
width: 100%; |
|||
height: 28px; |
|||
line-height: 28px; |
|||
margin-top: 15px; |
|||
display: flex; |
|||
flex-direction: row; |
|||
flex-wrap: nowrap; |
|||
align-content: center; |
|||
justify-content: flex-start; |
|||
align-items: center; |
|||
|
|||
.product-sku-name { |
|||
font-size: 24px; |
|||
font-family: Source Han Sans CN; |
|||
font-weight: 400; |
|||
color: #90919C; |
|||
margin-left: 30px; |
|||
} |
|||
} |
|||
|
|||
.product-price-row { |
|||
width: 100%; |
|||
height: 50px; |
|||
line-height: 50px; |
|||
display: flex; |
|||
flex-direction: row; |
|||
flex-wrap: nowrap; |
|||
align-content: center; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
margin-top: 10px; |
|||
|
|||
.price-warp { |
|||
display: flex; |
|||
align-items: center; |
|||
line-height: 28px; |
|||
margin-left: 24px; |
|||
justify-content: flex-start; |
|||
width: auto; |
|||
flex-direction: row; |
|||
flex-wrap: nowrap; |
|||
font-size: 14px; |
|||
font-family: Source Han Sans CN; |
|||
font-weight: bold; |
|||
color: #252744; |
|||
} |
|||
|
|||
.product-add { |
|||
width: 50px; |
|||
height: 50px; |
|||
margin-right: 24px; |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
After Width: 114 | Height: 114 | Size: 16 KiB |
After Width: 128 | Height: 126 | Size: 2.0 KiB |
After Width: 128 | Height: 126 | Size: 2.2 KiB |
After Width: 128 | Height: 126 | Size: 2.4 KiB |
After Width: 105 | Height: 105 | Size: 9.9 KiB |
After Width: 200 | Height: 200 | Size: 4.7 KiB |
After Width: 50 | Height: 50 | Size: 1.7 KiB |
After Width: 84 | Height: 84 | Size: 5.0 KiB |
After Width: 84 | Height: 84 | Size: 4.6 KiB |
After Width: 112 | Height: 112 | Size: 3.7 KiB |
After Width: 112 | Height: 112 | Size: 2.7 KiB |
After Width: 84 | Height: 84 | Size: 3.3 KiB |