(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/pt/index/index"],{"137d":function(t,e,n){},"53c8":function(t,e,n){"use strict";(function(t){n("b8bc");i(n("66fd"));var e=i(n("b603"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},"81c1":function(t,e,n){"use strict";var i=n("137d"),a=n.n(i);a.a},"9ab1":function(t,e,n){"use strict";n.r(e);var i=n("eb96"),a=n.n(i);for(var r in i)"default"!==r&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},b603:function(t,e,n){"use strict";n.r(e);var i=n("fa75"),a=n("9ab1");for(var r in a)"default"!==r&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("81c1");var o,c=n("f0c5"),u=Object(c["a"])(a["default"],i["b"],i["c"],!1,null,"c8df0462",null,!1,i["a"],o);e["default"]=u.exports},eb96:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n("a34a")),a=n("2f62");function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e,n,i,a,r,o){try{var c=t[r](o),u=c.value}catch(s){return void n(s)}c.done?e(u):Promise.resolve(u).then(i,a)}function l(t){return function(){var e=this,n=arguments;return new Promise((function(i,a){var r=t.apply(e,n);function o(t){s(r,i,a,o,c,"next",t)}function c(t){s(r,i,a,o,c,"throw",t)}o(void 0)}))}}var p=function(){n.e("components/page-component/app-image-ad/app-image-ad").then(function(){return resolve(n("c879"))}.bind(null,n)).catch(n.oe)},f=function(){n.e("plugins/pt/components/app-product-list").then(function(){return resolve(n("c508"))}.bind(null,n)).catch(n.oe)},d=function(){n.e("components/page-component/app-quick-navigation/app-quick-navigation").then(function(){return resolve(n("36d8"))}.bind(null,n)).catch(n.oe)},h={name:"index",data:function(){return{banners:[],setting:{},nav_list:[],page:1,page_count:1,goods_list:[],cat_id:0,imageStyle:0}},onLoad:function(t){wx.showShareMenu({menus:["shareAppMessage","shareTimeline"]}),t.cat_id&&(this.cat_id=t.cat_id),this.requestSetting(),this.requestCats(t.cat_id)},onReachBottom:function(){this.page<this.page_count&&(this.page++,this.requestList(1))},methods:{changeStatus:function(t){var e=this;return l(i.default.mark((function n(){return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:e.cat_id=t,e.page=1,e.goods_list=[],e.requestList(0);case 4:case"end":return n.stop()}}),n)})))()},requestList:function(t){var e=this;return l(i.default.mark((function n(){var a,r,o,c;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,e.$request({url:e.$api.pt.goods,data:{page:e.page,cat_id:e.cat_id}});case 2:a=n.sent,0===a.code&&(r=a.data,o=r.pagination,c=r.list,e.goods_list=1===t?e.goods_list.concat(c):c,e.page_count=o.page_count);case 4:case"end":return n.stop()}}),n)})))()},requestSetting:function(){var t=this;this.$request({url:this.$api.pt.index}).then((function(e){if(0===e.code){t.banners=e.data.banners,t.setting=e.data.setting;for(var n=e.data.setting.advertisement,i=[],a=0,r=n.list.length;a<r;a++){var o=n.list[a];o.link={value:o.link_url,open_type:o.open_type},i.push(o)}t.setting.advertisement.list=i,t.imageStyle=Number(n.style)}}))},requestCats:function(t){var e=this;this.$request({url:this.$api.pt.cats}).then((function(n){0===n.code&&(e.nav_list=e.nav_list.concat(n.data.list),!t&&(e.cat_id=e.nav_list[0].id),e.requestList(0))}))}},computed:c({},(0,a.mapState)({themeObject:function(t){var e=t.mallConfig.mall.setting.theme_color;return{back:e+"-m-back "+e,theme:e,color:e+"-m-text "+e,sBack:e+"-s-back "+e}}})),components:{"app-image-ad":p,"app-product-list":f,"app-quick-navigation":d},onShareAppMessage:function(){return this.$shareAppMessage({path:"/plugins/pt/index/index",title:this.$children[0].navigationBarTitle})},onShareTimeline:function(){return this.$shareTimeline({title:this.$children[0].navigationBarTitle,query:{}})}};e.default=h},fa75:function(t,e,n){"use strict";var i;n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i}));var a=function(){var t=this,e=t.$createElement;t._self._c},r=[]}},[["53c8","common/runtime","common/vendor"]]]);