|
@@ -5,6 +5,7 @@ import Box from "@/components/Box";
|
|
|
import { WheelClient } from "@/components/Box/WheelModal";
|
|
|
import { Link } from "@/i18n/routing";
|
|
|
import { useUserInfoStore } from "@/stores/useUserInfoStore";
|
|
|
+import { server } from "@/utils/client";
|
|
|
import { copyText, timeFormat } from "@/utils/methods";
|
|
|
import { useCountDown } from "ahooks";
|
|
|
import { Popup, Toast } from "antd-mobile";
|
|
@@ -17,7 +18,6 @@ import styles from "./style.module.scss";
|
|
|
interface Props {
|
|
|
// wheel: WheelsType;
|
|
|
allHistory: any[];
|
|
|
- selfHistory: any[];
|
|
|
phones: any[];
|
|
|
}
|
|
|
interface ContextType extends WheelsType, Props {
|
|
@@ -116,9 +116,20 @@ const LeftListClient = () => {
|
|
|
</>
|
|
|
);
|
|
|
};
|
|
|
-
|
|
|
+const getSelfHistoryApi = () => {
|
|
|
+ return server.request<any[]>({
|
|
|
+ url: "/v1/api/user/turntable/self_receive",
|
|
|
+ method: "POST",
|
|
|
+ });
|
|
|
+};
|
|
|
const RightListClient = () => {
|
|
|
- const wheel = useContext(WheelContext);
|
|
|
+ const [selfHistory, setSelfHistory] = useState<any[]>([]);
|
|
|
+
|
|
|
+ useEffect(() => {
|
|
|
+ getSelfHistoryApi().then((res) => {
|
|
|
+ setSelfHistory(res.data);
|
|
|
+ });
|
|
|
+ }, []);
|
|
|
return (
|
|
|
<div className={"h-[100%] overflow-scroll p-[10px]"}>
|
|
|
<div
|
|
@@ -127,42 +138,39 @@ const RightListClient = () => {
|
|
|
" text-[#8795b1]"
|
|
|
}
|
|
|
>
|
|
|
- {wheel.selfHistory &&
|
|
|
- wheel.selfHistory.map((n, index) => {
|
|
|
- return (
|
|
|
- <Fragment key={index}>
|
|
|
- <div className={"flex"}>
|
|
|
- <span
|
|
|
- className={"mr-[0.0694rem] text-[0.12rem] text-[#6ddf39]"}
|
|
|
- >
|
|
|
- +100.00
|
|
|
- </span>
|
|
|
- <div
|
|
|
- className={
|
|
|
- "h-[0.16rem] w-[0.16rem] rounded-[50%] bg-[#6ddf39] text-center" +
|
|
|
- " text-[0.07rem] leading-[0.16rem] text-[#fff]"
|
|
|
- }
|
|
|
- >
|
|
|
- R$
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div className={"flex flex-1"}>
|
|
|
- {" "}
|
|
|
- {timeFormat(Date.now(), "br", undefined, true)}
|
|
|
- </div>
|
|
|
- <div className={"flex justify-end text-[#f0ae18]"}>
|
|
|
- <Image
|
|
|
- className={"mr-[0.0694rem] object-contain"}
|
|
|
- src={"/wheels/group.png"}
|
|
|
- alt={"group"}
|
|
|
- width={20}
|
|
|
- height={8}
|
|
|
- />
|
|
|
- <span>+12</span>
|
|
|
+ {selfHistory.map((item, index) => {
|
|
|
+ return (
|
|
|
+ <Fragment key={index}>
|
|
|
+ <div className={"flex"}>
|
|
|
+ <span className={"mr-[0.0694rem] text-[0.12rem] text-[#6ddf39]"}>
|
|
|
+ +{item.lose_amount}
|
|
|
+ </span>
|
|
|
+ <div
|
|
|
+ className={
|
|
|
+ "h-[0.16rem] w-[0.16rem] rounded-[50%] bg-[#6ddf39] text-center" +
|
|
|
+ " text-[0.07rem] leading-[0.16rem] text-[#fff]"
|
|
|
+ }
|
|
|
+ >
|
|
|
+ R$
|
|
|
</div>
|
|
|
- </Fragment>
|
|
|
- );
|
|
|
- })}
|
|
|
+ </div>
|
|
|
+ <div className={"flex flex-1"}>
|
|
|
+ {" "}
|
|
|
+ {timeFormat(item.receive_time, "br", undefined)}
|
|
|
+ </div>
|
|
|
+ <div className={"flex items-center justify-end text-[#f0ae18]"}>
|
|
|
+ <Image
|
|
|
+ className={"mr-[0.0694rem] object-contain"}
|
|
|
+ src={"/wheels/group.png"}
|
|
|
+ alt={"group"}
|
|
|
+ width={20}
|
|
|
+ height={8}
|
|
|
+ />
|
|
|
+ <span>+{item.count_person}</span>
|
|
|
+ </div>
|
|
|
+ </Fragment>
|
|
|
+ );
|
|
|
+ })}
|
|
|
</div>
|
|
|
</div>
|
|
|
);
|
|
@@ -457,7 +465,7 @@ const ShareClient = () => {
|
|
|
Toast.show({ icon: "success", content: t("SummaryPage.copySuc"), maskClickable: false });
|
|
|
};
|
|
|
const handler = () => {
|
|
|
- const current = phones[currentPhoneIndex];
|
|
|
+ const current = wheel.phones?.[currentPhoneIndex];
|
|
|
window.open(`https://wa.me/${current}`);
|
|
|
setCurrentPhoneIndex((value) => (value += 1));
|
|
|
};
|
|
@@ -550,7 +558,7 @@ const ShareClient = () => {
|
|
|
|
|
|
<div className={"mt-[0.0694rem] bg-[#000] p-[10px]"}>
|
|
|
<div className={"grid grid-cols-3 gap-[5px] text-[0.0833rem]"}>
|
|
|
- {phones.map((phone, index) => {
|
|
|
+ {wheel.phones?.map((phone, index) => {
|
|
|
return (
|
|
|
<span
|
|
|
style={{
|
|
@@ -588,7 +596,7 @@ const ShareClient = () => {
|
|
|
/>
|
|
|
</div>
|
|
|
<Link
|
|
|
- href={`sms:${phones.join(";")}?body=message_body`}
|
|
|
+ href={`sms:${wheel.phones?.join(";")}?body=message_body`}
|
|
|
className={
|
|
|
"flex items-center rounded-[10px] bg-[#35b2fe]" +
|
|
|
" p-[0.0694rem] text-[#fff]"
|
|
@@ -629,7 +637,6 @@ const CashWheelClient: FC<Props> = (props) => {
|
|
|
const [values, setValues] = useState<Partial<ContextType>>({
|
|
|
num: 100,
|
|
|
allHistory: props.allHistory || [],
|
|
|
- selfHistory: props.selfHistory || [],
|
|
|
phones: props.phones || [],
|
|
|
handler: getWheelData,
|
|
|
});
|