index.js 4.8 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/pt/index/index"],{"018c":function(t,e,n){"use strict";var a;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return a}));var i=function(){var t=this,e=t.$createElement;t._self._c},r=[]},"0f9a":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=r(n("a34a")),i=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 a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}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,a,i,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(a,i)}function p(t){return function(){var e=this,n=arguments;return new Promise((function(a,i){var r=t.apply(e,n);function o(t){s(r,a,i,o,c,"next",t)}function c(t){s(r,a,i,o,c,"throw",t)}o(void 0)}))}}var l=function(){n.e("components/page-component/app-image-ad/app-image-ad").then(function(){return resolve(n("cbad"))}.bind(null,n)).catch(n.oe)},d=function(){n.e("plugins/pt/components/app-product-list").then(function(){return resolve(n("d8c8"))}.bind(null,n)).catch(n.oe)},f=function(){n.e("components/page-component/app-quick-navigation/app-quick-navigation").then(function(){return resolve(n("d475"))}.bind(null,n)).catch(n.oe)},h=function(){n.e("components/page-component/app-swiper/app-swiper").then(function(){return resolve(n("b886"))}.bind(null,n)).catch(n.oe)},g={name:"index",data:function(){return{banners:[],setting:{},nav_list:[],page:1,page_count:1,goods_list:[],cat_id:0,imageStyle:0}},onLoad:function(t){this.$commonLoad.onload(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 p(a.default.mark((function n(){return a.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 p(a.default.mark((function n(){var i,r,o,c;return a.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:i=n.sent,0===i.code&&(r=i.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,a=[],i=0,r=n.list.length;i<r;i++){var o=n.list[i];o.link={value:o.link_url,open_type:o.open_type},a.push(o)}t.setting.advertisement.list=a,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,i.mapGetters)("mallConfig",{getTheme:"getTheme"})),components:{"app-image-ad":l,"app-product-list":d,"app-quick-navigation":f,appSwiper:h},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=g},3469:function(t,e,n){},"3a1c":function(t,e,n){"use strict";n.r(e);var a=n("0f9a"),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,(function(){return a[t]}))}(r);e["default"]=i.a},"7c89":function(t,e,n){"use strict";(function(t){n("2d0a");a(n("66fd"));var e=a(n("a0ca"));function a(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},a0ca:function(t,e,n){"use strict";n.r(e);var a=n("018c"),i=n("3a1c");for(var r in i)"default"!==r&&function(t){n.d(e,t,(function(){return i[t]}))}(r);n("aed3");var o,c=n("f0c5"),u=Object(c["a"])(i["default"],a["b"],a["c"],!1,null,"b35b6a8e",null,!1,a["a"],o);e["default"]=u.exports},aed3:function(t,e,n){"use strict";var a=n("3469"),i=n.n(a);i.a}},[["7c89","common/runtime","common/vendor"]]]);