glhcp/server/public/_nuxt/b1dd136.js

1 line
8.2 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[14,9,18],{488:function(t,e,n){var content=n(491);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(18).default)("d7ac674a",content,!0,{sourceMap:!1})},489:function(t,e,n){"use strict";n.r(e);n(300);var o={data:function(){return{priceSlice:{}}},components:{},props:{firstSize:{type:Number,default:14},secondSize:{type:Number,default:14},color:{type:String},weight:{type:[String,Number],default:400},price:{type:[String,Number],default:""},showSubscript:{type:Boolean,default:!0},subscriptSize:{type:Number,default:14},lineThrough:{type:Boolean,default:!1}},created:function(){this.priceFormat()},watch:{price:function(t){this.priceFormat()}},methods:{priceFormat:function(){var t=this.price,e={};null!==t&&(t=String(t).split("."),e.first=t[0],e.second=t[1],this.priceSlice=e)}}},r=(n(490),n(9)),component=Object(r.a)(o,(function(){var t=this,e=t._self._c;return e("span",{class:(t.lineThrough?"line-through":"")+"price-format",style:{color:t.color,"font-weight":t.weight}},[t.showSubscript?e("span",{style:{"font-size":t.subscriptSize+"px","margin-right":"1px"}},[t._v("¥")]):t._e(),t._v(" "),e("span",{style:{"font-size":t.firstSize+"px","margin-right":"1px"}},[t._v(t._s(t.priceSlice.first))]),t._v(" "),t.priceSlice.second?e("span",{style:{"font-size":t.secondSize+"px"}},[t._v("."+t._s(t.priceSlice.second))]):t._e()])}),[],!1,null,null,null);e.default=component.exports},490:function(t,e,n){"use strict";n(488)},491:function(t,e,n){var o=n(17)((function(i){return i[1]}));o.push([t.i,".price-format{align-items:baseline;display:flex}",""]),o.locals={},t.exports=o},496:function(t,e,n){"use strict";n.r(e);n(300),n(87),n(63),n(12),n(47),n(39),n(88);var o=6e4,r=36e5,l=24*r;function c(t){return(0+t.toString()).slice(-2)}var d={components:{},props:{isSlot:{type:Boolean,default:!1},time:{type:Number,default:0},format:{type:String,default:"hh:mm:ss"},autoStart:{type:Boolean,default:!0}},watch:{time:{immediate:!0,handler:function(t){t&&this.reset()}}},data:function(){return{timeObj:{},formateTime:0}},created:function(){},computed:{},methods:{createTimer:function(t){return setTimeout(t,100)},isSameSecond:function(t,e){return Math.floor(t)===Math.floor(e)},start:function(){this.counting||(this.counting=!0,this.endTime=Date.now()+1e3*this.remain,this.setTimer())},setTimer:function(){var t=this;this.tid=this.createTimer((function(){var e=t.getRemain();t.isSameSecond(e,t.remain)&&0!==e||t.setRemain(e),0!==t.remain&&t.setTimer()}))},getRemain:function(){return Math.max(this.endTime-Date.now(),0)},pause:function(){this.counting=!1,clearTimeout(this.tid)},reset:function(){this.pause(),this.remain=this.time,this.setRemain(this.remain),this.autoStart&&this.start()},setRemain:function(t){var e=this.format;this.remain=t;var time,n=(time=t,{days:Math.floor(time/l),hours:c(Math.floor(time%l/r)),minutes:c(Math.floor(time%r/o)),seconds:c(Math.floor(time%o/1e3))});this.formateTime=function(t,e){var n=e.days,o=e.hours,r=e.minutes,l=e.seconds;return-1!==t.indexOf("dd")&&(t=t.replace("dd",n)),-1!==t.indexOf("hh")&&(t=t.replace("hh",c(o))),-1!==t.indexOf("mm")&&(t=t.replace("mm",c(r))),-1!==t.indexOf("ss")&&(t=t.replace("ss",c(l))),t}(e,n),this.$emit("change",n),0===t&&(this.pause(),this.$emit("finish"))}}},f=n(9),component=Object(f.a)(d,(function(){var t=this,e=t._self._c;return t.time>=0?e("div",[e("client-only",[t.isSlot?t._t("default"):e("span",[t._v(t._s(t.formateTime))])],2)],1):t._e()}),[],!1,null,null,null);e.default=component.exports},516:function(t,e,n){"use strict";var o=n(2),r=n(110).findIndex,l=n(194),c="findIndex",d=!0;c in[]&&Array(1)[c]((function(){d=!1})),o({target:"Array",proto:!0,forced:d},{findIndex:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),l(c)},541:function(t,e,n){var content=n(560);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(18).default)("7a59a7e0",content,!0,{sourceMap:!1})},559:function(t,e,n){"use strict";n(541)},560:function(t,e,n){var o=n(17)((function(i){return i[1]}));o.push([t.i,".seckill .seckill-header .count-down .item[data-v-784969e4]{background:#ff2c3c;border-radius:4px;height:20px;line-height:20px;text-align:center;width:38px}.seckill[data-v-784969e4] .el-carousel__indicator .el-carousel__button{background-color:#e5e5e5}.seckill[data-v-784969e4] .el-carousel__indicator.is-active .el-carousel__button{background-color:#ff2c3c}.seckill .goods-list .goods-item[data-v-784969e4]{width:216px}.seckill .goods-list .goods-item~.goods-item[data-v-784969e4]{margin-left:16px}.seckill .goods-list .goods-item .goods-img[data-v-784969e4]{height:0;padding-top:100%;position:relative;width:100%}.seckill .goods-list .goods-item .goods-img[data-v-784969e4] .el-image{height:100%;left:0;position:absolute;top:0;width:100%}.seckill .goods-list .goods-item .name[data-v-784969e4]{height:40px;line-height:20px}",""]),o.locals={},t.exports=o},565:function(t,e,n){"use strict";n.r(e);n(63),n(516);var o={components:{},props:{list:{type:Array,default:function(){return[]}}},data:function(){return{active:-1,goodsList:[],countTime:0,timeData:{},pageSize:5}},methods:{refresh:function(){this.$emit("refreshhome")},onChangeDate:function(t){var e={};for(var n in t)"milliseconds"!==n&&(e[n]=("0"+t[n]).slice(-2));this.timeData=e}},watch:{list:{handler:function(t){var e=t.findIndex((function(t){return 1==t.status}));-1==e&&(e=t.findIndex((function(t){return 0==t.status}))),-1==e&&(e=t.length-1),this.active=e,this.goodsList=t[e].goods,this.countTime=t[e].end_time_int-Date.now()/1e3},immediate:!0}},computed:{swiperSize:function(){return console.log(Math.ceil(this.goodsList.length/this.pageSize)),Math.ceil(this.goodsList.length/this.pageSize)},getSwiperList:function(){var t=this;return function(e){return t.goodsList.slice(e*t.pageSize,(e+1)*t.pageSize)}}}},r=(n(559),n(9)),component=Object(r.a)(o,(function(){var t=this,e=t._self._c;return t.goodsList.length?e("div",{staticClass:"seckill card"},[e("div",{staticClass:"seckill-header flex"},[e("div",{staticClass:"title font-size-20"},[t._v("限时秒杀")]),t._v(" "),e("div",{staticClass:"flex-1 flex"},[e("i",{staticClass:"el-icon-alarm-clock primary font-size-24 m-l-20 m-r-10"}),t._v(" "),e("count-down",{attrs:{time:t.countTime,"is-slot":!0},on:{change:t.onChangeDate,finish:t.refresh}},[e("div",{staticClass:"flex row-center count-down xs"},[e("div",{staticClass:"item white"},[t._v(t._s(t.timeData.hours)+"时")]),t._v(" "),e("div",{staticClass:"white",staticStyle:{margin:"0 4px"}},[t._v(":")]),t._v(" "),e("div",{staticClass:"item white"},[t._v(t._s(t.timeData.minutes)+"分")]),t._v(" "),e("div",{staticClass:"white",staticStyle:{margin:"0 4px"}},[t._v(":")]),t._v(" "),e("div",{staticClass:"item white"},[t._v(t._s(t.timeData.seconds)+"秒")])])])],1),t._v(" "),e("nuxt-link",{staticClass:"more lighter",attrs:{to:"/seckill"}},[t._v("更多 "),e("i",{staticClass:"el-icon-arrow-right"})])],1),t._v(" "),e("div",{staticClass:"seckill-list m-t-16"},[e("el-carousel",{attrs:{interval:3e3,arrow:"never",height:"320px","indicator-position":"outside"}},t._l(t.swiperSize,(function(n,o){return e("el-carousel-item",{key:o},[e("div",{staticClass:"goods-list flex"},t._l(t.getSwiperList(o),(function(n,o){return e("nuxt-link",{key:o,staticClass:"goods-item",attrs:{to:"/goods_details/".concat(n.goods_id)}},[e("div",{staticClass:"goods-img"},[e("el-image",{attrs:{src:n.goods_image,fit:"cover",alt:""}})],1),t._v(" "),e("div",{staticClass:"name line-2 m-t-10"},[t._v("\n "+t._s(n.goods_name)+"\n ")]),t._v(" "),e("div",{staticClass:"price flex col-baseline"},[e("div",{staticClass:"primary m-r-8"},[e("price-formate",{attrs:{price:n.seckill_price,"first-size":16}})],1),t._v(" "),e("div",{staticClass:"muted sm line-through"},[e("price-formate",{attrs:{price:n.seckill_total}})],1)]),t._v(" "),e("div",{staticClass:"muted xs m-t-10"},[t._v("\n "+t._s(n.seckill_total)+"人购买\n ")])])})),1)])})),1)],1)]):t._e()}),[],!1,null,"784969e4",null);e.default=component.exports;installComponents(component,{CountDown:n(496).default,PriceFormate:n(489).default})}}]);