From 5da638c253f9248c84bc5de7004367556f9eeac4 Mon Sep 17 00:00:00 2001
From: yezian
Date: Wed, 10 Jan 2024 00:50:00 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F=EF=BC=9B?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=94=B9=E4=B8=BB=E6=92=AD=E8=B5=84?=
=?UTF-8?q?=E6=96=99=E5=AD=97=E6=AE=B5=E6=A0=A1=E9=AA=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/StreamerInformation/index.jsx | 55 +++++++++++++------------
1 file changed, 29 insertions(+), 26 deletions(-)
diff --git a/src/pages/StreamerInformation/index.jsx b/src/pages/StreamerInformation/index.jsx
index a24c5c7..36ea58b 100644
--- a/src/pages/StreamerInformation/index.jsx
+++ b/src/pages/StreamerInformation/index.jsx
@@ -322,6 +322,33 @@ const StreamerInformationContent = () => {
const newPosterId = [...oldPosterId, ...displayPosterId];
const newVideoId = [...oldVideoId, ...displayVideoId];
const newGalleryId = [...oldGalleryId, ...displayGalleryId];
+ if (
+ newPosterId.length === 0 ||
+ newVideoId.length === 0 ||
+ newGalleryId.length < 2
+ ) {
+ alert("请确保封面、视频不为空,且相册大于2");
+ return;
+ }
+ if (
+ !defaultValues.key ||
+ !value.signature ||
+ !value.age ||
+ !value.height ||
+ !value.weight ||
+ !value.constellation ||
+ !value.location ||
+ !value.fans ||
+ !value.wechat_price ||
+ !value.auto_response_message
+ ) {
+ alert("请完善信息后提交");
+ return;
+ }
+ if (value.wechat_lock_type === 0 && !value.wechat) {
+ alert("请填写微信后提交");
+ return;
+ }
try {
const base = baseRequest();
const detailResponse = await fetch(`/op/streamer/update`, {
@@ -349,28 +376,7 @@ const StreamerInformationContent = () => {
...base,
}),
});
- console.log(value);
- console.log({
- mid: defaultValues.key,
- gender: parseInt(value.gender, 10),
- wechat_contact: value.wechat,
- bio: value.signature,
- cover: { image_ids: newPosterId },
- shorts: { video_ids: newVideoId },
- album: { image_ids: newGalleryId },
- age: parseInt(value.age, 10),
- height: parseInt(value.height, 10),
- weight: parseInt(value.weight, 10),
- constellation: value.constellation,
- city: value.location,
- wechat_lock_type: parseInt(value.wechat_lock_type, 10),
- fans: parseInt(value.fans, 10),
- wechat_coin_price: parseInt(value.wechat_price, 10) * 10,
- auto_response_message: value.auto_response_message,
- ...base,
- });
const detailData = await detailResponse.json();
- console.log(detailData);
if (detailData.ret === -1) {
alert(detailData.msg);
return;
@@ -756,12 +762,9 @@ const StreamerInformationContent = () => {
相册图片:
{defaultMedia.displayGallery.length !== 0 && (
-
+
{defaultMedia.displayGallery.map((item) => (
-