This commit is contained in:
张成
2026-02-07 00:51:30 +08:00
parent 2d68a558da
commit 8d729a0132
6 changed files with 27 additions and 33 deletions

View File

@@ -161,29 +161,22 @@ const ListContainer = (props) => {
// 渲染 banner 卡片
const renderBanner = (item, index) => {
if (!item?.banner_image_url) return null;
if (!item?.banner_image_url) {
return null;
}
return (
<View
key={item.id || `banner-${index}`}
style={{
maxHeight: "122px",
height: "122px",
overflow: "hidden",
borderRadius: "12px",
backgroundImage: `url(${item.banner_image_url})`,
backgroundSize: "contain",
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
}}
>
<Image
src={item.banner_image_url}
mode="widthFix"
style={{ width: "100%", display: "block", maxHeight: "122px" }}
onClick={() => {
const target = item.banner_detail_url;
if (target) {
(Taro as any).navigateTo({
url: `/other_pages/bannerDetail/index?img=${encodeURIComponent(target)}`,
});
}
}}
/>
</View>
);
};
@@ -216,7 +209,7 @@ const ListContainer = (props) => {
}
if (match.type === "evaluateCard") {
return (
<NTRPTestEntryCard key="evaluate" type={EvaluateScene.list} />
<NTRPTestEntryCard key={`evaluate-${index}`} type={EvaluateScene.list} />
);
}
return <ListCard key={match?.id || index} {...match} />;