Merge remote-tracking branch 'origin/main' into anln_1.6

This commit is contained in:
al 2025-03-19 18:09:47 +08:00
commit 054db90d23
11 changed files with 291 additions and 201 deletions

View File

@ -10,7 +10,6 @@ import {
import baseRequest from "../../utils/baseRequest";
const BlockUserContent = (props) => {
const { TextArea } = Input;
const current = props.current;
//
const columns = [
@ -137,7 +136,7 @@ const BlockUserContent = (props) => {
//
const [data, setData] = useState([]);
const getData = async () => {
const getData = async (user_id) => {
let querryUrl;
switch (current) {
case "blocking":
@ -158,7 +157,8 @@ const BlockUserContent = (props) => {
},
body: JSON.stringify({
offset: 0,
limit: 10000,
limit: 100,
user_id: user_id ? parseInt(user_id, 10) : undefined,
...base,
}),
});
@ -197,7 +197,7 @@ const BlockUserContent = (props) => {
ut: new Date(item.account_punishments.ut * 1000).toLocaleString(),
};
});
setData([...data, ...structedData]);
setData([...structedData]);
} catch (error) {
console.error(error);
}
@ -214,9 +214,7 @@ const BlockUserContent = (props) => {
//
const search = (value) => {
value.id
? setShowData(data.filter((item) => item.user.user_id == value.id))
: setShowData(data);
getData(value.id);
};
//Modal
@ -323,6 +321,7 @@ const BlockUserContent = (props) => {
>
添加封禁
</Button>
<p className="text-sm text-red-400">仅显示最新100条</p>
<Form
ref={formRef}
name="remarks"

View File

@ -28,6 +28,8 @@ const ContactContent = (props) => {
"Content-Type": "application/json",
},
body: JSON.stringify({
limit: 100,
offset: 0,
...base,
}),
}
@ -51,7 +53,7 @@ const ContactContent = (props) => {
body: JSON.stringify({
mids: userMids,
offset: 0,
limit: 1000,
limit: 100,
...base,
}),
});
@ -413,7 +415,7 @@ const ContactContent = (props) => {
body: JSON.stringify({
mids: userMids,
offset: 0,
limit: 1000,
limit: 100,
...base,
}),
});

View File

@ -222,7 +222,7 @@ const CreateAndEditPostContent = (props) => {
body: JSON.stringify({
ct_upper_bound: Math.floor(new Date().getTime() / 1000),
offset: 0,
limit: 20 + offset,
limit: 100,
...base,
}),
});
@ -455,6 +455,7 @@ const CreateAndEditPostContent = (props) => {
>
创建动态
</Button>
<p className="text-sm text-red-400">仅显示最新100条</p>
<Form name="remarks">
<Table
columns={columns}

View File

@ -1,161 +0,0 @@
import React, { useState, useEffect } from "react";
import { Form, Input, Table, Image, Space, Button, Modal, message } from "antd";
import baseRequest from "../../utils/baseRequest";
import VideoPlayer from "../../components/VideoPlayer";
export default function DeletedPostReview() {
//
const columns = [
{
title: "动态信息",
dataIndex: "info",
key: "info",
width: 300,
render: (data) => (
<div>
<p>
动态id<span className="text-red-400">{data.id}</span>
</p>
<p>
点赞<span className="text-red-400">{data.like}</span>
</p>
<p>
创建时间<span className="text-red-400">{data.ct}</span>
</p>
</div>
),
},
{
title: "动态文案",
dataIndex: "content",
key: "content",
},
{
title: "媒体",
dataIndex: "media",
key: "media",
width: 600,
render: (data) => (
<div
className={`grid ${
(data.media?.images[0]?.h <= data.media?.images[0]?.w &&
data.media?.images.length < 4) ||
data.media?.images.length === 0
? "grid-cols-2"
: "grid-cols-4"
} gap-2`}
>
{data?.images?.map((item, index) => (
<Image
key={index}
src={item.urls[0]}
style={{ marginBottom: 10 }}
/>
))}
{data?.videos?.map((item, index) => (
<VideoPlayer key={index} url={item.urls[0]} />
))}
</div>
),
},
{
title: "操作",
dataIndex: "opeartion",
key: "opeartion",
width: 200,
render: (_, record) => (
<div>
<Space>
<Space.Compact direction="vertical">
<Button type="primary" onClick={() => onClickRecovery(record)}>
恢复
</Button>
</Space.Compact>
</Space>
</div>
),
},
];
//
const onClickRecovery = async (record) => {
try {
const base = baseRequest();
const response = await fetch("/op/moment/update", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
id: record.info.id,
del_flag: 0,
...base,
}),
});
const temData = await response.json();
console.log(temData);
if (temData.ret === -1) {
alert(temData.msg);
return;
}
setShowData(showData.filter((item) => item.info.id !== record.info.id));
} catch (error) {
console.error(error);
}
};
//
const [showData, setShowData] = useState([]);
//
const getData = async () => {
try {
const base = baseRequest();
const response = await fetch("/op/moment/list_deleted", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
ct_upper_bound: Math.floor(new Date().getTime() / 1000),
offset: 0,
limit: 2000,
...base,
}),
});
const temData = await response.json();
if (temData.ret === -1) {
alert(temData.msg);
return;
}
//
const structedData = temData.data.list.map((item, index) => {
return {
key: index,
info: {
id: item.id,
like: item.thumbs_up_num,
ct: new Date(item.ct * 1000).toLocaleString(),
},
content: item.text,
media: item.media_component,
};
});
setShowData(structedData);
} catch (error) {
console.error(error);
}
};
useEffect(() => {
getData();
}, []);
return (
<div className="w-full h-full">
<Table
columns={columns}
dataSource={showData}
pagination={{ pageSize: 20 }}
/>
</div>
);
}

View File

@ -383,7 +383,7 @@ const EditSpacePostContent = (props) => {
body: JSON.stringify({
user_id: parseInt(value.userId, 10),
offset: 0,
limit: 1000,
limit: 100,
...base,
}),
});
@ -462,6 +462,7 @@ const EditSpacePostContent = (props) => {
</Button>
</Space>
</Form>
<p className="text-sm text-red-400">仅显示最新100条</p>
<Form
ref={formRef}
name="remarks"

View File

@ -457,7 +457,7 @@ const BannerList = (props) => {
},
body: JSON.stringify({
offset: offset,
limit: 200,
limit: 100,
...base,
}),
});

View File

@ -493,7 +493,7 @@ const HotList = (props) => {
},
body: JSON.stringify({
offset,
limit: 2000,
limit: 100,
status,
...base,
}),
@ -503,11 +503,6 @@ const HotList = (props) => {
alert(temData.msg);
return;
}
console.log("temData.data.list", temData.data.list, {
offset: offset,
limit: 200,
status,
});
setData((old) =>
isFirst ? temData.data.list : [...old, ...temData.data.list]

View File

@ -35,7 +35,7 @@ export default function Op() {
checkToken();
const b_mid = baseRequest().b_mid;
setMid(b_mid);
}, [location]);
}, [location, navigate]);
function getItem(label, key, icon, children, type) {
return {
key,
@ -60,7 +60,6 @@ export default function Op() {
getItem("主播昵称机审回查", "streamerNickTextMachineReview"),
getItem("广场动态审核", "postMachineReview"),
getItem("空间动态审核", "zonePostMachineReview"),
getItem("已删除动态回捞", "deletedPostReview"),
]),
getItem("网红管理", "streamerManagement", <ShopOutlined />, [
getItem("网红资料", "streamerInformation"),
@ -84,7 +83,7 @@ export default function Op() {
]),
getItem("社区治理", "communityManagement", <UsergroupAddOutlined />, [
getItem("用户封禁", "blockUser"),
// getItem("", "blockWithdraw"),
getItem("提现封禁", "withdrawFreeze"),
]),
getItem(
"人工充值/提现",
@ -116,7 +115,6 @@ export default function Op() {
getItem("主播昵称机审回查", "streamerNickTextMachineReview"),
getItem("动态机审回查", "postMachineReview"),
// getItem("", "zonePostMachineReview"),
// getItem("", "deletedPostReview"),
]),
getItem("网红管理", "streamerManagement", <ShopOutlined />, [
getItem("网红资料", "streamerInformation"),
@ -140,6 +138,7 @@ export default function Op() {
]),
getItem("社区治理", "communityManagement", <UsergroupAddOutlined />, [
getItem("用户封禁", "blockUser"),
getItem("提现封禁", "withdrawFreeze"),
]),
getItem(
"人工充值/提现",

View File

@ -169,10 +169,7 @@ const VerificationContent = (props) => {
};
//
const [data, setData] = useState([]);
const [offset, setOffset] = useState(0);
const [more, setMore] = useState(1);
const getData = async () => {
if (!more) return;
const getData = async (user_id) => {
let querryStatus;
switch (current) {
case "pending":
@ -196,8 +193,9 @@ const VerificationContent = (props) => {
},
body: JSON.stringify({
status: querryStatus,
offset: offset,
limit: 10000,
offset: 0,
limit: 100,
user_id,
...base,
}),
});
@ -220,7 +218,7 @@ const VerificationContent = (props) => {
body: JSON.stringify({
mids: streamerMids,
offset: 0,
limit: 10000,
limit: 100,
...base,
}),
});
@ -258,9 +256,7 @@ const VerificationContent = (props) => {
status: item.status,
};
});
setData([...data, ...structedData]);
setOffset(temData.data.offset);
setMore(temData.data.more);
setData([...structedData]);
} catch (error) {
console.error(error);
}
@ -276,9 +272,13 @@ const VerificationContent = (props) => {
}, [data]);
//
const search = (value) => {
value.id
? setShowData(data.filter((item) => item.baseInfo.user_id == value.id))
: setShowData(data);
if (value.id) {
setData([]);
getData(parseInt(value.id));
} else {
setData([]);
getData();
}
};
//
const onFinishFailed = (errorInfo) => {
@ -301,6 +301,7 @@ const VerificationContent = (props) => {
</Button>
</Space>
</Form>
<p className="text-sm text-red-400">仅显示最新100条</p>
<Form
ref={formRef}
name="remarks"

View File

@ -0,0 +1,253 @@
import React, { useState, useEffect } from "react";
import { Form, Input, Button, Space, Table, message, Modal } from "antd";
import baseRequest from "../../utils/baseRequest";
export default function WithdrawFreeze() {
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
const [freezeList, setFreezeList] = useState([]);
const [submitLoading, setSubmitLoading] = useState(false);
const [unfreezeLoading, setUnfreezeLoading] = useState(false);
const [modalVisible, setModalVisible] = useState(false);
const [selectedUser, setSelectedUser] = useState(null);
//
const fetchFreezeList = async () => {
setLoading(true);
try {
const base = baseRequest();
const response = await fetch("/op/vas/get_withdraw_freeze_list", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ ...base }),
});
const result = await response.json();
if (result.ret === 1) {
setFreezeList(result.data?.list || []);
} else {
message.error("获取冻结提现列表失败");
}
} catch (error) {
console.error("获取冻结提现列表出错:", error);
message.error("获取冻结提现列表出错");
} finally {
setLoading(false);
}
};
//
const handleAddFreeze = async (values) => {
setSubmitLoading(true);
try {
const base = baseRequest();
const response = await fetch("/op/vas/add_withdraw_freeze", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
...base,
user_id: parseInt(values.user_id),
}),
});
const result = await response.json();
if (result.ret === 1) {
message.success("添加冻结提现成功");
form.resetFields();
fetchFreezeList();
} else {
message.error("添加冻结提现失败");
}
} catch (error) {
console.error("添加冻结提现出错:", error);
message.error("添加冻结提现出错");
} finally {
setSubmitLoading(false);
}
};
//
const showUnfreezeModal = (record) => {
setSelectedUser(record);
setModalVisible(true);
};
//
const handleUnfreeze = async () => {
if (!selectedUser) return;
setUnfreezeLoading(true);
try {
const base = baseRequest();
const response = await fetch("/op/vas/del_withdraw_freeze", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
...base,
user_id: parseInt(selectedUser.user_id),
}),
});
const result = await response.json();
if (result.ret === 1) {
message.success("解除冻结提现成功");
setModalVisible(false);
fetchFreezeList();
} else {
message.error("解除冻结提现失败");
}
} catch (error) {
console.error("解除冻结提现出错:", error);
message.error("解除冻结提现出错");
} finally {
setUnfreezeLoading(false);
}
};
//
const columns = [
{
title: "用户ID",
dataIndex: "user_id",
key: "user_id",
},
{
title: "用户资料",
dataIndex: "account",
key: "account",
render: (account) => (
<div>
{account ? (
<>
<img
className="w-12 aspect-square rounded"
src={account.avatar.images[0].urls[0]}
alt="头像"
/>
<div>昵称: {account.name || "-"}</div>
</>
) : (
"-"
)}
</div>
),
},
{
title: "封禁时间",
dataIndex: "ct",
key: "ct",
render: (text) => new Date(text * 1000).toLocaleString(),
},
{
title: "操作人MID",
dataIndex: "operator_mid",
key: "operator_mid",
},
{
title: "操作",
key: "action",
render: (_, record) => (
<Button type="primary" danger onClick={() => showUnfreezeModal(record)}>
解除封禁
</Button>
),
},
];
//
useEffect(() => {
fetchFreezeList();
}, []);
return (
<div style={{ padding: 20 }}>
<h1>提现封禁管理</h1>
{/* 添加冻结提现表单 */}
<div style={{ marginBottom: 20, padding: 20, border: "1px solid #eee" }}>
<h2>添加提现封禁</h2>
<Form
form={form}
onFinish={handleAddFreeze}
layout="inline"
style={{ marginTop: 20 }}
>
<Form.Item
name="user_id"
label="用户ID"
rules={[
{ required: true, message: "请输入用户ID" },
{
pattern: /^\d+$/,
message: "用户ID必须为数字",
},
]}
>
<Input placeholder="请输入要封禁的用户ID" style={{ width: 250 }} />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit" loading={submitLoading}>
添加封禁
</Button>
</Form.Item>
</Form>
</div>
{/* 提现封禁列表 */}
<div>
<div
style={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
marginBottom: 16,
}}
>
<h2>提现封禁列表</h2>
<Button onClick={fetchFreezeList} loading={loading}>
刷新列表
</Button>
</div>
<Table
columns={columns}
dataSource={freezeList.map((item) => ({
...item,
key: item.user_id,
}))}
loading={loading}
pagination={{ pageSize: 10 }}
/>
</div>
{/* 解除封禁确认弹窗 */}
<Modal
title="确认解除提现封禁"
open={modalVisible}
onCancel={() => setModalVisible(false)}
footer={[
<Button key="cancel" onClick={() => setModalVisible(false)}>
取消
</Button>,
<Button
key="confirm"
type="primary"
danger
loading={unfreezeLoading}
onClick={handleUnfreeze}
>
确认解除
</Button>,
]}
>
<p>
确定要解除
<span className="text-red-500">{selectedUser?.account?.name}</span>
的提现封禁吗
</p>
</Modal>
</div>
);
}

View File

@ -27,7 +27,6 @@ import PostMachineReview from "../pages/PostMachineReview";
import GetPhoneNumber from "../pages/GetPhoneNumber";
import Refund from "../pages/Refund";
import BlockUser from "../pages/BlockUser";
import DeletedPostReview from "../pages/DeletedPostReview";
import ZonePostMachineReview from "../pages/ZonePostMachineReview";
import GuildMachineReview from "../pages/GuildMachineReview";
import StreamerSpace from "../pages/StreamerSpace";
@ -39,6 +38,7 @@ import StreamerNickTextMachineReview from "../pages/StreamerNickTextMachineRevie
import StreamerVideoMachineReview from "../pages/StreamerVideoMachineReview";
import RollbackUserLeaveSpace from "../pages/RollbackUserLeaveSpace";
import RollbackUserRefundSpaceStatus from "../pages/RollbackUserRefundSpaceStatus/index";
import WithdrawFreeze from "../pages/WithdrawFreeze";
const routes = [
{
@ -157,10 +157,6 @@ const routes = [
path: "blockUser/*",
element: <BlockUser />,
},
{
path: "deletedPostReview/*",
element: <DeletedPostReview />,
},
{
path: "zonePostMachineReview/*",
element: <ZonePostMachineReview />,
@ -205,6 +201,10 @@ const routes = [
path: "rollbackUserRefundSpaceStatus/*",
element: <RollbackUserRefundSpaceStatus />,
},
{
path: "withdrawFreeze/*",
element: <WithdrawFreeze />,
},
],
},
];