content: import React from 'react';
  import { Modal, Alert } from 'antd';
  import OrderDetail from '../isdbooking/components/orderdetail';
  let QRCode = require('qrcode.react');
  
  class CtripAlert {
  	constructor(){
  	}
  
   	show(title='this is title', content='this is content'){
   		this.showModelLayer(title, content);
   	}
  
   	showWinXin(account='HH18721845451'){//微信咨询
   		this.showModelLayer('1对1专属服务',<WeiXin account={account} />);
   	}
  
   	showComplaint(){//申诉
   		this.showModelLayer('感谢使用',<Complaint />, 'success', '确定');
   	}
  
   	showQRcode(localURL){//生成二维码
   		this.show('邀请好友扫一扫分享给TA',<QRcode url={localURL}/>);
   	}
  
      showStoreLocation(storename='良华购物中心便捷点'){//地点
          this.show(storename, <StoreLocation />);
      }
  
      showOrderDetail(){
          this.show('费用明细', <OrderDetail />);
      }
  
      showCitySelect(){
          let citylist = [{city:'上海', checked:true}, {city:'深圳', checked:false},{city:'北京', checked:false}];
          this.showModelLayer('请选择用车城市', <CitySelect citylist={citylist}/>, 'info','确定');
      }
  
      showTelphone(){
          this.showModelLayer('确定拨打客服热线？','','confirm', '确定', '取消');
      }
  
   	showModelLayer = (title = 'title', content = 'content', type='info', okText='知道了', cancelText='取消', okCallBack, cancelCallBack) =>{
  		//type:info success error warning confirm
  		Modal[type]({
  			okText:okText,
  			cancelText:cancelText,
              title: title,
              content: content,
          	onOk() {
          		if(okCallBack)
          			okCallBack();
          	},
          	onCancel(){
          		if(cancelCallBack)
          			cancelCallBack();
          	}
          });
  	}
  
  }
  
  class QRcode extends React.Component{
      render(){
          let { url } = this.props;
          return (
                  <div className='qrcode'>
                      <QRCode  level='L' value={url}/>
                  </div>
          );
      }
  }
  
  class WeiXin extends React.Component{
      render(){
          let { account } = this.props;
          return (
              <div>
                  <p>长按微信号<span className='weixin'>{account}</span> 拷贝,微信中粘贴添加好友</p>
                  <p>服务时间：工作日 9:00-18:00</p>
              </div>
          );
      }
  }
  
  class Complaint extends React.Component{
      render(){
          return (
              <div>
                  <p>已收到您的申诉请求，稍后会有客服人员为您服务</p>
              </div>
          );
      }
  }
  
  class StoreLocation extends React.Component{
      render(){
          return (
              <div>
                  <p>门店电话：021-62338565</p>
                  <p>营业时间：08:00-21:00</p>
                  <p>地址：申滨路990号（申滨路宁虹路交叉口）</p>
              </div>
          );
      }
  }
  
  class CitySelect extends React.Component{
      render(){
          let {citylist} = this.props;
          return (
              <div className='cityselect'>
              {
                  citylist.map((item,index) =>{
                      let {city, checked} = item;
                      let icon = checked ? 'success' : 'info';
                      return <Alert message={city} type={icon} key={index} showIcon className='pointer'/>
                  })
              }
              </div>
          );
      }
  }
  
  export default new CtripAlert();