"use client"; import React, { useState, useEffect } from "react"; import Image from "next/image"; import pinkline from "@/public/images/pinkline.png"; import ID from "@/public/images/ID.png"; import tiefen from "@/public/images/tiefen.png"; import wechat from "@/public/images/wechat.png"; import { Toast } from "antd-mobile"; import baseRequest from "@/utils/baseRequest"; import { generateSignature } from "@/utils/crypto"; import copy from "@/utils/copy"; import { setCookie } from "cookies-next"; import Link from "next/link"; export default function Zone({ params }) { //页面数据 const [data, setData] = useState({}); useEffect(() => { const getData = async () => { try { const base = baseRequest(); const body = { user_id: parseInt(params.user_id, 10), ...base, }; const signature = generateSignature(body); const _response = await fetch( `/api/zone/list_by_user_id_from_outside?signature=${signature}`, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify(body), } ); const _data = await _response.json(); if (_data.ret === -1) { Toast.show({ content: _data.msg, }); return; } setData(_data.data.list[0]); } catch (error) { console.error(error); } }; getData(); }, []); //将主播链接复制到剪贴板,并存cookie const copyAndSetCookieInviter = () => { setCookie("inviter", data?.streamer_ext?.user_id); copy( `【${data?.streamer_ext?.name}】『ID:${data?.streamer_ext?.user_id}』,复制此条消息,打开铁粉空间APP,查看详情https://tiefen.fun/zone/${data?.streamer_ext?.user_id}` ); }; return (

{data?.streamer_ext?.name}

{data?.streamer_ext?.user_id}

{data?.zone_moment_count}

动态

{data?.image_count}

照片

{data?.video_count}

视频

空间介绍

{data?.profile}

{data?.streamer_ext?.album?.images?.map((item, index) => { if (index > 2) return; return (
); })}
document.getElementById("comfirm_modal").showModal()} >

查看更多内容

document.getElementById("comfirm_modal").showModal()} >

解锁Ta的微信

{ copyAndSetCookieInviter(); document.getElementById("comfirm_modal").showModal(); }} > 立即加入

加入须知

阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴

{`请打开或下载【铁粉空间】APP,根据APP内弹窗指引加入空间。如未弹出,请在APP搜索ID:${data?.streamer_ext?.user_id},加入空间。`}

确认

); }