content: import React from 'react';
  import { Field, reduxForm } from 'redux-form';
  import Writings from '../containers/writings';
  
  import Alert from 'react-s-alert';
  
  class Form extends React.Component {
    render() {
      const src = this.props.initialValues ? this.props.initialValues.avatar : "http://placehold.it/280x350";
      return (
        <form onSubmit={this.props.handleSubmit} className="pure-form pure-form-aligned">
          <div className="ui grid">
            <div className="eight wide column">
              <fieldset>
                { this.props.onUpload ?
                  <div className="pure-control-group">
                    <label >专家照片 *</label>
                    <input type="file"  onChange={this.props.onUpload}/>
                  </div>
                    :
                    ''
                }
                <div className="pure-control-group">
                  <label >排序 *</label>
                  <Field name="order" component="input" type="text"/>
                </div>
                <div className="pure-control-group">
                  <label >专家头衔 *</label>
                  <Field name="title" component="input" type="text"/>
                </div>
                <div className="pure-control-group">
                  <label >专家姓名 *</label>
                  <Field name="name" component="input" type="text"/>
                </div>
                <div className="pure-control-group">
                  <label >联系方式 *</label>
                  <Field name="phone" component="input" type="text"/>
                </div>
                <div className="pure-control-group">
                  <label >专业领域 *</label>
                  <Field name="specialty" component="input" type="text"/>
                </div>
                <div className="pure-control-group">
                  <label >专家单位 *</label>
                  <Field name="unit" component="input" type="text"/>
                </div>
                <div className="pure-control-group">
                  <label >研究方向 *</label>
                  <Field name="research" component="textarea" rows= "3" cols="40" type="text"/>
                </div>
                <div className="pure-control-group">
                  <label >简介 *</label>
                  <Field name="description" component="textarea" rows= "10" cols="40" type="text"/>
                </div>
  
                <div className="pure-control-group" style={{marginTop: '10px'}}>
                  <label >专家论文 *</label>
                  <input type="file"  onChange={this.props.uploadFile}/>
                  <Field name="writings" component="input" type="hidden"/>
                </div>
              </fieldset>
              <div id="files" className="pure-controls" style={{marginTop: '-10px'}}>
                <Writings />
              </div>
              <div className="pure-controls">
                <button type="submit" className="pure-button pure-button-primary">提交</button>
              </div>
            </div>
            <div className="eight wide column">
              {this.props.onUpload ?
                <img id="cover" style={{width:280, height:350}}  src={src}/>
                :
                ''
              }
            </div>
          </div>
        </form>
      );
    }
  }
  
  export default reduxForm({ form: 'expert' })(Form);
  