增加用户重新购空间页面;优化代码格式
This commit is contained in:
parent
61a3492ac8
commit
4c1b1631f4
|
@ -4,13 +4,18 @@ import baseRequest from "../../utils/baseRequest";
|
|||
import ImageUploader from "../../components/ImageUploader";
|
||||
import VideoUploader from "../../components/VideoUploader";
|
||||
import { useSearchParams } from "react-router-dom";
|
||||
import VideoPlayer from '../../components/VideoPlayer';
|
||||
import VideoPlayer from "../../components/VideoPlayer";
|
||||
const EditSpacePostContent = (props) => {
|
||||
const { TextArea } = Input;
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const userId = searchParams.get("user_id");
|
||||
//表头
|
||||
const columns = [
|
||||
{
|
||||
title: "id",
|
||||
dataIndex: "momentId",
|
||||
key: "momentId",
|
||||
},
|
||||
{
|
||||
title: "发帖人",
|
||||
dataIndex: "creator",
|
||||
|
@ -55,13 +60,15 @@ const EditSpacePostContent = (props) => {
|
|||
</div>
|
||||
<p className="text-red-400">媒体:</p>
|
||||
<div className="flex flex-wrap gap-1">
|
||||
<Image.PreviewGroup items={data.media.images?.map((item) => item.urls[0])}>
|
||||
<Image.PreviewGroup
|
||||
items={data.media.images?.map((item) => item.urls[0])}
|
||||
>
|
||||
{data.media.images.map((item, index) => (
|
||||
<Image key={index} src={item.urls[0]} width={100} />
|
||||
))}
|
||||
</Image.PreviewGroup>
|
||||
{data.media.videos.map((item, index) => (
|
||||
<VideoPlayer key={index} url={item.urls[0]}/>
|
||||
<VideoPlayer key={index} url={item.urls[0]} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -511,8 +518,8 @@ const EditSpacePostContent = (props) => {
|
|||
{defaultMedia.video_ids.length !== 0 && (
|
||||
<div className="flex flex-row mt-4">
|
||||
<div className="relative">
|
||||
<div className="mr-auto" >
|
||||
<VideoPlayer url={defaultMedia.videos[0].urls[0]}/>
|
||||
<div className="mr-auto">
|
||||
<VideoPlayer url={defaultMedia.videos[0].urls[0]} />
|
||||
</div>
|
||||
<Button
|
||||
className="absolute top-0 left-0 w-full"
|
||||
|
|
|
@ -72,6 +72,7 @@ export default function Op() {
|
|||
getItem("退款", "refund"),
|
||||
getItem("空间成员退款查询", "spaceMemberRefundQuerry"),
|
||||
getItem("用户误退空间恢复", "rollbackUserLeaveSpace"),
|
||||
getItem("用户重购空间", "rollbackUserRefundSpaceStatus"),
|
||||
]),
|
||||
getItem("社区治理", "communityManagement", <UsergroupAddOutlined />, [
|
||||
getItem("用户封禁", "blockUser"),
|
||||
|
|
|
@ -10,7 +10,7 @@ const RefundContent = (props) => {
|
|||
try {
|
||||
const base = baseRequest();
|
||||
const _response = await fetch(
|
||||
`op/vas/${
|
||||
`/op/vas/${
|
||||
value.type === "coin" ? "refund_coin_order" : "refund_order"
|
||||
}`,
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ export default function RollbackUserLeaveSpace() {
|
|||
}
|
||||
try {
|
||||
const base = baseRequest();
|
||||
const response = await fetch(`op/vas/rollback_zone_exit_status`, {
|
||||
const response = await fetch(`/op/vas/rollback_zone_exit_status`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
import React from "react";
|
||||
import { Form, Input, Space, Button, message } from "antd";
|
||||
import baseRequest from "../../utils/baseRequest";
|
||||
|
||||
export default function RollbackUserRefundSpaceStatus() {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const rollback = async (value) => {
|
||||
if (!value.userid || !value.streamer_userid) {
|
||||
alert("请填写用户和主播的ID");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const base = baseRequest();
|
||||
const response = await fetch(`/op/vas/rollback_zone_refund_status`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
userid: parseInt(value.userid, 10),
|
||||
streamer_userid: parseInt(value.streamer_userid, 10),
|
||||
...base,
|
||||
}),
|
||||
});
|
||||
const data = await response.json();
|
||||
console.log(data);
|
||||
if (data.ret === -1) {
|
||||
alert(data.msg);
|
||||
return;
|
||||
}
|
||||
form.resetFields();
|
||||
message.success("恢复成功");
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
//表单提交失败
|
||||
const onFinishFailed = (errorInfo) => {
|
||||
console.log("Failed:", errorInfo);
|
||||
};
|
||||
return (
|
||||
<div className="mt-4" style={{ marginLeft: 20, marginRight: 20 }}>
|
||||
<p className="text-red-400 mb-4">
|
||||
该功能只适用于用户加入空间主动退款后,希望重新购买空间的情况
|
||||
</p>
|
||||
<Form
|
||||
name="rollback"
|
||||
form={form}
|
||||
onFinish={rollback}
|
||||
onFinishFailed={onFinishFailed}
|
||||
>
|
||||
<Space direction="vertical" style={{ marginBottom: 20 }}>
|
||||
<Form.Item label="请输入用户ID" name="userid" style={{ margin: 0 }}>
|
||||
<Input type="number" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="请输入主播ID"
|
||||
name="streamer_userid"
|
||||
style={{ margin: 0 }}
|
||||
>
|
||||
<Input type="number" />
|
||||
</Form.Item>
|
||||
<Button type="primary" htmlType="submit">
|
||||
恢复
|
||||
</Button>
|
||||
</Space>
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -92,7 +92,7 @@ export default function SpaceMemberRefundQuerry() {
|
|||
try {
|
||||
const base = baseRequest();
|
||||
//金币订单查询
|
||||
const response = await fetch(`op/vas/zone_refund_list`, {
|
||||
const response = await fetch(`/op/vas/zone_refund_list`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
|
|
@ -33,6 +33,7 @@ import StreamerImageMachineReview from "../pages/StreamerImageMachineReview";
|
|||
import StreamerTextMachineReview from "../pages/StreamerTextMachineReview";
|
||||
import StreamerVideoMachineReview from "../pages/StreamerVideoMachineReview";
|
||||
import RollbackUserLeaveSpace from "../pages/RollbackUserLeaveSpace";
|
||||
import RollbackUserRefundSpaceStatus from "../pages/RollbackUserRefundSpaceStatus/index";
|
||||
|
||||
const routes = [
|
||||
{
|
||||
|
@ -175,6 +176,10 @@ const routes = [
|
|||
path: "rollbackUserLeaveSpace/*",
|
||||
element: <RollbackUserLeaveSpace />,
|
||||
},
|
||||
{
|
||||
path: "rollbackUserRefundSpaceStatus/*",
|
||||
element: <RollbackUserRefundSpaceStatus />,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue