(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/search/search"],{"2f19":function(t,e,i){},"4f44":function(t,e,i){"use strict";i.r(e);var n=i("d608"),r=i.n(n);for(var o in n)"default"!==o&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=r.a},"73d7":function(t,e,i){"use strict";var n=i("2f19"),r=i.n(n);r.a},"8c6a":function(t,e,i){"use strict";(function(t){i("2d0a");n(i("66fd"));var e=n(i("d519"));function n(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,i("543d")["createPage"])},a0a6:function(t,e,i){"use strict";var n;i.d(e,"b",(function(){return r})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return n}));var r=function(){var t=this,e=t.$createElement;t._self._c},o=[]},d519:function(t,e,i){"use strict";i.r(e);var n=i("a0a6"),r=i("4f44");for(var o in r)"default"!==o&&function(t){i.d(e,t,(function(){return r[t]}))}(o);i("73d7");var s,a=i("f0c5"),c=Object(a["a"])(r["default"],n["b"],n["c"],!1,null,"dd67b6b4",null,!1,n["a"],s);e["default"]=c.exports},d608:function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(i("a34a")),r=i("2f62");function o(t){return t&&t.__esModule?t:{default:t}}function s(t){return h(t)||u(t)||c(t)||a()}function a(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t,e){if(t){if("string"===typeof t)return l(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?l(t,e):void 0}}function u(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function h(t){if(Array.isArray(t))return l(t)}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0?this.list:this.recommend_list},sizeTransform:function(){var e=t.getSystemInfoSync().windowWidth,i=750/e,n=24/i,r=20/i,o=60/i,s=e-2*n;return{p:i,boxLeft:n,marginRight:r,btnWidth:o,listWidth:s}}},(0,r.mapState)({isListUnderlinePrice:function(t){return t.mallConfig.mall.setting.is_list_underline_price}})),onLoad:function(t){this.$commonLoad.onload(t),this.mch_id=t.mch_id?t.mch_id:0,this.sign=t.sign?t.sign:"goods","goods"===this.sign?this.url=this.$api.default.goods_list:"pt"===this.sign?this.url=this.$api.pt.goods:"wholesale"===this.sign&&(this.url=this.$api.wholesale.index),b=1,w=!1,S=!1,this.historyList=this.getHistory(),this.getSelect(),this.getRecommend(),this.getHotSearch()},onReachBottom:function(){S||(this.goodsReset=!1,this.keyword&&(this.loading=!0,this.getGoodsList()))},watch:{keyword:{handler:function(t){""==t&&this.cancel()},immediate:!0}},methods:{getSelect:function(){var e=this;return f(n.default.mark((function i(){var r,o,s;return n.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:r=e.historyList,r&&r.length&&(o=e,s=0,setTimeout((function(){var i=t.createSelectorQuery().in(e);i.selectAll(".once-item").fields({size:!0},(function(t){o.formatData(t),o.beginAfter?o.selectLimitList(t):o.selectAllList()})).exec()}),s));case 2:case"end":return i.stop()}}),i)})))()},formatData:function(t){for(var e=this,i=e.historyList,n=e.sizeTransform,r=n.marginRight,o=n.listWidth,s=[],a=[],c=0,u=0;u2){var c=0,u=r-n-o,h=0;s[1].forEach((function(e,i){h+=t[s[0].length+i].width+o,h<=u&&(c=i+1)})),s[1].splice(c,s[1].length-c,{mark:!0}),a=[s[0],s[1]],e.beginAfter=!0}else s.forEach((function(t){return a.push(t)})),e.beginAfter=!1;e.realHistoryList=a},selectAllList:function(){var t=this.tempList,e=[];if(t&&t.length)for(var i=0;i<5&&i0?((n=e.list).push.apply(n,s(o.list)),b++):(S=!0,1===b&&e.getRecommend())):t.showModal({content:a})})).catch((function(){w=!1}))))},setHistory:function(){var e=this.getHistory(),i=this.keyword.trim();e.forEach((function(t,n){t.keyword===i&&e.splice(n,1)})),e.unshift({keyword:i}),e.length>20&&e.pop(),this.historyList=e,t.setStorageSync("SEARCH_HISTORY_LIST",e)},getHistory:function(){var e=t.getStorageSync("SEARCH_HISTORY_LIST");return e||(e=[]),e},deleteHistory:function(){var e=this;t.showModal({content:"确认删除全部历史记录?",success:function(i){i.confirm&&(t.removeStorageSync("SEARCH_HISTORY_LIST"),e.historyList=[])}})},historyClick:function(t){this.keyword=t.trim(),this.reset()},getRecommend:function(){var t=this;this.mch_id||this.recommend_list.length>0||this.$request({url:this.$api.goods.new_recommend,data:{goods_id:0,type:"goods"}}).then((function(e){0===e.code&&(t.recommend_list=e.data.list)}))},buyProduct:function(t){var e=this,i=t.goods,n=t.attrShow;this.attrGoods.goods=i,setTimeout((function(){e.attrGoods.attrShow=n}))}}};e.default=_}).call(this,i("543d")["default"])}},[["8c6a","common/runtime","common/vendor"]]]);