修复视频回填和样式问题

This commit is contained in:
al 2024-11-20 18:17:11 +08:00
parent af7da0681b
commit d1f888a09b
3 changed files with 14 additions and 8 deletions

View File

@ -273,14 +273,14 @@ textarea {
.adm-dialog .adm-dialog-content { .adm-dialog .adm-dialog-content {
max-height: none; max-height: none;
height: 100%; height: 100%;
color: #5c5c5c; color: #ffffff85;
} }
.adm-dialog .adm-dialog-header { .adm-dialog .adm-dialog-header {
font-size: large; font-size: large;
} }
.adm-dialog .adm-dialog-footer .adm-dialog-action-row { .adm-dialog .adm-dialog-footer .adm-dialog-action-row {
& > :first-child { & > :first-child {
color: #5c5c5c; color: #ffffff80;
} }
& > :last-child { & > :last-child {
color: #ffffff; color: #ffffff;

View File

@ -330,7 +330,7 @@ const ModalMask = ({ setModalVisible, zid, router }) => {
} }
}; };
return ( return (
<div className="flex flex-col w-full rounded-3xl "> <div className="flex flex-col w-full rounded-3xl text-white">
<div className="flex flex-row items-center mb-4"> <div className="flex flex-row items-center mb-4">
<span className="text-base font-medium">搜索用户:</span> <span className="text-base font-medium">搜索用户:</span>
<OwnInput <OwnInput

View File

@ -53,7 +53,7 @@ export default function EditPost() {
id: it.id, id: it.id,
})), })),
videoAssets: media_component.videos.map((it) => ({ videoAssets: media_component.videos.map((it) => ({
url: it.urls[0], url: it.cover_urls[0],
id: it.id, id: it.id,
})), })),
}); });
@ -88,18 +88,22 @@ export default function EditPost() {
if (isSubmitting) return; if (isSubmitting) return;
setIsSubmitting(true); setIsSubmitting(true);
const { content, imageAssets, videoAssets } = formData; const { content, imageAssets, videoAssets } = formData;
const newImageMedia = imageAssets.filter((it) => it.id == undefined);
const type = formData.imageAssets.length > 0 ? 1 : 2; const type = formData.imageAssets.length > 0 ? 1 : 2;
const media = await multiUploadImage( const newMedia = [...(type == 1 ? imageAssets : videoAssets)].filter(
type == 1 ? newImageMedia : videoAssets, (it) => it.id == undefined
type
); );
const media = await multiUploadImage(newMedia, type);
// const media = await multiUploadImage(imageAssets); // const media = await multiUploadImage(imageAssets);
if (type == 1) { if (type == 1) {
media.image_ids = [ media.image_ids = [
...imageAssets.filter((it) => it.id != undefined).map((it) => it.id), ...imageAssets.filter((it) => it.id != undefined).map((it) => it.id),
...media.image_ids, ...media.image_ids,
]; ];
} else {
media.video_ids = [
...videoAssets.filter((it) => it.id != undefined).map((it) => it.id),
...media.video_ids,
];
} }
try { try {
const body = { const body = {
@ -211,6 +215,8 @@ export default function EditPost() {
accept="video/*" accept="video/*"
id="uploadAvatarBtn2" id="uploadAvatarBtn2"
assets={formData.videoAssets} assets={formData.videoAssets}
videoSrc={data?.media_component?.videos[0]?.urls[0]}
maxLength={1}
getImgs={(imgs) => { getImgs={(imgs) => {
setFormData((old) => ({ setFormData((old) => ({
...old, ...old,