(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/product/list"],{"490a":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,"20fd"))}},a=function(){var e=this,t=e.$createElement;e._self._c},r=[]},"80f8":function(e,t,n){"use strict";var o=n("aa5c"),a=n.n(o);a.a},9496:function(e,t,n){"use strict";n.r(t);var o=n("e4ed"),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},aa5c:function(e,t,n){},c6e2:function(e,t,n){"use strict";n.r(t);var o=n("490a"),a=n("9496");for(var r in a)"default"!==r&&function(e){n.d(t,e,(function(){return a[e]}))}(r);n("80f8");var i,c=n("f0c5"),s=Object(c["a"])(a["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],i);t["default"]=s.exports},e4ed: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("7e95");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),s=c.value}catch(d){return void n(d)}c.done?t(s):Promise.resolve(s).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,s,"next",e)}function s(e){i(r,o,a,c,s,"throw",e)}c(void 0)}))}}var s=function(){n.e("components/uni-load-more/uni-load-more").then(function(){return resolve(n("20fd"))}.bind(null,n)).catch(n.oe)},d={components:{uniLoadMore:s},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,s,d;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,s=n,d={page:s.page,limit:s.limit,sid:s.cateId},"add"!==i){o.next=10;break}if("nomore"!==s.loadingType){o.next=7;break}return o.abrupt("return");case 7:s.loadingType="loading",o.next=11;break;case 10:s.loadingType="more";case 11:"refresh"===i&&(s.goodsList=[],s.page=1),1==n.filterIndex&&(console.log(s.salesOrder),d.salesOrder=1==s.numberOrder?"asc":"desc"),2==n.filterIndex&&(console.log(s.priceOrder),d.priceOrder=1==s.priceOrder?"asc":"desc"),(0,a.getProducts)(d).then((function(t){console.log(t.data),s.goodsList=s.goodsList.concat(t.data),s.limit==t.data.length?(s.page++,s.loadingType="more"):s.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=d}).call(this,n("543d")["default"])},eec8:function(e,t,n){"use strict";(function(e){n("5935");o(n("66fd"));var t=o(n("c6e2"));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"])}},[["eec8","common/runtime","common/vendor"]]]);