|
|
@@ -0,0 +1,220 @@
|
|
|
+import React, {Component} from 'react';
|
|
|
+import {FormattedMessage} from 'react-intl';
|
|
|
+import {Layout, Button, Spin, Col, Row, Tabs} from 'antd';
|
|
|
+
|
|
|
+import {withRouter} from "react-router-dom";
|
|
|
+
|
|
|
+import './developVersion/index.css';
|
|
|
+import {request} from 'graphql-request'
|
|
|
+import {graphqlUrl} from "../config";
|
|
|
+import {SHOW_ALL_CASE} from "../gql";
|
|
|
+import './index.css';
|
|
|
+
|
|
|
+const {Header, Footer, Content} = Layout;
|
|
|
+const TabPane = Tabs.TabPane;
|
|
|
+
|
|
|
+class App extends Component {
|
|
|
+ constructor(props) {
|
|
|
+ super(props);
|
|
|
+ this.state = {
|
|
|
+ examplesFirst: [],
|
|
|
+ examplesSecond: [],
|
|
|
+ examplesThird: []
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ componentWillMount() {
|
|
|
+ this._isMounted = true;
|
|
|
+
|
|
|
+ request(graphqlUrl, SHOW_ALL_CASE, {}).then(data => {
|
|
|
+ let cases = data.case_by_props;
|
|
|
+ let examplesFirst = cases.filter(cases => cases.title.includes('预约'));
|
|
|
+ let examplesSecond = cases.filter(cases => cases.title.includes('服装'));
|
|
|
+ let examplesThird = cases.filter(cases => cases.title.includes('小小杂志'));
|
|
|
+ if (this._isMounted) {
|
|
|
+ this.setState({
|
|
|
+ examplesFirst,
|
|
|
+ examplesSecond,
|
|
|
+ examplesThird
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ componentWillUnmount() {
|
|
|
+ this._isMounted = false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ render() {
|
|
|
+ let {examplesFirst, examplesSecond, examplesThird} = this.state;
|
|
|
+ const tabStyle = {
|
|
|
+ paddingBottom: '50px',
|
|
|
+ height: '550px',
|
|
|
+ display: 'inline-block',
|
|
|
+ };
|
|
|
+
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ <Layout className="layout-home" style={{minWidth: 1600}}>
|
|
|
+ <Header>
|
|
|
+ <div className="logo-wrapper">
|
|
|
+ <div className='logo'/>
|
|
|
+ </div>
|
|
|
+ </Header>
|
|
|
+ <Content>
|
|
|
+ <div className='intro-wrapper'>
|
|
|
+ <Row>
|
|
|
+ <Col span={8} offset={12}>
|
|
|
+ <div className="intro" style={{padding: '80px 60px 40px 60px'}}>
|
|
|
+ <h2>无年费 数据完全私有</h2>
|
|
|
+ <h3>即刻拥有自己的微信公众号、小程序</h3>
|
|
|
+ </div>
|
|
|
+ <div className="home-btn-group">
|
|
|
+ <Button size='large'
|
|
|
+ className='home-btn'
|
|
|
+ style={{marginLeft: '10px'}}
|
|
|
+ onClick={() => {
|
|
|
+ this.props.history.push({
|
|
|
+ pathname: `/developer`
|
|
|
+ })
|
|
|
+ }}>开发设计
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ <div className="intro-below" style={{padding: '0 60px'}}>
|
|
|
+ <h4>或致电:177 1810 6480</h4>
|
|
|
+ </div>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <div className={'cases-show-wrapper'}>
|
|
|
+ <div className={'cases-show-title'}>行业模板案例</div>
|
|
|
+ <div className={'case-show-tabs'}>
|
|
|
+ <Tabs tabPosition='left' size='large' tabBarStyle={tabStyle} tabBarGutter={100}>
|
|
|
+ <TabPane tab="预约" key="1">
|
|
|
+ <div style={{marginLeft: 100}}>
|
|
|
+ {
|
|
|
+ examplesFirst.length === 0 ?
|
|
|
+ <Spin/> :
|
|
|
+ <CasesShow
|
|
|
+ examples={examplesFirst}
|
|
|
+ />
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ </TabPane>
|
|
|
+ <TabPane tab="电商" key="2">
|
|
|
+ <div style={{marginLeft: 100}}>
|
|
|
+ {
|
|
|
+ examplesSecond.length === 0 ?
|
|
|
+ <Spin/> :
|
|
|
+ <CasesShow
|
|
|
+ examples={examplesSecond}
|
|
|
+ />
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ </TabPane>
|
|
|
+ <TabPane tab="杂志" key="3">
|
|
|
+ <div style={{marginLeft: 100}}>
|
|
|
+ {
|
|
|
+ examplesThird.length === 0 ?
|
|
|
+ <Spin/> :
|
|
|
+ <CasesShow
|
|
|
+ examples={examplesThird}
|
|
|
+ />
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ </TabPane>
|
|
|
+ </Tabs>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ </Content>
|
|
|
+ <Footer style={{textAlign: 'center'}}>
|
|
|
+ 版权所有 © 2019 栋天科技
|
|
|
+ {/*All right ©2019 Created by Ioobot*/}
|
|
|
+ </Footer>
|
|
|
+ </Layout>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export default withRouter(App);
|
|
|
+
|
|
|
+
|
|
|
+class CasesShow extends Component {
|
|
|
+ constructor(props) {
|
|
|
+ super(props);
|
|
|
+ console.log(props);
|
|
|
+ this.state = {
|
|
|
+ showCaseID: props.examples[0].id,
|
|
|
+ index: 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ render() {
|
|
|
+ let {examples} = this.props;
|
|
|
+ let {showCaseID, index} = this.state;
|
|
|
+ let thisCase = examples[index];
|
|
|
+ return (
|
|
|
+ <Row>
|
|
|
+ <Col span={16}>
|
|
|
+ <Row>
|
|
|
+ <div>
|
|
|
+ <div className={'case-detail-title'}>{thisCase.title}</div>
|
|
|
+ <div
|
|
|
+ className={'case-detail-description'}>{thisCase.detailDescription ? thisCase.detailDescription : '暂无简介'}</div>
|
|
|
+ <div className='cover-div'>
|
|
|
+ <img
|
|
|
+ className='cover-img'
|
|
|
+ src={thisCase.img}
|
|
|
+ alt={thisCase.title + '' + thisCase.description}
|
|
|
+ />
|
|
|
+ <div style={{marginTop: 5}}>—— 打开微信扫码体验 ——</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </Row>
|
|
|
+ <Row>
|
|
|
+ {
|
|
|
+ examples.map((item, index) => (
|
|
|
+ <div
|
|
|
+ className={showCaseID === item.id ? 'logo-cover-div logo-cover-div-on' : 'logo-cover-div'}
|
|
|
+ onMouseEnter={() => {
|
|
|
+ this.setState({
|
|
|
+ showCaseID: item.id,
|
|
|
+ index
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ key={index}
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ className='logo-cover-img'
|
|
|
+ src={item.img}
|
|
|
+ alt={item.title + '' + item.description}
|
|
|
+ />
|
|
|
+ <div>{item.description}</div>
|
|
|
+ </div>
|
|
|
+ ))
|
|
|
+ }
|
|
|
+ </Row>
|
|
|
+ </Col>
|
|
|
+ <Col span={8}>
|
|
|
+ <div className={'detail-images'}>
|
|
|
+ <img
|
|
|
+ key={thisCase.detailImages[0]}
|
|
|
+ src={thisCase.detailImages[0]}
|
|
|
+ alt=""
|
|
|
+ height="500"/>
|
|
|
+ </div>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ )
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|