require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages_tool/goods/search"],{"1c61":function(t,i,e){"use strict";e.r(i);var s=e("43aa"),n=e("48da");for(var o in n)["default"].indexOf(o)<0&&function(t){e.d(i,t,(function(){return n[t]}))}(o);e("b3ba");var r=e("828b"),a=Object(r["a"])(n["default"],s["b"],s["c"],!1,null,"0efb433a",null,!1,s["a"],void 0);i["default"]=a.exports},"43aa":function(t,i,e){"use strict";e.d(i,"b",(function(){return s})),e.d(i,"c",(function(){return n})),e.d(i,"a",(function(){}));var s=function(){var t=this,i=t.$createElement,e=(t._self._c,t.historyList.length),s=t.hotList.length;t._isMounted||(t.e0=function(i){t.isAllHistory=!1}),t.$mp.data=Object.assign({},{$root:{g0:e,g1:s}})},n=[]},"48da":function(t,i,e){"use strict";e.r(i);var s=e("8bbd"),n=e.n(s);for(var o in s)["default"].indexOf(o)<0&&function(t){e.d(i,t,(function(){return s[t]}))}(o);i["default"]=n.a},"8bbd":function(t,i,e){"use strict";(function(t){Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var e={data:function(){return{inputValue:"",historyList:[],searchList:[],alikeList:[],isIndex:!1,searchWords:"",hotList:[],isAllHistory:!1}},onLoad:function(i){i.keyword&&(this.inputValue=i.keyword),!t.getStorageSync("search")&&t.setStorageSync("search",[])},onShow:function(){this.findHistoryList(),this.defaultSearch(),this.findHotList(),this.$nextTick((function(){this.getHistoryHeight()}))},methods:{findHistoryList:function(){this.historyList=t.getStorageSync("search").reverse()},deleteHistoryList:function(){var i=this;t.showModal({title:"提示",content:"确认删除全部历史记录？",success:function(e){e.confirm&&(t.setStorageSync("search",[]),i.findHistoryList())}})},deleteItem:function(i){var e=this;t.showModal({title:"提示",content:"确认删除该条历史记录？",success:function(s){if(s.confirm){var n=t.getStorageSync("search"),o=n.filter((function(t){return t!=i}));t.setStorageSync("search",o),e.findHistoryList()}}})},defaultSearch:function(){var t=this;this.$api.sendRequest({url:"/api/goods/defaultSearchWords",success:function(i){t.searchWords=i.data.words}})},findHotList:function(){var t=this;this.$api.sendRequest({url:"/api/goods/hotSearchWords",success:function(i){""!=i.data.words&&(t.hotList=i.data.words.split(","))}})},inputFocus:function(t){""!=this.inputValue.trim()&&(this.dataList=[])},otherSearch:function(t){this.inputValue=t,this.search()},search:function(){var i=this;if(""!=this.inputValue.trim()){var e=t.getStorageSync("search"),s=[];e.length?(s=e.filter((function(t){return t!=i.inputValue.trim()})),s.push(this.inputValue.trim())):s.push(this.inputValue.trim()),t.setStorageSync("search",s),this.$util.redirectTo("/pages/goods/list",{keyword:this.inputValue.trim()})}else""==this.searchWords?this.$util.showToast({title:"搜索内容不能为空哦"}):this.$util.redirectTo("/pages/goods/list",{})},getHistoryHeight:function(){var i=this,e=t.createSelectorQuery().in(this);e.select("#history-list").boundingClientRect((function(e){e&&e.height>2*t.upx2px(70)+2*t.upx2px(35)&&(i.isAllHistory=!0)})).exec()}}};i.default=e}).call(this,e("df3c")["default"])},"9c9b":function(t,i,e){"use strict";(function(t,i){var s=e("47a9");e("1dee");s(e("3240"));var n=s(e("1c61"));t.__webpack_require_UNI_MP_PLUGIN__=e,i(n.default)}).call(this,e("3223")["default"],e("df3c")["createPage"])},b3ba:function(t,i,e){"use strict";var s=e("bd29"),n=e.n(s);n.a},bd29:function(t,i,e){}},[["9c9b","common/runtime","common/vendor"]]]);