修复入驻问题
This commit is contained in:
parent
adb617d041
commit
886ac93858
|
@ -86,9 +86,9 @@ export default function CreateProfile() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
spacePrice: 0,
|
spacePrice: "",
|
||||||
ironFanPrice: 0,
|
ironFanPrice: "",
|
||||||
openSuper: true,
|
openSuper: false,
|
||||||
superSingle: [
|
superSingle: [
|
||||||
{ enable: false, price: 0, wechatFree: false },
|
{ enable: false, price: 0, wechatFree: false },
|
||||||
{ enable: false, price: 0, wechatFree: false },
|
{ enable: false, price: 0, wechatFree: false },
|
||||||
|
@ -119,8 +119,15 @@ export default function CreateProfile() {
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
const { spaceIntro, spacePrice, ironFanPrice, openSuper, superSingle } =
|
const { spaceIntro, spacePrice, ironFanPrice, openSuper, superSingle } =
|
||||||
formData;
|
formData;
|
||||||
|
const openSuperEveryFalse = Object.values(superSingle).every(
|
||||||
if (!spaceIntro || !spacePrice || !ironFanPrice) {
|
(it) => !it.enable
|
||||||
|
);
|
||||||
|
if (
|
||||||
|
!spaceIntro ||
|
||||||
|
!spacePrice ||
|
||||||
|
!ironFanPrice ||
|
||||||
|
(openSuper && openSuperEveryFalse)
|
||||||
|
) {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
icon: "fail",
|
icon: "fail",
|
||||||
content: "请完善内容后提交",
|
content: "请完善内容后提交",
|
||||||
|
@ -196,41 +203,41 @@ export default function CreateProfile() {
|
||||||
}));
|
}));
|
||||||
setIsSubmitting(true);
|
setIsSubmitting(true);
|
||||||
|
|
||||||
try {
|
// try {
|
||||||
const body = {
|
// const body = {
|
||||||
profile: spaceIntro,
|
// profile: spaceIntro,
|
||||||
admission_price: parseInt(spacePrice * 100, 10),
|
// admission_price: parseInt(spacePrice * 100, 10),
|
||||||
ironfanship_price: parseInt(ironFanPrice * 100, 10),
|
// ironfanship_price: parseInt(ironFanPrice * 100, 10),
|
||||||
is_superfanship_enabled: openSuper ? 1 : 0,
|
// is_superfanship_enabled: openSuper ? 1 : 0,
|
||||||
superfan_price_list,
|
// superfan_price_list,
|
||||||
};
|
// };
|
||||||
const _data = await requireAPI(
|
// const _data = await requireAPI(
|
||||||
"POST",
|
// "POST",
|
||||||
"/api/zone/update",
|
// "/api/zone/create",
|
||||||
{
|
// {
|
||||||
body,
|
// body,
|
||||||
},
|
// },
|
||||||
true
|
// true
|
||||||
);
|
// );
|
||||||
if (_data.ret === -1) {
|
// if (_data.ret === -1) {
|
||||||
Toast.show({
|
// Toast.show({
|
||||||
icon: "error",
|
// icon: "fail",
|
||||||
content: _data.msg,
|
// content: _data.msg,
|
||||||
position: "top",
|
// position: "top",
|
||||||
});
|
// });
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
Toast.show({
|
// Toast.show({
|
||||||
icon: "success",
|
// icon: "success",
|
||||||
content: "修改成功,请重进空间刷新查看",
|
// content: "修改成功,请重进空间刷新查看",
|
||||||
position: "top",
|
// position: "top",
|
||||||
});
|
// });
|
||||||
router.back();
|
// router.back();
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
console.error(error);
|
// console.error(error);
|
||||||
} finally {
|
// } finally {
|
||||||
setIsSubmitting(false);
|
// setIsSubmitting(false);
|
||||||
}
|
// }
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
@ -287,10 +294,13 @@ export default function CreateProfile() {
|
||||||
id="spacePrice"
|
id="spacePrice"
|
||||||
type="number"
|
type="number"
|
||||||
fontSize="22"
|
fontSize="22"
|
||||||
|
placeholder="1~3888,仅支持整数"
|
||||||
value={formData.spacePrice}
|
value={formData.spacePrice}
|
||||||
onChange={(value) =>
|
onChange={(value) =>
|
||||||
setFormData((old) => ({ ...old, spacePrice: value }))
|
setFormData((old) => ({ ...old, spacePrice: value }))
|
||||||
}
|
}
|
||||||
|
inputClassName="placeholder:text-[14px]"
|
||||||
|
className={!formData.spacePrice ? "pb-1.5" : ""}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<label
|
<label
|
||||||
|
@ -309,7 +319,7 @@ export default function CreateProfile() {
|
||||||
<span className="text-[#f00]">*</span>
|
<span className="text-[#f00]">*</span>
|
||||||
</p>
|
</p>
|
||||||
<p className="text-[#ffffffae] text-xs">
|
<p className="text-[#ffffffae] text-xs">
|
||||||
(累计空间内消费达标可成为,铁粉可查看相关帖)
|
(累计消费达成后解锁铁粉权益)
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-2 px-4 py-3 h-12 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center">
|
<div className="mt-2 px-4 py-3 h-12 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center">
|
||||||
|
@ -319,10 +329,13 @@ export default function CreateProfile() {
|
||||||
id="ironPrice"
|
id="ironPrice"
|
||||||
type="number"
|
type="number"
|
||||||
fontSize="22"
|
fontSize="22"
|
||||||
|
placeholder="1~3888,仅支持整数"
|
||||||
value={formData.ironFanPrice}
|
value={formData.ironFanPrice}
|
||||||
onChange={(value) =>
|
onChange={(value) =>
|
||||||
setFormData((old) => ({ ...old, ironFanPrice: value }))
|
setFormData((old) => ({ ...old, ironFanPrice: value }))
|
||||||
}
|
}
|
||||||
|
inputClassName="placeholder:text-[14px]"
|
||||||
|
className={!formData.ironFanPrice ? "pb-1.5" : ""}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<label
|
<label
|
||||||
|
@ -359,24 +372,28 @@ export default function CreateProfile() {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-3">
|
{formData.openSuper && (
|
||||||
<div className="flex justify-between items-center">
|
<div className="mt-3">
|
||||||
<p className="text-sm">
|
<div className="flex justify-between items-center">
|
||||||
<span>超粉单次开通类型</span>
|
<p className="text-sm">
|
||||||
<span className="text-[#f00]">*</span>
|
<span>超粉单次开通类型</span>
|
||||||
</p>
|
<span className="text-[#f00]">*</span>
|
||||||
<div className="flex items-center"></div>
|
</p>
|
||||||
|
<p className="text-[#ffffffae] text-xs">
|
||||||
|
(付费后解锁对应期限超粉权益)
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<Space direction="vertical" block>
|
||||||
|
<Checkbox.Group
|
||||||
|
onChange={(values) => {
|
||||||
|
setSuperSingleCheckeds(values);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ul>{listItemWithCheckboxMemo}</ul>
|
||||||
|
</Checkbox.Group>
|
||||||
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
<Space direction="vertical" block>
|
)}
|
||||||
<Checkbox.Group
|
|
||||||
onChange={(values) => {
|
|
||||||
setSuperSingleCheckeds(values);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ul>{listItemWithCheckboxMemo}</ul>
|
|
||||||
</Checkbox.Group>
|
|
||||||
</Space>
|
|
||||||
</div>
|
|
||||||
<div className="mt-10 flex justify-center">
|
<div className="mt-10 flex justify-center">
|
||||||
<Button
|
<Button
|
||||||
size="middle"
|
size="middle"
|
||||||
|
|
|
@ -324,8 +324,8 @@ export default function EditHome() {
|
||||||
<Picker
|
<Picker
|
||||||
columns={[
|
columns={[
|
||||||
[
|
[
|
||||||
{ label: "男", value: "0" },
|
|
||||||
{ label: "女", value: "1" },
|
{ label: "女", value: "1" },
|
||||||
|
{ label: "男", value: "0" },
|
||||||
],
|
],
|
||||||
]}
|
]}
|
||||||
value={formData.gender}
|
value={formData.gender}
|
||||||
|
|
|
@ -123,6 +123,8 @@ const My = () => {
|
||||||
iconUrl: "icons/32DP/editprofile.png",
|
iconUrl: "icons/32DP/editprofile.png",
|
||||||
title: "完善资料",
|
title: "完善资料",
|
||||||
subTitle: "完善后解锁全部功能",
|
subTitle: "完善后解锁全部功能",
|
||||||
|
status: !statuses.data.details_status ? "审核中" : "未通过",
|
||||||
|
disable: statuses.data.details_status == 2,
|
||||||
},
|
},
|
||||||
...currentOld,
|
...currentOld,
|
||||||
];
|
];
|
||||||
|
@ -154,26 +156,57 @@ const My = () => {
|
||||||
title: "添加到主屏幕",
|
title: "添加到主屏幕",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
if (account.data.account.role != 3 && !isInJoinProgress) {
|
if (
|
||||||
|
(account.data.account.role != 3 && !isInJoinProgress) ||
|
||||||
|
statuses.data.details_status === 2
|
||||||
|
) {
|
||||||
currentOld = [
|
currentOld = [
|
||||||
...currentOld,
|
{
|
||||||
|
url: `my/wallet`,
|
||||||
|
iconUrl: "icons/32DP/wallet.png",
|
||||||
|
title: "我的钱包",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: `my/unlockedWechat`,
|
||||||
|
iconUrl: "icons/32DP/wechat.png",
|
||||||
|
title: "已解锁微信",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
url: `my/streamerVerification/joinStreamer`,
|
url: `my/streamerVerification/joinStreamer`,
|
||||||
iconUrl: "icons/32DP/join.png",
|
iconUrl: "icons/32DP/join.png",
|
||||||
title: "申请入驻",
|
title: "申请入驻",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
url: `/messageDetail`,
|
||||||
|
iconUrl: "icons/32DP/contact.png",
|
||||||
|
title: "联系客服",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: `/my/addToHome`,
|
||||||
|
iconUrl: "icons/32DP/toScreen.png",
|
||||||
|
title: "添加到主屏幕",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
return currentOld;
|
return currentOld;
|
||||||
});
|
});
|
||||||
setUserInfo({ ...data.data, ...account.data.account, ...streamer.data });
|
setUserInfo({ ...data.data, ...account.data.account, ...streamer.data });
|
||||||
};
|
};
|
||||||
const ItemEle = ({ url, iconUrl, title, subTitle, toWebView }) => {
|
const ItemEle = ({
|
||||||
|
url,
|
||||||
|
iconUrl,
|
||||||
|
title,
|
||||||
|
subTitle,
|
||||||
|
toWebView,
|
||||||
|
status,
|
||||||
|
disable,
|
||||||
|
}) => {
|
||||||
return (
|
return (
|
||||||
<li
|
<li
|
||||||
className="flex justify-between items-center p-3 py-2"
|
className="flex justify-between items-center p-3 py-2"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
subTitle != "完善资料后解锁" &&
|
subTitle != "完善资料后解锁" &&
|
||||||
|
!disable &&
|
||||||
router.push(
|
router.push(
|
||||||
toWebView ? `/webView/${encodeURIComponent(url)}` : url
|
toWebView ? `/webView/${encodeURIComponent(url)}` : url
|
||||||
);
|
);
|
||||||
|
@ -189,13 +222,28 @@ const My = () => {
|
||||||
<span className="text-base">{title}</span>
|
<span className="text-base">{title}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={`flex items-center text-[#FFFFFF80]`}>
|
<div className={`flex items-center text-[#FFFFFF80]`}>
|
||||||
<span className="mr-2">{subTitle}</span>
|
<div
|
||||||
<FontAwesomeIcon
|
className={`rounded-full`}
|
||||||
icon={faAngleRight}
|
style={{
|
||||||
style={{ maxWidth: "12px" }}
|
backgroundColor: status
|
||||||
size="sm"
|
? status == "未通过"
|
||||||
className="h-4"
|
? "#db2020"
|
||||||
/>
|
: "#207edb"
|
||||||
|
: "none",
|
||||||
|
padding: status ? "2px 10px" : "0",
|
||||||
|
marginRight: !disable ? "0.5rem" : "0",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{status || subTitle}
|
||||||
|
</div>
|
||||||
|
{!disable && (
|
||||||
|
<FontAwesomeIcon
|
||||||
|
icon={faAngleRight}
|
||||||
|
style={{ maxWidth: "12px" }}
|
||||||
|
size="sm"
|
||||||
|
className="h-4"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
|
|
|
@ -39,7 +39,6 @@ export default function Relationship() {
|
||||||
}, [currentKey]);
|
}, [currentKey]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const key = searchParams.get("key");
|
const key = searchParams.get("key");
|
||||||
// console.log('nnnnn',searchParams.get("key"))
|
|
||||||
key && setCurrentKey(key);
|
key && setCurrentKey(key);
|
||||||
}, [searchParams]);
|
}, [searchParams]);
|
||||||
async function loadMore(key) {
|
async function loadMore(key) {
|
||||||
|
|
|
@ -9,8 +9,8 @@ export default function SettleIn() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="p-4 fixed top-0 z-10 w-full">
|
<div className="p-4 fixed top-0 z-10 w-full ">
|
||||||
<div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full absolute">
|
<div className="w-9 h-9 flex items-center justify-between bg-[#FFFFFF1A] rounded-full absolute">
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon={faAngleLeft}
|
icon={faAngleLeft}
|
||||||
style={{ maxWidth: "12px" }}
|
style={{ maxWidth: "12px" }}
|
||||||
|
@ -19,8 +19,9 @@ export default function SettleIn() {
|
||||||
router.back();
|
router.back();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
<p className="text-base text-center leading-9">申请入驻</p>
|
||||||
|
<p className="text-base text-center leading-9">平台准则</p>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-base text-center leading-9">申请入驻</p>
|
|
||||||
</div>
|
</div>
|
||||||
{/* 内容 */}
|
{/* 内容 */}
|
||||||
<div className="pt-16 p-4 flex flex-col justify-center items-center">
|
<div className="pt-16 p-4 flex flex-col justify-center items-center">
|
||||||
|
|
|
@ -80,10 +80,7 @@ export default function AfterSubmitStreamerVerification() {
|
||||||
paddingLeft: "32px",
|
paddingLeft: "32px",
|
||||||
paddingRight: "32px",
|
paddingRight: "32px",
|
||||||
}}
|
}}
|
||||||
onClick={() => () =>
|
onClick={() => router.replace("completeStreamerInformation")}
|
||||||
router.replace(
|
|
||||||
"my/streamerVerification/completeStreamerInformation"
|
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
<div className="flex flex-col items-center text-base">
|
<div className="flex flex-col items-center text-base">
|
||||||
<span>前往完善资料</span>
|
<span>前往完善资料</span>
|
||||||
|
|
|
@ -93,12 +93,12 @@ export default function CompleteStreamerInformation() {
|
||||||
const [isWaitingReview, setIsWaitingReview] = useState(false);
|
const [isWaitingReview, setIsWaitingReview] = useState(false);
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
wechatPrice: 0,
|
wechatPrice: 0,
|
||||||
gender: ["0"],
|
gender: [""],
|
||||||
age: ["18"],
|
age: [""],
|
||||||
height: ["140"],
|
height: [""],
|
||||||
weight: ["35"],
|
weight: [""],
|
||||||
constellation: ["白羊座"],
|
constellation: [""],
|
||||||
province: ["北京市"],
|
province: [""],
|
||||||
tags: [],
|
tags: [],
|
||||||
info: "",
|
info: "",
|
||||||
autoResponse: "",
|
autoResponse: "",
|
||||||
|
@ -106,8 +106,8 @@ export default function CompleteStreamerInformation() {
|
||||||
wechatAddWay: 0,
|
wechatAddWay: 0,
|
||||||
fans: 0,
|
fans: 0,
|
||||||
imageAssets: [],
|
imageAssets: [],
|
||||||
displayImage: null,
|
displayImage: [],
|
||||||
displayVideo: null,
|
displayVideo: [],
|
||||||
});
|
});
|
||||||
const [spacePriceAble, setSpacePriceAble] = useState(false);
|
const [spacePriceAble, setSpacePriceAble] = useState(false);
|
||||||
// const [wechatAddWay, setWechatAddWay] = useState("0");
|
// const [wechatAddWay, setWechatAddWay] = useState("0");
|
||||||
|
@ -133,8 +133,11 @@ export default function CompleteStreamerInformation() {
|
||||||
getData();
|
getData();
|
||||||
}, []);
|
}, []);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (data.tag) {
|
// console.log("setFormData", data?.streamer);
|
||||||
|
|
||||||
|
if (data?.streamer?.tag) {
|
||||||
const {
|
const {
|
||||||
|
fans,
|
||||||
wechat_coin_price,
|
wechat_coin_price,
|
||||||
gender,
|
gender,
|
||||||
age,
|
age,
|
||||||
|
@ -150,7 +153,9 @@ export default function CompleteStreamerInformation() {
|
||||||
cover,
|
cover,
|
||||||
shorts,
|
shorts,
|
||||||
} = data?.streamer;
|
} = data?.streamer;
|
||||||
setFormData({
|
setFormData((old) => ({
|
||||||
|
...old,
|
||||||
|
fans,
|
||||||
wechatPrice: wechat_coin_price,
|
wechatPrice: wechat_coin_price,
|
||||||
gender: [`${gender}`],
|
gender: [`${gender}`],
|
||||||
age: [`${age}`],
|
age: [`${age}`],
|
||||||
|
@ -163,23 +168,27 @@ export default function CompleteStreamerInformation() {
|
||||||
autoResponse: auto_response_message,
|
autoResponse: auto_response_message,
|
||||||
wechatAddWay: wechat_lock_type,
|
wechatAddWay: wechat_lock_type,
|
||||||
wechat: wechat_contact,
|
wechat: wechat_contact,
|
||||||
|
|
||||||
displayImage: [
|
displayImage: [
|
||||||
{
|
{
|
||||||
notChanged: true,
|
notChanged: true,
|
||||||
id: { image_ids: cover.image_ids },
|
image_ids: cover.image_ids,
|
||||||
uri: cover.images[0].urls[0],
|
url: cover.images[0].urls[0],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
displayVideo: [
|
displayVideo: [
|
||||||
{
|
{
|
||||||
notChanged: true,
|
notChanged: true,
|
||||||
id: { video_ids: shorts?.video_ids },
|
video_ids: shorts?.video_ids,
|
||||||
cover: shorts?.videos[0]?.cover_urls[0],
|
url: shorts?.videos[0]?.cover_urls[0],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
useEffect(() => {
|
||||||
|
setFormData((old) => ({ ...old, imageAssets: oldPhotos }));
|
||||||
|
}, [oldPhotos]);
|
||||||
const superSingles = [
|
const superSingles = [
|
||||||
{ key: 0, text: "主动添加对方" },
|
{ key: 0, text: "主动添加对方" },
|
||||||
{ key: 1, text: "向对方展示微信" },
|
{ key: 1, text: "向对方展示微信" },
|
||||||
|
@ -258,26 +267,33 @@ export default function CompleteStreamerInformation() {
|
||||||
|
|
||||||
setData({ ...account, streamer: _data.data.list[0] });
|
setData({ ...account, streamer: _data.data.list[0] });
|
||||||
setWechatInputShow(_data.data.list[0].wechat_lock_type);
|
setWechatInputShow(_data.data.list[0].wechat_lock_type);
|
||||||
if (_data.data.list[0])
|
if (_data.data.list[0]) {
|
||||||
setFormData((old) => ({
|
setFormData((old) => ({
|
||||||
...old,
|
...old,
|
||||||
displayImage: [
|
displayImage: [
|
||||||
{
|
{
|
||||||
notChanged: true,
|
notChanged: true,
|
||||||
id: { image_ids: _data.data.list[0].cover.image_ids },
|
image_ids: _data.data.list[0].cover.image_ids,
|
||||||
uri: _data.data.list[0].cover.images[0].urls[0],
|
url: _data.data.list[0].cover.images[0].urls[0],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
displayVideo: [
|
displayVideo: [
|
||||||
{
|
{
|
||||||
notChanged: true,
|
notChanged: true,
|
||||||
id: { video_ids: _data.data.list[0].shorts?.video_ids },
|
video_ids: _data.data.list[0].shorts?.video_ids,
|
||||||
cover: _data.data.list[0].shorts?.videos[0]?.cover_urls[0],
|
url: _data.data.list[0].shorts?.videos[0]?.cover_urls[0],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}));
|
}));
|
||||||
setOldPhotos(_data.data.list[0].album.images);
|
setOldPhotos(
|
||||||
setIsloading(false);
|
_data.data.list[0].album.images.map((it) => ({
|
||||||
|
id: it.id,
|
||||||
|
url: it.urls[0],
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// setIsloading(false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -327,6 +343,14 @@ export default function CompleteStreamerInformation() {
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (isNaN(fans) || fans < 1) {
|
||||||
|
Toast.show({
|
||||||
|
icon: "fail",
|
||||||
|
content: "请输入有效的全网粉丝量(大于等于1的整数)",
|
||||||
|
position: "top",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
const price = parseInt(wechatPrice, 10);
|
const price = parseInt(wechatPrice, 10);
|
||||||
if (isNaN(price) || price < 1) {
|
if (isNaN(price) || price < 1) {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
|
@ -345,7 +369,7 @@ export default function CompleteStreamerInformation() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//相册不得低于2张
|
//相册不得低于2张
|
||||||
if (displayImage.length < 2) {
|
if (imageAssets.length < 2) {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
icon: "fail",
|
icon: "fail",
|
||||||
content: "相册至少需要上传2张照片哦!",
|
content: "相册至少需要上传2张照片哦!",
|
||||||
|
@ -354,7 +378,7 @@ export default function CompleteStreamerInformation() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//相册不得超过9张
|
//相册不得超过9张
|
||||||
if (displayImage.length > 9) {
|
if (imageAssets.length > 9) {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
icon: "fail",
|
icon: "fail",
|
||||||
content: "相册最多只能上传9张照片哦!",
|
content: "相册最多只能上传9张照片哦!",
|
||||||
|
@ -363,12 +387,14 @@ export default function CompleteStreamerInformation() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setIsSubmitting(true);
|
setIsSubmitting(true);
|
||||||
const cover = displayImage?.id
|
const cover =
|
||||||
? displayImage
|
displayImage[0]?.image_ids?.length > 0
|
||||||
: await multiUploadImage(displayImage.file, 1);
|
? displayImage[0]
|
||||||
const shorts = displayVideo?.id
|
: await multiUploadImage(displayImage[0].file, 1);
|
||||||
? displayVideo
|
const shorts =
|
||||||
: await multiUploadImage(displayVideo.file, 2);
|
displayVideo[0]?.video_ids?.length > 0
|
||||||
|
? displayVideo[0]
|
||||||
|
: await multiUploadImage(displayVideo[0].file, 2);
|
||||||
const newMedia = imageAssets.filter((it) => it.id == undefined);
|
const newMedia = imageAssets.filter((it) => it.id == undefined);
|
||||||
const media = await multiUploadImage(newMedia, 1);
|
const media = await multiUploadImage(newMedia, 1);
|
||||||
const album = {
|
const album = {
|
||||||
|
@ -446,19 +472,23 @@ export default function CompleteStreamerInformation() {
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
setFormData((old) => ({
|
setFormData((old) => ({
|
||||||
...old,
|
...old,
|
||||||
displayImage: {
|
displayImage: [
|
||||||
url: URL.createObjectURL(file),
|
{
|
||||||
file: Array.from(e.target.files),
|
url: URL.createObjectURL(file),
|
||||||
},
|
file: Array.from(e.target.files),
|
||||||
|
},
|
||||||
|
],
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
creatVideoCanvas(file);
|
creatVideoCanvas(file);
|
||||||
setFormData((old) => ({
|
setFormData((old) => ({
|
||||||
...old,
|
...old,
|
||||||
displayVideo: {
|
displayVideo: [
|
||||||
url: frameImageUrl,
|
{
|
||||||
file: Array.from(e.target.files),
|
url: frameImageUrl,
|
||||||
},
|
file: Array.from(e.target.files),
|
||||||
|
},
|
||||||
|
],
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -582,8 +612,8 @@ export default function CompleteStreamerInformation() {
|
||||||
<Picker
|
<Picker
|
||||||
columns={[
|
columns={[
|
||||||
[
|
[
|
||||||
{ label: "男", value: "0" },
|
|
||||||
{ label: "女", value: "1" },
|
{ label: "女", value: "1" },
|
||||||
|
{ label: "男", value: "0" },
|
||||||
],
|
],
|
||||||
]}
|
]}
|
||||||
value={formData.gender}
|
value={formData.gender}
|
||||||
|
@ -880,9 +910,9 @@ export default function CompleteStreamerInformation() {
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="请输入真实有效数据"
|
placeholder="请输入真实有效数据"
|
||||||
value={formData.fans}
|
value={formData.fans}
|
||||||
onChange={(value) =>
|
onChange={(value) => {
|
||||||
setFormData((old) => ({ ...old, fans: value }))
|
setFormData((old) => ({ ...old, fans: value }));
|
||||||
}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -970,12 +1000,12 @@ export default function CompleteStreamerInformation() {
|
||||||
</p>
|
</p>
|
||||||
<label htmlFor="uploadBtn1">
|
<label htmlFor="uploadBtn1">
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
{formData?.displayImage ? (
|
{formData?.displayImage[0] ? (
|
||||||
<Image
|
<Image
|
||||||
width={36}
|
width={36}
|
||||||
height={36}
|
height={36}
|
||||||
className="rounded-lg"
|
className="rounded-lg"
|
||||||
src={formData.displayImage?.url}
|
src={formData.displayImage[0]?.url}
|
||||||
fit="cover"
|
fit="cover"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
@ -1013,12 +1043,12 @@ export default function CompleteStreamerInformation() {
|
||||||
// onClick={() => pickDisPlayImage()}
|
// onClick={() => pickDisPlayImage()}
|
||||||
className="flex items-center"
|
className="flex items-center"
|
||||||
>
|
>
|
||||||
{formData?.displayVideo ? (
|
{formData?.displayVideo[0] ? (
|
||||||
<Image
|
<Image
|
||||||
width={36}
|
width={36}
|
||||||
height={36}
|
height={36}
|
||||||
className="rounded-lg"
|
className="rounded-lg"
|
||||||
src={frameImageUrl || formData.displayVideo.url}
|
src={frameImageUrl || formData.displayVideo[0]?.url}
|
||||||
fit="cover"
|
fit="cover"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
@ -1066,9 +1096,9 @@ export default function CompleteStreamerInformation() {
|
||||||
type={1}
|
type={1}
|
||||||
existImages={oldPhotos}
|
existImages={oldPhotos}
|
||||||
assets={formData.imageAssets}
|
assets={formData.imageAssets}
|
||||||
getImgs={(imgs) =>
|
getImgs={(imgs) => {
|
||||||
setFormData((old) => ({ ...old, imageAssets: imgs }))
|
setFormData((old) => ({ ...old, imageAssets: imgs }));
|
||||||
}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -86,8 +86,8 @@ export default function JoinStreamer() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{/* 头部标题 */}
|
{/* 头部标题 */}
|
||||||
<div className="p-4 fixed top-0 z-10 w-full bg-black">
|
<div className="p-4 fixed top-0 z-10 w-full bg-black flex justify-between items-center">
|
||||||
<div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full absolute">
|
<div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full">
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon={faAngleLeft}
|
icon={faAngleLeft}
|
||||||
style={{ maxWidth: "12px" }}
|
style={{ maxWidth: "12px" }}
|
||||||
|
@ -98,6 +98,16 @@ export default function JoinStreamer() {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-base text-center leading-9">申请入驻</p>
|
<p className="text-base text-center leading-9">申请入驻</p>
|
||||||
|
<p
|
||||||
|
className="text-base text-center leading-9 text-[#FF669E]"
|
||||||
|
onClick={() => {
|
||||||
|
router.push(
|
||||||
|
`/webView/${encodeURIComponent("/doc/platformguidelines")}`
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
平台准则
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{/* 内容 */}
|
{/* 内容 */}
|
||||||
<div className="pt-16 p-4">
|
<div className="pt-16 p-4">
|
||||||
|
|
|
@ -89,7 +89,7 @@ export default function spacePaymentSetting() {
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
spacePrice: null,
|
spacePrice: null,
|
||||||
ironFanPrice: null,
|
ironFanPrice: null,
|
||||||
openSuper: true,
|
openSuper: false,
|
||||||
superSingle: [
|
superSingle: [
|
||||||
{ enable: false, price: 0, wechatFree: false },
|
{ enable: false, price: 0, wechatFree: false },
|
||||||
{ enable: false, price: 0, wechatFree: false },
|
{ enable: false, price: 0, wechatFree: false },
|
||||||
|
@ -138,8 +138,10 @@ export default function spacePaymentSetting() {
|
||||||
}, [formData, superSingleCheckeds]);
|
}, [formData, superSingleCheckeds]);
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
const { spacePrice, ironFanPrice, openSuper, superSingle } = formData;
|
const { spacePrice, ironFanPrice, openSuper, superSingle } = formData;
|
||||||
|
const openSuperEveryFalse = Object.values(superSingle).every(
|
||||||
if (!spacePrice || !ironFanPrice) {
|
(it) => !it.enable
|
||||||
|
);
|
||||||
|
if (!spacePrice || !ironFanPrice || (openSuper && openSuperEveryFalse)) {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
icon: "fail",
|
icon: "fail",
|
||||||
content: "请完善内容后提交",
|
content: "请完善内容后提交",
|
||||||
|
@ -344,7 +346,7 @@ export default function spacePaymentSetting() {
|
||||||
<span className="text-[#f00]">*</span>
|
<span className="text-[#f00]">*</span>
|
||||||
</p>
|
</p>
|
||||||
<p className="text-[#ffffffb3] text-xs">
|
<p className="text-[#ffffffb3] text-xs">
|
||||||
(累计空间内消费达标可成为,铁粉可查看相关帖)
|
(累计消费达成后解锁铁粉权益)
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-2 px-4 py-3 h-12 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center">
|
<div className="mt-2 px-4 py-3 h-12 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center">
|
||||||
|
@ -364,7 +366,7 @@ export default function spacePaymentSetting() {
|
||||||
onChange={(value) =>
|
onChange={(value) =>
|
||||||
setFormData((old) => ({ ...old, ironFanPrice: value }))
|
setFormData((old) => ({ ...old, ironFanPrice: value }))
|
||||||
}
|
}
|
||||||
className={!formData.spacePrice ? "pb-1.5" : ""}
|
className={!formData.ironFanPrice ? "pb-1.5" : ""}
|
||||||
inputClassName="placeholder:text-[14px]"
|
inputClassName="placeholder:text-[14px]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -402,25 +404,30 @@ export default function spacePaymentSetting() {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-3">
|
{formData.openSuper && (
|
||||||
<div className="flex justify-between items-center">
|
<div className="mt-3">
|
||||||
<p className="text-sm">
|
<div className="flex justify-between items-center">
|
||||||
<span>超粉单次开通类型</span>
|
<p className="text-sm">
|
||||||
<span className="text-[#f00]">*</span>
|
<span>超粉单次开通类型</span>
|
||||||
</p>
|
<span className="text-[#f00]">*</span>
|
||||||
<div className="flex items-center"></div>
|
</p>
|
||||||
|
<p className="text-[#ffffffb3] text-xs">
|
||||||
|
(付费后解锁对应期限超粉权益)
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<Space direction="vertical" block>
|
||||||
|
<Checkbox.Group
|
||||||
|
value={superSingleCheckeds}
|
||||||
|
onChange={(values) => {
|
||||||
|
setSuperSingleCheckeds(values);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ul>{listItemWithCheckboxMemo}</ul>
|
||||||
|
</Checkbox.Group>
|
||||||
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
<Space direction="vertical" block>
|
)}
|
||||||
<Checkbox.Group
|
|
||||||
value={superSingleCheckeds}
|
|
||||||
onChange={(values) => {
|
|
||||||
setSuperSingleCheckeds(values);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ul>{listItemWithCheckboxMemo}</ul>
|
|
||||||
</Checkbox.Group>
|
|
||||||
</Space>
|
|
||||||
</div>
|
|
||||||
<div className="mt-10 flex justify-center">
|
<div className="mt-10 flex justify-center">
|
||||||
<Button
|
<Button
|
||||||
size="middle"
|
size="middle"
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default function UploadImgs({
|
||||||
}) {
|
}) {
|
||||||
const maxCount = 6;
|
const maxCount = 6;
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [filesUrls, setFilesUrls] = useState([...existImages]);
|
const [filesUrls, setFilesUrls] = useState([]);
|
||||||
const [videoUrl, setVideoUrl] = useState(null);
|
const [videoUrl, setVideoUrl] = useState(null);
|
||||||
const [frameImage, setFrameImage] = useState({ src: null, h: 0, w: 0 });
|
const [frameImage, setFrameImage] = useState({ src: null, h: 0, w: 0 });
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -35,13 +35,10 @@ export default function UploadImgs({
|
||||||
if (!file) return;
|
if (!file) return;
|
||||||
var videoUrl = URL.createObjectURL(file);
|
var videoUrl = URL.createObjectURL(file);
|
||||||
var videoObj = document.createElement("video");
|
var videoObj = document.createElement("video");
|
||||||
let newFilesUrls = [...filesUrls];
|
|
||||||
const eles = Array.from(e.target.files);
|
const eles = Array.from(e.target.files);
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
eles.forEach((element) => {
|
const newFils = eles.map((it) => URL.createObjectURL(it));
|
||||||
newFilesUrls = [...newFilesUrls, URL.createObjectURL(element)];
|
setFilesUrls((old) => [...old, ...newFils]);
|
||||||
});
|
|
||||||
setFilesUrls(newFilesUrls);
|
|
||||||
} else {
|
} else {
|
||||||
videoObj.onloadedmetadata = function (evt) {
|
videoObj.onloadedmetadata = function (evt) {
|
||||||
URL.revokeObjectURL(videoUrl);
|
URL.revokeObjectURL(videoUrl);
|
||||||
|
|
Loading…
Reference in New Issue