webpackJsonp([31],{"20Ku":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAABPklEQVR4Ae2YNUIEQRBFuQB2Aw6CZDgngAuQcQjc4QrrLt00ISkW4a4p7g79mdpo3WUqeLsjf6reuFS1DXSXNCyYDBa0uuWQ1S3uNL9xeNBMFUXQ4RFNJJEUm1u1FFzQ5ha9RnO5bpOyPhaYhwyyRRPUu3klwSGwYk5Bm1uO6uKbiRGXdIy9JMi8UOYyWT30TEfwGIULCXqmLBgILNXhLKUzdSePYjuRPuiZXDDBcZQHYh2/LPgOSlXwyxFYbAAYLkXB68gyGE6cZUG5gnutHh5PQXDcyMqVwgl6xPz/PM9CRzJBZIysmC8RQRZkQRYEYXpo7U8miAxNCxdSEBxqPpMJUuawFO4k70qpGoDhUn2aOQHl9jzIgv48CvqzFrR5VU++BFE7a0Fg98g+erv7zoEYauygZqV/fmNBFmTBP4xN9dpGKmpLAAAAAElFTkSuQmCC"},"4qyN":function(e,t){},K9Fu:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=r("Dd8w"),n=r.n(s),c=r("NYxO"),i=r("Au9i"),o={data:function(){return{keywords:this.keyword?this.keyword:"",currenKeywords:this.utils.fetch("keyword")}},props:["keyword"],methods:n()({},Object(c.d)({changeKey:"changeKey"}),{search:function(e,t){if(t.replace(/\s+/g,"").length<=0)return Object(i.Toast)("请输入您要搜索的关键字"),!1;if(this.keywords=t,t){this.currenKeywords.push(t);var r=this.utils.arrayFilter(this.currenKeywords);this.utils.save("keyword",r)}this.$router.push({name:"products",query:{keywords:this.keywords}}),e&&this.utils.stopPrevent(e)},cancel:function(){this.clear(),this.$route.params.isFromHome?this.$router.go(-1):this.$router.push({name:"category"})},clear:function(){this.keywords="",this.changeKey(this.keywords)}})},a={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ui-search-header"},[s("form",{attrs:{action:"#"},on:{submit:function(t){t.preventDefault(),e.search(t,e.keywords)}}},[s("div",[s("input",{directives:[{name:"model",rawName:"v-model",value:e.keywords,expression:"keywords"}],attrs:{type:"search",placeholder:"请输入您要搜索的商品"},domProps:{value:e.keywords},on:{input:function(t){t.target.composing||(e.keywords=t.target.value)}}}),e._v(" "),e.keywords.length>0?s("img",{attrs:{src:r("y9By")},on:{click:function(t){e.clear()}}}):e._e()]),e._v(" "),s("span",{on:{click:function(t){e.cancel()}}},[e._v("取消")])])])},staticRenderFns:[]};var u={data:function(){return{currenKeywords:[],keywords:this.$store.state.search.currentKey?this.$store.state.search.currentKey:""}},components:{searchHeader:r("VU/8")(o,a,!1,function(e){r("4qyN")},"data-v-71f118f8",null).exports},computed:n()({},Object(c.e)({currentKey:function(e){return e.search.currentKey},hotKeywords:function(e){return e.search.hotKeywords}})),created:function(){this.fetchSearchKeywordList(),this.getCurrentKey()},methods:n()({},Object(c.d)({changeKey:"changeKey"}),Object(c.b)({fetchSearchKeywordList:"fetchSearchKeywordList"}),{getKey:function(e){e.content?this.keywords=e.content:this.keywords=e,this.changeKey(this.keywords),this.$refs.header.search(null,this.keywords)},deleteCurrent:function(){this.utils.save("keyword",[]),this.currenKeywords=this.utils.fetch("keyword")},getCurrentKey:function(){this.currenKeywords=this.utils.fetch("keyword")}})},h={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"search-wrapper"},[s("search-header",{ref:"header",attrs:{keyword:e.keywords}}),e._v(" "),s("div",{staticClass:"search-body"},[e.currenKeywords.length>0?s("div",{staticClass:"list current-search"},[s("div",{staticClass:"list-header"},[s("span",[e._v("最近搜索")]),e._v(" "),s("img",{attrs:{src:r("20Ku")},on:{click:function(t){e.deleteCurrent()}}})]),e._v(" "),s("ul",e._l(e.currenKeywords,function(t,r){return s("li",{key:r,staticClass:"item",on:{click:function(r){e.getKey(t)}}},[e._v("\n\t\t\t\t\t"+e._s(t)+"\n\t\t\t\t")])}))]):e._e(),e._v(" "),s("div",{staticClass:"list hot-wrapper"},[e._m(0),e._v(" "),s("ul",e._l(e.hotKeywords,function(t,r){return s("li",{key:r,staticClass:"item",on:{click:function(r){e.getKey(t)}}},[e._v("\n\t\t\t\t\t"+e._s(t.content)+"\n\t\t\t\t")])}))])])],1)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"list-header"},[t("span",[this._v("热门搜索")])])}]};var d=r("VU/8")(u,h,!1,function(e){r("kkNN")},"data-v-709e84b4",null);t.default=d.exports},kkNN:function(e,t){}});
//# sourceMappingURL=31.ea224682ce7d4ca8cfca.js.map