修复问题1029
This commit is contained in:
parent
1c47975ea2
commit
adb617d041
|
@ -14,9 +14,10 @@ export default function CreateImagePost() {
|
|||
const [priceEdit, setPriceEdit] = useState(false);
|
||||
const [postCount, setPostCount] = useState(null);
|
||||
const [isBlockModalVisible, setIsBlockModalVisible] = useState(false);
|
||||
const [oldPhotos, setOldPhotos] = useState([]);
|
||||
//价格
|
||||
const [formData, setFormData] = useState({
|
||||
price: 0,
|
||||
price: "",
|
||||
content: "",
|
||||
paidText: "",
|
||||
imageAssets: [],
|
||||
|
@ -25,7 +26,7 @@ export default function CreateImagePost() {
|
|||
isFreeForIronfan: false,
|
||||
});
|
||||
const [priceEditData, setPriceEditData] = useState({
|
||||
price: 0,
|
||||
price: "",
|
||||
imageVisibleRange: 1,
|
||||
isCreatingPaidText: false,
|
||||
isFreeForIronfan: false,
|
||||
|
@ -48,6 +49,11 @@ export default function CreateImagePost() {
|
|||
});
|
||||
return;
|
||||
}
|
||||
const ttt = _data.data.streamer.album.images.map((item) => ({
|
||||
url: item.urls[0],
|
||||
id: item.id,
|
||||
}));
|
||||
setOldPhotos(ttt);
|
||||
setPostCount(_data.data);
|
||||
if (_data.data.rejected_count >= 5) setIsBlockModalVisible(true);
|
||||
} catch (error) {
|
||||
|
@ -214,37 +220,46 @@ export default function CreateImagePost() {
|
|||
</div>
|
||||
<div className="mt-2">
|
||||
<p className="text-base font-medium text-white">动态内容</p>
|
||||
<TextArea
|
||||
placeholder="请遵守平台准则,严禁发布违规内容"
|
||||
value={formData.content}
|
||||
onChange={(value) =>
|
||||
setFormData((old) => ({ ...old, content: value }))
|
||||
}
|
||||
style={{ "--font-size": "14px" }}
|
||||
className="h-32 bg-[#FFFFFF1A] rounded-2xl mt-2 mb-4 p-2"
|
||||
/>
|
||||
<div className="h-32">
|
||||
<TextArea
|
||||
placeholder="请遵守平台准则,严禁发布违规内容"
|
||||
value={formData.content}
|
||||
autoSize={{ minRows: 6, maxRows: 15 }}
|
||||
onChange={(value) =>
|
||||
setFormData((old) => ({ ...old, content: value }))
|
||||
}
|
||||
style={{ "--font-size": "14px" }}
|
||||
className="h-full bg-[#FFFFFF1A] rounded-2xl mt-2 mb-4 p-2"
|
||||
/>
|
||||
</div>
|
||||
{formData.isCreatingPaidText && formData.price > 0 && (
|
||||
<>
|
||||
<div className="mt-2">
|
||||
<span className="text-base font-medium text-white">付费文案</span>
|
||||
<TextArea
|
||||
placeholder="仅在用户解锁后展示,请勿发布违规内容"
|
||||
onChange={(value) =>
|
||||
setFormData((old) => ({ ...old, paidText: value }))
|
||||
}
|
||||
value={formData.paidText}
|
||||
style={{ "--font-size": "14px" }}
|
||||
className="h-32 bg-[#FFFFFF1A] rounded-2xl mt-2 mb-4 p-2"
|
||||
/>
|
||||
</>
|
||||
<div className="h-32">
|
||||
<TextArea
|
||||
placeholder="仅在用户解锁后展示,请勿发布违规内容"
|
||||
onChange={(value) =>
|
||||
setFormData((old) => ({ ...old, paidText: value }))
|
||||
}
|
||||
autoSize={{ minRows: 6, maxRows: 15 }}
|
||||
value={formData.paidText}
|
||||
style={{ "--font-size": "14px" }}
|
||||
className="h-full bg-[#FFFFFF1A] rounded-2xl mt-2 mb-4 p-2"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<UploadImgs
|
||||
type={1}
|
||||
assets={formData.imageAssets}
|
||||
getImgs={(imgs) => {
|
||||
setFormData((old) => ({ ...old, imageAssets: imgs }));
|
||||
}}
|
||||
/>
|
||||
<div className="mt-4">
|
||||
<UploadImgs
|
||||
type={1}
|
||||
existImages={oldPhotos}
|
||||
assets={formData.imageAssets}
|
||||
getImgs={(imgs) => {
|
||||
setFormData((old) => ({ ...old, imageAssets: imgs }));
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
color="#FF669E"
|
||||
radius="999"
|
||||
|
|
|
@ -17,7 +17,7 @@ export default function CreateVideoPost() {
|
|||
const [isBlockModalVisible, setIsBlockModalVisible] = useState(false);
|
||||
//价格
|
||||
const [formData, setFormData] = useState({
|
||||
price: 0,
|
||||
price: "",
|
||||
content: "",
|
||||
paidText: "",
|
||||
imageAssets: [],
|
||||
|
@ -26,7 +26,7 @@ export default function CreateVideoPost() {
|
|||
isFreeForIronfan: false,
|
||||
});
|
||||
const [priceEditData, setPriceEditData] = useState({
|
||||
price: 0,
|
||||
price: "",
|
||||
blurCover: true,
|
||||
isCreatingPaidText: false,
|
||||
isFreeForIronfan: false,
|
||||
|
@ -152,7 +152,7 @@ export default function CreateVideoPost() {
|
|||
}}
|
||||
/>
|
||||
</div>
|
||||
<p className="text-base text-center leading-9">图文动态(空间内)</p>
|
||||
<p className="text-base text-center leading-9">视频动态(空间内)</p>
|
||||
{isSubmitting ? (
|
||||
<DotLoading />
|
||||
) : (
|
||||
|
@ -202,6 +202,7 @@ export default function CreateVideoPost() {
|
|||
onChange={(value) =>
|
||||
setFormData((old) => ({ ...old, content: value }))
|
||||
}
|
||||
autoSize={{ minRows: 6, maxRows: 15 }}
|
||||
style={{ "--font-size": "14px" }}
|
||||
className="h-32 bg-[#FFFFFF1A] text-white rounded-2xl mt-2 mb-4 p-2"
|
||||
/>
|
||||
|
@ -213,6 +214,7 @@ export default function CreateVideoPost() {
|
|||
onChange={(value) =>
|
||||
setFormData((old) => ({ ...old, paidText: value }))
|
||||
}
|
||||
autoSize={{ minRows: 6, maxRows: 15 }}
|
||||
value={formData.paidText}
|
||||
style={{ "--font-size": "14px" }}
|
||||
className="h-32 bg-[#FFFFFF1A] text-white rounded-2xl mt-2 mb-4 p-2"
|
||||
|
|
|
@ -15,7 +15,7 @@ export default function EditSpacePost() {
|
|||
const [priceEdit, setPriceEdit] = useState(false);
|
||||
//价格
|
||||
const [formData, setFormData] = useState({
|
||||
price: 0,
|
||||
price: "",
|
||||
content: "",
|
||||
paidText: "",
|
||||
imageAssets: [],
|
||||
|
@ -24,7 +24,7 @@ export default function EditSpacePost() {
|
|||
isFreeForIronfan: false,
|
||||
});
|
||||
const [priceEditData, setPriceEditData] = useState({
|
||||
price: 0,
|
||||
price: "",
|
||||
imageVisibleRange: 1,
|
||||
isCreatingPaidText: false,
|
||||
isFreeForIronfan: false,
|
||||
|
@ -43,7 +43,6 @@ export default function EditSpacePost() {
|
|||
blurCover: data?.is_blurring_cover == 1,
|
||||
};
|
||||
// const imgs = getExistImgs(data);
|
||||
|
||||
setFormData({
|
||||
content: data?.paid_text
|
||||
? data?.text.slice(0, data?.text.length - data?.paid_text.length)
|
||||
|
@ -252,32 +251,41 @@ export default function EditSpacePost() {
|
|||
)}
|
||||
<div className="mt-2">
|
||||
<p className="text-base font-medium text-white">动态内容</p>
|
||||
<TextArea
|
||||
placeholder="请遵守平台准则,严禁发布违规内容"
|
||||
value={formData.content}
|
||||
onChange={(value) =>
|
||||
setFormData((old) => ({ ...old, content: value }))
|
||||
}
|
||||
style={{ "--font-size": "14px" }}
|
||||
className="h-32 bg-[#FFFFFF1A] rounded-2xl mt-2 mb-4 p-2"
|
||||
/>
|
||||
<div className="h-32">
|
||||
<TextArea
|
||||
placeholder="请遵守平台准则,严禁发布违规内容"
|
||||
value={formData.content}
|
||||
onChange={(value) =>
|
||||
setFormData((old) => ({ ...old, content: value }))
|
||||
}
|
||||
autoSize={{ minRows: 6, maxRows: 15 }}
|
||||
style={{ "--font-size": "14px" }}
|
||||
className="h-full bg-[#FFFFFF1A] rounded-2xl mt-2 mb-4 p-2"
|
||||
/>
|
||||
</div>
|
||||
{!!formData.isCreatingPaidText && formData.price > 0 && (
|
||||
<>
|
||||
<div className="mt-2">
|
||||
<span className="text-base font-medium text-white">付费文案</span>
|
||||
<TextArea
|
||||
placeholder="仅在用户解锁后展示,请勿发布违规内容"
|
||||
onChange={(value) =>
|
||||
setFormData((old) => ({ ...old, paidText: value }))
|
||||
}
|
||||
value={formData.paidText}
|
||||
style={{ "--font-size": "14px" }}
|
||||
className="h-32 bg-[#FFFFFF1A] rounded-2xl mt-2 mb-4 p-2"
|
||||
/>
|
||||
</>
|
||||
<div className="h-32">
|
||||
<TextArea
|
||||
placeholder="仅在用户解锁后展示,请勿发布违规内容"
|
||||
onChange={(value) =>
|
||||
setFormData((old) => ({
|
||||
...old,
|
||||
paidText: value,
|
||||
}))
|
||||
}
|
||||
autoSize={{ minRows: 6, maxRows: 15 }}
|
||||
value={formData.paidText && formData.paidText.slice(2)}
|
||||
style={{ "--font-size": "14px" }}
|
||||
className="bg-[#FFFFFF1A] rounded-2xl mt-2 mb-4 p-2 h-full"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{data?.m_type && (
|
||||
<div>
|
||||
<div className="mt-2">
|
||||
<UploadImgs
|
||||
type={data?.m_type}
|
||||
existImages={getExistImgs}
|
||||
|
|
|
@ -208,6 +208,9 @@ export default function EditStreamerMedia() {
|
|||
URL.revokeObjectURL(url);
|
||||
});
|
||||
};
|
||||
useEffect(() => {
|
||||
setFormData((old) => ({ ...old, imageAssets: oldPhotos }));
|
||||
}, [oldPhotos]);
|
||||
return (
|
||||
<div>
|
||||
{/* 头部标题 */}
|
||||
|
|
|
@ -175,26 +175,33 @@ export default function PostItem({
|
|||
{(data?.status === 0 || data?.status === 1) && (
|
||||
<div className="flex flex-col items-start mt-2">
|
||||
<div className="py-1 px-2 rounded bg-[#3B69B8]">
|
||||
<span className="text-white text-sm">审核中</span>
|
||||
<span className="text-sm">审核中</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{data?.status === 3 && type == "space" && (
|
||||
<p
|
||||
className="py-1 px-2 inline-block bg-[#F53030] rounded"
|
||||
onClick={() => {
|
||||
router.push(
|
||||
`/space/editSpacePost?data=${encodeURIComponent(
|
||||
JSON.stringify(data)
|
||||
)}`
|
||||
);
|
||||
}}
|
||||
>
|
||||
<span className="text-white text-sm">
|
||||
审核未通过,请<span className="underline">重新编辑</span>。
|
||||
</span>
|
||||
</p>
|
||||
)}
|
||||
{data?.status === 3 &&
|
||||
(type == "space" ? (
|
||||
<p
|
||||
className="py-1 px-2 inline-block bg-[#F53030] rounded"
|
||||
onClick={() => {
|
||||
router.push(
|
||||
`/space/editSpacePost?data=${encodeURIComponent(
|
||||
JSON.stringify(data)
|
||||
)}`
|
||||
);
|
||||
}}
|
||||
>
|
||||
<span className="text-sm">
|
||||
审核未通过,请<span className="underline">重新编辑</span>。
|
||||
</span>
|
||||
</p>
|
||||
) : (
|
||||
<p className="py-1 px-2 inline-block bg-[#F53030] rounded">
|
||||
<span className="text-sm">
|
||||
审核未通过,请删除后重新提交。{type}
|
||||
</span>
|
||||
</p>
|
||||
))}
|
||||
<div>
|
||||
{!data?.is_zone_moment_unlocked ? (
|
||||
<span
|
||||
|
|
Loading…
Reference in New Issue