"use client";
import React, { useRef, useState } from "react";
import { Image } from "antd-mobile";
import { useRouter } from "next/navigation";
import baseRequest from "@/utils/baseRequest";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faAngleRight } from "@fortawesome/free-solid-svg-icons";
export default function PaySpacePost({
type = "ironFan",
status = 0,
is_ironfan_visible = false,
data = {},
isCreator,
}) {
const base = baseRequest();
const router = useRouter();
return (
<>
{isCreator ? (
{
router.push("/space/postPurchasers?id=" + data?.id);
}}
>
{data.price / 100}
元
{data.is_ironfan_visible === 1 && (
空间内任意消费满{data.ironfanship_price / 100}元即可成为铁粉
)}
) : (
{
if (!data.is_zone_moment_unlocked) {
router.push(
"/webView/" +
encodeURIComponent(
"/zone/pay/" +
data?.zid +
"/h5_zone_moment/" +
data?.id +
"?base=" +
encodeURIComponent(JSON.stringify(base))
)
);
}
}}
>
{!data.is_zone_moment_unlocked ? (
{data.is_ironfan_visible === 1
? "铁粉免费查看"
: data.is_superfanship_enabled === 1
? "超粉免费查看"
: "付费解锁"}
) : (
{data.is_ironfanship_unlocked === 1 &&
data.is_ironfan_visible === 1 &&
"已使用铁粉特权解锁"}
{data.is_superfanship_unlocked === 1 &&
data.is_ironfan_visible === 0 &&
"已使用超粉特权解锁"}
{data.is_superfanship_unlocked === 0 &&
data.is_ironfan_visible === 0 &&
"已付费解锁"}
{data.is_ironfanship_unlocked === 0 &&
data.is_ironfan_visible === 1 &&
"已付费解锁"}
)}
{is_ironfan_visible && (
空间内任意消费满{data.ironfanship_price / 100}元即可成为铁粉
)}
)}
>
);
}