webpackJsonp([50],{"64qr":function(t,e){},GGjq:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i("woOf"),s=i.n(r),n=i("Dd8w"),a=i.n(n),o=i("c+FZ"),c=i("UgCr"),u=i("NYxO"),m={data:function(){return{loading:!1,isMore:!0,params:{page:0,per_page:10},promotionsList:{},products:[],flag:!1,day:"",hours:"",minute:"",second:"",time:""}},components:{"v-promotions-list":i("G/zf").a},created:function(){var t=this;this.$on("get-cart-quantity",function(){t.getCarNumber()})},computed:a()({},Object(u.e)({user:function(t){return t.auth.user},cartNumber:function(t){return t.tabBar.cartNumber}}),{getCarCount:function(){return this.cartNumber>0&&this.cartNumber<100?this.cartNumber:this.cartNumber>=100?"99+":void 0}}),mounted:function(){var t=this;this.$nextTick(function(){t.target=document.querySelector(".ui-recommend-body");var e=t.target;t.utils.fillTheScreen({target:e,totalHeight:90})}),this.time=setInterval(function(){1==t.flag?clearInterval(time):t.timeDown()},1e3)},methods:a()({},Object(u.d)({setCartNumber:"setCartNumber"}),{getCarNumber:function(){var t=this;Object(o.f)().then(function(e){e&&t.setCartNumber(e.quantity)})},goBack:function(){this.$router.go(-1)},getMore:function(){this.loading=!0,this.params.page=++this.params.page,this.isMore&&(this.loading=!1,this.getPromotionsList())},goCart:function(){this.user?this.$router.push({name:"cart",params:{type:0}}):this.$router.push({name:"signin"})},getPromotionsList:function(){var t=this,e=s()({},this.params,this.$route.query);Object(c.e)(e.id,e.page,e.per_page).then(function(e){e&&(t.promotionsList=s()({},e),t.products=t.products.concat(e.products),t.isMore=e.paged.more)})},timeDown:function(){if(this.promotionsList){var t=new Date(1e3*this.promotionsList.end_at),e=new Date,i=parseInt((t.getTime()-e.getTime())/1e3);this.day=i?parseInt(i/86400):"",this.hours=i?this.formate(parseInt(i/3600%24)):"",this.minute=i?this.formate(parseInt(i/60%60)):"",this.second=i?this.formate(parseInt(i%60)):"",i<=0&&(this.flag=!0,this.$emit("time-end"))}},formate:function(t){return t>=10?t:"0"+t}})},d={render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"promotions-list-wrapper recommend-wrapper"},[r("div",{staticClass:"ui-commmon-header"},[r("img",{staticClass:"ui-go-back",attrs:{src:i("Vbkh")},on:{click:function(e){t.goBack()}}}),t._v(" "),r("h3",[t._v(t._s(t.promotionsList.title))]),t._v(" "),r("img",{staticClass:"ui-cart",attrs:{src:i("6B49")},on:{click:function(e){t.goCart()}}}),t._v(" "),t.cartNumber>0?r("span",{staticClass:"cart-number"},[t._v(t._s(t.getCarCount))]):t._e()]),t._v(" "),r("div",{staticClass:"time-body"},[r("span",{staticClass:"title"},[t._v("距离活动结束时间")]),t._v(" "),r("div",[r("span",[t._v(t._s(t.day))]),t._v(" 天 "),r("span",[t._v(t._s(t.hours))]),t._v(" 时 "),r("span",[t._v(t._s(t.minute))]),t._v(" 分 "),r("span",[t._v(t._s(t.second))]),t._v(" 秒\n\t\t")])]),t._v(" "),r("div",{directives:[{name:"infinite-scroll",rawName:"v-infinite-scroll",value:t.getMore,expression:"getMore"}],staticClass:"ui-recommend-body",attrs:{"infinite-scroll-disabled":"loading","infinite-scroll-distance":"10"}},[t._l(t.products,function(t,e){return r("v-promotions-list",{key:e,attrs:{item:t,productId:t.id}})}),t._v(" "),t.isMore?t._e():r("p",{staticClass:"recommend-no-more"},[t._v("没有更多了")])],2)])},staticRenderFns:[]};var p=i("VU/8")(m,d,!1,function(t){i("64qr")},"data-v-b64bc5a4",null);e.default=p.exports}});
//# sourceMappingURL=50.8fbec978271da6e8bc4c.js.map