|
|
@ -64,17 +64,24 @@ |
|
|
|
</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"> |
|
|
|
<!-- 供应商名称 --> |
|
|
|
<view class="supplier-header"> |
|
|
|
<text class="supplier-name">{{ supplierGroup.supplierName }}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 该供应商的商品列表 --> |
|
|
|
<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 |
|
|
@ -115,7 +126,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 该供应商的备注 --> |
|
|
|
<view class="supplier-remark"> |
|
|
|
<view class="section-row"> |
|
|
@ -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" |
|
|
@ -438,26 +449,26 @@ 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,15 +643,16 @@ 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); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.flag) { |
|
|
|
this.getPost(); |
|
|
|
} |
|
|
@ -916,21 +928,23 @@ 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, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
let data = { |
|
|
|
createDtos: createDtos, |
|
|
|
userContactId: this.contacts.id, |
|
|
|
expectedAmount: this.allprice, |
|
|
|
usePoints: this.usePoints ? 0 : 1, // 是否使用积分 |
|
|
|
pointsQuantity: parseInt(this.usePoints) || 0, // 使用的积分数量 |
|
|
|
shippingFee: 0, |
|
|
|
}; |
|
|
|
|
|
|
|
this.Post( |
|
|
@ -1964,7 +1978,7 @@ $bg-light: #f9f9f9; |
|
|
|
.supplier-header { |
|
|
|
padding: 20rpx 24rpx; |
|
|
|
background: #ffffff; |
|
|
|
|
|
|
|
|
|
|
|
.supplier-name { |
|
|
|
font-size: 30rpx; |
|
|
|
font-weight: 600; |
|
|
@ -1975,10 +1989,10 @@ $bg-light: #f9f9f9; |
|
|
|
// 供应商商品列表样式 |
|
|
|
.supplier-goods { |
|
|
|
padding: 0; |
|
|
|
|
|
|
|
|
|
|
|
.commodity-item { |
|
|
|
border-bottom: 1rpx solid #f0f0f0; |
|
|
|
|
|
|
|
|
|
|
|
&:last-child { |
|
|
|
border-bottom: none; |
|
|
|
} |
|
|
@ -1990,35 +2004,35 @@ $bg-light: #f9f9f9; |
|
|
|
background-color: #ffffff; |
|
|
|
padding: 20rpx 24rpx; |
|
|
|
border-top: 1rpx solid #f0f0f0; |
|
|
|
|
|
|
|
|
|
|
|
.section-row { |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
min-height: 60rpx; |
|
|
|
|
|
|
|
.section-label { |
|
|
|
font-size: 28rpx; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
min-height: 60rpx; |
|
|
|
|
|
|
|
.section-label { |
|
|
|
font-size: 28rpx; |
|
|
|
color: #333333; |
|
|
|
font-weight: 500; |
|
|
|
} |
|
|
|
|
|
|
|
.note-input { |
|
|
|
flex: 1; |
|
|
|
margin-left: 40rpx; |
|
|
|
|
|
|
|
input { |
|
|
|
font-size: 26rpx; |
|
|
|
color: #333333; |
|
|
|
font-weight: 500; |
|
|
|
text-align: right; |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
|
|
|
|
.note-input { |
|
|
|
flex: 1; |
|
|
|
margin-left: 40rpx; |
|
|
|
|
|
|
|
input { |
|
|
|
font-size: 26rpx; |
|
|
|
color: #333333; |
|
|
|
text-align: right; |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
|
|
|
|
.placeholder { |
|
|
|
color: #999999; |
|
|
|
} |
|
|
|
|
|
|
|
.placeholder { |
|
|
|
color: #999999; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.tickets-box { |
|
|
|