(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/product/search"],{"2ce4":function(e,t,n){"use strict";n.r(t);var r=n("a502"),o=n("4428");for(var a in o)"default"!==a&&function(e){n.d(t,e,(function(){return o[e]}))}(a);n("5eb7");var i,c=n("f0c5"),u=Object(c["a"])(o["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],i);t["default"]=u.exports},3516:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n("a34a")),o=n("4d2c");function a(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n,r,o,a,i){try{var c=e[a](i),u=c.value}catch(s){return void n(s)}c.done?t(u):Promise.resolve(u).then(r,o)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function c(e){i(a,r,o,c,u,"next",e)}function u(e){i(a,r,o,c,u,"throw",e)}c(void 0)}))}}var u=function(){n.e("components/uni-load-more/uni-load-more").then(function(){return resolve(n("cb81"))}.bind(null,n)).catch(n.oe)},s={components:{uniLoadMore:u},data:function(){return{arrlist:[],keyword:"",list:[],tabCurrentIndex:0,goodsList:[],limit:6,page:1,loadingType:"more",numberOrder:1,priceOrder:1,newOrder:0,searchType:0}},onLoad:function(){this.loadData()},onPullDownRefresh:function(){this.page=1,this.getProducts("refresh")},methods:{getProducts:function(t,n){var a=this;return c(r.default.mark((function i(){var c,u;return r.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(c=a,"refresh"===t){r.next=9;break}if("nomore"!==c.loadingType){r.next=6;break}return r.abrupt("return");case 6:c.loadingType="loading";case 7:r.next=10;break;case 9:c.loadingType="more";case 10:u={page:c.page,limit:c.limit,news:c.newOrder,keyword:a.keyword},1===a.searchType&&(u.salesOrder=1===c.numberOrder?"asc":"desc"),2===a.searchType&&(u.priceOrder=1===c.priceOrder?"asc":"desc"),(0,o.getProducts)(u).then((function(r){"refresh"===t&&(c.goodsList=[]),c.goodsList=c.goodsList.concat(r.data),c.limit==r.data.length?(c.page++,c.loadingType="more"):c.loadingType="nomore","refresh"===t&&(1==n?e.hideLoading():e.stopPullDownRefresh())}));case 14:case"end":return r.stop()}}),i)})))()},clickHotText:function(e){this.keyword=e,this.navTo()},loadData:function(){var e=this;return c(r.default.mark((function t(){return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:(0,o.searchKeyword)({}).then((function(t){e.list=t.data})).catch((function(e){console.log(e)}));case 1:case"end":return t.stop()}}),t)})))()},navTo:function(){this.tabCurrentIndex=1,this.infoData()},defaultSearch:function(){this.numberOrder="",this.priceOrder="",this.newOrder=0,this.searchType=0,this.infoData()},newGoodsTab:function(){this.newOrder=1===this.newOrder?0:1,this.infoData()},sortTab:function(e){this.searchType=e,1===this.searchType&&(this.numberOrder=1===this.numberOrder?2:1),2===this.searchType&&(this.priceOrder=1===this.priceOrder?2:1),this.infoData()},infoData:function(){this.page=1,e.pageScrollTo({duration:300,scrollTop:0}),this.getProducts("refresh",1),e.showLoading({title:"正在加载"})},navToDetailPage:function(t){var n=t.id;e.navigateTo({url:"/pages/product/product?id="+n})}}};t.default=s}).call(this,n("543d")["default"])},4428:function(e,t,n){"use strict";n.r(t);var r=n("3516"),o=n.n(r);for(var a in r)"default"!==a&&function(e){n.d(t,e,(function(){return r[e]}))}(a);t["default"]=o.a},"5eb7":function(e,t,n){"use strict";var r=n("a66f"),o=n.n(r);o.a},a502:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return r}));var r={uniLoadMore:function(){return n.e("components/uni-load-more/uni-load-more").then(n.bind(null,"cb81"))}},o=function(){var e=this,t=e.$createElement;e._self._c},a=[]},a66f:function(e,t,n){},d996:function(e,t,n){"use strict";(function(e){n("30ba");r(n("66fd"));var t=r(n("2ce4"));function r(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=n,e(t.default)}).call(this,n("543d")["createPage"])}},[["d996","common/runtime","common/vendor"]]]);