import React, { Component , Suspense } from 'react'; import ReactDOM from 'react-dom'; import './App.css'; import { Menu, Button } from 'antd'; import { $Axios } from './common/publish'; import { SettingOutlined, DollarCircleOutlined, } from '@ant-design/icons'; import * as Icons from "@ant-design/icons"; import { MenuUnfoldOutlined, MenuFoldOutlined, PieChartOutlined, } from '@ant-design/icons'; export default class App extends React.Component { constructor(props) { super(props) this.state = { isLogin: true, current: 'one', arr1 : [ { txt : '商户入网' , icon : 'GlobalOutlined' , assembly:'Layout' }, { txt : '商户入网列表' , icon : 'SlidersOutlined', assembly:'center-tab'} ], arr2 : [ { txt : '订单查询' , icon : '', assembly:'Finance-orderQuery'},//ok { txt : '退款查询' , icon : '', assembly:'Refund-inquiry'}, //ok { txt : '账户概览' , icon : '', assembly:'Account-overview'}, //ok { txt : '发起提现' , icon : '', assembly:'Cash-initiated'}, //ok { txt : '提现记录' , icon : '', assembly:'Withdrawal-record'}, //ok { txt : '分账收益记录' , icon : '', assembly:'Income-record'}, //ok // { txt : 'demo' , icon : '', assembly:'homePage'}, ], assembly : 'Layout', defaultSelectedKeys : 'Layout', defaultSelectedKeys1 : 'Finance-orderQuery', assembly_cw : 'Finance-orderQuery', user_txt : { userName : 'xxx', //名字 userJur : 'Y1', //权限 userInternet : null, // 用户权限为Y3时 才会出现是否入网字段 } } } componentDidMount() { this.initJurisdiction() } initJurisdiction(){//初始化用户权限 console.log('----------初始化用户权限---------'); console.log(process.env.NODE_ENV == 'development' ? '----------开发测试环境----------' : '----------线上生产环境----------') this.autoLogin() //登录查询用户信息 let Jur = ['Y1','Y2','Y3'] //Y1为云悦平台权限最高权限 //Y2为商城权限二级权限 // Y3为商户权限属于个人权限 let obj = { appName : 'com.smrongshengtianxia', merchantId : '896582034', id : 2, pfAppName : 'com.chuangyetong' //包名 } localStorage.setItem('userData',JSON.stringify(obj)) } handleClick(e){ this.setState({ current : e.key, }); this.initassembly() } toggleCollapsed(e){ this.setState({ collapsed: !this.state.collapsed, }); } toggleNavs(e){ let current = this.state.current; if(current == 'one'){ this.setState({ assembly: e.key, }); }else{ this.setState({ assembly_cw : e.key }); } } initassembly(){ let current = this.state.current; let Assembly = null; if(current == 'one'){ Assembly = React.lazy(() => import(`./component/${this.state.assembly}/${this.state.assembly}.jsx`)); }else{ Assembly = React.lazy(() => import(`./component/${this.state.assembly_cw}/${this.state.assembly_cw}.jsx`)); } return } initIcon(item){ let Icon = item.icon; return React.createElement(Icons[Icon]) } autoLogin = () => { let url = '/payment/merchant.query.groovy' let param = { appName : '吕卓', action : "queryInfo" } $Axios('post',url,param,(res) => { // console.log(res) }) } render() { const { current, arr1, arr2 , user_txt } = this.state; const { SubMenu } = Menu; return ( {/* {this.state.isLogin ? } */}
商户入网信息管理平台
}> 高级设置 }> 财务管理
用户名 : {user_txt.userName}
修改密码 退出
{current === 'one' && {current === 'one' && (arr1.map((item,index) =>( {item.txt} )))} } {current === 'tow' && {current === 'tow' && (arr2.map((item,index) =>( }> {item.txt} )))} }
{ this.initassembly() }
) } } ReactDOM.render( , document.getElementById('root') );