fix:订单详情
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"fusenapi/constants"
|
||||
"fusenapi/model/gmodel"
|
||||
"fusenapi/utils/basic"
|
||||
@@ -79,16 +78,21 @@ func (d *defaultOrder) Detail(ctx context.Context, in *DetailReq) (res *DetailRe
|
||||
return &DetailRes{}, nil
|
||||
}
|
||||
|
||||
func (d *defaultOrder) OrderDetailHandler(ctx context.Context, order *gmodel.FsOrder) (res *DetailRes, err error) {
|
||||
func (d *defaultOrder) OrderDetailHandler(ctx context.Context, orderInfo *gmodel.FsOrder) (res *DetailRes, err error) {
|
||||
var orderDetail gmodel.OrderDetail
|
||||
|
||||
err = json.Unmarshal(*order.Metadata, &orderDetail)
|
||||
err = json.Unmarshal(*orderInfo.Metadata, &orderDetail)
|
||||
if err != nil {
|
||||
logx.Errorf("create handler unmarshal metadata failed, err: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println(orderDetail)
|
||||
|
||||
for _, orderProduct := range orderDetail.OrderProduct {
|
||||
orderProduct.TotalPrice = order.GetAmountInfoFormat(&orderProduct.TotalPrice)
|
||||
orderProduct.ItemPrice = order.GetAmountInfoFormat(&orderProduct.ItemPrice)
|
||||
orderProduct.ShoppingCartSnapshot = nil
|
||||
}
|
||||
orderDetail.OrderInfo.StatusLink = order.GetOrderStatusLinkUser(orderDetail.OrderInfo.DeliveryMethod, orderDetail.OrderInfo.StatusLink)
|
||||
orderDetail.OrderAmount.Deposit.PayAmount = order.GetAmountInfoFormat(&orderDetail.OrderAmount.Deposit.PayAmount)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -294,7 +298,8 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe
|
||||
Cm: shoppingCartSnapshot.SizeInfo.Cm,
|
||||
},
|
||||
},
|
||||
StepNum: stepNum,
|
||||
StepNum: stepNum,
|
||||
IsHighlyCustomized: *shoppingCart.IsHighlyCustomized,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user