"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 (
{ router.push("/my"); }} />

我的钱包

{/* 内容 */}

{data?.gold_num || 0}

金币

{data?.diamond_num || 0}

钻石

// navigation.navigate("WebWithHeader", { // title: "充值中心", // uri: process.env.EXPO_PUBLIC_WEB_URL + "/pay", // }) { // console.log("base,base", base); router.push( `/webView/${encodeURIComponent( `/pay?base=${encodeURIComponent(JSON.stringify(base))}` )}` ); } } className="flex justify-between items-center py-4 w-full" >
充值
// navigation.navigate("WebWithHeader", { // title: "收支明细", // uri: process.env.EXPO_PUBLIC_WEB_URL + "/bill/recharge", // }) // } onClick={() => { router.push("/bill/recharge"); }} className="flex justify-between items-center py-4" >
收支明细
window && window.open( `${process.env.NEXT_PUBLIC_WEB_URL}/withdrawal?mid=${data?.mid}&mobile_phone=${mobilePhone}&token=${temToken}` ) } className="flex justify-between items-center py-4" >
提现
); }