cate-two.js 5.1 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/cate-two/cate-two"],{"020c":function(e,t,n){"use strict";n.r(t);var o=n("c1fc"),r=n("115a");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i);n("39c3");var a=n("f0c5"),s=Object(a["a"])(r["default"],o["b"],o["c"],!1,null,"4eff92e2",null,!1,o["a"],void 0);t["default"]=s.exports},"115a":function(e,t,n){"use strict";n.r(t);var o=n("be2e"),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},"39c3":function(e,t,n){"use strict";var o=n("6b62"),r=n.n(o);r.a},"6b62":function(e,t,n){},be2e:function(e,t,n){"use strict";var o=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n("2eee")),i=o(n("9523")),a=o(n("448a")),s=o(n("c973")),c=n("de38"),u=n("26cb"),f=n("da04");function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var p={name:"cate-two",props:{cateList:{type:Array,default:function(){return[]}}},data:function(){return{selectIndex:0,cateTwoList:[],goodsList:[],sortConfig:{goodsType:"double",priceSort:"",saleSort:""},status:f.loadingType.LOADING,hasData:!0}},methods:{changeActive:function(e){this.selectIndex=e},getListByLevelOneFun:function(){var e=this;return(0,s.default)(r.default.mark((function t(){var n,o,i,a,s,u;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.selectIndex,o=e.cateList,o.length){t.next=3;break}return t.abrupt("return");case 3:return i=o[n].id,t.next=6,(0,c.getListByLevelOne)({id:i});case 6:a=t.sent,s=a.code,u=a.data,1==s&&(e.cateTwoList=u);case 10:case"end":return t.stop()}}),t)})))()},getGoodsListFun:function(){var e=this,t=this.page,n=this.cateList,o=this.status,r=this.selectIndex,i=this.goodsList,s=this.sortConfig,u=s.priceSort,l=s.saleSort;if(n.length){var p=n[r].id;if(o!=f.loadingType.FINISHED&&4!=this.appConfig.cate_style){var d={};d=40!=p?{page_no:t,platform_cate_id:p,sort_by_price:u,sort_by_sales:l}:{page_no:t,sort_by_price:u,sort_by_sales:l,use_energy:1},console.log(d),(0,c.getGoodsList)(d).then((function(t){if(1==t.code){var n=t.data,o=n.more,r=n.lists;if(i.push.apply(i,(0,a.default)(r)),e.page++,o||(e.status=f.loadingType.FINISHED),i.length<=0)return void(e.status=f.loadingType.EMPTY)}else e.status=f.loadingType.ERROR}))}}},onRefresh:function(){this.status=f.loadingType.LOADING,this.page=1,this.goodsList=[],this.getGoodsListFun()}},watch:{selectIndex:function(){1==this.appConfig.cate_style?this.onRefresh():this.getListByLevelOneFun()},cateList:{immediate:!0,handler:function(e){this.hasData=!!e.length,1==this.appConfig.cate_style?this.onRefresh():this.getListByLevelOneFun()}},"sortConfig.saleSort":function(){this.onRefresh()},"sortConfig.priceSort":function(){this.onRefresh()}},computed:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},(0,u.mapGetters)(["appConfig"]))};t.default=p},c1fc:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o}));var o={adSwipers:function(){return n.e("components/ad-swipers/ad-swipers").then(n.bind(null,"bdd0"))},uIcon:function(){return n.e("components/uview-ui/components/u-icon/u-icon").then(n.bind(null,"9a0e"))},uImage:function(){return n.e("components/uview-ui/components/u-image/u-image").then(n.bind(null,"2a31"))},sortNav:function(){return n.e("components/sort-nav/sort-nav").then(n.bind(null,"9426"))},priceFormat:function(){return n.e("components/price-format/price-format").then(n.bind(null,"87ff"))},loadingFooter:function(){return n.e("components/loading-footer/loading-footer").then(n.bind(null,"129a"))}},r=function(){var e=this,t=e.$createElement,n=(e._self._c,4==e.appConfig.cate_style?e.__map(e.cateTwoList,(function(t,n){var o=e.__get_orig(t),r={path:"/pages/goods_search/goods_search",query:{id:t.id,name:t.name,type:1}},i=e.__map(t.children,(function(t,n){var o=e.__get_orig(t),r={path:"/pages/goods_search/goods_search",query:{id:t.id,name:t.name,type:1}};return{$orig:o,a1:r}}));return{$orig:o,a0:r,l0:i}})):null),o=1==e.appConfig.cate_style&&e.hasData?e.__map(e.goodsList,(function(t,n){var o=e.__get_orig(t),r=(t.min_price*t.use_energy/100/e.appConfig.energyprice).toFixed(6),i=(t.min_price*t.use_energy/100).toFixed(2);return{$orig:o,g0:r,g1:i}})):null;e.$mp.data=Object.assign({},{$root:{l1:n,l2:o}})},i=[]}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'components/cate-two/cate-two-create-component',
  4. {
  5. 'components/cate-two/cate-two-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('543d')['createComponent'](__webpack_require__("020c"))
  7. })
  8. },
  9. [['components/cate-two/cate-two-create-component']]
  10. ]);