批发商品展示

master
lemon橪 2022-05-27 18:17:23 +08:00
parent 1dc42e1333
commit 6e04a5d3da
4 changed files with 48 additions and 21 deletions

View File

@ -36,30 +36,31 @@
</view>
<!-- 正常商品的价格 -->
<view v-else>
<div class="goods-price">
<!-- 批发价格 -->
<div class='price-row flex' v-if="wholesaleList.length">
<div class='goods-price' v-for="(item,index) in wholesaleList" :key="index">
<span>
<span class="goods-price-bigshow">{{
formatPrice(item.price)[0]
}}</span>
.{{ formatPrice(item.price)[1] }}
</span>
<span class='wholesale-item'>
{{item.num}}{{goodsDetail.goodsUnit}}
</span>
</div>
</div>
<div class="goods-price" v-else>
<span>
<span class="goods-price-bigshow">{{
formatPrice(goodsDetail.price)[0]
}}</span>
formatPrice(goodsDetail.price)[0]
}}</span>
.{{ formatPrice(goodsDetail.price)[1] }}
</span>
</div>
<!-- 批发价格 -->
<div class='price-row'>
<div class='goods-price'>
<span >
<span class="goods-price-bigshow">{{
formatPrice(goodsDetail.price)[0]
}}</span>
.{{ formatPrice(goodsDetail.price)[1] }}
</span>
</div>
<div>
23-30
</div>
</div>
</view>
<view class="goods-check-skus">
已选
@ -133,9 +134,14 @@
currentSelceted: [],
skuList: "",
isClose: false, //
};
},
props: {
wholesaleList:{
type: null,
default: false,
},
buyMask: {
type: Boolean,
default: false,
@ -165,6 +171,14 @@
type: null,
},
},
computed: {
wholesalePrice(key){
return this.wholesaleList.length ? this.wholesaleList.map(item=>{ return item.price }) :[]
},
wholesaleNum(key){
return this.wholesaleList.length ? this.wholesaleList.map(item=>{ return item.num }) :[]
}
},
watch: {
num(val){
if(val){
@ -455,6 +469,11 @@
}
}
}
.wholesale-item{
color: #999 !important;
font-size: 24rpx;
margin:0 20rpx;
}
.goods-header {
height: 200rpx;

View File

@ -164,12 +164,16 @@
</view>
<div class="promotion" @click="navigateToDetailPage(item)">
<div v-if="item.content.salesModel == 'WHOLESALE'">
<span></span>
</div>
<div v-for="(promotionItem,promotionIndex) in getPromotion(item)" :key="promotionIndex">
<span v-if="promotionItem.indexOf('COUPON') != -1"></span>
<span v-if="promotionItem.indexOf('FULL_DISCOUNT') != -1"></span>
<span v-if="promotionItem.indexOf('SECKILL') != -1"></span>
</div>
</div>
<div class="count-config" @click="navigateToDetailPage(item)">
<span>已售 {{ item.content.buyCount || "0" }}</span>
<span>{{ item.content.commentNum || "0" }}条评论</span>

View File

@ -348,6 +348,7 @@
:id="productId"
v-if="goodsDetail.id"
:pointDetail="pointDetail"
:wholesaleList="wholesaleList"
@handleClickSku="selectSku"
:buyMask="buyMask"
/>
@ -523,6 +524,7 @@ export default {
routerVal: "",
IMLink: "", // IM
wholesaleList:[]
};
},
@ -661,6 +663,7 @@ export default {
}
/**商品信息以及规格信息存储 */
this.goodsDetail = response.data.result.data;
this.wholesaleList = response.data.result.wholesaleList;
this.goodsSpec = response.data.result.specs;
this.PromotionList = response.data.result.promotionMap;
this.goodsParams = response.data.result.goodsParamsDTOList || [];

View File

@ -74,6 +74,7 @@
</p>
<!-- 规格 -->
<p class="sp-type">{{skuItem.goodsSku.simpleSpecs}}</p>
<p class="sp-type" v-if="skuItem.goodsSku.salesModel == 'WHOLESALE'"></p>
<p class="sp-number">
<view class="sp-price">
<div class="default-color" :class="{'main-color':Object.keys(skuItem.promotionMap).length ==0 }">