(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/product/list"],{"126d":function(e,t,n){"use strict";(function(e){var a=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n("2eee")),i=a(n("c973")),r=n("9918"),d={components:{uniLoadMore:function(){n.e("components/uni-load-more/uni-load-more").then(function(){return resolve(n("eaf8"))}.bind(null,n)).catch(n.oe)}},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(0,i.default)(o.default.mark((function t(){var a;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:a=n,(0,r.getCategoryList)({}).then((function(t){console.log(t),t.data.forEach((function(t){t.id!=e||(a.cateList=t.children)})),console.log(a.cateList)}));case 2:case"end":return t.stop()}}),t)})))()},loadData:function(){var t=arguments,n=this;return(0,i.default)(o.default.mark((function a(){var i,d,c,s;return o.default.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(i=t.length>0&&void 0!==t[0]?t[0]:"add",d=t.length>1?t[1]:void 0,c=n,s={page:c.page,limit:c.limit,sid:c.cateId},"add"!==i){a.next=10;break}if("nomore"!==c.loadingType){a.next=7;break}return a.abrupt("return");case 7:c.loadingType="loading",a.next=11;break;case 10:c.loadingType="more";case 11:"refresh"===i&&(c.goodsList=[],c.page=1),1==n.filterIndex&&(console.log(c.salesOrder),s.salesOrder=1==c.numberOrder?"asc":"desc"),2==n.filterIndex&&(console.log(c.priceOrder),s.priceOrder=1==c.priceOrder?"asc":"desc"),(0,r.getProducts)(s).then((function(t){console.log(t.data),c.goodsList=c.goodsList.concat(t.data),c.limit==t.data.length?(c.page++,c.loadingType="more"):c.loadingType="nomore","refresh"===i&&(1==d?e.hideLoading():e.stopPullDownRefresh())}));case 15:case"end":return a.stop()}}),a)})))()},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,a="show"===e?1:0;this.cateMaskState=2,setTimeout((function(){t.cateMaskState=a}),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"])},"1a57":function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return a}));var a={uniLoadMore:function(){return n.e("components/uni-load-more/uni-load-more").then(n.bind(null,"eaf8"))}},o=function(){var e=this.$createElement;this._self._c},i=[]},"3b83":function(e,t,n){"use strict";var a=n("f51d"),o=n.n(a);o.a},6417:function(e,t,n){"use strict";(function(e,t){var a=n("4ea4");n("3e39");a(n("66fd"));var o=a(n("e775"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(o.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},a00b:function(e,t,n){"use strict";n.r(t);var a=n("126d"),o=n.n(a);for(var i in a)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(i);t["default"]=o.a},e775:function(e,t,n){"use strict";n.r(t);var a=n("1a57"),o=n("a00b");for(var i in o)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i);n("3b83");var r=n("f0c5"),d=Object(r["a"])(o["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);t["default"]=d.exports},f51d:function(e,t,n){}},[["6417","common/runtime","common/vendor"]]]);