"use client"; import React, { useEffect, 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 requireAPI from "@/utils/requireAPI"; 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 requireAPI( "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}
钻石