import * as React from "react"; import { Typography, message } from "antd"; import ContentView from "@/layout/ContentView"; import { AccountDetail } from "@/api/service/AccountService"; import { defaultAccountDetail } from "../index" import { getDictInfoByCode } from "@/components/CustComponents/CitySelector/utils"; import { HTTP_STATUS, AccountRoleText } from "@/shared/common/constants"; import MainLayout from "@/layout"; import Api from "@/api"; import "../css/info.scss"; // 账户信息 type P = {}; type S = { entity: AccountDetail; agentDistrict: string; }; const { Title, Paragraph, Text } = Typography; class AccountInfo extends React.Component
{
state = {
entity: defaultAccountDetail,
agentDistrict: ""
};
componentDidMount() {
this.getAccountDetail();
}
getAccountDetail = async () => {
const res = await Api.account.detail();
console.log({ res });
if (HTTP_STATUS.SUCCESSS === res.code) {
this.setState({
entity: res.data || null
});
const agentDistrict = res.data.agentDistrict || null;
if (agentDistrict) {
const info = getDictInfoByCode(agentDistrict);
if (info) {
this.setState({
agentDistrict: info.name || ""
});
}
}
} else {
message.error(res.message);
}
};
render() {
const { entity, agentDistrict } = this.state;
return (
我的信息
公司信息
入驻业务
联系人信息