fix:购物车下单

This commit is contained in:
momo 2023-09-20 16:37:37 +08:00
parent 71b6aaf014
commit 4d3f1512ac
2 changed files with 44 additions and 18 deletions

View File

@ -116,11 +116,27 @@ type OrderProduct struct {
ItemPrice AmountInfo `json:"product_price"` // 商品单价
ProductSnapshot map[string]interface{} `json:"product_snapshot"` // 商品快照
ShoppingCartSnapshot *FsShoppingCart `json:"shopping_cart_snapshot"` // 购物车快照
DiyInformation *UserDiyInformation `json:"diy_information"`
FittingInfo *FittingInfo `json:"fitting_info"`
ProductCover string `json:"product_cover"` // 商品封面
ProductCoverMetadata map[string]interface{} `json:"product_cover_metadata"` // 商品封面
ProductSn string `json:"product_sn"` // 商品编码
SizeInfo *SizeInfo `json:"size_info"`
DiyInformation *UserDiyInformation `json:"diy_information"`
SizeInfo *OrderProductSizeInfo `json:"size_info"`
FittingInfo *OrderProductFittingInfo `json:"fitting_info"`
StepNum []int `json:"step_num"` // 阶梯数量
}
type OrderProductSizeInfo struct {
SizeID int64 `json:"size_id"`
Capacity string `json:"capacity"`
Title OrderProductSizeInfoTitle `json:"title"`
}
type OrderProductSizeInfoTitle struct {
Inch string `json:"inch"`
Cm string `json:"cm"`
}
type OrderProductFittingInfo struct {
FittingID int64 `json:"fitting_id"` //配件ID
FittingName string `json:"fitting_name"` //配件名称
}

View File

@ -247,8 +247,18 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe
ShoppingCartSnapshot: &shoppingCart.FsShoppingCart,
ProductSn: *shoppingCart.ShoppingCartProduct.Sn,
DiyInformation: &shoppingCartSnapshot.UserDiyInformation,
FittingInfo: &shoppingCartSnapshot.FittingInfo,
SizeInfo: &shoppingCartSnapshot.SizeInfo,
FittingInfo: &gmodel.OrderProductFittingInfo{
FittingID: *shoppingCart.FittingId,
FittingName: shoppingCartSnapshot.FittingInfo.FittingName,
},
SizeInfo: &gmodel.OrderProductSizeInfo{
SizeID: *shoppingCart.SizeId,
Capacity: shoppingCartSnapshot.SizeInfo.Capacity,
Title: gmodel.OrderProductSizeInfoTitle{
Inch: shoppingCartSnapshot.SizeInfo.Inch,
Cm: shoppingCartSnapshot.SizeInfo.Cm,
},
},
StepNum: stepNum,
})
}