Commit ccc89877 by FE

build

parent 505f5e31
{"version":3,"sources":["common/Tag/index.js","components/search/index.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","components/search/searchHead.js"],"names":["Tag","react_default","a","createElement","Object","assign","className","this","props","name","children","PureComponent","Search","state","searchHistory","JSON","parse","localStorage","getItem","hot_words","defaultWord","searchList","value","isLoading","clearHistory","setItem","_this","setState","handleChange","handleSearch","_this$state","val","history","push","concat","encodeURIComponent","storeHistory","keyword","data","some","item","stringify","http","get","API","res","errno","info","recommend_word","_this2","searchHead","Loading","length","onClick","map","v","i","react_router_dom","key","to","Tag_Tag","bind","style","textAlign","padding","defineProperty","exports","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","call","SearchBar","_React$Component","__proto__","getPrototypeOf","onSubmit","e","preventDefault","inputRef","blur","onChange","focus","target","onFocus","firstFocus","onBlur","cb","onBlurTimeout","blurFromOnClear","document","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","el","action","visibility","type","activeClassName","Component","defaultProps","contextTypes","object","noop","SearchHead","isFocus","returnPage","go","search","storeKeyword","_this$props","_this$props$searchHis","changeFontColor","refs","cls","classnames","submit-btn--active","react__WEBPACK_IMPORTED_MODULE_7___default","forwardedRef","antd_mobile_lib_search_bar__WEBPACK_IMPORTED_MODULE_1___default","withRouter"],"mappings":"2OAEqBA,4LAEb,OACIC,EAAAC,EAAAC,cAAA,OAAAC,OAAAC,OAAA,CAAMC,UAAWC,KAAKC,MAAMC,MAAUF,KAAKC,OACtCD,KAAKC,MAAME,iBAJKC,mDCO3BC,6MAEFC,MAAQ,CACJC,cAAeC,KAAKC,MAAMC,aAAaC,QAAQ,mBAAqB,GACpEC,UAAW,GACXC,YAAa,GACbC,WAAY,GACZC,MAAO,GACPC,WAAW,KAefC,aAAe,WACXP,aAAaQ,QAAQ,gBAAiB,MACtCC,EAAKC,SAAS,CACVb,cAAe,QAIvBc,aAAe,SAAAN,GACXI,EAAKC,SAAS,CAACL,aAGnBO,aAAe,WAAM,IAAAC,EACcJ,EAAKb,MAA5BO,EADSU,EACTV,YACFW,EAFWD,EACIR,OACAF,EACrBW,GAAOL,EAAKlB,MAAMwB,QAAQC,KAAnB,uBAAAC,OAA+CC,mBAAmBJ,QAG7EK,aAAe,SAAAC,GAAW,IACdvB,EAAkBY,EAAKb,MAAvBC,cACFwB,EAAOxB,EAAcyB,KAAK,SAAAC,GAAI,OAAIA,IAASH,IAAUvB,EAAgBA,EAAcoB,OAAO,CAACG,IACjGpB,aAAaQ,QAAQ,gBAAiBV,KAAK0B,UAAUH,4NA/BnCI,IAAKC,IAAL,GAAAT,OAAYU,IAAI,cAAhB,4BAAZC,WACkBA,EAAIP,KAApBQ,UAAOR,SACD,IAAVQ,GACAvC,KAAKoB,SAAS,CACVR,UAAWmB,EAAKS,KAAK5B,UACrBG,MAAOgB,EAAKS,KAAKC,eACj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AcoB,OAAO,CAACZ,IAE9FL,aAAaQ,QAAQ,gBAAiBV,KAAK0B,UAAUH,OAGzD0J,gBAAkB,SAACP,GACf/J,EAAKC,SAAS,CACV8J,gGAjBJlL,KAAK0L,KAAKL,OAAOtE,yCAqBZ,IAAArE,EAAA1C,KACGkL,EAAYlL,KAAKM,MAAjB4K,QACFS,EAAMC,IAAW,aAAc,CAACC,qBAAsBX,IAC5D,OAEIY,EAAAnM,EAAAC,cAAA,OAAKG,UAAU,cAAcwD,MAAOvD,KAAKC,MAAMsD,MAAO+G,IAAKtK,KAAKC,MAAM8L,cAElED,EAAAnM,EAAAC,cAAA,OAAKG,UAAU,OAAO+C,QAAS9C,KAAKmL,YAChCW,EAAAnM,EAAAC,cAAA,KAAGG,UAAU,+BAGjB+L,EAAAnM,EAAAC,cAAA,OAAKG,UAAU,UACX+L,EAAAnM,EAAAC,cAAAoM,EAAArM,EAAA,CACIoB,MAAOf,KAAKC,MAAMc,MAClBqI,kBAAgB,EAChBa,WAAY,IACZK,IAAI,SACJvD,OAAO,EACPD,SAAU9G,KAAKC,MAAMoB,aACrB0I,YAAY,2BACZ9C,QAAS,kBAAMvE,EAAK+I,iBAAgB,IACpCtE,OAAQ,kBAAMzE,EAAK+I,iBAAgB,IACnChF,SAAWzG,KAAKqL,UAGxBS,EAAAnM,EAAAC,cAAA,OAAKG,UAAU,kBAAkB+C,QAAS9C,KAAKqL,QAC3CS,EAAAnM,EAAAC,cAAA,OAAKG,UAAW4L,GAAhB,yBA1DKvL,kBAkEV6L,gBAAWhB","file":"mrstatic/js/search.f58a0569.chunk.js","sourcesContent":["import React, { PureComponent } from 'react'\nimport './tag.scss'\nexport default class Tag extends PureComponent {\n render() {\n return (\n <span className={this.props.name} {...this.props}>\n {this.props.children}\n </span>\n )\n }\n}\n","import React, { PureComponent } from 'react';\nimport SearchHead from './searchHead'\nimport Tag from '@common/Tag/index.js'\nimport { http } from '@/utils'\nimport './index.scss';\nimport { Link } from 'react-router-dom'\nimport Loading from '@/common/Loading'\n\n\nclass Search extends PureComponent {\n\n state = {\n searchHistory: JSON.parse(localStorage.getItem('searchHistory')) || [],\n hot_words: [],\n defaultWord: '',\n searchList: [],\n value: '',\n isLoading: true\n }\n\n async componentDidMount() {\n const res = await http.get(`${API['search-api']}/search_hot_word`);\n const { errno, data } = res.data; \n if (errno === 0) {\n this.setState({\n hot_words: data.info.hot_words,\n value: data.info.recommend_word,\n isLoading: false\n })\n }\n }\n\n clearHistory = () => {\n localStorage.setItem('searchHistory', null)\n this.setState({\n searchHistory: []\n })\n }\n\n handleChange = value => {\n this.setState({value})\n }\n\n handleSearch = () => {\n const { defaultWord, value } = this.state;\n const val = value || defaultWord;\n val && this.props.history.push(`/search-result?word=${encodeURIComponent(val)}`)\n }\n\n storeHistory = keyword => {\n const { searchHistory } = this.state;\n const data = searchHistory.some(item => item === keyword)? searchHistory : searchHistory.concat([keyword]);\n localStorage.setItem('searchHistory', JSON.stringify(data));\n }\n\n\n render() {\n const {searchHistory} = this.state\n return (\n <div className=\"search-page\">\n <SearchHead\n searchHistory={this.state.searchHistory}\n value={this.state.value}\n handleChange={this.handleChange}\n handleSearch={this.handleSearch}\n />\n <Loading isLoading={this.state.isLoading}>\n <div className=\"search-main\">\n {\n searchHistory.length > 0 &&\n <div className=\"search-land\">\n <div className='search-history'>\n <span>最近搜索</span>\n <i className=\"iconfont iconiconfront-56\" onClick={this.clearHistory}/>\n </div>\n <div className=\"search-tag\">\n {\n\n searchHistory.map((v, i) => {\n return (\n <Link\n key={i}\n to={`/search-result?word=${encodeURIComponent(v)}`}\n >\n <Tag name={\"tagLately\"}>{v}</Tag>\n </Link>\n )\n })\n }\n </div>\n </div>\n }\n <div className=\"search-land search-hot\">\n <label className={'search-history'}>\n <span>热门搜索</span>\n </label>\n <div className=\"search-tag\">\n {\n this.state['hot_words'].length > 0 ?\n this.state['hot_words'].map((v, i) => {\n return (\n <Link key={i}\n to={`/search-result?word=${encodeURIComponent(v)}`}\n onClick={this.storeHistory.bind(this, v)}\n >\n <Tag name={\"tagHot\"}>{v}</Tag>\n </Link>\n )\n })\n : <div style={{textAlign: 'center', padding: '20px'}}>暂无热门</div>\n }\n </div>\n </div>\n </div>\n </Loading>\n\n </div>\n )\n }\n\n}\n\nexport default Search;","'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, { PureComponent } from 'react'\nimport { SearchBar } from 'antd-mobile'\nimport { withRouter } from 'react-router-dom'\nimport classnames from 'classnames';\n\nimport './search_header.scss'\n\nclass SearchHead extends PureComponent {\n \n state = {\n isFocus: false\n }\n\n returnPage = () => {\n this.props.history.go(-1)\n }\n\n componentDidMount() {\n this.refs.search.focus();\n }\n\n search = () => {\n this.storeKeyword()\n this.props.handleSearch()\n }\n\n storeKeyword = () => {\n const {searchHistory = [], value} = this.props;\n const data = searchHistory.some(item =>item === value)? searchHistory : searchHistory.concat([value]);\n // value && localStorage.setItem('searchHistory', JSON.stringify([...searchHistory, value]))\n localStorage.setItem('searchHistory', JSON.stringify(data));\n }\n\n changeFontColor = (isFocus) => {\n this.setState({\n isFocus\n });\n }\n\n render() {\n const { isFocus } = this.state;\n const cls = classnames('submit-btn', {'submit-btn--active': isFocus})\n return (\n \n <div className=\"search-head\" style={this.props.style} ref={this.props.forwardedRef}>\n\n <div className=\"left\" onClick={this.returnPage}>\n <i className=\"iconfont iconiconfront-68\"/>\n </div>\n\n <div className=\"center\">\n <SearchBar\n value={this.props.value}\n showCancelButton\n cancelText={\" \"}\n ref=\"search\"\n focus={true}\n onChange={this.props.handleChange}\n placeholder=\"搜索课程\"\n onFocus={() => this.changeFontColor(true)}\n onBlur={() => this.changeFontColor(false)}\n onSubmit={ this.search }\n />\n </div>\n <div className=\"right right-btn\" onClick={this.search}>\n <div className={cls}>搜索</div>\n </div>\n </div>\n\n )\n }\n}\n\nexport default withRouter(SearchHead)"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["common/Tag/index.js","components/search/index.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","components/search/searchHead.js"],"names":["Tag","react_default","a","createElement","Object","assign","className","this","props","name","children","PureComponent","Search","state","searchHistory","JSON","parse","localStorage","getItem","hot_words","defaultWord","searchList","value","isLoading","clearHistory","setItem","_this","setState","handleChange","handleSearch","_this$state","val","history","push","concat","encodeURIComponent","storeHistory","keyword","data","some","item","stringify","http","get","API","res","errno","info","recommend_word","_this2","searchHead","Loading","length","onClick","map","v","i","react_router_dom","key","to","Tag_Tag","bind","style","textAlign","padding","defineProperty","exports","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","call","SearchBar","_React$Component","__proto__","getPrototypeOf","onSubmit","e","preventDefault","inputRef","blur","onChange","focus","target","onFocus","firstFocus","onBlur","cb","onBlurTimeout","blurFromOnClear","document","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","el","action","visibility","type","activeClassName","Component","defaultProps","contextTypes","object","noop","SearchHead","isFocus","returnPage","go","search","storeKeyword","_this$props","_this$props$searchHis","changeFontColor","refs","cls","classnames","submit-btn--active","react__WEBPACK_IMPORTED_MODULE_7___default","forwardedRef","antd_mobile_lib_search_bar__WEBPACK_IMPORTED_MODULE_1___default","withRouter"],"mappings":"2OAEqBA,4LAEb,OACIC,EAAAC,EAAAC,cAAA,OAAAC,OAAAC,OAAA,CAAMC,UAAWC,KAAKC,MAAMC,MAAUF,KAAKC,OACtCD,KAAKC,MAAME,iBAJKC,mDCO3BC,6MAEFC,MAAQ,CACJC,cAAeC,KAAKC,MAAMC,aAAaC,QAAQ,mBAAqB,GACpEC,UAAW,GACXC,YAAa,GACbC,WAAY,GACZC,MAAO,GACPC,WAAW,KAefC,aAAe,WACXP,aAAaQ,QAAQ,gBAAiB,MACtCC,EAAKC,SAAS,CACVb,cAAe,QAIvBc,aAAe,SAAAN,GACXI,EAAKC,SAAS,CAACL,aAGnBO,aAAe,WAAM,IAAAC,EACcJ,EAAKb,MAA5BO,EADSU,EACTV,YACFW,EAFWD,EACIR,OACAF,E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I,iBAAgB,IACnChF,SAAWzG,KAAKqL,UAGxBS,EAAAnM,EAAAC,cAAA,OAAKG,UAAU,kBAAkB+C,QAAS9C,KAAKqL,QAC3CS,EAAAnM,EAAAC,cAAA,OAAKG,UAAW4L,GAAhB,yBA1DKvL,kBAkEV6L,gBAAWhB","file":"mrstatic/js/search.f58a0569.chunk.js","sourcesContent":["import React, { PureComponent } from 'react'\nimport './tag.scss'\nexport default class Tag extends PureComponent {\n render() {\n return (\n <span className={this.props.name} {...this.props}>\n {this.props.children}\n </span>\n )\n }\n}\n","import React, { PureComponent } from 'react';\nimport SearchHead from './searchHead'\nimport Tag from '@common/Tag/index.js'\nimport { http } from '@/utils'\nimport './index.scss';\nimport { Link } from 'react-router-dom'\nimport Loading from '@/common/Loading'\n\n\nclass Search extends PureComponent {\n\n state = {\n searchHistory: JSON.parse(localStorage.getItem('searchHistory')) || [],\n hot_words: [],\n defaultWord: '',\n searchList: [],\n value: '',\n isLoading: true\n }\n\n async componentDidMount() {\n const res = await http.get(`${API['search-api']}/search_hot_word`);\n const { errno, data } = res.data; \n if (errno === 0) {\n this.setState({\n hot_words: data.info.hot_words,\n value: data.info.recommend_word,\n isLoading: false\n })\n }\n }\n\n clearHistory = () => {\n localStorage.setItem('searchHistory', null)\n this.setState({\n searchHistory: []\n })\n }\n\n handleChange = value => {\n this.setState({value})\n }\n\n handleSearch = () => {\n const { defaultWord, value } = this.state;\n const val = value || defaultWord;\n val && this.props.history.push(`/search-result?word=${encodeURIComponent(val)}`)\n }\n\n storeHistory = keyword => {\n const { searchHistory } = this.state;\n const data = searchHistory.some(item => item === keyword)? searchHistory : searchHistory.concat([keyword]);\n localStorage.setItem('searchHistory', JSON.stringify(data));\n }\n\n\n render() {\n const {searchHistory} = this.state\n return (\n <div className=\"search-page\">\n <SearchHead\n searchHistory={this.state.searchHistory}\n value={this.state.value}\n handleChange={this.handleChange}\n handleSearch={this.handleSearch}\n />\n <Loading isLoading={this.state.isLoading}>\n <div className=\"search-main\">\n {\n searchHistory.length > 0 &&\n <div className=\"search-land\">\n <div className='search-history'>\n <span>最近搜索</span>\n <i className=\"iconfont iconiconfront-56\" onClick={this.clearHistory}/>\n </div>\n <div className=\"search-tag\">\n {\n\n searchHistory.map((v, i) => {\n return (\n <Link\n key={i}\n to={`/search-result?word=${encodeURIComponent(v)}`}\n >\n <Tag name={\"tagLately\"}>{v}</Tag>\n </Link>\n )\n })\n }\n </div>\n </div>\n }\n <div className=\"search-land search-hot\">\n <label className={'search-history'}>\n <span>热门搜索</span>\n </label>\n <div className=\"search-tag\">\n {\n this.state['hot_words'].length > 0 ?\n this.state['hot_words'].map((v, i) => {\n return (\n <Link key={i}\n to={`/search-result?word=${encodeURIComponent(v)}`}\n onClick={this.storeHistory.bind(this, v)}\n >\n <Tag name={\"tagHot\"}>{v}</Tag>\n </Link>\n )\n })\n : <div style={{textAlign: 'center', padding: '20px'}}>暂无热门</div>\n }\n \n </div>\n </div>\n </div>\n </Loading>\n\n </div>\n )\n }\n\n}\n\nexport default Search;","'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, { PureComponent } from 'react'\nimport { SearchBar } from 'antd-mobile'\nimport { withRouter } from 'react-router-dom'\nimport classnames from 'classnames';\n\nimport './search_header.scss'\n\nclass SearchHead extends PureComponent {\n \n state = {\n isFocus: false\n }\n\n returnPage = () => {\n this.props.history.go(-1)\n }\n\n componentDidMount() {\n this.refs.search.focus();\n }\n\n search = () => {\n this.storeKeyword()\n this.props.handleSearch()\n }\n\n storeKeyword = () => {\n const {searchHistory = [], value} = this.props;\n const data = searchHistory.some(item =>item === value)? searchHistory : searchHistory.concat([value]);\n // value && localStorage.setItem('searchHistory', JSON.stringify([...searchHistory, value]))\n localStorage.setItem('searchHistory', JSON.stringify(data));\n }\n\n changeFontColor = (isFocus) => {\n this.setState({\n isFocus\n });\n }\n\n render() {\n const { isFocus } = this.state;\n const cls = classnames('submit-btn', {'submit-btn--active': isFocus})\n return (\n \n <div className=\"search-head\" style={this.props.style} ref={this.props.forwardedRef}>\n\n <div className=\"left\" onClick={this.returnPage}>\n <i className=\"iconfont iconiconfront-68\"/>\n </div>\n\n <div className=\"center\">\n <SearchBar\n value={this.props.value}\n showCancelButton\n cancelText={\" \"}\n ref=\"search\"\n focus={true}\n onChange={this.props.handleChange}\n placeholder=\"搜索课程\"\n onFocus={() => this.changeFontColor(true)}\n onBlur={() => this.changeFontColor(false)}\n onSubmit={ this.search }\n />\n </div>\n <div className=\"right right-btn\" onClick={this.search}>\n <div className={cls}>搜索</div>\n </div>\n </div>\n\n )\n }\n}\n\nexport default withRouter(SearchHead)"],"sourceRoot":""}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment