From 51906bafa48d66abe8fd0465a0063b18a1d613b9 Mon Sep 17 00:00:00 2001 From: yezian Date: Thu, 18 Jan 2024 21:31:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=81=94=E7=B3=BB=E5=AE=A2?= =?UTF-8?q?=E6=9C=8D=E9=A1=B5=E9=9D=A2bug=EF=BC=9B=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=AE=A2=E5=8D=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Contact/index.jsx | 2 + src/pages/Op/data.jsx | 89 +++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/src/pages/Contact/index.jsx b/src/pages/Contact/index.jsx index 52b8268..7b9b890 100644 --- a/src/pages/Contact/index.jsx +++ b/src/pages/Contact/index.jsx @@ -403,6 +403,8 @@ const ContactContent = (props) => { }, body: JSON.stringify({ mids: userMids, + offset: 0, + limit: 1000, ...base, }), }); diff --git a/src/pages/Op/data.jsx b/src/pages/Op/data.jsx index 0376a63..5a575e6 100644 --- a/src/pages/Op/data.jsx +++ b/src/pages/Op/data.jsx @@ -5,6 +5,7 @@ import { DatePicker, Table } from "antd"; export default function Data() { const { RangePicker } = DatePicker; const [data, setData] = useState(); + const [order, setOrder] = useState(); // 获取当前时间戳 const currentTimestamp = Date.now(); @@ -55,7 +56,49 @@ export default function Data() { console.error(error); } }; + + const getOrderData = async () => { + try { + const base = baseRequest(); + const response = await fetch(`/op/vas/coin_order_list`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + st: Math.floor(selectTime.ct_lower_bound / 1000), + et: Math.floor(selectTime.ct_upper_bound / 1000), + offset: 0, + limit: 100, + ...base, + }), + }); + const _data = await response.json(); + if (_data.ret === -1) { + alert(_data.msg); + return; + } + const structedData = _data.data.list.map((item, index) => { + return { + key: index, + time: new Date(item.ct * 1000).toLocaleString(), + user: item.user_user_id, + streamer: item.streamer_user_id, + price: item.coins / 10, + order_detail: { + order_id: item.order_id, + order_status_desc: item.order_status_desc, + }, + }; + }); + setOrder(structedData); + } catch (error) { + console.error(error); + } + }; + getData(); + getOrderData(); }, [selectTime]); const onOk = (value) => { @@ -110,6 +153,46 @@ export default function Data() { }, ]; + //订单表头 + const orderColumns = [ + { + title: "订单时间", + dataIndex: "time", + key: "time", + }, + { + title: "用户", + dataIndex: "user", + key: "user", + }, + { + title: "主播", + dataIndex: "streamer", + key: "streamer", + }, + { + title: "价格", + dataIndex: "price", + key: "price", + render: (data) => { + return

¥{data}

; + }, + }, + { + title: "订单详情", + dataIndex: "order_detail", + key: "order_detail", + render: (data) => { + return ( +
+

订单号:{data.order_id}

+

订单状态:{data.order_status_desc}

+
+ ); + }, + }, + ]; + return (

数据统计

@@ -122,6 +205,12 @@ export default function Data() { format="YYYY-MM-DD HH:mm" onOk={onOk} /> +