修改文字

This commit is contained in:
张成
2026-03-09 17:23:32 +08:00
parent 636e218a63
commit 2e4fd16383

View File

@@ -16,6 +16,11 @@ export default function VenueInfo(props) {
venue_image_list = [], venue_image_list = [],
} = detail; } = detail;
// 统一为 URL 数组:接口可能是 { id, url }[] 或 string[]
const screenshot_urls = (venue_image_list || []).map((item) =>
typeof item === "string" ? item : (item?.url ?? "")
).filter(Boolean);
function showScreenShot() { function showScreenShot() {
setVisible(true); setVisible(true);
} }
@@ -23,10 +28,10 @@ export default function VenueInfo(props) {
setVisible(false); setVisible(false);
} }
function previewImage(current_url) { function previewImage(current_url: string) {
Taro.previewImage({ Taro.previewImage({
current: current_url, current: current_url,
urls: venue_image_list || [], urls: screenshot_urls,
}); });
} }
return ( return (
@@ -34,14 +39,14 @@ export default function VenueInfo(props) {
{/* venue detail title and venue ordered status */} {/* venue detail title and venue ordered status */}
<View className={styles["venue-detail-title"]}> <View className={styles["venue-detail-title"]}>
<Text></Text> <Text></Text>
{venue_image_list?.length > 0 ? ( {screenshot_urls.length > 0 ? (
<> <>
<Text>·</Text> <Text>·</Text>
<View <View
className={styles["venue-reserve-status"]} className={styles["venue-reserve-status"]}
onClick={showScreenShot} onClick={showScreenShot}
> >
<Text></Text> <Text></Text>
<Image <Image
className={styles["venue-reserve-screenshot"]} className={styles["venue-reserve-screenshot"]}
src={img.ICON_DETAIL_ARROW_RIGHT} src={img.ICON_DETAIL_ARROW_RIGHT}
@@ -81,12 +86,11 @@ export default function VenueInfo(props) {
<View className={styles["venue-screenshot-title"]}></View> <View className={styles["venue-screenshot-title"]}></View>
<ScrollView scrollY className={styles["venue-screenshot-scroll-view"]}> <ScrollView scrollY className={styles["venue-screenshot-scroll-view"]}>
<View className={styles["venue-screenshot-image-list"]}> <View className={styles["venue-screenshot-image-list"]}>
{venue_image_list?.length > 0 && {screenshot_urls.length > 0 &&
venue_image_list.map((url, index) => { screenshot_urls.map((url, index) => (
return (
<View <View
className={styles["venue-screenshot-image-item"]} className={styles["venue-screenshot-image-item"]}
onClick={previewImage.bind(null, url)} onClick={() => previewImage(url)}
key={index} key={index}
> >
<Image <Image
@@ -95,8 +99,7 @@ export default function VenueInfo(props) {
src={url} src={url}
/> />
</View> </View>
); ))}
})}
</View> </View>
</ScrollView> </ScrollView>
</CommonPopup> </CommonPopup>