1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/full_reduce/index/index"],{"63cc":function(t,e,n){"use strict";n.r(e);var i=n("dcd7"),r=n("9021");for(var a in r)"default"!==a&&function(t){n.d(e,t,(function(){return r[t]}))}(a);n("ce75");var o,c=n("f0c5"),u=Object(c["a"])(r["default"],i["b"],i["c"],!1,null,"cb575322",null,!1,i["a"],o);e["default"]=u.exports},"85b0":function(t,e,n){"use strict";(function(t){n("2d0a");i(n("66fd"));var e=i(n("63cc"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},9021:function(t,e,n){"use strict";n.r(e);var i=n("fb7f"),r=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);e["default"]=r.a},ce75:function(t,e,n){"use strict";var i=n("f89a"),r=n.n(i);r.a},dcd7:function(t,e,n){"use strict";var i;n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return i}));var r=function(){var t=this,e=t.$createElement;t._self._c},a=[]},f89a:function(t,e,n){},fb7f:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=a(n("a34a")),r=n("2f62");function a(t){return t&&t.__esModule?t:{default:t}}function o(t){return l(t)||s(t)||u(t)||c()}function c(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t,e){if(t){if("string"===typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(t,e):void 0}}function s(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function l(t){if(Array.isArray(t))return f(t)}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function d(t,e,n,i,r,a,o){try{var c=t[a](o),u=c.value}catch(s){return void n(s)}c.done?e(u):Promise.resolve(u).then(i,r)}function p(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var a=t.apply(e,n);function o(t){d(a,i,r,o,c,"next",t)}function c(t){d(a,i,r,o,c,"throw",t)}o(void 0)}))}}function h(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 g(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){m(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var v=function(){n.e("pages/full_reduce/u-waterfall").then(function(){return resolve(n("9c26"))}.bind(null,n)).catch(n.oe)},b=function(){n.e("components/page-component/app-diy-goods-list/app-diy-goods-list").then(function(){return resolve(n("b898"))}.bind(null,n)).catch(n.oe)},y=function(){n.e("components/page-component/app-no-goods/app-no-goods").then(function(){return resolve(n("5cd3"))}.bind(null,n)).catch(n.oe)},_=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/app-attr/app-attr")]).then(function(){return resolve(n("8b0c"))}.bind(null,n)).catch(n.oe)},w={name:"index",data:function(){return{flowList:[],page:1,page_count:1,rule_type:1,rule:null,cats:[],cat_id:null,time_str:{day:"00",hou:"00",min:"00"},timing:null,is_fixed:!1,style_switch:!1,loading:!1,hasActivity:!0,activityLoading:!1,is_no_scroll:!0,goods:{},attrShow:0,no_active:!1,bottomLoading:!1}},computed:g(g({},(0,r.mapGetters)("mallConfig",{getTheme:"getTheme"})),(0,r.mapState)("gConfig",{windowWidth:function(t){return t.systemInfo.windowWidth}})),methods:{getListData:function(t){var e=this;return p(i.default.mark((function n(){var r,a,c,u;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.loading=!0,n.next=3,e.$request({url:e.$api.full_reduce.list,data:{page:e.page,cat_id:e.cat_id}});case 3:r=n.sent,e.loading=!1,0===r.code&&(e.no_active=!1,a=r.data.list,!0===t?(c=e.flowList).push.apply(c,o(a)):e.flowList=a,e.page_count=r.data.pagination.page_count,u=e.page,u++===e.page_count&&(e.bottomLoading=!1));case 6:case"end":return n.stop()}}),n)})))()},getIndex:function(){var t=this;return p(i.default.mark((function e(){var n;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$request({url:t.$api.full_reduce.index});case 2:n=e.sent,t.activityLoading=!0,0===n.code&&(t.$validation.empty(n.data)?t.hasActivity=!1:(t.rule=n.data.rule,t.rule_type=n.data.rule_type,t.$validation.date(n.data.time)&&t.getTiming(n.data.time)));case 5:case"end":return e.stop()}}),e)})))()},getCats:function(){var t=this;return p(i.default.mark((function e(){var n;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$request({url:t.$api.default.cat_list});case 2:n=e.sent,0===n.code&&(t.cats=n.data.list,t.cat_id=t.cats[0].id);case 4:case"end":return e.stop()}}),e)})))()},active:function(e){this.bottomLoading=!1,this.no_active||(this.no_active=!0,this.cats.forEach((function(t){t.active=!1})),e.active=!0,this.page=1,this.cat_id=e.id,this.flowList=[],this.style_switch&&this.$refs.waterFall.emptyList(),t.pageScrollTo({scrollTop:0,duration:500}),this.getListData())},getTiming:function(t){var e=this;clearInterval(this.timing);var n=new Date(t.replace(/-/g,"/"));this.now_time(n),this.timing=setInterval((function(){e.now_time(n)}),1e3)},now_time:function(t){var e=t.getTime()-(new Date).getTime();e<0&&clearInterval(this.timing);var n=parseInt(e/1e3/60/60/24),i=parseInt(e/1e3/60/60%24),r=parseInt(e/1e3/60%60);this.time_str.day=n<10?"0"+n:n,this.time_str.hou=i<10?"0"+i:i,this.time_str.min=r<10?"0"+r:r},goRouter:function(){t.navigateTo({url:"/pages/rules/index?url=".concat(encodeURIComponent(this.$api.full_reduce.index),"&key=content")})},routeGood:function(e){t.navigateTo({url:e.page_url})},search:function(){t.navigateTo({url:"/pages/full_reduce/search/search"})},setSwitch:function(){this.style_switch=!this.style_switch},buyProduct:function(t){this.goods=t,this.attrShow=Math.random()}},onReachBottom:function(){this.page<this.page_count&&(this.page++,this.bottomLoading=!0,this.getListData(!0))},mounted:function(){var t=this;this.getIndex().then((function(){t.getCats().then((function(){t.getListData()}))}))},components:{uWaterFall:v,appDiyGoodsList:b,appNoGoods:y,appAttr:_},onHide:function(){clearInterval(this.timing)},onUnload:function(){clearInterval(this.timing)}};e.default=w}).call(this,n("543d")["default"])}},[["85b0","common/runtime","common/vendor"]]]);
|