|
|
@@ -2,11 +2,57 @@
|
|
|
<div class="wrap">
|
|
|
<div class="reco-title">产品展示</div>
|
|
|
<div class="recommend-fragment clearfix">
|
|
|
- <ul class="recommend-list clearfix">
|
|
|
- <li v-for="commodity in commodities" class="big">
|
|
|
- <div v-swiper:mySwiper="swiperOption">
|
|
|
- <div class="swiper-wrapper">
|
|
|
- <div class="swiper-slide">
|
|
|
+ <div v-if="!commodities || commodities.length === 0" class="empty-show">
|
|
|
+ <div class="empty">
|
|
|
+ <div class="empty-img">
|
|
|
+ <img src="/images/brandList/empty-cart.jpg">
|
|
|
+ </div>
|
|
|
+ <div class="empty-info">
|
|
|
+ <p class="grey f16"> 暂无展示产品</p>
|
|
|
+ <i class="iconfont" v-if="emptyShow === false"></i> <a v-if="emptyShow === false" href="/">返回首页</a>
|
|
|
+ <img v-if="emptyShow === true" src="/images/brandList/upload.png"> <a v-if="emptyShow === true" href="/vendor#/store/maintain" target="_blank">马上去上传</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-swiper:mySwiper="swiperOption" v-if="commodities || commodities.length>0">
|
|
|
+ <div class="swiper-wrapper">
|
|
|
+ <div class="swiper-slide" v-if="commodities.length>0">
|
|
|
+ <ul class="recommend-list clearfix">
|
|
|
+ <li v-for="commodity in commodities.slice(0,3)" class="big">
|
|
|
+ <a :href="commodity.batchCode ? '/store/productDetail/'+ commodity.batchCode : '#'" class="href">
|
|
|
+ <div class="img">
|
|
|
+ <img :src="commodity.comImg.startsWith('static')?'/'+commodity.comImg:commodity.comImg"/>
|
|
|
+ </div>
|
|
|
+ <div class="content">
|
|
|
+ <p>{{commodity.comCode | comCodeFilter}}</p>
|
|
|
+ <!-- <p class="color666" v-text="commodity.brandNameCn">PANFAEFQ</p>-->
|
|
|
+ <p class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB | currency}}</p>
|
|
|
+ <!-- <p class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD || 0}}</p>-->
|
|
|
+ </div>
|
|
|
+ </a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="swiper-slide" v-if="commodities.length>=3">
|
|
|
+ <ul class="recommend-list clearfix">
|
|
|
+ <li v-for="commodity in commodities.slice(3,6)" class="big">
|
|
|
+ <a :href="commodity.batchCode ? '/store/productDetail/'+ commodity.batchCode : '#'" class="href">
|
|
|
+ <div class="img">
|
|
|
+ <img :src="commodity.comImg.startsWith('static')?'/'+commodity.comImg:commodity.comImg"/>
|
|
|
+ </div>
|
|
|
+ <div class="content">
|
|
|
+ <p>{{commodity.comCode | comCodeFilter}}</p>
|
|
|
+ <!-- <p class="color666" v-text="commodity.brandNameCn">PANFAEFQ</p>-->
|
|
|
+ <p class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB | currency}}</p>
|
|
|
+ <!-- <p class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD || 0}}</p>-->
|
|
|
+ </div>
|
|
|
+ </a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="swiper-slide" v-if="commodities.length>=6">
|
|
|
+ <ul class="recommend-list clearfix">
|
|
|
+ <li v-for="commodity in commodities.slice(6,9)" class="big">
|
|
|
<a :href="commodity.batchCode ? '/store/productDetail/'+ commodity.batchCode : '#'" class="href">
|
|
|
<div class="img">
|
|
|
<img :src="commodity.comImg.startsWith('static')?'/'+commodity.comImg:commodity.comImg"/>
|
|
|
@@ -18,39 +64,29 @@
|
|
|
<!-- <p class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD || 0}}</p>-->
|
|
|
</div>
|
|
|
</a>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="swiper-pagination swiper-pagination-bullets"></div>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
</div>
|
|
|
- <!--<a :href="commodity.batchCode ? '/store/productDetail/'+ commodity.batchCode : '#'" class="href">-->
|
|
|
- <!--<div class="img">-->
|
|
|
- <!--<img :src="commodity.comImg.startsWith('static')?'/'+commodity.comImg:commodity.comImg"/>-->
|
|
|
- <!--</div>-->
|
|
|
- <!--<div class="content">-->
|
|
|
- <!--<p>{{commodity.comCode | comCodeFilter}}</p>-->
|
|
|
- <!--<!– <p class="color666" v-text="commodity.brandNameCn">PANFAEFQ</p>–>-->
|
|
|
- <!--<p class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB | currency}}</p>-->
|
|
|
- <!--<!– <p class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD || 0}}</p>–>-->
|
|
|
- <!--</div>-->
|
|
|
- <!--</a>-->
|
|
|
- <!--<div class="enter-store">-->
|
|
|
- <!--<a @click="buyNow(false, commodity)">加入购物车</a>-->
|
|
|
- <!--<a @click="buyNow(true, commodity)">立即购买</a>-->
|
|
|
- <!--</div>-->
|
|
|
- </li>
|
|
|
- <li v-if="!commodities || commodities.length === 0" class="empty-show">
|
|
|
- <div class="empty">
|
|
|
- <div class="empty-img">
|
|
|
- <img src="/images/brandList/empty-cart.jpg">
|
|
|
- </div>
|
|
|
- <div class="empty-info">
|
|
|
- <p class="grey f16"> 暂无展示产品</p>
|
|
|
- <i class="iconfont" v-if="emptyShow === false"></i> <a v-if="emptyShow === false" href="/">返回首页</a>
|
|
|
- <img v-if="emptyShow === true" src="/images/brandList/upload.png"> <a v-if="emptyShow === true" href="/vendor#/store/maintain" target="_blank">马上去上传</a>
|
|
|
- </div>
|
|
|
+ <div class="swiper-slide" v-if="commodities.length>=9">
|
|
|
+ <ul class="recommend-list clearfix">
|
|
|
+ <li v-for="commodity in commodities.slice(9,12)" class="big">
|
|
|
+ <a :href="commodity.batchCode ? '/store/productDetail/'+ commodity.batchCode : '#'" class="href">
|
|
|
+ <div class="img">
|
|
|
+ <img :src="commodity.comImg.startsWith('static')?'/'+commodity.comImg:commodity.comImg"/>
|
|
|
+ </div>
|
|
|
+ <div class="content">
|
|
|
+ <p>{{commodity.comCode | comCodeFilter}}</p>
|
|
|
+ <!-- <p class="color666" v-text="commodity.brandNameCn">PANFAEFQ</p>-->
|
|
|
+ <p class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB | currency}}</p>
|
|
|
+ <!-- <p class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD || 0}}</p>-->
|
|
|
+ </div>
|
|
|
+ </a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
</div>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
+ </div>
|
|
|
+ <div class="swiper-pagination swiper-pagination-bullets"></div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -158,87 +194,6 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- buyNow: function (isBuy, item) {
|
|
|
- if (!this.$store.state.option.user.logged) {
|
|
|
- this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
|
|
|
- if (response.data) {
|
|
|
- window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- if (item) {
|
|
|
- if (isBuy) {
|
|
|
- this.$http.post('/trade/order/buyNow', [{
|
|
|
- uuid: item.comUuid,
|
|
|
- batchCode: item.batchCode,
|
|
|
- number: item.minBuyQty,
|
|
|
- storeid: item.storeId,
|
|
|
- storeUuid: item.storeUuid,
|
|
|
- currencyName: item.currency,
|
|
|
- minPackQty: item.minPackQty ? item.minPackQty : item.minBuyQty
|
|
|
- }])
|
|
|
- .then(response => {
|
|
|
- if (response.data.success) {
|
|
|
- if (response.data.message) {
|
|
|
- this.$message({
|
|
|
- message: response.data.message,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- window.setTimeout(function () {
|
|
|
- window.location.href = '/user#/order/pay/' + this.baseUtils.enidfilter(response.data.data.orderid)
|
|
|
- }, 1000)
|
|
|
- } else {
|
|
|
- window.location.href = '/user#/order/pay/' + this.baseUtils.enidfilter(response.data.data.orderid)
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (response.data.data && response.data.data.unvailable === 1) {
|
|
|
- this.$message.error('产品信息已失效,请刷新界面')
|
|
|
- } else {
|
|
|
- this.$message.error(response.data.message)
|
|
|
- }
|
|
|
- }
|
|
|
- }, err => {
|
|
|
- console.log(err)
|
|
|
- if (item.minBuyQty > item.reserve) {
|
|
|
- this.$message.error('商品' + item.code + '的库存已经不满足最小起订量')
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- // this.$store.dispatch('user/addCar', {uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty})
|
|
|
- this.$http.post('/trade/cart/add', {
|
|
|
- uuid: item.comUuid,
|
|
|
- batchCode: item.batchCode,
|
|
|
- number: item.minBuyQty,
|
|
|
- storeid: item.storeId,
|
|
|
- storeUuid: item.storeUuid,
|
|
|
- currencyName: item.currency,
|
|
|
- minPackQty: item.minPackQty ? item.minPackQty : item.minBuyQty
|
|
|
- })
|
|
|
- .then(response => {
|
|
|
- if (response.data.success) {
|
|
|
- if (response.data.message) {
|
|
|
- this.$message({
|
|
|
- message: '添加购物车成功,但商品信息有更新',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: '添加购物车成功',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (response.data.code === 2) {
|
|
|
- this.$message.error(response.data.message + ',请刷新页面')
|
|
|
- } else {
|
|
|
- this.$message.error(response.data.message)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
enidfilter: function (str) {
|
|
|
if (str) {
|
|
|
let encryptStr = '' // 最终返回的加密后的字符串
|
|
|
@@ -331,9 +286,39 @@
|
|
|
}
|
|
|
.recommend-fragment {
|
|
|
background: #fff;
|
|
|
+ .empty-show{
|
|
|
+ height: 389px;
|
|
|
+ padding-top: 140px;
|
|
|
+ &:hover{
|
|
|
+ box-shadow: 0px 0px 0px transparent;
|
|
|
+ }
|
|
|
+ .empty{
|
|
|
+ margin: 0 auto;
|
|
|
+ width: 181px;
|
|
|
+ .empty-img{
|
|
|
+ float: left;
|
|
|
+ }
|
|
|
+ .empty-info{
|
|
|
+ float: left;
|
|
|
+ margin: 5px 0px 0px 20px;
|
|
|
+ .grey{
|
|
|
+ color: #999;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ i{
|
|
|
+ color: #5078cb;
|
|
|
+ }
|
|
|
+ a{
|
|
|
+ font-size: 14px;
|
|
|
+ color: #5078cb;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
.recommend-fragment ul{
|
|
|
width: 100%;
|
|
|
+ height: 368px;
|
|
|
background: #fff;
|
|
|
/* display: inline-block;*/
|
|
|
-webkit-padding-start: 0;
|
|
|
@@ -344,12 +329,12 @@
|
|
|
}
|
|
|
.recommend-fragment ul li
|
|
|
.img{
|
|
|
- height: 90px;
|
|
|
+ height: 42px;
|
|
|
text-align: center;
|
|
|
- line-height: 90px;
|
|
|
+ line-height: 42px;
|
|
|
img{
|
|
|
- max-width: 80px;
|
|
|
- max-height: 80px;
|
|
|
+ max-width: 63px;
|
|
|
+ max-height: 42px;
|
|
|
}
|
|
|
}
|
|
|
.recommend-fragment ul li .content{
|
|
|
@@ -364,7 +349,7 @@
|
|
|
overflow: hidden;
|
|
|
text-overflow: ellipsis;
|
|
|
white-space: nowrap;
|
|
|
- margin-bottom: 0;
|
|
|
+ margin: 5px 0;
|
|
|
padding-left: 10px;
|
|
|
color: #666;
|
|
|
&.price{
|
|
|
@@ -409,7 +394,7 @@
|
|
|
.recommend-fragment ul li.big {
|
|
|
float: left;
|
|
|
width: 190px;
|
|
|
- height: 174px;
|
|
|
+ height: 115px;
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
margin: 2px 3px 0px 0px;
|
|
|
@@ -424,9 +409,9 @@
|
|
|
transition: all .3s linear;
|
|
|
}
|
|
|
.img, .content{
|
|
|
- transform:translate(0px,-10px);
|
|
|
- -ms-transform:translate(0px,-10px); /* IE 9 */
|
|
|
- -webkit-transform:translate(0px,-10px); /* Safari and Chrome */
|
|
|
+ /*transform:translate(0px,-10px);*/
|
|
|
+ /*-ms-transform:translate(0px,-10px); !* IE 9 *!*/
|
|
|
+ /*-webkit-transform:translate(0px,-10px); !* Safari and Chrome *!*/
|
|
|
}
|
|
|
}
|
|
|
}
|