(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/product/list"],{"4b72":function(e,t,n){"use strict";var o=n("6d25"),a=n.n(o);a.a},"6cdb":function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return o}));var o={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},r=[]},"6d25":function(e,t,n){},9068:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n("a34a")),a=n("3998");function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n,o,a,r,i){try{var c=e[r](i),d=c.value}catch(s){return void n(s)}c.done?t(d):Promise.resolve(d).then(o,a)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(o,a){var r=e.apply(t,n);function c(e){i(r,o,a,c,d,"next",e)}function d(e){i(r,o,a,c,d,"throw",e)}c(void 0)}))}}var d=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:d},data:function(){return{cateMaskState:0,headerPosition:"fixed",headerTop:"0px",loadingType:"more",filterIndex:0,numberOrder:0,limit:6,page:0,cateId:0,priceOrder:0,cateList:[],goodsList:[]}},onLoad:function(e){this.cateId=e.tid,this.loadCateList(e.fid,e.sid),this.loadData()},onPageScroll:function(e){e.scrollTop>=0?this.headerPosition="fixed":this.headerPosition="absolute"},onPullDownRefresh:function(){this.loadData("refresh")},onReachBottom:function(){this.loadData()},methods:{loadCateList:function(e,t){var n=this;return c(o.default.mark((function t(){var r;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:r=n,(0,a.getCategoryList)({}).then((function(t){console.log(t),t.data.forEach((function(t){t.id!=e||(r.cateList=t.children)})),console.log(r.cateList)}));case 2:case"end":return t.stop()}}),t)})))()},loadData:function(){var t=arguments,n=this;return c(o.default.mark((function r(){var i,c,d,s;return o.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(i=t.length>0&&void 0!==t[0]?t[0]:"add",c=t.length>1?t[1]:void 0,d=n,s={page:d.page,limit:d.limit,sid:d.cateId},"add"!==i){o.next=10;break}if("nomore"!==d.loadingType){o.next=7;break}return o.abrupt("return");case 7:d.loadingType="loading",o.next=11;break;case 10:d.loadingType="more";case 11:"refresh"===i&&(d.goodsList=[],d.page=1),1==n.filterIndex&&(console.log(d.salesOrder),s.salesOrder=1==d.numberOrder?"asc":"desc"),2==n.filterIndex&&(console.log(d.priceOrder),s.priceOrder=1==d.priceOrder?"asc":"desc"),(0,a.getProducts)(s).then((function(t){console.log(t.data),d.goodsList=d.goodsList.concat(t.data),d.limit==t.data.length?(d.page++,d.loadingType="more"):d.loadingType="nomore","refresh"===i&&(1==c?e.hideLoading():e.stopPullDownRefresh())}));case 15:case"end":return o.stop()}}),r)})))()},tabClick:function(t){0===this.filterIndex&&this.filterIndex===t||(this.filterIndex=t,1===t&&(this.numberOrder=1===this.numberOrder?2:1),2===t&&(this.priceOrder=1===this.priceOrder?2:1),this.page=1,e.pageScrollTo({duration:300,scrollTop:0}),this.loadData("refresh",1),e.showLoading({title:"正在加载"}))},toggleCateMask:function(e){var t=this,n="show"===e?10:300,o="show"===e?1:0;this.cateMaskState=2,setTimeout((function(){t.cateMaskState=o}),n)},changeCate:function(t){this.cateId=t.id,this.toggleCateMask(),e.pageScrollTo({duration:300,scrollTop:0}),this.page=1,this.loadData("refresh",1),e.showLoading({title:"正在加载"})},navToDetailPage:function(t){var n=t.id;e.navigateTo({url:"/pages/product/product?id=".concat(n)})},stopPrevent:function(){}}};t.default=s}).call(this,n("543d")["default"])},cbd5:function(e,t,n){"use strict";n.r(t);var o=n("9068"),a=n.n(o);for(var r in o)"default"!==r&&function(e){n.d(t,e,(function(){return o[e]}))}(r);t["default"]=a.a},d662:function(e,t,n){"use strict";n.r(t);var o=n("6cdb"),a=n("cbd5");for(var r in a)"default"!==r&&function(e){n.d(t,e,(function(){return a[e]}))}(r);n("4b72");var i,c=n("f0c5"),d=Object(c["a"])(a["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],i);t["default"]=d.exports},ffea:function(e,t,n){"use strict";(function(e){n("e27b");o(n("66fd"));var t=o(n("d662"));function o(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=n,e(t.default)}).call(this,n("543d")["createPage"])}},[["ffea","common/runtime","common/vendor"]]]);