|
|
@ -64,7 +64,10 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 按供应商分组显示商品 --> |
|
|
|
<view v-for="(supplierGroup, supplierIndex) in groupedGoods" :key="supplierGroup.supplierId"> |
|
|
|
<view |
|
|
|
v-for="(supplierGroup, supplierIndex) in groupedGoods" |
|
|
|
:key="supplierGroup.supplierId" |
|
|
|
> |
|
|
|
<!-- 供应商卡片 --> |
|
|
|
<view class="supplier-card"> |
|
|
|
<!-- 供应商名称 --> |
|
|
@ -74,7 +77,11 @@ |
|
|
|
|
|
|
|
<!-- 该供应商的商品列表 --> |
|
|
|
<view class="supplier-goods"> |
|
|
|
<view class="commodity-item" v-for="(sku, index) in supplierGroup.goods" :key="index"> |
|
|
|
<view |
|
|
|
class="commodity-item" |
|
|
|
v-for="(sku, index) in supplierGroup.goods" |
|
|
|
:key="index" |
|
|
|
> |
|
|
|
<view class="commodity box"> |
|
|
|
<image |
|
|
|
class="img" |
|
|
@ -96,7 +103,11 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="commodity box sb" style="padding-left: 10rpx" v-if="false"> |
|
|
|
<view |
|
|
|
class="commodity box sb" |
|
|
|
style="padding-left: 10rpx" |
|
|
|
v-if="false" |
|
|
|
> |
|
|
|
<view class="title" style="font-weight: bold"> 购买数量 </view> |
|
|
|
<view class="num-box"> |
|
|
|
<view |
|
|
@ -156,10 +167,10 @@ |
|
|
|
<view class="text">商品总价:</view> |
|
|
|
<view class="price">{{ getGoodsTotal() }}</view> |
|
|
|
</view> |
|
|
|
<view class="price-detail"> |
|
|
|
<view class="text">运费:</view> |
|
|
|
<view class="price">包邮</view> |
|
|
|
</view> |
|
|
|
<view class="price-detail"> |
|
|
|
<view class="text">运费:</view> |
|
|
|
<view class="price">包邮</view> |
|
|
|
</view> |
|
|
|
<view class="price-detail" v-if="usePoints > 0"> |
|
|
|
<view class="text">积分抵扣:</view> |
|
|
|
<view class="price deduction" |
|
|
@ -439,25 +450,25 @@ export default { |
|
|
|
// 按supplierId分组 |
|
|
|
const supplierMap = new Map(); |
|
|
|
|
|
|
|
this.info.forEach(item => { |
|
|
|
const supplierId = item.supplierId || 'default'; |
|
|
|
const supplierName = item.supplierName || '默认供应商'; |
|
|
|
this.info.forEach((item) => { |
|
|
|
const supplierId = item.supplierId || "default"; |
|
|
|
const supplierName = item.supplierName || "默认供应商"; |
|
|
|
|
|
|
|
if (!supplierMap.has(supplierId)) { |
|
|
|
supplierMap.set(supplierId, { |
|
|
|
supplierId, |
|
|
|
supplierName, |
|
|
|
goods: [] |
|
|
|
goods: [], |
|
|
|
}); |
|
|
|
// 初始化该供应商的备注 |
|
|
|
this.$set(this.supplierRemarks, supplierId, ''); |
|
|
|
this.$set(this.supplierRemarks, supplierId, ""); |
|
|
|
} |
|
|
|
|
|
|
|
supplierMap.get(supplierId).goods.push(item); |
|
|
|
}); |
|
|
|
|
|
|
|
this.groupedGoods = Array.from(supplierMap.values()); |
|
|
|
console.log('分组后的商品:', this.groupedGoods); |
|
|
|
console.log("分组后的商品:", this.groupedGoods); |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取总积分 |
|
|
@ -632,10 +643,11 @@ export default { |
|
|
|
} else if (sku.quantity == 1) { |
|
|
|
this.$nextTick(() => { |
|
|
|
// 从原始info数组中移除该商品 |
|
|
|
const skuIndex = this.info.findIndex(item => |
|
|
|
item.goodsName === sku.goodsName && |
|
|
|
item.specValueOne === sku.specValueOne && |
|
|
|
item.specValueTwo === sku.specValueTwo |
|
|
|
const skuIndex = this.info.findIndex( |
|
|
|
(item) => |
|
|
|
item.goodsName === sku.goodsName && |
|
|
|
item.specValueOne === sku.specValueOne && |
|
|
|
item.specValueTwo === sku.specValueTwo |
|
|
|
); |
|
|
|
if (skuIndex !== -1) { |
|
|
|
this.info.splice(skuIndex, 1); |
|
|
@ -916,12 +928,13 @@ export default { |
|
|
|
|
|
|
|
// 按供应商分组构建 createDtos |
|
|
|
let createDtos = []; |
|
|
|
this.groupedGoods.forEach(supplierGroup => { |
|
|
|
const supplierRemark = this.supplierRemarks[supplierGroup.supplierId] || ''; |
|
|
|
this.groupedGoods.forEach((supplierGroup) => { |
|
|
|
const supplierRemark = |
|
|
|
this.supplierRemarks[supplierGroup.supplierId] || ""; |
|
|
|
createDtos.push({ |
|
|
|
supplierId: supplierGroup.supplierId, |
|
|
|
remark: supplierRemark, |
|
|
|
shoppingCartBoList: supplierGroup.goods |
|
|
|
shoppingCartBoList: supplierGroup.goods, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
@ -931,6 +944,7 @@ export default { |
|
|
|
expectedAmount: this.allprice, |
|
|
|
usePoints: this.usePoints ? 0 : 1, // 是否使用积分 |
|
|
|
pointsQuantity: parseInt(this.usePoints) || 0, // 使用的积分数量 |
|
|
|
shippingFee: 0, |
|
|
|
}; |
|
|
|
|
|
|
|
this.Post( |
|
|
@ -1992,33 +2006,33 @@ $bg-light: #f9f9f9; |
|
|
|
border-top: 1rpx solid #f0f0f0; |
|
|
|
|
|
|
|
.section-row { |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
min-height: 60rpx; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
min-height: 60rpx; |
|
|
|
|
|
|
|
.section-label { |
|
|
|
font-size: 28rpx; |
|
|
|
color: #333333; |
|
|
|
font-weight: 500; |
|
|
|
} |
|
|
|
.section-label { |
|
|
|
font-size: 28rpx; |
|
|
|
color: #333333; |
|
|
|
font-weight: 500; |
|
|
|
} |
|
|
|
|
|
|
|
.note-input { |
|
|
|
flex: 1; |
|
|
|
margin-left: 40rpx; |
|
|
|
.note-input { |
|
|
|
flex: 1; |
|
|
|
margin-left: 40rpx; |
|
|
|
|
|
|
|
input { |
|
|
|
font-size: 26rpx; |
|
|
|
color: #333333; |
|
|
|
text-align: right; |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
input { |
|
|
|
font-size: 26rpx; |
|
|
|
color: #333333; |
|
|
|
text-align: right; |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
|
|
|
|
.placeholder { |
|
|
|
color: #999999; |
|
|
|
} |
|
|
|
.placeholder { |
|
|
|
color: #999999; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.tickets-box { |
|
|
|