(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/page-component/u-index-plugins/u-flash-sale"],{1358:function(t,e,i){"use strict";i.r(e);var n=i("2f35"),s=i("b6f2");for(var a in s)"default"!==a&&function(t){i.d(e,t,(function(){return s[t]}))}(a);i("dd23");var o,r=i("f0c5"),u=Object(r["a"])(s["default"],n["b"],n["c"],!1,null,"372d26f7",null,!1,n["a"],o);e["default"]=u.exports},"1e58":function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i("2f62");function s(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function a(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?s(Object(i),!0).forEach((function(e){o(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function o(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var r=function(){i.e("components/page-component/u-index-plugins/u-index-plugins").then(function(){return resolve(i("41a5"))}.bind(null,i)).catch(i.oe)},u=function(){i.e("components/page-component/u-goods-list/u-ordinary-list").then(function(){return resolve(i("1f2b"))}.bind(null,i)).catch(i.oe)},c={name:"u-flash-sale",props:{theme:Object,index:Number,page_id:Number,is_required:Boolean,appImg:{type:Object,default:function(){return{plugins_out:""}}},appSetting:{type:Object,default:function(){return{is_show_stock:1,sell_out_pic:"",is_use_stock:1}}}},data:function(){return{newData:{},tempList:[],goodsList:[],time:0,time_str:{day:"00",hou:"00",min:"00",sec:"00"},timing:null,style:"1",goods_num:20}},components:{uIndexPlugins:r,uOrdinaryList:u},computed:a(a({},(0,n.mapGetters)("mallConfig",{getTheme:"getTheme"})),{},{copyList:function(){return this.newData.list}}),methods:{router:function(t){this.$emit("router",t)},isShowMemPrice:function(t){return 1===t.is_level&&1!==t.is_negotiable?1:0},isShowVip:function(t){return t.vip_card_appoint&&t.vip_card_appoint.discount>0&&1!==t.is_negotiable?1:0},isShowStock:function(t){return 1===this.appSetting.is_show_stock&&0===t.goods_stock?1:0},loadData:function(){var t=this,e={type:0===this.page_id?"mall":"diy",key:"flash_sale",page_id:this.page_id,index:this.index};this.goods_num&&(e.goods_num=this.goods_num),this.$request({url:this.$api.index.extra,data:e}).then((function(e){0===e.code&&(t.newData=e.data,t.newData.activity?(t.newData.str="结束",t.set_time(t.newData.activity.end_at)):(t.newData.str="开始",t.set_time(t.newData.next_activity.start_at)))}))},cloneData:function(t){return JSON.parse(JSON.stringify(t))},splitData:function(){var t=this;if(this.tempList.length){var e=this.tempList[0];this.goodsList.push(e),this.tempList.splice(0,1),this.tempList.length&&(this.timeOut=setTimeout((function(){t.splitData()}),200))}},set_time:function(t){var e=this;clearInterval(this.timing);var i=new Date(t.replace(/-/g,"/"));this.now_time(i),this.timing=setInterval((function(){e.now_time(i)}),1e3)},now_time:function(t){var e=t.getTime()-(new Date).getTime();e<0&&clearInterval(this.timing);var i=parseInt(e/1e3/60/60/24),n=parseInt(e/1e3/60/60%24),s=parseInt(e/1e3/60%60),a=parseInt(e/1e3%60);this.time_str.day=i<10?"0"+i:i,this.time_str.hou=n<10?"0"+n:n,this.time_str.min=s<10?"0"+s:s,this.time_str.sec=a<10?"0"+a:a}},mounted:function(){var t=this.$storage.getStorageSync("INDEX_MALL");this.style=t.home_pages[this.index].style,this.goods_num=t.home_pages[this.index].goods_num,this.loadData()},watch:{copyList:{handler:function(t){this.$validation.empty(t)||(this.tempList=this.cloneData(t),this.splitData())}},pageHide:{handler:function(t){t?clearInterval(this.timing):this.newData.activity?(this.newData.str="结束",this.set_time(this.newData.activity.end_at)):this.newData.next_activity&&(this.newData.str="开始",this.set_time(this.newData.next_activity.start_at))},immediate:!0}},destroyed:function(){clearTimeout(this.time)},beforeDestroy:function(){clearInterval(this.timing)}};e.default=c},"2f35":function(t,e,i){"use strict";var n;i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){return n}));var s=function(){var t=this,e=t.$createElement,i=(t._self._c,"1"==t.style?t.__map(t.goodsList,(function(e,i){var n=t.__get_orig(e),s=t.isShowStock(e),a=t.isShowMemPrice(e),o=t.isShowVip(e);return{$orig:n,m0:s,m1:a,m2:o}})):null);t.$mp.data=Object.assign({},{$root:{l0:i}})},a=[]},3029:function(t,e,i){},b6f2:function(t,e,i){"use strict";i.r(e);var n=i("1e58"),s=i.n(n);for(var a in n)"default"!==a&&function(t){i.d(e,t,(function(){return n[t]}))}(a);e["default"]=s.a},dd23:function(t,e,i){"use strict";var n=i("3029"),s=i.n(n);s.a}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'components/page-component/u-index-plugins/u-flash-sale-create-component',
    {
        'components/page-component/u-index-plugins/u-flash-sale-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('543d')['createComponent'](__webpack_require__("1358"))
        })
    },
    [['components/page-component/u-index-plugins/u-flash-sale-create-component']]
]);
