修改退款审核和消息

This commit is contained in:
al 2024-12-24 17:51:06 +08:00
parent 5e2375c8d9
commit 840ef29428
9 changed files with 51 additions and 22 deletions

View File

@ -141,7 +141,7 @@ export default function RefundDetail() {
<Radio.Group
className="flex flex-col"
onChange={setIndex}
value={selectedIndex}
value={data && data?.refunds_status === 4 ? 2 : selectedIndex}
disabled={!checkAble}
>
<div className="flex flex-row items-start mt-4 pr-6">
@ -204,7 +204,6 @@ export default function RefundDetail() {
</div>
</Radio.Group>
</div>
<div
onClick={(e) => {
if (isLoading || !checkAble) return;
@ -215,7 +214,13 @@ export default function RefundDetail() {
background: isLoading || !checkAble ? "#FFFFFF80" : "#FF669E",
}}
>
{!checkAble ? "您已提交" : isLoading ? "正在提交..." : "提交"}
{data && data?.refunds_status === 4
? "系统已自动提交"
: !checkAble
? "您已提交"
: isLoading
? "正在提交..."
: "提交"}
</div>
</div>
</div>

View File

@ -26,7 +26,7 @@ export default function Reviewed({ currentIndex }) {
b_mid: account.mid,
audit_type: 1,
offset: offset,
limit: 20,
limit: 10,
};
const _data = await requireAPI("POST", "/api/zone/refund_list", {
body,
@ -90,7 +90,7 @@ export default function Reviewed({ currentIndex }) {
<div className="bg-[#FFFFFF1A] w-max flex items-center rounded-full px-2 py-0.5">
<span className="text-white text-xs font-medium">
申请时间
{formatTimestamp(item?.account.ut)}
{formatTimestamp(item?.refund_t)}
</span>
</div>
</div>

View File

@ -93,7 +93,7 @@ export default function PendingReview({ currentIndex }) {
<div className="bg-[#FFFFFF1A] w-max flex items-center rounded-full px-2 py-0.5">
<span className="text-white text-xs font-medium">
申请时间
{formatTimestamp(item?.account.ut)}
{formatTimestamp(item?.refund_t)}
</span>
</div>
</div>
@ -102,7 +102,11 @@ export default function PendingReview({ currentIndex }) {
<div className="flex flex-col justify-center items-center">
<div className="px-4 py-1 rounded-full bg-[#FFFFFF1A] flex-row items-center">
<span className="text-white text-sm">
{item?.refunds_status === -1 ? "已拒绝" : "已退款"}
{item?.refunds_status === 4
? "已自动退款"
: item?.refunds_status === -1
? "已拒绝"
: "已退款"}
</span>
</div>
{item?.refunds_status === 3 && (

View File

@ -25,7 +25,7 @@ export default function SpaceMember() {
);
return (
<div>
<div className="p-4 fixed top-0 z-10 w-full">
<div className="p-4 fixed top-0 z-10 w-full bg-deepBg">
<div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full float-left absolute">
<FontAwesomeIcon
icon={faAngleLeft}

View File

@ -88,6 +88,7 @@ export default function JoinEntrance() {
}
>
<OwnIcon
className="h-auto w-80"
src={`/images/${
streamerState?.basic_status === 2 ||
streamerState?.basic_status === 4
@ -101,6 +102,7 @@ export default function JoinEntrance() {
onClick={() => guildState !== 0 && router.push("joinGuild")}
>
<OwnIcon
className="h-auto w-80"
src={`/images/${
guildState === 0 ? "guildJoined" : "guildJoin"
}.png`}

View File

@ -1,5 +1,5 @@
import React, { useMemo } from "react";
import { formatTimestamp } from "@/utils/tools";
import React from "react";
import { formatDate } from "@/utils/tools";
import { Toast } from "antd-mobile";
import { useRouter } from "next/navigation";
import OwnImage from "@/components/OwnImage";
@ -32,7 +32,9 @@ export default function NoticeItem({ leftIcon, hasLink, data }) {
>
<div className="mr-2 bg-white rounded-lg w-[50px] h-[50px]">
<OwnImage
className="rounded-lg"
outClassName="w-full h-full rounded-lg"
className="w-full h-full"
rounded="rounded-lg"
height="100%"
fit="cover"
src={data.thumbnail?.images[0].urls[0]}
@ -90,7 +92,7 @@ export default function NoticeItem({ leftIcon, hasLink, data }) {
{/* 时间 */}
<div>
<span className="text-xs text-[#FFFFFF80]">
{formatTimestamp(data?.push_time || data?.ct)}
{formatDate(data?.push_time || data?.ct)}
</span>
</div>
</div>

View File

@ -1,7 +1,6 @@
"use client";
import React, { useState, useRef } from "react";
import NoticeItem from "../../components/NoticeItem";
import Empty from "../../../../components/Empty";
import { Toast, InfiniteScroll } from "antd-mobile";
import { useParams, useRouter, useSearchParams } from "next/navigation";
import requireAPI from "@/utils/requireAPI";
@ -104,7 +103,6 @@ export default function SystemNotice({ mid, total, ...props }) {
<NoticeItem
key={it.id}
data={it}
navigation={navigation}
hasLink={{ url: it.url, text: it.link_text }}
leftIcon={
<div>

View File

@ -7,7 +7,7 @@ const WebSocketComponent = ({ getData }) => {
let socket = null;
let interval = null;
function fn() {
function connect_socket() {
const base = baseRequest();
if (socket && socket.readyState === 1) return;
// WebSocket
@ -15,6 +15,14 @@ const WebSocketComponent = ({ getData }) => {
socket = new WebSocket(
`${process.env.NEXT_PUBLIC_WEBSOCKET_URL}/ws?b_mid=${base.b_mid}&b_dt=1&b_token=${base.b_token}&b-ch=h5`
);
// ping
// socket.on("ping", () => {
// socket.send("pong");
// });
}
connect_socket();
if (socket) {
// 使wss
//
socket.onopen = () => {
@ -53,24 +61,19 @@ const WebSocketComponent = ({ getData }) => {
//
socket.onclose = () => {
clearInterval(interval);
connect_socket();
// console.log("WebSocket disconnected.");
};
//
socket.onerror = (error) => {
// console.error("WebSocket error:", error);
};
// ping
// socket.on("ping", () => {
// socket.send("pong");
// });
}
fn();
// WebSocket
return () => {
// console.log("state", socket.readyState);
socket?.readyState === WebSocket.OPEN && socket?.close();
clearInterval(interval);
};
}, []); // effect
// return <Error statusCode={500} />;

View File

@ -54,6 +54,21 @@ export function formatTimestamp(timestamp) {
)}`;
}
export function formatDate(timestamp) {
const nowTime = new Date();
const date = new Date(timestamp * 1000);
const year = date.getFullYear();
const month = date.getMonth() + 1; // 月份从0开始,所以需要加1
const day = date.getDate();
const hours = date.getHours();
const minutes = date.getMinutes();
if (nowTime.getTime() - 24 * 60 * 60 * 1000 > date.getTime()) {
return `${month}/${day}`;
} else {
return `${hours}:${minutes > 9 ? minutes : "0" + minutes}`;
}
}
// 防抖函数
export function debounce(fn, delay) {
let timer = null;