feat(h5): align report care and single-product section with updated design
This commit is contained in:
+8
-9
@@ -1556,20 +1556,19 @@
|
||||
}).join('') || '<p class="care-item">本次有效数据不足,暂无个性化护理建议。</p>';
|
||||
var product = presentation.product;
|
||||
$('.card-product').hidden = !product;
|
||||
$('.prod-title').hidden = !product;
|
||||
$('#product-unavailable').hidden = !!product;
|
||||
if (product) {
|
||||
$('#product-title').textContent = product.title;
|
||||
$('#product-name').replaceChildren();
|
||||
[product.name, '双仓精华液'].forEach(function (line) {
|
||||
var span = document.createElement('span'); span.className = 'product-line'; span.textContent = line;
|
||||
$('#product-name').appendChild(span);
|
||||
});
|
||||
// Presentation snapshots retain historical copy/recommendations. Only the
|
||||
// artwork crop is refreshed by tier, without mutating stored report data.
|
||||
// product display/artwork is refreshed by selected tier, never re-selected.
|
||||
var productArt = ReportUI.products.filter(function (p) { return p.tier === product.tier; })[0];
|
||||
$('#product-title').textContent = productArt ? productArt.title : product.title;
|
||||
$('#product-name').textContent = productArt ? productArt.name : product.name;
|
||||
$('#product-image').src = productArt ? productArt.image : product.image;
|
||||
$('#product-image').alt = product.name + '双仓精华液';
|
||||
$('#product-image').alt = (productArt ? productArt.title : product.title) + '推荐产品';
|
||||
} else {
|
||||
$('#product-image').removeAttribute('src');
|
||||
$('#product-title').textContent = '';
|
||||
$('#product-name').textContent = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user