"use client"; import React, { useState } from "react"; import { Button, Toast } from "antd-mobile"; import { useRouter } from "next/navigation"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleLeft } from "@fortawesome/free-solid-svg-icons"; import OwnInput from "@/components/OwnInput"; import UploadImgs from "@/components/UploadImgs"; import { multiUploadImage } from "@/utils/upload"; import { get } from "@/utils/storeInfo"; import requireAPI from "@/utils/requireAPI"; import { Contrail_One } from "next/font/google"; export default function JoinStreamer() { const router = useRouter(); const [formData, setFormData] = useState({ name: "", platforms: "", contact: "", imageAssets: [], }); const [isSubmitting, setIsSubmitting] = useState(false); const handleSubmit = async (values) => { if ( !values.name || !values.platforms || !values.contact || values.imageAssets.length === 0 ) { Toast.show({ icon: "fail", content: "请完善信息后提交", position: 60, }); return; } setIsSubmitting(true); const account = await get("account"); const account_shot = await multiUploadImage(values.imageAssets, 1); if (!account_shot.image_ids.length) { Toast.show({ icon: "fail", content: "上传失败,请联系客服进行上传", position: 60, }); setIsSubmitting(false); return; } //上传表单 const body = { avatar: { image_ids: [account?.avatar.images[0].id] }, name: values.name, contact_way: values.contact, account_shot: account_shot, main_platform: values.platforms, }; try { const streamerData = await requireAPI( "POST", "/api/streamer_auth_approval/create_basic", { body, }, true ); if (streamerData.ret === -1) { Toast.show({ icon: "fail", content: streamerData.msg, position: 60, }); return; } //提交成功后跳转成功页 router.replace( "/my/streamerVerification/afterSubmitStreamerVerification" ); } catch (error) { console.error(error); } finally { setIsSubmitting(false); } }; return (
{/* 头部标题 */}
{ router.back(); }} />

申请入驻

{ router.push( `/webView/${encodeURIComponent("/doc/platformguidelines")}` ); }} > 平台准则

{/* 内容 */}

审核资料(仅用于审核,不对外展示) *

昵称 *

setFormData((old) => ({ ...old, name: value })) } />

主营平台 *

(若有多个,按粉丝从多到少排序)

setFormData((old) => ({ ...old, platforms: value })) } />

联系方式 *

注明方式,如“电话:xxxxx”

setFormData((old) => ({ ...old, contact: value })) } />

账号截图 *

各平台账号截图(最多9张)

{ setFormData((old) => ({ ...old, imageAssets: imgs })); }} />
); }