diff --git a/buyer/src/components/goodsDetail/ShowGoods.vue b/buyer/src/components/goodsDetail/ShowGoods.vue index 7b844042..7924be84 100644 --- a/buyer/src/components/goodsDetail/ShowGoods.vue +++ b/buyer/src/components/goodsDetail/ShowGoods.vue @@ -238,6 +238,7 @@ :disabled="skuDetail.quantity === 0" v-model="count" :precision="0.1" + @on-blur="changeCount" > 库存{{ skuDetail.quantity }} @@ -317,6 +318,9 @@ export default { handler(val) { this.skuDetail = val.data; this.wholesaleList = val.wholesaleList; + if (this.wholesaleList && this.wholesaleList.length > 0) { + this.count = this.wholesaleList[0].num; + } this.swiperGoodsImg(); }, deep: true, @@ -364,6 +368,14 @@ export default { }, }, methods: { + changeCount(val) { + if (this.wholesaleList && this.wholesaleList.length > 0) { + if (this.count <= this.wholesaleList[0].num) { + this.$Message.warning("购买数量不能小于起批数量"); + this.count = this.wholesaleList[0].num; + } + } + }, select(index, value) { // 选择规格 this.$set(this.currentSelceted, index, value); diff --git a/buyer/src/pages/GoodsList.vue b/buyer/src/pages/GoodsList.vue index 6ff52c06..3721b1c0 100644 --- a/buyer/src/pages/GoodsList.vue +++ b/buyer/src/pages/GoodsList.vue @@ -66,7 +66,7 @@ v-if="item.content.salesModel === 'WHOLESALE'" class="goods-show-tag" color="purple" - > + > 批发 {{ item.content.goodsName }} @@ -76,33 +76,30 @@ >人评价