增加付费内容提示

This commit is contained in:
al 2024-11-05 19:16:48 +08:00
parent 83dcbacf3d
commit b8fa171a65
4 changed files with 16 additions and 3 deletions

View File

@ -384,7 +384,7 @@ export default function CreateProfile() {
</div>
<div className="mt-2 px-4 py-3 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center">
<TextArea
value={formData.info}
value={formData.spaceIntro}
placeholder="介绍下你的空间吧~"
onChange={(value) =>
setFormData((old) => ({ ...old, spaceIntro: value }))

View File

@ -151,7 +151,7 @@ export default function spacePaymentSetting() {
setSuperSingleChecked(res.superfanship_valid_period);
}
const newFormData = {
spacePrice: res.admission_price / 100,
spacePrice: `${res.admission_price / 100}`,
ironFanPrice: res.ironfanship_price / 100,
openSuper: !!res.is_superfanship_enabled,
superSingle: formData.superSingle.map((it, index) => {
@ -212,6 +212,8 @@ export default function spacePaymentSetting() {
const openSuperEveryFalse = Object.values(superSingle).every(
(it) => !it.enable
);
debugger;
if (!spacePrice || !ironFanPrice || (openSuper && openSuperEveryFalse)) {
Toast.show({
icon: "fail",
@ -220,6 +222,7 @@ export default function spacePaymentSetting() {
});
return;
}
const _spacePrice = parseInt(spacePrice * 100, 10);
if (isNaN(_spacePrice) || _spacePrice < 0 || _spacePrice > 388800) {
Toast.show({

View File

@ -19,6 +19,7 @@ export default function Photos({
media,
type,
data,
isCreator = false,
}) {
const [seeAllPhotos, setSeeAllPhotos] = useState(false);
const [currentPhotos, setCurrentPhotos] = useState([]);
@ -264,7 +265,7 @@ export default function Photos({
>
{
<div
className={`overflow-hidden rounded h-full ${
className={`overflow-hidden rounded h-full relative ${
currentPhotos.length > 1 ? "h-[24vw]" : ""
}`}
>
@ -293,6 +294,14 @@ export default function Photos({
fit={currentPhotos.length > 1 ? "cover" : "contain"}
src={item?.url}
/>
{!item?.mp4 &&
isCreator &&
mediaVisibleRange < index + 1 &&
data.c_type === 1 && (
<div className="absolute bottom-0 py-1 flex justify-center w-full bg-[#00000080]">
<p className="text-sm">付费内容</p>
</div>
)}
</div>
}
{item?.mp4 && (

View File

@ -254,6 +254,7 @@ export default function PostItem({
mediaAmount={data.media_amount}
mediaVisibleRange={data.media_visible_range}
type={type}
isCreator={isCreator}
/>
)}
{type == "space" && !!data.c_type && (