feat: present miniapp order details with formatted amounts
This commit is contained in:
@@ -38,6 +38,23 @@ function toOrderCards({ goodsOrders = [], expressOrders = [], groupBuyOrders = [
|
||||
return orders
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
toOrderCards
|
||||
function toOrderDetail(type, order) {
|
||||
const detail = Object.assign({}, order, {
|
||||
statusText: statusText(order && order.status)
|
||||
})
|
||||
if (type === 'goods') {
|
||||
detail.totalAmountText = '¥' + yuan(order.totalAmountCent)
|
||||
detail.deliveryFeeText = '¥' + yuan(order.deliveryFeeCent)
|
||||
detail.payableAmountText = '¥' + yuan(order.payableAmountCent)
|
||||
} else if (type === 'express') {
|
||||
detail.feeText = '¥' + yuan(order.feeCent)
|
||||
} else if (type === 'group') {
|
||||
detail.amountText = '¥' + yuan(order.amountCent)
|
||||
}
|
||||
return detail
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
toOrderCards,
|
||||
toOrderDetail
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user