"use client"; import React, { useEffect, useRef, useState } from "react"; import { Image, Swiper, Divider, ImageViewer, Popover, Toast, } from "antd-mobile"; import { useRouter, useParams } from "next/navigation"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleLeft, faAngleRight, faEllipsisVertical, faCopy, faWarning, } from "@fortawesome/free-solid-svg-icons"; import require from "@/utils/require"; import AddWeChat from "@/components/AddWeChat"; import { handleFollow, checkRelation } from "@/api/public"; import { get } from "@/utils/storeInfo"; // import * as Clipboard from "expo-clipboard"; export default function PersonSpace() { const { mid } = useParams(); const router = useRouter(); const [streamerInfo, setStreamerInfo] = useState(null); const [spaceData, setSpaceData] = useState(null); const [loading, setLoading] = useState(false); const [visible, setVisible] = useState(false); const [isFollow, setIsFollow] = useState(false); // 获取屏幕高度 // const scrollHeight = 600; const photos = [ { url: "https://picsum.photos/seed/picsum/200/300", type: "video" }, { url: "https://picsum.photos/seed/picsum/200/300", type: "img" }, ]; useEffect(() => { getStreamerInfo(); getSpaceData(); getRelationData(); }, []); const showPhotos = (photos, index) => { ImageViewer.Multi.show({ images: photos.map((item) => item.url), defaultIndex: index, }); }; const getStreamerInfo = async () => { try { setLoading(true); const data = await require("POST", "/api/streamer/list_ext_by_mid", { body: { mid: Number(mid), }, }); if (data.ret === -1) { Toast.show({ icon: "fail", content: data.msg, position: "top", }); return; } setStreamerInfo({ ...data.data, }); setLoading(false); } catch (error) { console.error(error); } }; const getSpaceData = async () => { try { const data = await require("POST", "/api/zone/list_by_mid", { body: { mid: Number(mid), }, }); if (data.ret === -1) { Toast.show({ icon: "fail", content: data.msg, position: "top", }); return; } setSpaceData(data.data.list[0]); } catch (error) { console.error(error); } }; const getRelationData = async () => { const account = get("account"); const subMid = account.mid; const objMid = Number(mid); const temIsFollowed = await checkRelation(subMid, objMid, 0); setIsFollow(temIsFollowed); }; return (
{ router.back(); }} />
{ router.push("messageDetail"); }} > 举报
} trigger="click" placement="left" > { // router.back(); }} />
{/* 内容 */}
{photos.map((photo, index) => (
{ showPhotos(photos, index); }} > { // Toast.show(`你点击了卡片 ${index + 1}`); // }} /> {photo.type == "video" && (
)}
))}

{streamerInfo?.streamer_ext?.name}

    {streamerInfo?.streamer_ext?.tag.map((item, index) => (
  • {item}
  • ))}
  • {streamerInfo?.streamer_ext?.user_id}

个性签名| {streamerInfo?.streamer_ext?.bio}

router.push("/space/"+mid)}>
空间动态
查看{spaceData?.zone_moment_count}条 { router.back(); }} />
{spaceData?.previews?.images.map((item, index) => (
))}
{streamerInfo?.streamer_ext?.platforms && ( <>

来这找我玩

  • 微信: 点击查看
  • {streamerInfo?.streamer_ext?.platforms?.map((item) => (
  • {item?.link_name}: {item?.nickname}
    { // Clipboard.setStringAsync(item.url); // }} > 复制
    前往
  • ))}
)}
handleFollow(isFollow, Number(mid), setIsFollow)} > {isFollow ? "已关注" : "关注"}
setVisible(true)} > 添加微信
); }