fix:支付
This commit is contained in:
parent
46f3b2ff0e
commit
94088b5aa4
|
@ -95,22 +95,23 @@ type OrderStatus struct {
|
|||
|
||||
// 订单商品
|
||||
type OrderProduct struct {
|
||||
TotalPrice AmountInfo `json:"amount"` // 商品总价
|
||||
ExpectedDeliveryTime *time.Time `json:"expected_delivery_time"` // 预计到货时间
|
||||
PurchaseQuantity PurchaseQuantity `json:"purchase_quantity"` // 购买数量
|
||||
ProductID int64 `json:"product_id"` // 商品ID
|
||||
ProductName string `json:"product_name"` // 商品名称
|
||||
ItemPrice AmountInfo `json:"product_price"` // 商品单价
|
||||
ProductSnapshot interface{} `json:"product_snapshot"` // 商品快照
|
||||
ShoppingCartSnapshot *FsShoppingCart `json:"shopping_cart_snapshot"` // 购物车快照
|
||||
ProductCover string `json:"product_cover"` // 商品封面
|
||||
ProductCoverMetadata map[string]interface{} `json:"product_cover_metadata"` // 商品封面
|
||||
ProductSn string `json:"product_sn"` // 商品编码
|
||||
DiyInformation *UserDiyInformation `json:"diy_information"`
|
||||
SizeInfo *OrderProductSizeInfo `json:"size_info"`
|
||||
FittingInfo *OrderProductFittingInfo `json:"fitting_info"`
|
||||
StepNum []int `json:"step_num"` // 阶梯数量
|
||||
IsHighlyCustomized int64 `json:"is_highly_customized"`
|
||||
TotalPrice AmountInfo `json:"amount"` // 商品总价
|
||||
ExpectedDeliveryTime *time.Time `json:"expected_delivery_time"` // 预计到货时间
|
||||
PurchaseQuantity PurchaseQuantity `json:"purchase_quantity"` // 购买数量
|
||||
ProductID int64 `json:"product_id"` // 商品ID
|
||||
ProductName string `json:"product_name"` // 商品名称
|
||||
ItemPrice AmountInfo `json:"product_price"` // 商品单价
|
||||
ProductSnapshot interface{} `json:"product_snapshot"` // 商品快照
|
||||
ShoppingCartSnapshot *FsShoppingCart `json:"shopping_cart_snapshot"` // 购物车快照
|
||||
ShoppingCartSnapshotInfo map[string]interface{} `json:"shopping_cart_snapshot_info"` // 商品封面
|
||||
ProductCover string `json:"product_cover"` // 商品封面
|
||||
ProductCoverMetadata map[string]interface{} `json:"product_cover_metadata"` // 商品封面
|
||||
ProductSn string `json:"product_sn"` // 商品编码
|
||||
DiyInformation *UserDiyInformation `json:"diy_information"`
|
||||
SizeInfo *OrderProductSizeInfo `json:"size_info"`
|
||||
FittingInfo *OrderProductFittingInfo `json:"fitting_info"`
|
||||
StepNum []int `json:"step_num"` // 阶梯数量
|
||||
IsHighlyCustomized int64 `json:"is_highly_customized"`
|
||||
}
|
||||
type PurchaseQuantity struct {
|
||||
Current interface{} `json:"current"`
|
||||
|
|
|
@ -1076,6 +1076,43 @@ func (d *defaultOrder) OrderDetailHandler(ctx context.Context, orderInfo *gmodel
|
|||
orderDetail.OrderProduct[orderProductKey].TotalPrice = order.GetAmountInfoFormat(&orderProduct.TotalPrice)
|
||||
orderDetail.OrderProduct[orderProductKey].PurchaseQuantity = order.GetPurchaseQuantity(&orderProduct.PurchaseQuantity)
|
||||
orderDetail.OrderProduct[orderProductKey].ProductSnapshot = nil
|
||||
var snapshot map[string]interface{}
|
||||
if orderDetail.OrderProduct[orderProductKey].ShoppingCartSnapshot.Snapshot != nil {
|
||||
json.Unmarshal([]byte(*orderDetail.OrderProduct[orderProductKey].ShoppingCartSnapshot.Snapshot), &snapshot)
|
||||
}
|
||||
snapshotfittingInfoData, snapshotfittingInfoEx := snapshot["fitting_info"]
|
||||
var snapshotfittingInfoJson map[string]interface{}
|
||||
if snapshotfittingInfoEx {
|
||||
snapshotfittingInfo := snapshotfittingInfoData.(map[string]interface{})
|
||||
snapshotfittingInfoJsonData, snapshotfittingInfoJsonEx := snapshotfittingInfo["fitting_json"]
|
||||
if snapshotfittingInfoJsonEx {
|
||||
var snapshotfittingInfoJson map[string]interface{}
|
||||
json.Unmarshal([]byte(snapshotfittingInfoJsonData.(string)), &snapshotfittingInfoJson)
|
||||
}
|
||||
}
|
||||
snapshot["fitting_info"] = snapshotfittingInfoJson
|
||||
snapshotModelInfoData, snapshotModelInfoEx := snapshot["model_info"]
|
||||
var snapshotModelInfoJson map[string]interface{}
|
||||
if snapshotModelInfoEx {
|
||||
snapshotModelInfo := snapshotModelInfoData.(map[string]interface{})
|
||||
snapshotModelInfoJsonData, snapshotModelInfoJsonEx := snapshotModelInfo["model_json"]
|
||||
if snapshotModelInfoJsonEx {
|
||||
json.Unmarshal([]byte(snapshotModelInfoJsonData.(string)), &snapshotModelInfoJson)
|
||||
}
|
||||
}
|
||||
snapshot["model_info"] = snapshotModelInfoJson
|
||||
snapshotTemplateInfoData, snapshotTemplateInfoEx := snapshot["template_info"]
|
||||
var snapshotTemplateInfoJson map[string]interface{}
|
||||
if snapshotTemplateInfoEx {
|
||||
snapshotTemplateInfo := snapshotTemplateInfoData.(map[string]interface{})
|
||||
snapshotTemplateInfoJsonData, snapshotTemplateInfoJsonEx := snapshotTemplateInfo["template_json"]
|
||||
if snapshotTemplateInfoJsonEx {
|
||||
json.Unmarshal([]byte(snapshotTemplateInfoJsonData.(string)), &snapshotTemplateInfoJson)
|
||||
}
|
||||
}
|
||||
snapshot["template_info"] = snapshotTemplateInfoJson
|
||||
orderDetail.OrderProduct[orderProductKey].ShoppingCartSnapshot.Snapshot = nil
|
||||
orderDetail.OrderProduct[orderProductKey].ShoppingCartSnapshotInfo = snapshot
|
||||
}
|
||||
orderDetail.OrderInfo.StatusLink = order.GetOrderStatusLinkUser(orderDetail.OrderInfo.DeliveryMethod, orderDetail.OrderInfo.StatusLink)
|
||||
orderDetail.OrderAmount.Deposit.PayAmount = order.GetAmountInfoFormat(&orderDetail.OrderAmount.Deposit.PayAmount)
|
||||
|
|
Loading…
Reference in New Issue
Block a user