(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/category/category"],{"031e":function(t,e,n){"use strict";(function(t){var i=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=i(n("2eee")),a=i(n("c973")),c=n("b711"),r={data:function(){return{sizeCalcState:!1,tabScrollTop:0,currentId:9,flist:[],height:"",currentIndex:0,list:[],page:1,limit:20,loadingType:"more",loaded:!1}},onLoad:function(){this.loadData()},onNavigationBarSearchInputClicked:function(e){t.navigateTo({url:"/pages/product/search"})},onReady:function(e){var n=this;t.getSystemInfo({success:function(e){var i=t.createSelectorQuery();i.select(".cate-wrap").boundingClientRect(),i.exec((function(t){n.height=e.windowHeight-t[0].top+"px",console.log("打印页面的剩余高度",n.height)}))},fail:function(t){}})},methods:{leftClick:function(t){this.currentIndex=t,this.getProducts("reload")},getProducts:function(t){var e=this,n=this.flist[this.currentIndex].id;"reload"==t&&(this.list=[],this.page=1,this.loadingType="more",this.loaded=!1),"loading"!=this.loadingType&&"noMore"!=this.loadingType&&(this.loadingType="loading",(0,c.getProducts)({cid:n}).then((function(t){e.list=e.list.concat(t.data),e.limit==t.data.length?e.loadingType="more":e.loadingType="noMore",e.loaded=!0})))},loadData:function(){var t=this;return(0,a.default)(o.default.mark((function e(){var n;return o.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:n=t,(0,c.getCategoryList)({}).then((function(t){var e=t.data;n.flist=e.map((function(t){return t})),n.getProducts()})).catch((function(t){console.log(t)}));case 2:case"end":return e.stop()}}),e)})))()},tabtap:function(t){console.log(t),this.sizeCalcState||this.calcSize(),this.currentId=t.id,console.log(t.top),this.tabScrollTop=t.top,console.log(this.tabScrollTop)},asideScroll:function(e){this.sizeCalcState||this.calcSize();var n=e.detail.scrollTop,i=0,o=t.createSelectorQuery().select(".content");o.fields({id:!0,dataset:!0,rect:!0,size:!0,scrollOffset:!0},(function(t){i=t.height})).exec();var a=this.flist.filter((function(t){return t.top-10<=n})).reverse();a.length>0&&(i+n+10>=e.detail.scrollHeight?this.currentId=this.flist[this.flist.length-1].id:this.currentId=a[0].id)},calcSize:function(){var e=0;this.flist.forEach((function(n){var i=t.createSelectorQuery().select("#main-"+n.id);i.fields({size:!0},(function(t){n.top=e,e+=t.height,n.bottom=e})).exec()})),this.sizeCalcState=!0},navToList:function(e,n){t.navigateTo({url:"/pages/product/list?fid="+this.currentId+"&sid="+e+"&tid="+n})},navto:function(e){t.navigateTo({url:e})}}};e.default=r}).call(this,n("543d")["default"])},"0e2d":function(t,e,n){"use strict";(function(t,e){var i=n("4ea4");n("ab68");i(n("66fd"));var o=i(n("5bf8"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(o.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},"1c4a":function(t,e,n){"use strict";n.r(e);var i=n("031e"),o=n.n(i);for(var a in i)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(a);e["default"]=o.a},"24be":function(t,e,n){"use strict";var i=n("b4ff"),o=n.n(i);o.a},"3ee9":function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return i}));var i={uniLoadMore:function(){return n.e("components/uni-load-more/uni-load-more").then(n.bind(null,"07b4"))}},o=function(){var t=this.$createElement;this._self._c},a=[]},"5bf8":function(t,e,n){"use strict";n.r(e);var i=n("3ee9"),o=n("1c4a");for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);n("24be");var c=n("f0c5"),r=Object(c["a"])(o["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);e["default"]=r.exports},b4ff:function(t,e,n){}},[["0e2d","common/runtime","common/vendor"]]]);