修复视频回填和样式问题
This commit is contained in:
parent
af7da0681b
commit
d1f888a09b
|
@ -273,14 +273,14 @@ textarea {
|
|||
.adm-dialog .adm-dialog-content {
|
||||
max-height: none;
|
||||
height: 100%;
|
||||
color: #5c5c5c;
|
||||
color: #ffffff85;
|
||||
}
|
||||
.adm-dialog .adm-dialog-header {
|
||||
font-size: large;
|
||||
}
|
||||
.adm-dialog .adm-dialog-footer .adm-dialog-action-row {
|
||||
& > :first-child {
|
||||
color: #5c5c5c;
|
||||
color: #ffffff80;
|
||||
}
|
||||
& > :last-child {
|
||||
color: #ffffff;
|
||||
|
|
|
@ -330,7 +330,7 @@ const ModalMask = ({ setModalVisible, zid, router }) => {
|
|||
}
|
||||
};
|
||||
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">
|
||||
<span className="text-base font-medium">搜索用户:</span>
|
||||
<OwnInput
|
||||
|
|
|
@ -53,7 +53,7 @@ export default function EditPost() {
|
|||
id: it.id,
|
||||
})),
|
||||
videoAssets: media_component.videos.map((it) => ({
|
||||
url: it.urls[0],
|
||||
url: it.cover_urls[0],
|
||||
id: it.id,
|
||||
})),
|
||||
});
|
||||
|
@ -88,18 +88,22 @@ export default function EditPost() {
|
|||
if (isSubmitting) return;
|
||||
setIsSubmitting(true);
|
||||
const { content, imageAssets, videoAssets } = formData;
|
||||
const newImageMedia = imageAssets.filter((it) => it.id == undefined);
|
||||
const type = formData.imageAssets.length > 0 ? 1 : 2;
|
||||
const media = await multiUploadImage(
|
||||
type == 1 ? newImageMedia : videoAssets,
|
||||
type
|
||||
const newMedia = [...(type == 1 ? imageAssets : videoAssets)].filter(
|
||||
(it) => it.id == undefined
|
||||
);
|
||||
const media = await multiUploadImage(newMedia, type);
|
||||
// const media = await multiUploadImage(imageAssets);
|
||||
if (type == 1) {
|
||||
media.image_ids = [
|
||||
...imageAssets.filter((it) => it.id != undefined).map((it) => it.id),
|
||||
...media.image_ids,
|
||||
];
|
||||
} else {
|
||||
media.video_ids = [
|
||||
...videoAssets.filter((it) => it.id != undefined).map((it) => it.id),
|
||||
...media.video_ids,
|
||||
];
|
||||
}
|
||||
try {
|
||||
const body = {
|
||||
|
@ -211,6 +215,8 @@ export default function EditPost() {
|
|||
accept="video/*"
|
||||
id="uploadAvatarBtn2"
|
||||
assets={formData.videoAssets}
|
||||
videoSrc={data?.media_component?.videos[0]?.urls[0]}
|
||||
maxLength={1}
|
||||
getImgs={(imgs) => {
|
||||
setFormData((old) => ({
|
||||
...old,
|
||||
|
|
Loading…
Reference in New Issue