| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- import React, {Component} from 'react';
- import {Layout, Menu} from 'antd';
- import {FormattedMessage} from 'react-intl';
- import WxConfig from "./wxConfig/WxConfig";
- import WxDeploy from "../common/deploy/Deploy";
- import Manage from '../common/manage/Manage';
- const {Content} = Layout;
- class WxTrialCase extends Component {
- constructor() {
- super();
- this.state = {
- menuLevel3: "wechat-config",
- userID: 'ioobot'
- }
- }
- switchMenu = (menuName, e) => {
- this.setState({
- [menuName]: e.key,
- });
- };
- render() {
- let configID = this.props.location.state ? this.props.location.state.configID : "ecommerce_wxConfigID";
- let appName = this.props.location.state ? this.props.location.state.appName : "ecommerce";
- let projectID = this.props.location.state ? this.props.location.state.projectID : "";
- return (
- <div>
- <Menu
- mode="horizontal"
- defaultSelectedKeys={['wechat-config']}
- style={{
- padding: '0 24px',
- position: 'fixed',
- width: '100%',
- zIndex: '1',
- lineHeight: '50px',
- fontWeight: 600
- }}
- onClick={(e) => this.switchMenu('menuLevel3', e)}
- selectedKeys={[this.state.menuLevel3]}
- >
- <Menu.Item key="wechat-config"><FormattedMessage id="config"/></Menu.Item>
- <Menu.Item key="wechat-deploy"><FormattedMessage id="deploy"/></Menu.Item>
- <Menu.Item key="wechat-manage"><FormattedMessage id="manage"/></Menu.Item>
- </Menu>
- <Layout style={{padding: '24px', zIndex: '0'}}>
- <Content style={{padding: '24px', minHeight: 280, background: '#fff', marginTop: '48px'}}>
- {(() => {
- switch (this.state.menuLevel3) {
- case 'wechat-config':
- return <WxConfig projectID={projectID} defaultAppName={'ecommerce'} defaultConfigID={'ecommerce_wxConfigID'} trialcase={true} history={this.props.history} location={this.props.location}/>;
- case 'wechat-deploy':
- return <WxDeploy trialcase={true} userID={this.state.userID} configID={configID}/>;
- case 'wechat-manage':
- return <Manage trialcase={true} userID={this.state.userID} configID={configID} switchMenu={this.switchMenu}/>;
- default:
- return <WxConfig/>
- }
- })()}
- </Content>
- </Layout>
- </div>
- )
- }
- }
- export default WxTrialCase;
|