修改文字
This commit is contained in:
@@ -16,6 +16,11 @@ export default function VenueInfo(props) {
|
||||
venue_image_list = [],
|
||||
} = detail;
|
||||
|
||||
// 统一为 URL 数组:接口可能是 { id, url }[] 或 string[]
|
||||
const screenshot_urls = (venue_image_list || []).map((item) =>
|
||||
typeof item === "string" ? item : (item?.url ?? "")
|
||||
).filter(Boolean);
|
||||
|
||||
function showScreenShot() {
|
||||
setVisible(true);
|
||||
}
|
||||
@@ -23,10 +28,10 @@ export default function VenueInfo(props) {
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
function previewImage(current_url) {
|
||||
function previewImage(current_url: string) {
|
||||
Taro.previewImage({
|
||||
current: current_url,
|
||||
urls: venue_image_list || [],
|
||||
urls: screenshot_urls,
|
||||
});
|
||||
}
|
||||
return (
|
||||
@@ -34,14 +39,14 @@ export default function VenueInfo(props) {
|
||||
{/* venue detail title and venue ordered status */}
|
||||
<View className={styles["venue-detail-title"]}>
|
||||
<Text>场馆详情</Text>
|
||||
{venue_image_list?.length > 0 ? (
|
||||
{screenshot_urls.length > 0 ? (
|
||||
<>
|
||||
<Text>·</Text>
|
||||
<View
|
||||
className={styles["venue-reserve-status"]}
|
||||
onClick={showScreenShot}
|
||||
>
|
||||
<Text>已订场</Text>
|
||||
<Text>查看订场截图</Text>
|
||||
<Image
|
||||
className={styles["venue-reserve-screenshot"]}
|
||||
src={img.ICON_DETAIL_ARROW_RIGHT}
|
||||
@@ -81,22 +86,20 @@ export default function VenueInfo(props) {
|
||||
<View className={styles["venue-screenshot-title"]}>预定截图</View>
|
||||
<ScrollView scrollY className={styles["venue-screenshot-scroll-view"]}>
|
||||
<View className={styles["venue-screenshot-image-list"]}>
|
||||
{venue_image_list?.length > 0 &&
|
||||
venue_image_list.map((url, index) => {
|
||||
return (
|
||||
<View
|
||||
className={styles["venue-screenshot-image-item"]}
|
||||
onClick={previewImage.bind(null, url)}
|
||||
key={index}
|
||||
>
|
||||
<Image
|
||||
className={styles["venue-screenshot-image-item-image"]}
|
||||
mode="aspectFill"
|
||||
src={url}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
})}
|
||||
{screenshot_urls.length > 0 &&
|
||||
screenshot_urls.map((url, index) => (
|
||||
<View
|
||||
className={styles["venue-screenshot-image-item"]}
|
||||
onClick={() => previewImage(url)}
|
||||
key={index}
|
||||
>
|
||||
<Image
|
||||
className={styles["venue-screenshot-image-item-image"]}
|
||||
mode="aspectFill"
|
||||
src={url}
|
||||
/>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
</ScrollView>
|
||||
</CommonPopup>
|
||||
|
||||
Reference in New Issue
Block a user