|
|
|
@ -111,12 +111,17 @@ function processWeightAndQuantityData(weightSpecString, quantityString, specStri |
|
|
|
|
|
|
|
console.log(`处理第${i}组数据: weightSpec=${weightSpec}, quantity=${quantity}`); |
|
|
|
|
|
|
|
// 处理净重规格显示格式 - 保持原始格式,如果包含"净重"则保持,否则添加
|
|
|
|
// 处理净重规格显示格式 - 根据内容类型添加相应前缀
|
|
|
|
let weightSpecDisplay = ''; |
|
|
|
if (weightSpec) { |
|
|
|
if (weightSpec.includes('净重')) { |
|
|
|
// 如果已包含"净重"前缀,保持不变
|
|
|
|
weightSpecDisplay = weightSpec; |
|
|
|
} else if (weightSpec.includes('毛重')) { |
|
|
|
// 如果已包含"毛重"前缀,保持不变
|
|
|
|
weightSpecDisplay = weightSpec; |
|
|
|
} else { |
|
|
|
// 如果都不包含,默认为净重
|
|
|
|
weightSpecDisplay = `净重${weightSpec}`; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -338,20 +343,20 @@ Page({ |
|
|
|
console.log('product.minOrder:', product.minOrder); |
|
|
|
console.log('product.grossWeight:', grossWeightValue); |
|
|
|
|
|
|
|
if (product.spec && typeof product.spec === 'string' && product.spec.includes('净重')) { |
|
|
|
// 如果规格字段包含净重信息,则使用该字段作为净重规格数据
|
|
|
|
if (product.spec && typeof product.spec === 'string' && (product.spec.includes('净重') || product.spec.includes('毛重'))) { |
|
|
|
// 如果规格字段包含净重或毛重信息,则使用该字段作为重量规格数据
|
|
|
|
weightSpecString = product.spec; |
|
|
|
console.log('使用规格字段作为净重规格数据:', weightSpecString); |
|
|
|
} else if (product.specification && typeof product.specification === 'string' && product.specification.includes('净重')) { |
|
|
|
console.log('使用规格字段作为重量规格数据:', weightSpecString); |
|
|
|
} else if (product.specification && typeof product.specification === 'string' && (product.specification.includes('净重') || product.specification.includes('毛重'))) { |
|
|
|
// 检查specification字段
|
|
|
|
weightSpecString = product.specification; |
|
|
|
console.log('使用specification字段作为净重规格数据:', weightSpecString); |
|
|
|
console.log('使用specification字段作为重量规格数据:', weightSpecString); |
|
|
|
} else if (grossWeightValue) { |
|
|
|
// 如果有单独的净重字段,则使用净重字段
|
|
|
|
// 如果有单独的重量字段,则使用该字段
|
|
|
|
weightSpecString = grossWeightValue; |
|
|
|
console.log('使用净重字段作为净重规格数据:', weightSpecString); |
|
|
|
console.log('使用重量字段作为重量规格数据:', weightSpecString); |
|
|
|
} else { |
|
|
|
console.log('未找到净重规格数据'); |
|
|
|
console.log('未找到重量规格数据'); |
|
|
|
} |
|
|
|
|
|
|
|
// 处理件数数据
|
|
|
|
|