| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- import React, {Component} from 'react';
- import {Layout, Menu} from 'antd';
- import WxConfig from "./wxConfig/WxConfig";
- import WxDeploy from "../common/deploy/Deploy";
- import WxResult from './wxResult/WxResult';
- import {FormattedMessage} from 'react-intl';
- 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.history.location.state ? this.props.history.location.state.configID : "ecommerce_wxConfigID";
- let appName = this.props.history.location.state ? this.props.history.location.state.appName : "ecommerce";
- 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-result"><FormattedMessage id="result"/></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 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-result':
- return <WxResult/>;
- default:
- return <WxConfig/>
- }
- })()}
- </Content>
- </Layout>
- </div>
- )
- }
- }
- export default WxTrialCase;
|