CourseList.50e182c5.chunk.js.map 41.6 KB
Newer Older
zhanghaozhe committed
1
{"version":3,"sources":["components/classify/courselist.js","../node_modules/antd-mobile/lib/_util/getDataAttr.js","../node_modules/antd-mobile/lib/_util/getLocale.js","../node_modules/antd-mobile/lib/search-bar/style/css.js","../node_modules/antd-mobile/lib/search-bar/index.js","../node_modules/antd-mobile/lib/search-bar/PropsType.js","../node_modules/antd-mobile/lib/search-bar/locale/zh_CN.js","common/HeaderSearch/index.js"],"names":["stopScroll","e","preventDefault","Classify","connect","_ref","user","props","_this2","Object","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_7__","this","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_9__","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_10__","call","getTabs","http","get","concat","API","home","then","res","_this","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_12__","data","code","common","length","arr2","basics","advanced","arr3","forEach","item","index","list","push","title","c_name","id","c_id","setState","arr","allClass","antd_mobile_lib_toast__WEBPACK_IMPORTED_MODULE_6___default","a","info","msg","catch","err","console","log","getList","state","isLoading","getParam","ontabclick","tab","history","activeTab","decodeURIComponent","pulldown","status","ispull","display","document","addEventListener","passive","removeEventListener","labelclick","toCourseDetail","_this2$props","dispatch","toClassify","replace","top","el","querySelector","offsetHeight","_this3","_this$props$user","isLogin","uid","bottom","react__WEBPACK_IMPORTED_MODULE_13___default","createElement","className","page","findIndex","_common_HeaderSearch_index__WEBPACK_IMPORTED_MODULE_16__","toHref","_common_Loading__WEBPACK_IMPORTED_MODULE_18__","onClick","bind","react_sticky__WEBPACK_IMPORTED_MODULE_20__","antd_mobile_lib_tabs__WEBPACK_IMPORTED_MODULE_3___default","tabs","animated","onChange","renderTabBar","_ref2","style","_Users_zhanghaozhe_server_mr_julyedu_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_4__","zIndex","DefaultTabBar","map","Info","course_id","course_title","desc","is_restricted","LimitFree","course","is_buy","price1","price0","bargain_num","groupon_num","is_aist","_common__WEBPACK_IMPORTED_MODULE_14__","key","img","image_name","toDetail","antd_mobile_lib_white_space__WEBPACK_IMPORTED_MODULE_1___default","ClassCourse","name","Component","LimitFreeStatus","_ref3","limit_free_status","_ref4","defineProperty","exports","value","keys","reduce","prev","substr","module","obj","_extends2","__webpack_require__","_extends3","__esModule","default","getComponentLocale","context","componentName","getDefaultLocale","locale","antLocale","defaultLocale","result","lang","getLocaleCode","localeCode","exist","_interopRequireDefault","_defineProperty3","_classCallCheck3","_createClass3","_possibleConstructorReturn3","_inherits3","_classnames5","React","_interopRequireWildcard","PropTypes","_rmcFeedback2","_getDataAttr2","_getLocale","_PropsType","newObj","prototype","hasOwnProperty","SearchBar","_React$Component","__proto__","getPrototypeOf","onSubmit","inputRef","blur","focus","target","onFocus","firstFocus","onBlur","cb","onBlurTimeout","blurFromOnClear","activeElement","window","requestAnimationFrame","setTimeout","body","scrollTop","onClear","doClear","arguments","undefined","onCancel","defaultValue","rightBtnRef","initBtn","getComputedStyle","rightBtnInitMarginleft","marginLeft","componentDidUpdate","syntheticPhRef","inputContainerRef","indexOf","prefixCls","syntheticPhContainerRef","realWidth","getBoundingClientRect","width","Math","ceil","showCancelButton","marginRight","offsetWidth","parseInt","nextProps","nextFrameId","cancelAnimationFrame","clearTimeout","_classnames3","_props","disabled","placeholder","maxLength","cancelText","_state","wrapCls","clearCls","cancelCls","ref","action","visibility","type","activeClassName","defaultProps","contextTypes","object","noop","HeaderBar","goShop","_this$props$isLogin","url","location","href","react__W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aAAA,CACA3F,UAAAgB,EAAA4E,QAEAxG,EAAAN,UAAA,0CC5WA,SAAA+G,KAJA5O,OAAA4H,eAAAC,EAAA,cACAC,OAAA,IAKAD,EAAA4G,aAAA,CACA9B,UAAA,YACAkB,YAAA,GACAlD,SAAAiE,EACAlJ,SAAAkJ,EACA5D,QAAA4D,EACA1D,OAAA0D,EACAhD,QAAAgD,EACA1B,kBAAA,EACAU,UAAA,qCCfA5N,OAAA4H,eAAAC,EAAA,cACAC,OAAA,IAEAD,EAAA,SACAkG,WAAA,gBAEA5F,EAAAN,UAAA,+HCJMgH,qNASFC,OAAS,WAAM,IAAAC,EACiBjO,EAAKhB,MAAzB2E,QACJuK,OAFO,IAAAD,KAEQ,YAAc,YACjCxD,OAAO0D,SAAS/K,QAAQ8K,8EAVxBzD,OAAO0D,SAASC,KAAO,2CAIvB3D,OAAO0D,SAASC,KAAO,qCAUvB,OACIC,EAAA9M,EAAAwC,cAAA,OAAKC,UAAU,gBACXqK,EAAA9M,EAAAwC,cAAA,OAAKC,UAAU,eAEN5E,KAAKJ,MAAMoF,QACZiK,EAAA9M,EAAAwC,cAAA,KACIC,UAAW,mCACXM,QAASlF,KAAKkP,OAAO/J,KAAKnF,QAI9BA,KAAKJ,MAAMoF,QACXiK,EAAA9M,EAAAwC,cAAA,KACIC,UAAW,mCACXM,QAASlF,KAAKJ,MAAMoF,SAG5BiK,EAAA9M,EAAAwC,cAAAwK,EAAAhN,EAAA,CACIwL,YAAY,2BACZE,WAAY,IACZ/C,QAAS9K,KAAKoP,SAASjK,KAAKnF,MAC5BgN,kBAAkB,IAEtBiC,EAAA9M,EAAAwC,cAAA,KACIC,UAAW,+CACXM,QAASlF,KAAK4O,kBAzCdvH,cAkDTsH","file":"mrstatic/js/CourseList.50e182c5.chunk.js","sourcesContent":["import React, { Component } from 'react'\nimport { VList } from '../../common'\nimport { Tabs, WhiteSpace, Toast } from 'antd-mobile'\nimport './courselist.scss'\nimport HeaderSearch from '../../common/HeaderSearch/index'\nimport { http, getParam } from \"@/utils\"\nimport Loading from '@/common/Loading'\nimport { connect } from 'react-redux';\nimport { StickyContainer, Sticky } from \"react-sticky\";\n\n\nfunction stopScroll(e) {\n  e.preventDefault()\n}\n\n@connect(({user}) => ({\n  user\n}))\nclass Classify extends Component {\n  constructor(props) {\n    super(props)\n    this.state = {\n      ispull: false,\n      display: 'none',\n      arr: [{basics: []}, {advanced: []}],\n      allClass: [],\n      data: [],\n      activeTab: decodeURIComponent(getParam('name')),\n      isLoading: true,\n      top: 44\n    }\n\n  }\n\n  componentDidMount() {\n    this.getTabs()\n    this.getList()\n\n    const el = document.querySelector('.search-nav');\n    this.setState({\n      top: el.offsetHeight\n    });\n  }\n\n  componentWillUnmount() {\n    document.removeEventListener('touchmove', stopScroll)\n  }\n\n\n  // 获取tabs接口\n  getTabs = () => {\n    let data = 0\n    http.get(`${API.home}/m/course/classify/${data}`)\n      .then((res) => {\n        const _this = this\n        if (res.data.code === 200) {\n          if (res.data.data.common.length > 0) {\n            let arr = ['basics', 'advanced']\n            let arr2 = [{basics: []}, {advanced: []}]\n            let arr3 = []\n            arr.forEach(function (item, index) {\n              arr2[item] = res.data.data.common[index]\n              res.data.data.common[index].list.forEach(function (item, index) {\n                arr3.push({'title': item.c_name, 'id': item.c_id})\n              })\n            })\n            _this.setState({\n              arr: arr2,\n              allClass: arr3\n            })\n          }\n        } else {\n          Toast.info(res.data.msg, 2)\n        }\n\n      })\n      .catch(err => {\n        console.log(err)\n      })\n  }\n\n  // 获取课程接口\n  getList = () => {\n    const _this = this\n    _this.setState((state, props) => ({\n      isLoading: true\n    }));\n    http.get(`${API.home}/m/course/list/${getParam('id')}`).then((res) => {\n      if (res.data.code === 200) {\n        _this.setState({\n          data: res.data.data,\n          isLoading: false\n        })\n      }\n    })\n  }\n\n\n  // 点击横向滚动tab查询\n  ontabclick = (tab) => {\n    this.props.history.push(`/courselist?id=${tab.id}&name=${tab.title}`)\n    this.getList()\n    this.setState({\n      activeTab: decodeURIComponent(getParam('name'))\n    });\n  }\n\n  // 上下展示\n  pulldown = () => {\n    this.setState(status => ({\n      ispull: !status.ispull,\n      display: status.ispull ? 'none' : 'block'\n    }), () => {\n      this.state.ispull ? document.addEventListener('touchmove', stopScroll, {\n        passive: false\n      }) : document.removeEventListener('touchmove', stopScroll)\n    });\n  }\n\n  // 弹窗里面tab点击查询\n  labelclick = (item) => {\n    this.props.history.push(`/courselist?id=${item.c_id}&name=${item.c_name}`)\n    this.getList()\n    this.setState(status => ({\n      ispull: !status.ispull,\n      display: status.ispull ? 'none' : 'block',\n      activeTab: decodeURIComponent(getParam('name'))\n    }))\n  }\n\n  toCourseDetail = (id) => {\n    const {dispatch, history} = this.props;\n    // dispatch(getCourses(id, () => {\n    history.push(`/detail?id=${id}`)\n    // }));\n  }\n\n  toClassify = () => {\n    this.props.history.replace('/classify');\n  }\n\n  render() {\n    const {user = {}} = this.props;\n    let isLogin = user.data && user.data.uid ? true : false;\n    const bottom = (\n      <i className={'iconfont iconiconfront-69 pull-down'}></i>\n    )\n    const top = (\n      <i className={'iconfont iconiconfront-71 pull-down'}></i>\n    )\n\n    let page = this.state.allClass.findIndex((item) => item.title === this.state.activeTab)\n    return (\n      <div className='class-child'>\n        <HeaderSearch\n          isLogin={isLogin}\n          toHref={this.toClassify}\n        />\n        <Loading isLoading={this.state.isLoading}>\n          <div className='class-content'>\n            {/* <WhiteSpace/> */}\n            <div onClick={this.pulldown.bind(this)}>\n              {this.state.ispull ? top : bottom}\n            </div>\n            <StickyContainer>\n              {/* <Tabs\n                                tabs={this.state.allClass}\n                                animated={false}\n                                page={page}\n                                onChange={(tab) => this.ontabclick(tab)}\n                                renderTabBar={props => <div className={'custom-render-bar'}>\n                                    <Tabs.DefaultTabBar {...props}/>\n                                </div>}\n                            > */}\n              <Tabs\n                tabs={this.state.allClass}\n                animated={false}\n                page={page}\n                onChange={(tab) => this.ontabclick(tab)}\n                renderTabBar={props => {\n                  return (\n                    <Sticky>\n                      {({style}) => {\n                        return (\n                          <div style={{...style, top: `${this.state.top}px`, zIndex: 1}}>\n                            <Tabs.DefaultTabBar {...props} />\n                          </div>\n                        )\n                      }}\n                    </Sticky>\n                  )\n                }}\n              >\n                <div className='tabs'>\n                  <ul>\n                    {this.state.data && this.state.data.length > 0 && this.state.data.map((item, index) => {\n                      const Info = (\n                        <div className=\"info\">\n                          <p className='title'\n                             onClick={() => this.toCourseDetail(item.course_id)}>\n                            {item.course_title}\n                          </p>\n                          <p className='contact text-overflow-2'>{item.desc}</p>\n                          <div className='des'>\n                            {\n                              item.is_restricted ?\n                                <LimitFree course={item}/>\n                                : item.is_buy\n                                ? <span className=\"isbuy\">已购买</span>\n                                : <p className=\"course-price\">\n                                  <span className=\"new\">¥{item.price1}</span>\n                                  <span className=\"old\">¥{item.price0}</span>\n                                </p>\n                            }\n                          </div>\n                        </div>\n                      )\n                      const status = (\n                        !item.is_buy &&\n                        <div>\n                          {item.bargain_num === 0 && item.groupon_num !== 0 &&\n                          <p className='course-status'>拼团减{item.groupon_num}元</p>\n                          }\n                          {item.bargain_num !== 0 && item.groupon_num === 0 &&\n                          <p className='course-status'>砍价减{item.bargain_num}元</p>\n                          }\n                          {\n                            item.is_aist && <span className='return_cash'></span>\n                          }\n                        </div>\n                      )\n                      return (\n                        <VList\n                          key={index}\n                          status={status}\n                          img={item.image_name}\n                          id={item.course_id}\n                          info={Info}\n                          toDetail={this.toCourseDetail}\n                        />\n                      )\n                    })}\n                  </ul>\n                </div>\n              </Tabs>\n\n            </StickyContainer>\n            <WhiteSpace/>\n          </div>\n          <div className='mbc-box' style={{display: this.state.display}}>\n            {\n              this.state.arr.basics &&\n              <div className=\"tabcontent\">\n                <ClassCourse activeTab={this.state.activeTab} data={this.state.arr.basics.list}\n                             title={this.state.arr.basics.name} labelclick={this.labelclick}/>\n                <ClassCourse activeTab={this.state.activeTab} data={this.state.arr.advanced.list}\n                             title={this.state.arr.advanced.name} labelclick={this.labelclick}/>\n              </div>\n            }\n          </div>\n        </Loading>\n      </div>\n    )\n  }\n\n}\n\nfunction ClassCourse(props) {\n  return (\n    <div className=\"class-course\">\n      <p className='course-items-title'>{props.title}</p>\n      <div className='items-box'>\n        {\n          props.data && props.data.length > 0 && props.data.map((item, index) => {\n            return (\n              <span className={props.activeTab === item.c_name ? 'active-label' : 'item-label'}\n                    key={index} onClick={e => props.labelclick(item)}>{item.c_name}</span>\n            )\n          })\n        }\n      </div>\n    </div>\n  )\n}\n\nfunction LimitFreeStatus({course}) {\n  /*\n  *  limit-free-status: 0-未领取 1-已领取 2-已过期\n  *\n  * */\n  switch (course.limit_free_status) {\n    case 0:\n      return <div className=\"limit-free\">\n        <span>限时免费</span>\n        <span>¥{course.price0}</span>\n      </div>\n    case 1:\n      return <div>已领取</div>\n    case 2:\n      return <p className=\"course-price\">\n        <span className=\"new\">¥{course.price1}</span>\n        <span className=\"old\">¥{course.price0}</span>\n      </p>\n  }\n}\n\nfunction LimitFree({course}) {\n  if (course.is_buy) {\n    if (course.limit_free_status === 1) {\n      return <div className={'isbuy'}>已领取</div>\n    } else {\n      return <div className={'isbuy'}>已购买</div>\n    }\n  } else {\n    return <LimitFreeStatus course={course}/>\n  }\n}\n\nexport default Classify;\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nexports['default'] = function (props) {\n  return Object.keys(props).reduce(function (prev, key) {\n    if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') {\n      prev[key] = props[key];\n    }\n\n    return prev;\n  }, {});\n};\n\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nexports.getComponentLocale = getComponentLocale;\nexports.getLocaleCode = getLocaleCode;\n\nfunction _interopRequireDefault(obj) {\n  return obj && obj.__esModule ? obj : {\n    'default': obj\n  };\n}\n\nfunction getComponentLocale(props, context, componentName, getDefaultLocale) {\n  var locale = {};\n\n  if (context && context.antLocale && context.antLocale[componentName]) {\n    locale = context.antLocale[componentName];\n  } else {\n    var defaultLocale = getDefaultLocale(); // TODO: make default lang of antd be English\n    // https://github.com/ant-design/ant-design/issues/6334\n\n    locale = defaultLocale['default'] || defaultLocale;\n  }\n\n  var result = (0, _extends3['default'])({}, locale);\n\n  if (props.locale) {\n    result = (0, _extends3['default'])({}, result, props.locale);\n\n    if (props.locale.lang) {\n      result.lang = (0, _extends3['default'])({}, locale.lang, props.locale.lang);\n    }\n  }\n\n  return result;\n}\n\nfunction getLocaleCode(context) {\n  var localeCode = context.antLocale && context.antLocale.locale; // Had use LocaleProvide but didn't set locale\n\n  if (context.antLocale && context.antLocale.exist && !localeCode) {\n    return 'zh-cn';\n  }\n\n  return localeCode;\n}","'use strict';\n\nrequire('../../style/css');\n\nrequire('./index.css');","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _classnames4 = require('classnames');\n\nvar _classnames5 = _interopRequireDefault(_classnames4);\n\nvar _react = require('react');\n\nvar React = _interopRequireWildcard(_react);\n\nvar _propTypes = require('prop-types');\n\nvar PropTypes = _interopRequireWildcard(_propTypes);\n\nvar _rmcFeedback = require('rmc-feedback');\n\nvar _rmcFeedback2 = _interopRequireDefault(_rmcFeedback);\n\nvar _getDataAttr = require('../_util/getDataAttr');\n\nvar _getDataAttr2 = _interopRequireDefault(_getDataAttr);\n\nvar _getLocale = require('../_util/getLocale');\n\nvar _PropsType = require('./PropsType');\n\nfunction _interopRequireWildcard(obj) {\n  if (obj && obj.__esModule) {\n    return obj;\n  } else {\n    var newObj = {};\n\n    if (obj != null) {\n      for (var key in obj) {\n        if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];\n      }\n    }\n\n    newObj['default'] = obj;\n    return newObj;\n  }\n}\n\nfunction _interopRequireDefault(obj) {\n  return obj && obj.__esModule ? obj : {\n    'default': obj\n  };\n}\n\nfunction onNextFrame(cb) {\n  if (window.requestAnimationFrame) {\n    return window.requestAnimationFrame(cb);\n  }\n\n  return window.setTimeout(cb, 1);\n}\n\nfunction clearNextFrameAction(nextFrameId) {\n  if (window.cancelAnimationFrame) {\n    window.cancelAnimationFrame(nextFrameId);\n  } else {\n    window.clearTimeout(nextFrameId);\n  }\n}\n\nvar SearchBar = function (_React$Component) {\n  (0, _inherits3['default'])(SearchBar, _React$Component);\n\n  function SearchBar(props) {\n    (0, _classCallCheck3['default'])(this, SearchBar);\n\n    var _this = (0, _possibleConstructorReturn3['default'])(this, (SearchBar.__proto__ || Object.getPrototypeOf(SearchBar)).call(this, props));\n\n    _this.onSubmit = function (e) {\n      e.preventDefault();\n\n      if (_this.props.onSubmit) {\n        _this.props.onSubmit(_this.state.value || '');\n      }\n\n      if (_this.inputRef) {\n        _this.inputRef.blur();\n      }\n    };\n\n    _this.onChange = function (e) {\n      if (!_this.state.focus) {\n        _this.setState({\n          focus: true\n        });\n      }\n\n      var value = e.target.value;\n\n      if (!('value' in _this.props)) {\n        _this.setState({\n          value: value\n        });\n      }\n\n      if (_this.props.onChange) {\n        _this.props.onChange(value);\n      }\n    };\n\n    _this.onFocus = function () {\n      _this.setState({\n        focus: true\n      });\n\n      _this.firstFocus = true;\n\n      if (_this.props.onFocus) {\n        _this.props.onFocus();\n      }\n    };\n\n    _this.onBlur = function () {\n      _this.onBlurTimeout = onNextFrame(function () {\n        if (!_this.blurFromOnClear) {\n          if (document.activeElement !== _this.inputRef) {\n            _this.setState({\n              focus: false\n            });\n          }\n        }\n\n        _this.blurFromOnClear = false;\n      });\n\n      if (_this.props.onBlur) {\n        // fix autoFocus item blur with flash\n        setTimeout(function () {\n          // fix ios12 wechat browser click failure after input\n          if (document.body) {\n            document.body.scrollTop = document.body.scrollTop;\n          }\n        }, 100);\n\n        _this.props.onBlur();\n      }\n    };\n\n    _this.onClear = function () {\n      _this.doClear();\n    };\n\n    _this.doClear = function () {\n      var blurFromOnClear = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n      _this.blurFromOnClear = blurFromOnClear;\n\n      if (!('value' in _this.props)) {\n        _this.setState({\n          value: ''\n        });\n      }\n\n      if (_this.props.onClear) {\n        _this.props.onClear('');\n      }\n\n      if (_this.props.onChange) {\n        _this.props.onChange('');\n      }\n\n      if (blurFromOnClear) {\n        _this.focus();\n      }\n    };\n\n    _this.onCancel = function () {\n      if (_this.props.onCancel) {\n        _this.props.onCancel(_this.state.value || '');\n      } else {\n        _this.doClear(false);\n      }\n    };\n\n    _this.focus = function () {\n      if (_this.inputRef) {\n        _this.inputRef.focus();\n      }\n    };\n\n    var value = void 0;\n\n    if ('value' in props) {\n      value = props.value || '';\n    } else if ('defaultValue' in props) {\n      value = props.defaultValue;\n    } else {\n      value = '';\n    }\n\n    _this.state = {\n      value: value,\n      focus: false\n    };\n    return _this;\n  }\n\n  (0, _createClass3['default'])(SearchBar, [{\n    key: 'componentDidMount',\n    value: function componentDidMount() {\n      if (this.rightBtnRef) {\n        var initBtn = window.getComputedStyle(this.rightBtnRef);\n        this.rightBtnInitMarginleft = initBtn.marginLeft;\n      }\n\n      this.componentDidUpdate();\n    }\n  }, {\n    key: 'componentDidUpdate',\n    value: function componentDidUpdate() {\n      if (this.syntheticPhRef) {\n        if (this.inputContainerRef && this.inputContainerRef.className.indexOf(this.props.prefixCls + '-start') > -1) {\n          // 检测是否包含名为 ${this.props.prefixCls}-start 样式,生成动画\n          // offsetWidth 某些时候是向上取整,某些时候是向下取整,不能用\n          if (this.syntheticPhContainerRef) {\n            var realWidth = this.syntheticPhContainerRef.getBoundingClientRect().width; // 包含小数\n\n            this.syntheticPhRef.style.width = Math.ceil(realWidth) + 'px';\n          }\n\n          if (!this.props.showCancelButton && this.rightBtnRef) {\n            this.rightBtnRef.style.marginRight = '0';\n          }\n        } else {\n          this.syntheticPhRef.style.width = '100%';\n\n          if (!this.props.showCancelButton && this.rightBtnRef) {\n            this.rightBtnRef.style.marginRight = '-' + (this.rightBtnRef.offsetWidth + (this.rightBtnInitMarginleft != null ? parseInt(this.rightBtnInitMarginleft, 10) : 0)) + 'px';\n          }\n        }\n      }\n    }\n  }, {\n    key: 'componentWillReceiveProps',\n    value: function componentWillReceiveProps(nextProps) {\n      if ('value' in nextProps && nextProps.value !== this.state.value) {\n        this.setState({\n          value: nextProps.value\n        });\n      }\n    }\n  }, {\n    key: 'componentWillUnmount',\n    value: function componentWillUnmount() {\n      if (this.onBlurTimeout) {\n        clearNextFrameAction(this.onBlurTimeout);\n        this.onBlurTimeout = null;\n      }\n    }\n  }, {\n    key: 'render',\n    value: function render() {\n      var _classnames3,\n          _this2 = this;\n\n      var _props = this.props,\n          prefixCls = _props.prefixCls,\n          showCancelButton = _props.showCancelButton,\n          disabled = _props.disabled,\n          placeholder = _props.placeholder,\n          className = _props.className,\n          style = _props.style,\n          maxLength = _props.maxLength; // tslint:disable-next-line:variable-name\n\n      var _locale = (0, _getLocale.getComponentLocale)(this.props, this.context, 'SearchBar', function () {\n        return require('./locale/zh_CN');\n      });\n\n      var cancelText = _locale.cancelText;\n      var _state = this.state,\n          value = _state.value,\n          focus = _state.focus;\n      var wrapCls = (0, _classnames5['default'])(prefixCls, className, (0, _defineProperty3['default'])({}, prefixCls + '-start', !!(focus || value && value.length > 0)));\n      var clearCls = (0, _classnames5['default'])(prefixCls + '-clear', (0, _defineProperty3['default'])({}, prefixCls + '-clear-show', !!(focus && value && value.length > 0)));\n      var cancelCls = (0, _classnames5['default'])(prefixCls + '-cancel', (_classnames3 = {}, (0, _defineProperty3['default'])(_classnames3, prefixCls + '-cancel-show', !!(showCancelButton || focus || value && value.length > 0)), (0, _defineProperty3['default'])(_classnames3, prefixCls + '-cancel-anim', this.firstFocus), _classnames3));\n      return React.createElement('form', {\n        onSubmit: this.onSubmit,\n        className: wrapCls,\n        style: style,\n        ref: function ref(el) {\n          return _this2.inputContainerRef = el;\n        },\n        action: '#'\n      }, React.createElement('div', {\n        className: prefixCls + '-input'\n      }, React.createElement('div', {\n        className: prefixCls + '-synthetic-ph',\n        ref: function ref(el) {\n          return _this2.syntheticPhRef = el;\n        }\n      }, React.createElement('span', {\n        className: prefixCls + '-synthetic-ph-container',\n        ref: function ref(el) {\n          return _this2.syntheticPhContainerRef = el;\n        }\n      }, React.createElement('i', {\n        className: prefixCls + '-synthetic-ph-icon'\n      }), React.createElement('span', {\n        className: prefixCls + '-synthetic-ph-placeholder' // tslint:disable-next-line:jsx-no-multiline-js\n        ,\n        style: {\n          visibility: placeholder && !value ? 'visible' : 'hidden'\n        }\n      }, placeholder))), React.createElement('input', (0, _extends3['default'])({\n        type: 'search',\n        className: prefixCls + '-value',\n        value: value,\n        disabled: disabled,\n        placeholder: placeholder,\n        onChange: this.onChange,\n        onFocus: this.onFocus,\n        onBlur: this.onBlur,\n        ref: function ref(el) {\n          return _this2.inputRef = el;\n        },\n        maxLength: maxLength\n      }, (0, _getDataAttr2['default'])(this.props))), React.createElement(_rmcFeedback2['default'], {\n        activeClassName: prefixCls + '-clear-active'\n      }, React.createElement('a', {\n        onClick: this.onClear,\n        className: clearCls\n      }))), React.createElement('div', {\n        className: cancelCls,\n        onClick: this.onCancel,\n        ref: function ref(el) {\n          return _this2.rightBtnRef = el;\n        }\n      }, this.props.cancelText || cancelText));\n    }\n  }]);\n  return SearchBar;\n}(React.Component);\n\nexports['default'] = SearchBar;\nSearchBar.defaultProps = _PropsType.defaultProps;\nSearchBar.contextTypes = {\n  antLocale: PropTypes.object\n};\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nfunction noop() {}\n\nvar defaultProps = exports.defaultProps = {\n  prefixCls: 'am-search',\n  placeholder: '',\n  onSubmit: noop,\n  onChange: noop,\n  onFocus: noop,\n  onBlur: noop,\n  onClear: noop,\n  showCancelButton: false,\n  disabled: false\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports['default'] = {\n  cancelText: '取消'\n};\nmodule.exports = exports['default'];","import React, {Component} from 'react'\nimport {SearchBar} from 'antd-mobile'\nimport './index.scss'\n\nclass HeaderBar extends Component {\n    toSearch() {\n        window.location.href = '/search';\n    }\n\n    return() {\n        window.location.href = '/';\n    }\n\n    goShop = () => {\n        const { isLogin = false } = this.props;\n        let url = isLogin? '/shopcart' : '/passport';\n        window.location.replace(url);\n    }\n\n    render() {\n        return (\n            <div className='preferential'>\n                <div className=\"search-nav\">\n                    {\n                        !this.props.toHref &&\n                        <i \n                            className={'iconfont iconiconfront-68 return'} \n                            onClick={this.return.bind(this)}\n                        />\n                    }\n                    {\n                        this.props.toHref &&\n                        <i \n                            className={'iconfont iconiconfront-68 return'} \n                            onClick={this.props.toHref}\n                        />\n                    }\n                    <SearchBar\n                        placeholder=\"搜索课程\"\n                        cancelText={\" \"}\n                        onFocus={this.toSearch.bind(this)}\n                        showCancelButton={false}\n                    />\n                    <i \n                        className={'iconfont icongouwuche-xianxing shopping-cart'} \n                        onClick={this.goShop}\n                    />\n                </div>\n            </div>\n        )\n    }\n\n}\n\nexport default HeaderBar;\n"],"sourceRoot":""}