diff --git a/src/pages/CreateAndEditPost/index.jsx b/src/pages/CreateAndEditPost/index.jsx index c87c4df..1557655 100644 --- a/src/pages/CreateAndEditPost/index.jsx +++ b/src/pages/CreateAndEditPost/index.jsx @@ -5,6 +5,7 @@ import ImageUploader from "../../components/ImageUploader"; import VideoUploader from "../../components/VideoUploader"; const CreateAndEditPostContent = (props) => { + const { TextArea } = Input; //表头 const columns = [ { @@ -182,7 +183,6 @@ const CreateAndEditPostContent = (props) => { }), }); const temData = await response.json(); - console.log(temData); if (temData.ret === -1) { alert(temData.msg); return; @@ -487,7 +487,7 @@ const CreateAndEditPostContent = (props) => { ]} style={{ margin: 0 }} > - + @@ -502,7 +502,7 @@ const CreateAndEditPostContent = (props) => { {isEditModalOpen && ( - *请选中主播后再发布,并确保文案不为空,图片数不超过9,视频数不超过1,图片视频不同时存在 + *请确保文案不为空,图片数不超过9,视频数不超过1,图片视频不同时存在 @@ -518,7 +518,7 @@ const CreateAndEditPostContent = (props) => { ]} style={{ margin: 0 }} > - + {defaultMedia.image_ids.length !== 0 && ( diff --git a/src/pages/EditSpacePost/index.jsx b/src/pages/EditSpacePost/index.jsx new file mode 100644 index 0000000..5117421 --- /dev/null +++ b/src/pages/EditSpacePost/index.jsx @@ -0,0 +1,451 @@ +import React, { useState, useRef, useEffect } from "react"; +import { Form, Input, Table, Image, Space, Button, Modal, message } from "antd"; +import baseRequest from "../../utils/baseRequest"; +import ImageUploader from "../../components/ImageUploader"; +import VideoUploader from "../../components/VideoUploader"; +import { useSearchParams } from "react-router-dom"; + +const EditSpacePostContent = (props) => { + const { TextArea } = Input; + const [searchParams, setSearchParams] = useSearchParams(); + const userId = searchParams.get("user_id"); + //表头 + const columns = [ + { + title: "发帖人", + dataIndex: "creator", + key: "creator", + render: (data) => ( + + + + ID:{data.user_id} + + + 昵称:{data.name} + + + ), + }, + { + title: "动态内容", + dataIndex: "content", + key: "content", + render: (data) => ( + + + + 当前状态: + + {data.status === 0 && "机审中"} + {data.status === 1 && "运营待审核"} + {data.status === 2 && "可见"} + {data.status === 3 && "审核不通过"} + + + + + 文案:{data.content} + + + 媒体: + + {data.media.images.map((item, index) => ( + + ))} + {data.media.videos.map((item, index) => ( + + ))} + + + ), + }, + { + title: "审核结果", + dataIndex: "info", + key: "info", + render: (data) => ( + + 文案审核结果: + {data.text_audit_opinion} + + 媒体审核结果: + {data.image_audit_opinion} + + ), + }, + { + title: "发布时间", + dataIndex: "submitTime", + key: "submitTime", + }, + { + title: "备注", + dataIndex: "remarks", + key: "remarks", + render: (_, record) => ( + + + + + + ), + }, + { + title: "操作", + dataIndex: "opeartion", + key: "opeartion", + render: (_, record) => ( + + + + onClickEdit(record)}> + 编辑 + + onClickInvisible(record)}>设为违规 + onClickDelete(record)}>删除 + + + + ), + }, + ]; + + //控制编辑modal是否出现 + const [isEditModalOpen, setIsEditModalOpen] = useState(false); + + //modal打开时的默认值 + const [defaultValues, setDefaultValues] = useState({}); + const [defaultMedia, setDefaultMedia] = useState({}); + + //点击modal取消按钮 + const handleCancel = () => { + setDefaultValues({}); + setDefaultMedia({}); + setEditImageId([]); + setEditVideoId([]); + setIsEditModalOpen(false); + }; + + //点击编辑按钮 + const onClickEdit = (record) => { + setDefaultValues(record); + setDefaultMedia(record.content.media); + setIsEditModalOpen(true); + }; + + //保存上传的媒体id + const [editImageId, setEditImageId] = useState([]); + const [editVideoId, setEditVideoId] = useState([]); + + //删除默认的媒体 + const handleDeleteMedia = (type, id) => { + if (type === "video") { + setDefaultMedia({ + ...defaultMedia, + video_ids: [], + }); + return; + } + if (type === "image") { + setDefaultMedia({ + ...defaultMedia, + image_ids: defaultMedia.image_ids.filter((item) => item !== id), + images: defaultMedia.images.filter((item) => item.id !== id), + }); + return; + } + }; + + //点击确认提交更改动态 + const handleChange = async (value) => { + const imageIds = [...defaultMedia.image_ids, ...editImageId]; + const videoIds = [...defaultMedia.video_ids, ...editVideoId]; + if (imageIds.length === 0 && videoIds.length === 0) { + alert("图片或视频不可为空"); + return; + } + if (imageIds.length !== 0 && videoIds.length !== 0) { + alert("不可同时上传图片和视频"); + return; + } + if (imageIds.length > 30) { + alert("图片不可超过30张"); + return; + } + if (videoIds.length > 1) { + alert("视频不可超过1个"); + return; + } + + try { + const base = baseRequest(); + const response = await fetch("/op/zone_moment/update", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + id: defaultValues.momentId, + text: value.content, + media_component: { + image_ids: imageIds, + video_ids: videoIds, + }, + c_type: defaultValues.data.c_type, + m_type: defaultValues.data.m_type, + ...base, + }), + }); + const temData = await response.json(); + if (temData.ret === -1) { + alert(temData.msg); + return; + } + setShowData( + showData.filter((item) => item.momentId !== defaultValues.momentId) + ); + handleCancel(); + } catch (error) { + console.error(error); + } + }; + + //点击删除按钮 + const onClickDelete = async (record) => { + try { + const base = baseRequest(); + const response = await fetch("/op/zone_moment/delete", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + id: record.momentId, + ...base, + }), + }); + const temData = await response.json(); + if (temData.ret === -1) { + alert(temData.msg); + return; + } + setShowData(showData.filter((item) => item.momentId !== record.momentId)); + } catch (error) { + console.error(error); + } + }; + + //给表单绑定ref + const formRef = useRef(null); + //点击设为违规按钮 + const onClickInvisible = (record) => { + formRef.current.record = record; + formRef.current.type = 0; + formRef.current.submit(); + }; + //提交备注 + const handleSubmit = async (value) => { + try { + const base = baseRequest(); + const response = await fetch("/op/zone_moment/set_private", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + zone_moment_id: parseInt(formRef.current.record.momentId, 10), + manually_review_opinion: value[formRef.current.record.momentId] + ? value[formRef.current.record.momentId] + : "", + ...base, + }), + }); + const temData = await response.json(); + if (temData.ret === -1) { + alert(temData.msg); + return; + } + setShowData( + showData.filter( + (item) => item.momentId !== formRef.current.record.momentId + ) + ); + } catch (error) { + console.error(error); + } + }; + + //展示的数据 + const [showData, setShowData] = useState([]); + + //搜索 + const search = async (value) => { + try { + const base = baseRequest(); + const detailResponse = await fetch(`/op/zone_moment/list_by_user_id`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + user_id: parseInt(value.userId, 10), + offset: 0, + limit: 1000, + ...base, + }), + }); + const detailData = await detailResponse.json(); + if (detailData.ret === -1) { + alert(detailData.msg); + return; + } + //匹配表格格式 + const structedData = detailData.data.list.map((item, index) => { + return { + key: index, + data: item, + momentId: item.id, + creator: item.streamer_ext, + content: { + status: item.status, + media: item.media_component, + content: item.text, + }, + info: { + image_audit_status: item.image_audit_status, + image_audit_opinion: item.image_audit_opinion, + text_audit_status: item.text_audit_status, + text_audit_opinion: item.text_audit_opinion, + }, + submitTime: new Date(item.ct * 1000).toLocaleString(), + remarks: { + manually_review_status: item.manually_review_status, + manually_review_opinion: item.manually_review_opinion, + manually_review_operator: item.manually_review_operator, + }, + }; + }); + setShowData(structedData); + } catch (error) { + console.error(error); + } + }; + + useEffect(() => { + if (!userId) return; + search({ userId }); + }, []); + + //表单提交失败 + const onFinishFailed = (errorInfo) => { + console.log("Failed:", errorInfo); + }; + + return ( + + + + + + + + 搜索 + + + + + + + {/* 编辑动态内容的弹窗,重复判断isEditModalOpen是为了重新渲染ImageUploader和VideoUploader组件 */} + {isEditModalOpen && ( + + + *请确保文案不为空,图片数不超过30,视频数不超过1,图片视频不同时存在 + + + + + + + + {defaultMedia.image_ids.length !== 0 && ( + + {defaultMedia.images.map((item) => ( + + + handleDeleteMedia("image", item.id)} + > + 删除 + + + ))} + + )} + {defaultMedia.video_ids.length !== 0 && ( + + + + handleDeleteMedia("video")} + > + 删除 + + + + )} + {defaultValues.data.m_type === 1 && ( + + )} + {defaultValues.data.m_type === 2 && ( + + )} + + 确认 + + + + )} + + ); +}; + +export default function EditSpacePost() { + return ; +} diff --git a/src/pages/Op/index.jsx b/src/pages/Op/index.jsx index 0a5035a..4da240b 100644 --- a/src/pages/Op/index.jsx +++ b/src/pages/Op/index.jsx @@ -1,13 +1,10 @@ import React, { useEffect } from "react"; import "./index.css"; import { - FireOutlined, ShopOutlined, UsergroupAddOutlined, SoundOutlined, PhoneOutlined, - ToolOutlined, - SearchOutlined, SafetyCertificateOutlined, PoweroffOutlined, MoneyCollectOutlined, @@ -43,13 +40,9 @@ export default function Op() { }; } const items = [ - // getItem("资源位管理", "management", , [ - // getItem("推荐排序", "feed"), - // ]), getItem("审核专区", "review", , [ getItem("网红入驻审核", "streamerJoin"), getItem("网红实名认证审核", "streamerVerification"), - // getItem("网红信息修改审核", "streamerProfileReview"), getItem("图片机审回查", "imageMachineReview"), getItem("文本机审回查", "textMachineReview"), getItem("动态机审回查", "postMachineReview"), @@ -58,19 +51,21 @@ export default function Op() { ]), getItem("网红管理", "streamerManagement", , [ getItem("网红资料", "streamerInformation"), - // getItem("网红平台", "streamerPlatform"), + getItem("空间管理", "streamerSpace"), ]), getItem("动态管理", "postManagement", , [ - getItem("发布与编辑", "createAndEditPost"), - getItem("置顶动态", "topPosts"), + getItem("广场动态管理", "createAndEditPost"), + getItem("广场置顶动态", "topPosts"), + getItem("空间动态管理", "EditSpacePost"), ]), getItem("信息查询", "search", , [ getItem("手机号查询", "getPhoneNumber"), + getItem("mid/user_id互查", "querryMidAndUserId"), ]), - // getItem("用户管理", "userManagement", ), getItem("订单管理", "orderManagement", , [ getItem("查询", "ordersQuerry"), getItem("退款", "refund"), + getItem("空间成员退款查询", "spaceMemberRefundQuerry"), ]), getItem("社区治理", "communityManagement", , [ getItem("用户封禁", "blockUser"), @@ -82,9 +77,6 @@ export default function Op() { ), getItem("意见反馈", "feedback", ), getItem("客服回复", "contact", ), - // getItem("辅助工具", "tools", , [ - // getItem("上传媒体", "uploadMedia"), - // ]), getItem("退出登录", "signOut", ), ]; const onClick = (e) => { diff --git a/src/pages/PostMachineReview/index.jsx b/src/pages/PostMachineReview/index.jsx index c40d3ed..3245277 100644 --- a/src/pages/PostMachineReview/index.jsx +++ b/src/pages/PostMachineReview/index.jsx @@ -14,6 +14,22 @@ const PostMachineReviewContent = (props) => { const current = props.current; //表头 const columns = [ + { + title: "发帖人", + dataIndex: "creator", + key: "creator", + render: (data) => ( + + + + ID:{data.user_id} + + + 昵称:{data.name} + + + ), + }, { title: "现内容", dataIndex: "newMedia", @@ -347,6 +363,7 @@ const PostMachineReviewContent = (props) => { return { key: index, momentId: item.moment_audit_task.associative_table_id, + creator: item?.streamer_ext, id: { media: item.image_audit_task_vo.id, text: item.text_audit_task_vo.id, diff --git a/src/pages/QuerryMidAndUserId/index.jsx b/src/pages/QuerryMidAndUserId/index.jsx new file mode 100644 index 0000000..86bfa23 --- /dev/null +++ b/src/pages/QuerryMidAndUserId/index.jsx @@ -0,0 +1,67 @@ +import React, { useState } from "react"; +import { Form, Input, Space, Button } from "antd"; +import baseRequest from "../../utils/baseRequest"; + +export default function QuerryMidAndUserId() { + const [result, setResult] = useState({}); + //搜索 + const search = async (value) => { + if (value.mid && value.user_id) { + alert("不可同时查询mid和user_id"); + return; + } + let type = "list_by_mid"; + if (!value.mid) type = "list_by_user_id"; + try { + const base = baseRequest(); + const response = await fetch(`/op/account/${type}`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + user_id: value.user_id ? parseInt(value.user_id, 10) : 0, + mid: value.mid ? parseInt(value.mid, 10) : 0, + ...base, + }), + }); + const data = await response.json(); + if (data.ret === -1) { + alert(data.msg); + return; + } + if (type === "list_by_user_id") { + setResult({ user_id: null, mid: data.data.account.mid }); + return; + } + setResult({ user_id: data.data.account.user_id, mid: null }); + } catch (error) { + console.error(error); + } + }; + //表单提交失败 + const onFinishFailed = (errorInfo) => { + console.log("Failed:", errorInfo); + }; + return ( + + + + + + + + + + + 搜索 + + + + {result?.user_id && ( + user_id:{result?.user_id} + )} + {result?.mid && mid:{result?.mid}} + + ); +} diff --git a/src/pages/SpaceMemberRefundQuerry/index.jsx b/src/pages/SpaceMemberRefundQuerry/index.jsx new file mode 100644 index 0000000..51841a9 --- /dev/null +++ b/src/pages/SpaceMemberRefundQuerry/index.jsx @@ -0,0 +1,192 @@ +import React, { useState } from "react"; +import baseRequest from "../../utils/baseRequest"; +import { DatePicker, Table, Form, Space, Button, Input, Radio } from "antd"; + +export default function SpaceMemberRefundQuerry() { + const { RangePicker } = DatePicker; + const [data, setData] = useState(); + + //表头 + const columns = [ + { + title: "基本信息", + dataIndex: "base", + key: "base", + render: (data) => { + return ( + + + 订单号: + {data.order_id} + + + 订单状态: + {data.order_status_desc} + + + 创建时间: + {data.ct} + + + ); + }, + }, + { + title: "金额", + dataIndex: "cost", + key: "cost", + render: (data) => { + return ( + {data.money !== undefined && ¥{data.money / 100}} + ); + }, + }, + { + title: "购买(双)方", + dataIndex: "userAndStreamer", + key: "userAndStreamer", + render: (data) => { + return ( + + + 用户id: + {data.user_user_id} + + {data.streamer_user_id !== 0 && ( + + 主播id: + {data.streamer_user_id} + + )} + + ); + }, + }, + { + title: "退款备注", + dataIndex: "refundNote", + key: "refundNote", + render: (data) => { + return ( + + + 联系人: + {data.contact_name} + + + 联系电话: + {data.contact_phone} + + + 退款原因: + {data.note} + + + ); + }, + }, + ]; + + //搜索 + const handleQuerry = async (value) => { + try { + const base = baseRequest(); + //金币订单查询 + const response = await fetch(`op/vas/zone_refund_list`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + st: value.time ? Math.floor(value.time[0].valueOf() / 1000) : 0, + et: value.time ? Math.floor(value.time[1].valueOf() / 1000) : 0, + user_id: value.user_id ? parseInt(value.user_id, 10) : 0, + mid: value.mid ? parseInt(value.mid, 10) : 0, + order_id: value.order_id ? value.order_id : "", + ...base, + }), + }); + const _data = await response.json(); + if (_data.ret === -1) { + alert(_data.msg); + return false; + } + const structedData = _data.data.list.map((item, index) => { + return { + key: index, + base: { + order_id: item.order_id, + order_status_desc: item.order_status_desc, + ct: new Date(item.ct * 1000).toLocaleString(), + }, + cost: { + money: item?.money, + }, + userAndStreamer: { + user_user_id: item?.user_user_id, + streamer_user_id: item?.streamer_user_id, + }, + refundNote: { + contact_name: item?.contact_name, + contact_phone: item?.contact_phone, + note: item?.note, + }, + }; + }); + setData(structedData); + } catch (error) { + console.error(error); + } + }; + + //表单提交失败 + const onFinishFailed = (errorInfo) => { + console.log("Failed:", errorInfo); + }; + + return ( + + 订单查询 + *以下字段择一填写进行查询 + + + + + + + + + + + + + + + + 搜索 + + + + + + ); +} diff --git a/src/pages/StreamerSpace/index.jsx b/src/pages/StreamerSpace/index.jsx new file mode 100644 index 0000000..df0a5b6 --- /dev/null +++ b/src/pages/StreamerSpace/index.jsx @@ -0,0 +1,669 @@ +import React, { useState, useEffect } from "react"; +import { + Form, + Input, + Button, + Space, + Table, + Checkbox, + InputNumber, + Image, +} from "antd"; +import Modal from "../../components/Modal"; +import baseRequest from "../../utils/baseRequest"; +import { useNavigate } from "react-router-dom"; + +//tab内容 +const StreamerSpaceContent = () => { + const navigate = useNavigate(); + const { TextArea } = Input; + //展示的表头 + const [showColumns, setShowColumns] = useState([ + "baseInfo", + "profile", + "paymentSettings", + "active", + "ratio", + ]); + //动态的表头 + const dynamicColumns = showColumns.map((item) => { + switch (item) { + case "baseInfo": + return { + title: "基础信息", + dataIndex: "baseInfo", + key: "baseInfo", + render: (data) => ( + + + + ID:{data.id} + + + 昵称:{data.name} + + + 创建时间:{data.ct} + + + ), + }; + case "profile": + return { + title: "空间介绍", + dataIndex: "profile", + key: "profile", + }; + case "paymentSettings": + return { + title: "付费设置", + dataIndex: "paymentSettings", + key: "paymentSettings", + render: (data) => ( + + + 解锁空间价格: + ¥{data.admission_price} + + + 铁粉价格: + ¥{data.ironfanship_price} + + + 是否开启超粉功能: + + {data.is_superfanship_enabled === 1 ? "是" : "否"} + + + {data.is_superfanship_enabled === 1 && ( + <> + + 超粉价格: + + ¥{data.superfanship_price} + + + + 超粉有效期: + {data.superfanship_valid_period === 0 && ( + 永久 + )} + {data.superfanship_valid_period === 1 && ( + 月度 + )} + {data.superfanship_valid_period === 2 && ( + 季度 + )} + {data.superfanship_valid_period === 3 && ( + 半年 + )} + {data.superfanship_valid_period === 4 && ( + 年度 + )} + + + 开通超粉是否送微信: + + {data.is_superfanship_give_wechat === 1 ? "是" : "否"} + + + > + )} + + ), + }; + case "active": + return { + title: "活跃情况", + dataIndex: "active", + key: "active", + render: (data) => ( + + + 动态数量: + {data.zone_moment_count} + + + 图片数量: + {data.image_count} + + + 视频数量: + {data.video_count} + + + 最后发帖时间: + {data.last_zone_moment_ct} + + + ), + }; + case "ratio": + return { + title: "分成情况", + dataIndex: "ratio", + key: "ratio", + render: (data) => ( + + {data.zone_third_partner?.third_partner_account?.mid && ( + <> + + 代运营ID: + + {data.zone_third_partner?.third_partner_account?.user_id} + + + + 代运营比例: + + {(data.zone_third_partner.sharing_ratio * 100).toFixed()}% + + + > + )} + + {data.zone_collaborator_list.length !== 0 && + data.zone_collaborator_list?.map((item, index) => ( + + + 合伙人ID: + + {item?.collaborator_account?.user_id} + + + + 合伙人比例: + + {(item.sharing_ratio * 100).toFixed()}% + + + + + ))} + + ), + }; + default: + return {}; + } + }); + dynamicColumns.push({ + title: "操作", + dataIndex: "opeartion", + key: "opeartion", + render: (_, record) => ( + + + + handleModal(record)}> + 修改 + + + navigate(`/editSpacePost?user_id=${record.baseInfo.id}`) + } + > + 查看动态 + + + + + ), + }); + + //表头可见性表单的checkbox选项 + const showColumnsOptions = [ + { + label: "基础信息", + value: "baseInfo", + }, + { + label: "空间介绍", + value: "profile", + }, + { + label: "付费设置", + value: "paymentSettings", + }, + { + label: "活跃情况", + value: "active", + }, + { + label: "分成情况", + value: "ratio", + }, + ]; + //展示的数据 + const [showData, setShowData] = useState([]); + //搜索空间 + const search = async (value) => { + if (!value.id) { + getAllSpace(); + return; + } + try { + const base = baseRequest(); + const detailResponse = await fetch(`/op/zone/list_by_user_id`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + user_id: parseInt(value.id, 10), + ...base, + }), + }); + const detailData = await detailResponse.json(); + if (detailData.ret === -1) { + alert(detailData.msg); + return; + } + const zone = detailData.data.list[0]; + setShowData([ + { + key: zone.id, + baseInfo: { + id: zone.streamer_ext.user_id, + name: zone.streamer_ext.name, + avatar: zone.streamer_ext.avatar.images[0].urls[0], + ct: new Date(zone.ct * 1000).toLocaleString(), + }, + profile: zone.profile, + paymentSettings: { + admission_price: zone.admission_price / 100, + ironfanship_price: zone.ironfanship_price / 100, + is_superfanship_enabled: zone.is_superfanship_enabled, + superfanship_price: zone.superfanship_price / 100, + superfanship_valid_period: zone.superfanship_valid_period, + is_superfanship_give_wechat: zone.is_superfanship_give_wechat, + }, + active: { + zone_moment_count: zone.zone_moment_count, + image_count: zone.image_count, + video_count: zone.video_count, + last_zone_moment_ct: new Date( + zone?.last_zone_moment_ct * 1000 + ).toLocaleString(), + }, + ratio: { + zone_third_partner: zone.zone_third_partner, + zone_collaborator_list: zone.zone_collaborator_list, + }, + }, + ]); + } catch (error) { + console.error(error); + } + }; + //表单提交失败 + const onFinishFailed = (errorInfo) => { + console.log("Failed:", errorInfo); + }; + //展示所有已创建空间 + const getAllSpace = async () => { + try { + const base = baseRequest(); + const detailResponse = await fetch(`/op/zone/list`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + offset: 0, + limit: 2000, + ...base, + }), + }); + const detailData = await detailResponse.json(); + if (detailData.ret === -1) { + alert(detailData.msg); + return; + } + //匹配表格格式 + const structedData = detailData.data.list.map((item, index) => { + return { + key: item.id, + baseInfo: { + id: item.streamer_ext.user_id, + name: item.streamer_ext.name, + avatar: item.streamer_ext.avatar.images[0].urls[0], + ct: new Date(item.ct * 1000).toLocaleString(), + }, + profile: item.profile, + paymentSettings: { + admission_price: item.admission_price / 100, + ironfanship_price: item.ironfanship_price / 100, + is_superfanship_enabled: item.is_superfanship_enabled, + superfanship_price: item.superfanship_price / 100, + superfanship_valid_period: item.superfanship_valid_period, + is_superfanship_give_wechat: item.is_superfanship_give_wechat, + }, + active: { + zone_moment_count: item.zone_moment_count, + image_count: item.image_count, + video_count: item.video_count, + last_zone_moment_ct: new Date( + item?.last_zone_moment_ct * 1000 + ).toLocaleString(), + }, + ratio: { + zone_third_partner: item.zone_third_partner, + zone_collaborator_list: item.zone_collaborator_list, + }, + }; + }); + setShowData(structedData); + } catch (error) { + console.error(error); + } + }; + useEffect(() => { + getAllSpace(); + }, []); + //modal是否展示 + const [isModalOpen, setIsModalOpen] = useState(false); + //点击modal取消按钮 + const handleCancel = () => { + setShowData([]); + setDefaultValues({}); + setIsModalOpen(false); + }; + //modal打开时的默认值 + const [defaultValues, setDefaultValues] = useState({}); + //点击修改按钮 + const handleModal = (record) => { + setDefaultValues(record); + setIsModalOpen(true); + }; + //表单提交成功 + const onModalFormFinish = async (value) => { + //上传表单操作... + if ( + !value.admission_price?.toString() || + !value.ironfanship_price?.toString() || + !value.is_superfanship_enabled?.toString() || + !value.profile + ) { + alert("请完善表单信息"); + return; + } + if ( + parseInt(value.is_superfanship_enabled) === 1 && + (!value.superfanship_price?.toString() || + !value.superfanship_valid_period?.toString() || + !value.is_superfanship_give_wechat?.toString()) + ) { + alert("请完善表单信息"); + return; + } + const _spacePrice = parseInt(value.admission_price * 100, 10); + if (isNaN(_spacePrice) || _spacePrice < 0) { + alert("请输入有效的解锁空间价格"); + return; + } + const _ironFanPrice = parseInt(value.ironfanship_price * 100, 10); + if (isNaN(_ironFanPrice) || _ironFanPrice < 100 || _ironFanPrice > 388800) { + alert("请输入有效的铁粉价格"); + return; + } + const _superFanPrice = parseInt(value.superfanship_price * 100, 10); + if ( + parseInt(value.is_superfanship_enabled) === 1 && + (isNaN(_superFanPrice) || _superFanPrice < 100 || _superFanPrice > 388800) + ) { + alert("请输入有效的超粉价格"); + return; + } + if ( + parseInt(value.is_superfanship_enabled) === 1 && + _superFanPrice <= _ironFanPrice + ) { + alert("请输入大于铁粉价格的超粉价格"); + return; + } + try { + const base = baseRequest(); + const detailResponse = await fetch(`/op/zone/update`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + id: defaultValues.key, + admission_price: parseInt(value.admission_price * 100, 10), + ironfanship_price: parseInt(value.ironfanship_price * 100, 10), + is_superfanship_enabled: parseInt(value.is_superfanship_enabled), + superfanship_price: parseInt(value.superfanship_price * 100, 10), + superfanship_valid_period: parseInt( + value.superfanship_valid_period, + 10 + ), + is_superfanship_give_wechat: parseInt( + value.is_superfanship_give_wechat, + 10 + ), + ...base, + }), + }); + const detailData = await detailResponse.json(); + if (detailData.ret === -1) { + alert(detailData.msg); + return; + } + } catch (error) { + console.error(error); + } + //关闭模态 + setShowData([]); + setDefaultValues({}); + setIsModalOpen(false); + }; + //表单提交失败 + const onModalFormFinishFailed = (errorInfo) => { + console.log("Failed:", errorInfo); + }; + + return ( + + + 数据可见性: + setShowColumns(value)} + /> + + + + + + + + 搜索 + + + + 共{showData.length}条结果 + + {/* 模态框是否显示 */} + {isModalOpen && ( + + + + + + ID:{defaultValues.baseInfo.id} + + 昵称:{defaultValues.baseInfo.name} + + + 创建时间:{defaultValues.baseInfo.ct} + + + + + + + + + + + + + + + + 是 + 否 + + + + + + + + 永久 + 月度 + 季度 + 半年 + 年度 + + + + + 是 + 否 + + + + + } + /> + + )} + + ); +}; + +export default function StreamerSpace() { + return ; +} diff --git a/src/pages/ZonePostMachineReview/index.jsx b/src/pages/ZonePostMachineReview/index.jsx index 52865ef..0de2117 100644 --- a/src/pages/ZonePostMachineReview/index.jsx +++ b/src/pages/ZonePostMachineReview/index.jsx @@ -189,6 +189,7 @@ const ZonePostMachineReviewContent = (props) => { }), }); const temData = await response.json(); + console.log(temData); if (temData.ret === -1) { alert(temData.msg); return; diff --git a/src/routes/index.js b/src/routes/index.js index 0b77176..0d48a56 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -23,6 +23,10 @@ import Refund from "../pages/Refund"; import BlockUser from "../pages/BlockUser"; import DeletedPostReview from "../pages/DeletedPostReview"; import ZonePostMachineReview from "../pages/ZonePostMachineReview"; +import StreamerSpace from "../pages/StreamerSpace"; +import SpaceMemberRefundQuerry from "../pages/SpaceMemberRefundQuerry"; +import QuerryMidAndUserId from "../pages/QuerryMidAndUserId"; +import EditSpacePost from "../pages/EditSpacePost"; const routes = [ { @@ -125,6 +129,22 @@ const routes = [ path: "zonePostMachineReview/*", element: , }, + { + path: "streamerSpace/*", + element: , + }, + { + path: "spaceMemberRefundQuerry/*", + element: , + }, + { + path: "querryMidAndUserId/*", + element: , + }, + { + path: "editSpacePost/*", + element: , + }, ], }, ];
- *请选中主播后再发布,并确保文案不为空,图片数不超过9,视频数不超过1,图片视频不同时存在 + *请确保文案不为空,图片数不超过9,视频数不超过1,图片视频不同时存在
+ ID:{data.user_id} +
+ 昵称:{data.name} +
+ 当前状态: + + {data.status === 0 && "机审中"} + {data.status === 1 && "运营待审核"} + {data.status === 2 && "可见"} + {data.status === 3 && "审核不通过"} + +
+ 文案:{data.content} +
媒体:
文案审核结果:
{data.text_audit_opinion}
媒体审核结果:
{data.image_audit_opinion}
+ *请确保文案不为空,图片数不超过30,视频数不超过1,图片视频不同时存在 +
user_id:{result?.user_id}
mid:{result?.mid}
+ 订单号: + {data.order_id} +
+ 订单状态: + {data.order_status_desc} +
+ 创建时间: + {data.ct} +
¥{data.money / 100}
+ 用户id: + {data.user_user_id} +
+ 主播id: + {data.streamer_user_id} +
+ 联系人: + {data.contact_name} +
+ 联系电话: + {data.contact_phone} +
+ 退款原因: + {data.note} +
*以下字段择一填写进行查询
+ ID:{data.id} +
+ 创建时间:{data.ct} +
+ 解锁空间价格: + ¥{data.admission_price} +
+ 铁粉价格: + ¥{data.ironfanship_price} +
+ 是否开启超粉功能: + + {data.is_superfanship_enabled === 1 ? "是" : "否"} + +
+ 超粉价格: + + ¥{data.superfanship_price} + +
+ 超粉有效期: + {data.superfanship_valid_period === 0 && ( + 永久 + )} + {data.superfanship_valid_period === 1 && ( + 月度 + )} + {data.superfanship_valid_period === 2 && ( + 季度 + )} + {data.superfanship_valid_period === 3 && ( + 半年 + )} + {data.superfanship_valid_period === 4 && ( + 年度 + )} +
+ 开通超粉是否送微信: + + {data.is_superfanship_give_wechat === 1 ? "是" : "否"} + +
+ 动态数量: + {data.zone_moment_count} +
+ 图片数量: + {data.image_count} +
+ 视频数量: + {data.video_count} +
+ 最后发帖时间: + {data.last_zone_moment_ct} +
+ 代运营ID: + + {data.zone_third_partner?.third_partner_account?.user_id} + +
+ 代运营比例: + + {(data.zone_third_partner.sharing_ratio * 100).toFixed()}% + +
+ 合伙人ID: + + {item?.collaborator_account?.user_id} + +
+ 合伙人比例: + + {(item.sharing_ratio * 100).toFixed()}% + +
数据可见性:
共{showData.length}条结果
ID:{defaultValues.baseInfo.id}
+ 昵称:{defaultValues.baseInfo.name} +
+ 创建时间:{defaultValues.baseInfo.ct} +