1
This commit is contained in:
@@ -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} />;
|
||||
|
||||
Reference in New Issue
Block a user