(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/product/search"],{"159c":function(e,t,n){"use strict";(function(e){n("e27b");r(n("66fd"));var t=r(n("1ea8"));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"])},"1ea8":function(e,t,n){"use strict";n.r(t);var r=n("5a0e"),a=n("858f");for(var o in a)"default"!==o&&function(e){n.d(t,e,(function(){return a[e]}))}(o);n("b4cd");var i,u=n("f0c5"),c=Object(u["a"])(a["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],i);t["default"]=c.exports},"5a0e":function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return o})),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,"feaa"))}},a=function(){var e=this,t=e.$createElement;e._self._c},o=[]},"858f":function(e,t,n){"use strict";n.r(t);var r=n("92ee"),a=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);t["default"]=a.a},"92ee":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n("a34a")),a=n("3998");function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n,r,a,o,i){try{var u=e[o](i),c=u.value}catch(s){return void n(s)}u.done?t(c):Promise.resolve(c).then(r,a)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function u(e){i(o,r,a,u,c,"next",e)}function c(e){i(o,r,a,u,c,"throw",e)}u(void 0)}))}}var c=function(){n.e("components/uni-load-more/uni-load-more").then(function(){return resolve(n("feaa"))}.bind(null,n)).catch(n.oe)},s={components:{uniLoadMore:c},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 o=this;return u(r.default.mark((function i(){var u,c;return r.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(u=o,"refresh"===t){r.next=9;break}if("nomore"!==u.loadingType){r.next=6;break}return r.abrupt("return");case 6:u.loadingType="loading";case 7:r.next=10;break;case 9:u.loadingType="more";case 10:c={page:u.page,limit:u.limit,news:u.newOrder,keyword:o.keyword},1===o.searchType&&(c.salesOrder=1===u.numberOrder?"asc":"desc"),2===o.searchType&&(c.priceOrder=1===u.priceOrder?"asc":"desc"),(0,a.getProducts)(c).then((function(r){"refresh"===t&&(u.goodsList=[]),u.goodsList=u.goodsList.concat(r.data),u.limit==r.data.length?(u.page++,u.loadingType="more"):u.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 u(r.default.mark((function t(){return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:(0,a.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"])},aeeb:function(e,t,n){},b4cd:function(e,t,n){"use strict";var r=n("aeeb"),a=n.n(r);a.a}},[["159c","common/runtime","common/vendor"]]]);