继续完善购物逻辑闭环,consumer模块完成度75%

This commit is contained in:
2026-01-26 17:15:51 +08:00
parent be90f1213b
commit f2f208f258
21 changed files with 2516 additions and 217 deletions

View File

@@ -326,9 +326,27 @@ export default {
return
}
const sku = this.productSkus.find(s => s.id === this.selectedSkuId)
const selectedItem = {
id: this.selectedSkuId,
product_id: this.product.id,
sku_id: this.selectedSkuId,
product_name: this.product.name,
product_image: (sku && sku.image_url) ? sku.image_url : this.product.images[0],
sku_specifications: sku ? sku.specifications : {},
price: sku ? sku.price : this.product.price,
quantity: this.quantity
}
// 跳转到订单确认页
uni.navigateTo({
url: `/pages/mall/consumer/order-confirm?productId=${this.product.id}&skuId=${this.selectedSkuId}&quantity=${this.quantity}`
url: '/pages/mall/consumer/checkout',
success: (res) => {
res.eventChannel.emit('acceptData', {
selectedItems: [selectedItem]
})
}
})
},