1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/flash_sale/index/index"],{"164a":function(t,e,n){"use strict";(function(t){n("2d0a");i(n("66fd"));var e=i(n("8c10"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},"177c":function(t,e,n){"use strict";n.r(e);var i=n("2671"),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},2671:function(t,e,n){"use strict";(function(t){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 s(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){c(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 c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t){return h(t)||p(t)||f(t)||l()}function l(){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 f(t,e){if(t){if("string"===typeof t)return g(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)?g(t,e):void 0}}function p(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function h(t){if(Array.isArray(t))return g(t)}function g(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,a,r,o){try{var s=t[r](o),c=s.value}catch(u){return void n(u)}s.done?e(c):Promise.resolve(c).then(i,a)}function m(t){return function(){var e=this,n=arguments;return new Promise((function(i,a){var r=t.apply(e,n);function o(t){d(r,i,a,o,s,"next",t)}function s(t){d(r,i,a,o,s,"throw",t)}o(void 0)}))}}var _=function(){n.e("components/page-component/app-no-goods/app-no-goods").then(function(){return resolve(n("5cd3"))}.bind(null,n)).catch(n.oe)},v=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/goods/u-attr")]).then(function(){return resolve(n("338d"))}.bind(null,n)).catch(n.oe)},y={name:"index",data:function(){return{is_switch:!0,page:1,type:1,activity:{},timing:null,time_str:{day:"00",hou:"00",min:"00",sec:"00"},list:[],page_count:1,detail:null,attr_groups:[],attrShow:0,selectAttr:{},switch_height:0,title:"暂无进行中活动",is_no_now:!1,going:!0,loading:!0,disable:"disable"}},methods:{getList:function(){var t=this;return m(i.default.mark((function e(){var n,a,r,o,s,c,l,f,p,h,g,d,m,_;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loading=!1,e.next=3,t.$request({url:t.$api.flash_sale.list,data:{type:t.type,page:t.page}});case 3:if(n=e.sent,0!==n.code){e.next=28;break}if(a=n.data,r=a.activity,o=a.list,s=a.next_activity,c=a.pagination,1!==t.type){e.next=25;break}if(t.activity=r,0!==Object.keys(r).length){e.next=20;break}return t.is_no_now=!0,t.type=2,e.next=13,t.$request({url:t.$api.flash_sale.list,data:{type:t.type,page:t.page}});case 13:f=e.sent,p=f.data,h=p.list,g=p.next_activity,d=p.pagination,t.activity=g,(l=t.list).push.apply(l,u(h)),t.page_count=d.page_count,e.next=23;break;case 20:t.is_no_now=!1,(m=t.list).push.apply(m,u(o)),t.page_count=c.page_count;case 23:e.next=28;break;case 25:t.activity=s,(_=t.list).push.apply(_,u(o)),t.page_count=c.page_count;case 28:t.loading=!0;case 29:case"end":return e.stop()}}),e)})))()},set_time: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),a=parseInt(e/1e3/60%60),r=parseInt(e/1e3%60);this.time_str.day=n<10?"0"+n:n,this.time_str.hou=i<10?"0"+i:i,this.time_str.min=a<10?"0"+a:a,this.time_str.sec=r<10?"0"+r:r},grab:function(e){var n=this;if(1===this.type){if(this.detail=null,0!==e.goods_stock){if(!e.buy_goods_auth)return void this.$tips.showToast({title:"该商品您暂无权限购买",icon:"none"});setTimeout((function(){n.selectAttr={},n.detail=e,n.attrShow=!0}))}}else t.navigateTo({url:"/plugins/flash_sale/goods/goods?id=".concat(e.id)})},onAttr:function(t){var e=t.item;this.selectAttr=e},routeDetail:function(e){t.navigateTo({url:"/plugins/flash_sale/goods/goods?id=".concat(e)})},goRule:function(){t.navigateTo({url:"/pages/rules/index?url=".concat(encodeURIComponent(this.$api.flash_sale.list),"&key=content")})},rightFunc:function(e){t.navigateTo({url:"/pages/order-submit/order-submit?mch_list=".concat(JSON.stringify([e]))})},leftFunc:function(e){this.$request({url:this.$api.flash_sale.add_cart,data:{flash_goods_id:this.selectAttr.goods_id,attr_id:this.selectAttr.id,num:e},method:"post"}).then((function(e){t.showToast({title:e.msg,type:"success"})}))}},mounted:function(){var t=this,e=wx.createSelectorQuery();this.$nextTick().then((function(){e.select(".f-switch").boundingClientRect((function(e){t.switch_height=e.height})).exec()})),wx.showShareMenu({menus:["shareAppMessage","shareTimeline"]})},onReachBottom:function(){this.page<this.page_count&&(this.page++,this.getList())},watch:{is_switch:{handler:function(t){var e=this;this.going&&(this.going=!1,this.list=[],this.page=1,t?(this.type=1,this.title="暂无进行中活动"):(this.type=2,this.title="暂无下一场活动"),this.getList().then((function(){if(1===e.type){var t=e.activity.end_at;t&&e.set_time(t)}else{var n=e.activity.start_at;n&&e.set_time(n)}e.going=!0})))},immediate:!0}},computed:s(s(s({},(0,a.mapGetters)("mallConfig",{getTheme:"getTheme"})),(0,a.mapState)("gConfig",{windowHeight:function(t){return t.systemInfo.windowHeight}})),(0,a.mapState)({appImg:function(t){return t.mallConfig.__wxapp_img.mall},appSetting:function(t){return t.mallConfig.mall.setting}})),components:{"app-no-goods":_,uAttr:v},onShareAppMessage:function(){return this.$shareAppMessage({path:"/plugins/flash_sale/index/index",title:this.$children[0].navigationBarTitle})},onShareTimeline:function(){return this.$shareTimeline({title:this.$children[0].navigationBarTitle})}};e.default=y}).call(this,n("543d")["default"])},"8c10":function(t,e,n){"use strict";n.r(e);var i=n("bf18"),a=n("177c");for(var r in a)"default"!==r&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("ff5b");var o,s=n("f0c5"),c=Object(s["a"])(a["default"],i["b"],i["c"],!1,null,"7e8bf280",null,!1,i["a"],o);e["default"]=c.exports},bf18: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,n=(t._self._c,Object.keys(t.activity)),i=t.list.length>0?t.__map(t.list,(function(e,n){var i=t.__get_orig(e),a=1===e.discount_type?Number(e.min_discount):null;return{$orig:i,m0:a}})):null,a=Object.keys(t.activity);t._isMounted||(t.e0=function(e){t.is_switch=!0},t.e1=function(e){t.is_switch=!1}),t.$mp.data=Object.assign({},{$root:{g0:n,l0:i,g1:a}})},r=[]},e905:function(t,e,n){},ff5b:function(t,e,n){"use strict";var i=n("e905"),a=n.n(i);a.a}},[["164a","common/runtime","common/vendor"]]]);
|