feat: 展示蝦皮主图和店铺 (#142)

This commit is contained in:
chengma
2026-08-11 11:18:51 +08:00
parent a441dfef87
commit 38d6a0a04b
22 changed files with 555 additions and 101 deletions
+14
View File
@@ -342,6 +342,7 @@
title.textContent = productTitle + " · 原图";
link.href = url;
image.alt = productTitle + " 原图";
image.referrerPolicy = "no-referrer";
image.hidden = true;
status.hidden = false;
status.classList.remove("missing");
@@ -363,6 +364,18 @@
});
}
function setupImageThumbnails() {
document.querySelectorAll("[data-image-thumb]").forEach(function (image) {
function showFallback() {
image.hidden = true;
var fallback = image.parentElement && image.parentElement.querySelector("[data-image-thumb-fallback]");
if (fallback) fallback.hidden = false;
}
image.addEventListener("error", showFallback);
if (image.complete && image.naturalWidth === 0) showFallback();
});
}
/* ── 顺运宝登录弹窗:验证码"换一张" ─────────────
图片本身、以及旁边的"换一张"按钮,点了都重新请求验证码接口。
`[必须]` 每次请求带一个新的时间戳查询参数,绕开浏览器缓存——
@@ -474,6 +487,7 @@
setupModals();
setupRowDetail();
setupImagePreview();
setupImageThumbnails();
setupCaptchaRefresh();
setupSybSyncFeedback();
setupSybHistoryRefresh();