Commit ec0e609d authored by GuanHua's avatar GuanHua

fix: 下单页面商品名称拼接规格

parent 65ed174f
......@@ -286,6 +286,17 @@ const Order: React.FC<OrderPropsType> = (props) => {
return mode
}
const getProductNameAndAttr = (productInfo: any) => {
const attribute = productInfo.attribute
let attributeName = ""
let productName = productInfo.name
if(attribute && attribute.length > 0) {
attributeName = attribute.map(item => item.customerAttributeValue.value).join("/")
productName = `${productName}/${attributeName}`
}
return productName
}
/**
* 提交订单
*/
......@@ -317,7 +328,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
purchaseIds.push(orderItem.purchaseId)
temp.imgUrl = orderItem.commodityPic
temp.productId = orderItem.id
temp.productName = orderItem.name
temp.productName = getProductNameAndAttr(orderItem)
temp.unit = orderItem.unitName
temp.price = orderItem.unitPrice
temp.purchaseCount = orderItem.count
......@@ -355,7 +366,6 @@ const Order: React.FC<OrderPropsType> = (props) => {
if(signatureLogId) {
params.signatureLogId = signatureLogId
}
setConfirmLoading(true)
PublicApi.postOrderProcurementOrderAdd(params).then(res => {
if (res.code === 1000) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment