|
|
@ -204,7 +204,7 @@ Page({ |
|
|
|
|
|
|
|
|
// 解析规格
|
|
|
// 解析规格
|
|
|
const specInfo = this.parseSpecification(spec); |
|
|
const specInfo = this.parseSpecification(spec); |
|
|
let finalPrice = price; |
|
|
let finalPrice = parseFloat(price) || 0; |
|
|
let finalPriceText = price; |
|
|
let finalPriceText = price; |
|
|
|
|
|
|
|
|
// 根据规格类型和价格水平计算最终价格
|
|
|
// 根据规格类型和价格水平计算最终价格
|
|
|
@ -222,13 +222,17 @@ Page({ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return { |
|
|
const specObj = { |
|
|
name: spec, |
|
|
name: spec, |
|
|
price: price, |
|
|
price: price, |
|
|
priceText: price, |
|
|
priceText: price, |
|
|
finalPrice: finalPrice, |
|
|
finalPrice: finalPrice, |
|
|
finalPriceText: finalPriceText |
|
|
finalPriceText: finalPriceText |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
console.log('创建的规格对象:', specObj); |
|
|
|
|
|
|
|
|
|
|
|
return specObj; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
console.log('提取的规格和价格:', specifications); |
|
|
console.log('提取的规格和价格:', specifications); |
|
|
@ -243,8 +247,10 @@ Page({ |
|
|
// 跳转到规格详情页面
|
|
|
// 跳转到规格详情页面
|
|
|
goToSpecDetail(e) { |
|
|
goToSpecDetail(e) { |
|
|
const specItem = e.currentTarget.dataset.spec; |
|
|
const specItem = e.currentTarget.dataset.spec; |
|
|
|
|
|
console.log('点击的规格项:', specItem); |
|
|
|
|
|
console.log('传递的价格:', specItem.finalPriceText); |
|
|
wx.navigateTo({ |
|
|
wx.navigateTo({ |
|
|
url: `/pages/evaluate1/spec-detail?productName=${encodeURIComponent(this.data.productName)}&specification=${encodeURIComponent(specItem.name)}&price=${encodeURIComponent(specItem.finalPrice)}` |
|
|
url: `/pages/evaluate1/spec-detail?productName=${encodeURIComponent(this.data.productName)}&specification=${encodeURIComponent(specItem.name)}&price=${encodeURIComponent(specItem.finalPriceText)}` |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|