|
|
@@ -16,17 +16,24 @@
|
|
|
<view class="mb-32 fs-30">{{item.name}}</view>
|
|
|
<view class="menu-list flex-justify-space" v-for="(info,k) in item.list" :key="k">
|
|
|
<image class="flex-shrink0 goods_img" :src="info.goods_image" mode="scaleToFill"></image>
|
|
|
- <view class="menu-list-right">
|
|
|
- <view class="mb-4 goods-name text-overflow-ellipsis fs-34 fw-600">{{info.goods_name}}</view>
|
|
|
- <view class="mb-20 fw-400 fc-9 fs-24">月销{{info.sales}}</view>
|
|
|
+ <view class="menu-list-right flex-direction flex-justify-space">
|
|
|
+ <view class="mb-8">
|
|
|
+ <view class="mb-4 goods-name text-overflow-ellipsis fs-32 fw-600">{{info.goods_name}}
|
|
|
+ </view>
|
|
|
+ <view class="text-overflow-ellipsis-one fw-400 fc-9 fs-24 mb-2 goods-name" v-if="info.spec_type == 1">
|
|
|
+ {{info.goods_desc}}
|
|
|
+ </view>
|
|
|
+ <view class="fw-400 fc-9 fs-24">月销{{info.sales}}</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<view class="flex-justify-space align-items-flex-end">
|
|
|
<view class="">
|
|
|
<span class="fs-24 fw-400 fc-FB3D03">¥</span>
|
|
|
<span
|
|
|
class="fs-40 fw-b fc-FB3D03">{{info.seckill_money>0?info.seckill_money:info.price}}</span>
|
|
|
- <view class="">
|
|
|
+ <!-- <view class="">
|
|
|
<span class="fs-24 fc-9 fw-400 text-line-through">¥{{info.line_price}}</span>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
<view class="display-flex align-items-center" v-if="info.spec_type == 1">
|
|
|
<image v-show="info.num > 0" class="wh-44" @click="addred(1,i,k,info)"
|
|
|
@@ -65,6 +72,9 @@
|
|
|
<view style="width: 446rpx;" class="fw-600 fs-34 text-overflow-ellipsis-one">
|
|
|
{{popData.goodsItem.goods_name}}
|
|
|
</view>
|
|
|
+ <view class="fw-400 fc-9 fs-24 mb-2 text-overflow-ellipsis-t">
|
|
|
+ {{popData.goodsItem.goods_desc}}
|
|
|
+ </view>
|
|
|
<view class="fw-400 fc-9 fs-24">月销{{popData.goodsItem.sales}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -167,7 +177,7 @@
|
|
|
is_quota: 0,
|
|
|
is_infinite: 0,
|
|
|
quota_num: 0,
|
|
|
- payNum: 0,
|
|
|
+ payNum: 0,
|
|
|
stock: 0,
|
|
|
spec_key: '',
|
|
|
goods_spec_id: '',
|
|
|
@@ -204,14 +214,14 @@
|
|
|
this.isAjax = false
|
|
|
}
|
|
|
} else {
|
|
|
- if (this.popData.is_infinite === 0 && this.popData.payNum > this.popData.stock) {
|
|
|
- tools.error('最多购买' + this.popData.quota_num + '件')
|
|
|
- } else if (this.popData.is_quota > 0 && this.popData.payNum > this.popData.quota_num) {
|
|
|
- tools.error('限购' + this.popData.quota_num + '件')
|
|
|
- }else {
|
|
|
- // 加
|
|
|
- ++this.popData.num;
|
|
|
- }
|
|
|
+ if (this.popData.is_infinite === 0 && this.popData.payNum > this.popData.stock) {
|
|
|
+ tools.error('商品库存' + this.popData.stock + '件')
|
|
|
+ } else if (this.popData.is_quota > 0 && this.popData.payNum > this.popData.quota_num) {
|
|
|
+ tools.error('限购' + this.popData.quota_num + '件')
|
|
|
+ } else {
|
|
|
+ // 加
|
|
|
+ ++this.popData.num;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|
|
|
@@ -239,7 +249,6 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
this.popData.spec_list = res.data.spec_list
|
|
|
this.popData.spec_attr = res.data.spec_attr
|
|
|
@@ -395,8 +404,8 @@
|
|
|
}
|
|
|
} else if (type === 2) {
|
|
|
// 加
|
|
|
- if (item.is_infinite === 0 && item.num >= item.stock) {
|
|
|
- tools.error('最多购买' + item.quota_num + '件')
|
|
|
+ if (item.is_infinite === 0 && item.num >= item.stock) {
|
|
|
+ tools.error('商品库存' + item.stock + '件')
|
|
|
this.isAjax = false
|
|
|
} else if (item.is_quota > 0 && item.num >= item.quota_num) {
|
|
|
tools.error('限购' + item.quota_num + '件')
|
|
|
@@ -407,7 +416,7 @@
|
|
|
|
|
|
} else if (type === 3) {
|
|
|
// 选规格
|
|
|
- console.log(item)
|
|
|
+ console.log(item)
|
|
|
this.popData.is_quota = item.is_quota
|
|
|
this.popData.quota_num = item.quota_num
|
|
|
this.popData.is_infinite = item.is_infinite
|
|
|
@@ -419,27 +428,27 @@
|
|
|
console.log('this.popData.goods_spec_id')
|
|
|
console.log(this.popData.goods_spec_id)
|
|
|
if (this.popData.goods_spec_id) {
|
|
|
- if (this.popData.is_infinite === 0 && this.popData.payNum > this.popData.stock) {
|
|
|
- tools.error('最多购买' + this.popData.quota_num + '件')
|
|
|
- this.popData.num = this.popData.stock
|
|
|
- } else if (this.popData.is_quota > 0 && this.popData.payNum > this.popData.quota_num) {
|
|
|
- tools.error('限购' + this.popData.quota_num + '件')
|
|
|
- this.popData.num = this.popData.quota_num
|
|
|
- }else {
|
|
|
- let cartKey = this.cartData.goods_list.findIndex(row => this.popData.goods_spec_id === row
|
|
|
- .goods_spec_id)
|
|
|
- console.log(cartKey)
|
|
|
- let addType = this.popData.num > 0 ? 2 : 1
|
|
|
- console.log('addType:' + addType)
|
|
|
- if (addType === 2 && cartKey < 0) {
|
|
|
- this.setShopIngAdd(this.popData.goods_id, this.popData.goodsItem.category_id, this.popData
|
|
|
- .goods_spec_id, this.popData.num)
|
|
|
- } else {
|
|
|
- this.setShopIngNumber(this.popData.goods_id, this.popData.goodsItem.category_id, type, this
|
|
|
- .popData
|
|
|
- .goods_spec_id, this.popData.num)
|
|
|
- }
|
|
|
- }
|
|
|
+ if (this.popData.is_infinite === 0 && this.popData.payNum > this.popData.stock) {
|
|
|
+ tools.error('商品库存' + this.popData.stock + '件')
|
|
|
+ this.popData.num = this.popData.stock
|
|
|
+ } else if (this.popData.is_quota > 0 && this.popData.payNum > this.popData.quota_num) {
|
|
|
+ tools.error('限购' + this.popData.quota_num + '件')
|
|
|
+ this.popData.num = this.popData.quota_num
|
|
|
+ } else {
|
|
|
+ let cartKey = this.cartData.goods_list.findIndex(row => this.popData.goods_spec_id === row
|
|
|
+ .goods_spec_id)
|
|
|
+ console.log(cartKey)
|
|
|
+ let addType = this.popData.num > 0 ? 2 : 1
|
|
|
+ console.log('addType:' + addType)
|
|
|
+ if (addType === 2 && cartKey < 0) {
|
|
|
+ this.setShopIngAdd(this.popData.goods_id, this.popData.goodsItem.category_id, this.popData
|
|
|
+ .goods_spec_id, this.popData.num)
|
|
|
+ } else {
|
|
|
+ this.setShopIngNumber(this.popData.goods_id, this.popData.goodsItem.category_id, type, this
|
|
|
+ .popData
|
|
|
+ .goods_spec_id, this.popData.num)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
} else {
|
|
|
console.log('无规格信息')
|