(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/product/list"],{146:function(e,t,n){"use strict";(function(e){var t=n(3);n(25);t(n(24));var o=t(n(147));wx.__webpack_require_UNI_MP_PLUGIN__=n,e(o.default)}).call(this,n(1)["createPage"])},147:function(e,t,n){"use strict";n.r(t);var o=n(148),r=n(150);for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i);n(152);var a,s=n(39),c=Object(s["default"])(r["default"],o["render"],o["staticRenderFns"],!1,null,null,null,!1,o["components"],a);c.options.__file="pages/product/list.vue",t["default"]=c.exports},148:function(e,t,n){"use strict";n.r(t);var o=n(149);n.d(t,"render",(function(){return o["render"]})),n.d(t,"staticRenderFns",(function(){return o["staticRenderFns"]})),n.d(t,"recyclableRender",(function(){return o["recyclableRender"]})),n.d(t,"components",(function(){return o["components"]}))},149:function(e,t,n){"use strict";var o;n.r(t),n.d(t,"render",(function(){return r})),n.d(t,"staticRenderFns",(function(){return a})),n.d(t,"recyclableRender",(function(){return i})),n.d(t,"components",(function(){return o}));try{o={uniLoadMore:function(){return n.e("components/uni-load-more/uni-load-more").then(n.bind(null,322))}}}catch(s){if(-1===s.message.indexOf("Cannot find module")||-1===s.message.indexOf(".vue"))throw s;console.error(s.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范，文档：https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范，需手动引入，并在 components 中注册该组件")}var r=function(){var e=this,t=e.$createElement;e._self._c},i=!1,a=[];r._withStripped=!0},150:function(e,t,n){"use strict";n.r(t);var o=n(151),r=n.n(o);for(var i in o)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i);t["default"]=r.a},151:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(52),r=function(){n.e("components/uni-load-more/uni-load-more").then(function(){return resolve(n(322))}.bind(null,n)).catch(n.oe)},i={components:{uniLoadMore:r},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:async function(e,t){var n=this;(0,o.getCategoryList)({}).then((function(t){console.log(t),t.data.forEach((function(t){t.id!=e||(n.cateList=t.children)})),console.log(n.cateList)}))},loadData:async function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"add",n=arguments.length>1?arguments[1]:void 0,r=this,i={page:r.page,limit:r.limit,sid:r.cateId};if("add"===t){if("nomore"===r.loadingType)return;r.loadingType="loading"}else r.loadingType="more";"refresh"===t&&(r.goodsList=[],r.page=1),1==this.filterIndex&&(console.log(r.salesOrder),i.salesOrder=1==r.numberOrder?"asc":"desc"),2==this.filterIndex&&(console.log(r.priceOrder),i.priceOrder=1==r.priceOrder?"asc":"desc"),(0,o.getProducts)(i).then((function(o){console.log(o.data),r.goodsList=r.goodsList.concat(o.data),r.limit==o.data.length?(r.page++,r.loadingType="more"):r.loadingType="nomore","refresh"===t&&(1==n?e.hideLoading():e.stopPullDownRefresh())}))},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=i}).call(this,n(1)["default"])},152:function(e,t,n){"use strict";n.r(t);var o=n(153),r=n.n(o);for(var i in o)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i);t["default"]=r.a},153:function(e,t,n){}},[[146,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/product/list.js.map