"use client"; import React, { useEffect, useRef, useState } from "react"; import { Image, Divider, Toast } from "antd-mobile"; import { useRouter } from "next/navigation"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleLeft, faAngleRight, faWallet, faPrint, faDollar, } from "@fortawesome/free-solid-svg-icons"; import baseRequest from "@/utils/baseRequest"; import { get, save } from "@/utils/storeInfo"; import require from "@/utils/require"; export default function Wallet() { const tokenCache = get("token"); const temToken = encodeURIComponent(tokenCache); const mobilePhone = get("mobile_phone"); const base = baseRequest(); const router = useRouter(); const [data, setData] = useState(""); // 获取屏幕高度 // const scrollHeight = 600; useEffect(() => { getData() }, []); const getData = async () => { try { //获取账号基本信息 const data = await require("POST", "/api/account/list_by_mid", null, true); if (data.ret === -1) { Toast.show({ icon: "fail", content: data.msg, position: "top", }); return; } save("account", data.data.account); setData(data.data.account); } catch (error) { console.error(error); } }; return (
我的钱包
{data?.gold_num || 0}
金币
{data?.diamond_num || 0}
钻石