\n
\n '+i(e.value,"cent").short+'\n '+e.value_desc+'\n '+e.time_desc+"\n
";return n+=r?'
\n ':'
'}},{key:"renderLItem",value:function(e){var t=1===+e.type?"https://shop.io.mi-img.com/app/shop/img?id=shop_79bb7d9bad6d1a85936c74def97de289.png&w=38&h=48":"https://shop.io.mi-img.com/app/shop/img?id=shop_a73947c94f59f6a4e763b3e1a1350ccc.png&w=38&h=48",o={0:"https://shop.io.mi-img.com/app/shop/img?id=shop_2cfd8cf3bba47a6cd00e8bd6995bbbbd.png&w=173&h=42",1:"https://shop.io.mi-img.com/app/shop/img?id=shop_3899517ec10ae1cca78cea3b34cedead.png&w=173&h=42",3:"https://shop.io.mi-img.com/app/shop/img?id=shop_7079df2c1ca300788a20f288f6edccb1.png&w=173&h=42",4:"https://shop.io.mi-img.com/app/shop/img?id=shop_f6c62c9ed05a2db14d261a01b61243fd.png&w=173&h=42"},r=o[3];2===+e.round_status&&(r=o[4]),0!==+e.status&&0!==+e.round_status||(r=o[0]),1===+e.fetched&&(r=o[1]);var a=void 0;a=1===+e.round_status&&1===+e.status?1:0;var n='\n

\n

\n
\n
\n '+i(e.value,"cent").short+'\n '+e.value_desc+'\n
\n
\n
'+e.scope_desc+'\n
'+e.time_desc+'\n

\n
\n
';return n}}]),e}();t.exports=r}(require,e),e.exports&&(allModuleMap["/cloud/module/coupon_seckill/main.js"]=e.exports)}(),currentProcessingModule="/cloud/module/coupon_seckill/coupon_seckill.action.js",function(){var e={type:"resource"};!function(e,t){var o=e("util"),i=(o.ua,o.showFloatingLayer2),r=o.miFetch2,a=(o.countEvent,o.toast),n=(o.addParam,o.GPIPE_URL),s=(o.args,o.getChineseMessage),d=(o.getLogin,o.jumptoLogin,o.formatMoney,e("/cloud/module/coupon_seckill/test_data.js"),e("/cloud/module/coupon_seckill/nav.js")),c=e("/cloud/module/coupon_seckill/main.js"),l={starterCheck:function(e,t){return r({url:n,data:{result:{action:"GetUserActList",model:"CouponAct",parameters:{act_id:e,round_id:t}}}}).then(function(e){var t=e.result;if(t.code)throw a(s(t)),new Error(t);return t.data})},getCoupon:function(e,t,o){return r({url:n,data:{result:{action:"Fetch",model:"CouponAct",parameters:{type:e,id:t,act_id:o}}}}).then(function(e){var t=e.result;if(t.code)throw a(s(t)),new Error(t);return t})}},p=void 0,g=void 0,m=void 0;t.exports=function(){function e(t,o){var i=this;_classCallCheck(this,e);var r=$("[data-id="+o+"]"),a=r.find.bind(r);this.$$=a,this.$dom=r,this.props=t,p=this.props.actId,g=this.props.itemStyle,m=this.props.succWin,l.starterCheck(this.props.actId).then(function(e){i.navRender(e.round_list),i.mainRender(i.props.itemStyle,e.coupon_list)})}return _createClass(e,[{key:"navRender",value:function(e){var t=new d(e);this.$$(".nav-tabs").empty().append(t.$dom);var o=this;o.$$(".nav-link").click(function(){o.$$(".nav-link").removeClass("active"),o.$$(this).addClass("active");var e=o.$$(this).attr("roundid");l.starterCheck(p,e).then(function(e){o.mainRender(g,e.coupon_list)})})}},{key:"mainRender",value:function(e,t){var o=new c(e,t);this.$$(".main-list").empty().append(o.$dom);var i=this;i.$$(".item-box").click(function(){var e=this,t=i.$$(this).attr("cstatus"),o=i.$$(this).attr("fid"),r=i.$$(this).attr("ftype");return+t&&0!==+o?void l.getCoupon(r,o,p).then(function(t){i.$$(e).addClass("box-disable"),t&&0===+t.code?(i.$$(e).find(".status").attr("src","https://shop.io.mi-img.com/app/shop/img?id=shop_3899517ec10ae1cca78cea3b34cedead.png&w=173&h=42"),i.$$(e).find(".item-status").show().attr("src","https://shop.io.mi-img.com/app/shop/img?id=shop_42f2a4832f2780cba5d6ccca97bed21f.png&w=332&h=198"),i.showWin()):a(s(t))}):void(0===+o&&a("您已经领取过了!"))})}},{key:"showWin",value:function(){var e=i({$dom:$("#"+m),closeOnTapWrap:!1,closeOnTapShadow:!1}),t=e.$wrap,o=e.exit;t.on("tap",".editor-action-click_to_remove",function(){o()})}}]),e}()}(require,e),e.exports&&(allModuleMap["/cloud/module/coupon_seckill/coupon_seckill.action.js"]=e.exports);
}(),currentProcessingModule="/cloud/module/tab_switch/tab_switch.action.js",function(){var e={type:"resource"};!function(e,t){var o=e("mi-home-lib"),i=o.preloadImage,r=o.eventEmitter;t.exports=function(){function e(t,o){_classCallCheck(this,e);var a=$('[data-id="'+o+'"]');t.tabs.forEach(function(e){i(e.url2)}),i(t.tabs[0].url1),a.find(".tab").on("tap",function(){t.tabs.forEach(function(e){var t=e.id;$("#"+t).hide()});var e=$(this).data("tab-id");$("#"+e).show(),$("#"+e).find(".editor-adjust-height-wrapper").each(function(){this.containerAdjustHeight&&this.containerAdjustHeight()}),r.emit("view-update"),a.find(".tab").removeClass("active"),$(this).addClass("active")})}return e}()}(require,e),e.exports&&(allModuleMap["/cloud/module/tab_switch/tab_switch.action.js"]=e.exports)}(),function(){var e={type:"resource"};!function(e,t){var o=e("util"),i=o.eventEmitter;t.exports=function(e){function t(){function e(e){var t=e.children()[0].scrollHeight,o=1*(e.css("border-bottom-width").match(/^[\d.]+/)||[0])[0],i=1*(e.css("border-top-width").match(/^[\d.]+/)||[0])[0];return t+o+i}var t=function(t){var o=r[t];if(o.length<2)return"continue";var i=Math.max.apply(Math,_toConsumableArray(o.map(e)));o.forEach(function(e){e.css("min-height",i+"px")})};for(var o in r){t(o)}}function o(){setTimeout(t),setTimeout(t,500)}var r={},a=e.find.bind(e);e.addClass("editor-adjust-height-wrapper"),a("[data-sync-height]").each(function(){var e=$(this),t=e.data("sync-height");r[t]||(r[t]=[]),r[t].push(e)});var n=void 0;Object.keys(r).length&&(e[0].containerAdjustHeight=o,o(),i.on("base-width-change",function(e){if(e!==n){n=e;for(var t in r){var i=r[t];i.length<2||i.forEach(function(e){e.css("min-height","0px")})}o()}}))}}(require,e),e.exports&&(allModuleMap["/cloud/container/horizontal_layout/adjust-height.js"]=e.exports)}(),currentProcessingModule="/cloud/container/table_container/table_container.action.js",function(){var e={type:"resource"};!function(e,t){var o=e("util"),i=o.eventEmitter,r=e("/cloud/container/horizontal_layout/adjust-height.js");t.exports=function(){function e(t,o){var a=this;_classCallCheck(this,e);var n=$("[data-id="+o+"]"),s=n.find.bind(n);if(this.$dom=n,this.$$=s,this.props=t,t.random)for(var d=s(".rag"),c=$(""),l=0;l1e8?(o={model:"Cart",action:"add",parameters:{product_id:e,consumption:"1"}},i=_({url:C,$dom:t})):(o={model:"Cart",action:"add",parameters:{pid:e,num:"1"}},i=_({url:w,$dom:t})),g({data:{detail:o},url:i,$dom:t}).then(function(e){u(e.detail.code?f(e.detail)||"加入购物车失败":l.app||l.weirdhybrid||$(".editor-fixed-cart-btn").length?"加入购物车成功":"已加入购物车")})}function i(e,t){y&&clearTimeout(y),T.push({gid:e,cb:t}),y=setTimeout(function(){var e=T.slice(0);T.length=0,y=0;var t={model:"Product",action:"GetDetailLite",parameters:{}};t.parameters.gid=e.map(function(e){var t=e.gid;return t}),g({data:{gid:t},success:function(t){if(t.code)return void u(f(t));var o=t.gid.data;e.forEach(function(e){var t=e.gid,i=e.cb;o[t]&&i(o[t])})},error:function(e){u("获取商品信息失败"),console.warn(e)},url:p("/app/shopv3/pipe","editor-cache",""+Math.floor(Date.now()/36e5)),skipLogin:!0})},10)}function r(e,t){function o(e,t){e=e.replace(/[,,。 ]+/g," "),e=e.trim();var o=e.split(/ /),i=[];return o.forEach(function(e){var o=i.join(",").length;return!(o+e.length+1>=t)&&void i.push(e)}),i.join(",")}var i=e.optional||{},r=e.tag||{},a={gid:e.gid,pid:e.pid,name:"",summary:"",src:"",price:"",unit:"元",marketPrice:"",showMarketPrice:"",showTag:!1,tagLineCount:2,firstTagLine:"直降",secondTagLine:"",tagDifferent:!0,btnTitle:e.btnTitle,href:i.href};if(t.atrr_ext&&(t.attr_ext=t.atrr_ext),t.attr_ext){var n=t.attr_ext;a.name=i.name||n.custom_name,a.summary=i.summary||n.custom_summary,1===n.price_tag&&(a.unit="元起")}return a.name||(a.name=i.name||t.name),a.summary||(a.summary=i.summary||t.summary),a.summary=o(a.summary,16),a.src=e.src||("场景图"===e.imgType?t.album_url:t.pic_url),a.src||(a.src=t.img),t.price_min||(t.price_min=t.price),t.market_price||(t.market_price=t.price_min),i.price&&(t.price_min=Math.round(100*parseFloat(i.price))),i.originalPrice&&(t.market_price=Math.round(100*parseFloat(i.originalPrice))),a.price=c(t.price_min,"cent").short,a.marketPrice=c(t.market_price,"cent").short,a.showMarketPrice=1*t.price_min<1*t.market_price,a.downPriceValue=t.market_price-t.price_min,a.downPrice=c(a.downPriceValue,"cent").short,a.discountText=""+Math.ceil(t.price_min/t.market_price*100)/10,a.discountText=""+a.discountText.replace(/\.\d+/,function(e){return e.slice(0,2)}).replace(/\.0/,""),r.show?(a.showTag=!0,a.tagLineCount=parseInt(r.lines),a.firstTagLine=1===a.tagLineCount?r.text:r.firstLine,a.secondTagLine=2===a.tagLineCount?r.secondLine||"":"",a.tagDifferent=2===a.tagLineCount&&r.different):a.showMarketPrice&&(a.showTag=!0,a.secondTagLine=a.downPrice),t.inventory&&(a.inventory=t.inventory),a}function a(e,t){function i(e){var o="//m.xiaomiyoupin.com/shop/detail?gid="+t.gid;t.pid&&(o+="&pid="+t.pid);var i=t.href||o;return m(i,{$dom:a}),e.stopPropagation(),!1}var r=e.$$,a=e.$dom,d=r(".tag-box"),c=r(".img-box img"),p=r(".btn");s(a);c.setSrc(t.src),r(".name").html(t.name).on("tap",i),r(".desc").html(t.summary).on("tap",i),r(".present-price").html(t.price),t.showMarketPrice&&r(".market-price").html(t.marketPrice+"元").show(),"元起"===t.unit&&r(".price-yen").html(t.unit),t.pid||p.html(t.btnTitle),t.showTag&&(d.addClass("in"),1===t.tagLineCount&&d.addClass("one-line"),t.tagDifferent&&d.addClass("different"),d.find(".first-line").html(t.firstTagLine),d.find(".second-line").html(t.secondTagLine)),c.on("tap",i),l.wxminiprogram&&a.on("tap",i),p.on("tap",function(){return p.hasClass("waiting")?void u("抢购还未开始,请保持关注"):p.hasClass("disable")?void(p.hasClass("soldoff")&&u("商品已售罄,下次早点来吧")):p.hasClass("success")?(n(t.gid,t.pid,a,t.btnTitle),void("加入购物车"===t.btnTitle?(e.countEvent("addcart"),o(t.pid,a).catch(function(e){u(e)})):(e.countEvent("button"),i()))):void("加入购物车"===t.btnTitle?(e.countEvent("addcart"),e.bottomWindow.trigger()):(e.countEvent("button"),i()))})}function n(e,t,o,i){function r(e){var t=parseInt(e/3600),o=parseInt(e%3600/60),i=e-3600*t-60*o;return t<10&&(t="0"+t),o<10&&(o="0"+o),i<10&&(i="0"+i),t+":"+o+":"+i}function a(e,t){l.html(r(e--)),d&&clearInterval(d),d=setInterval(function(){e>0?l.html(r(e--)):t()},1e3)}function s(r){function s(){l.removeClass("waiting"),d&&clearInterval(d),!u.inventory||parseInt(u.inventory)<=0?l.html("已售罄").addClass("disable soldoff"):l.html(i).addClass("success toDetail")}var c=r.detail&&r.detail.data,p=r.activity&&r.activity.data,g=null,m=Array.isArray(c.props)&&c.props,u=null;return m&&m.forEach(function(e){e.pid==t&&(u=e)}),u?b().then(function(r){if(!Array.isArray(p)||0===p.length)return s(),Promise.resolve(u);for(var c=0,m=void 0;c-1||m.pids.indexOf(parseInt(t))>-1)&&r>m.start&&rr?(h=f-r,h>86400&&(h=86400),setTimeout(function(){d&&clearInterval(d),n(e,t,o,i)},1e3*h+500)):h=0,0===h)return void s();l.addClass("waiting");var b=parseInt(h/86400);b>1?(l.html("倒计时"+b+"天"),setTimeout(function(){d&&clearInterval(d),n(e,t,o,i)},1e3*(h-24*b*3600))):a(h,function(){return setTimeout(function(){n(e,t,o,i)},1e3)})}else s();return Promise.resolve(u)}):Promise.reject("no pid detail")}var d=void 0,c={activity:{model:"Activity",action:"getAct",parameters:{gid:e}},detail:{model:"Shopv2",action:"getDetail",parameters:{gid:e}}},l=o.find(".btn").removeClass("hide");return g({data:c}).then(s)}function s(e){var t=e.data("editor-trace");return window.articleModeTraceName+"-"+window.articleId+"-"+t}var d=e("mi-home-lib"),c=d.formatMoney,l=d.ua,p=(d.args,d.addParam),g=d.miFetch2,m=d.jumpTo,u=d.toast,h=d.Rag,f=d.getChineseMessage,b=(d.floatingLayerId,d.getServerTimestamp),_=d.getTracedUrl2,C=d.PIPE_URL,w=(d.SHOPV3_URL,d.GPIPE_URL),v=e("/cloud/module/product_big/bottom_window.js"),y=void 0,T=[];t.exports=function(e){function t(e,o){_classCallCheck(this,t),_get(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,o),this.initBtnTitle=e.btnTitle,this.init(e,o)}return _inherits(t,e),_createClass(t,[{key:"init",value:function(e){var t=this,o=e.gid,s=e.pid;o&&(s?n(o,s,this.$dom,this.initBtnTitle).then(function(o){var i=r(e,o);a(t,i)}).catch(function(e){return console.log(e)}):i(o,function(i){if(!i)return void console.warn("gid error",o);var n=r(e,i);a(t,n)}),"加入购物车"===e.btnTitle&&(this.bottomWindow=new v({id:"venue-product-floating",gid:e.gid,$sourceDom:this.$dom})))}}]),t}(h)}(require,e),e.exports&&(allModuleMap["/cloud/module/venue_main_product_card_b/venue_main_product_card_b.action.js"]=e.exports)}(),currentProcessingModule="/cloud/container/more_product_container/more_product_container.action.js",function(){var e={type:"resource"};!function(e,t){var o=e("mi-home-lib"),i=o.eventEmitter;t.exports=function(){function e(t,o){_classCallCheck(this,e);var r=$("[data-id="+o+"]"),a=r.find.bind(r);this.$dom=r,this.$$=a,this.props=t,a(".init_more").click(function(e){i.emit("view-update"),a(".init_more").hide(),a(".product_box").show(),a(".editor-adjust-height-wrapper").each(function(){this.containerAdjustHeight&&this.containerAdjustHeight()})})}return e}()}(require,e),e.exports&&(allModuleMap["/cloud/container/more_product_container/more_product_container.action.js"]=e.exports)}(),currentProcessingModule="/cloud/module/seckill_preview/seckill_preview.action.js",function(){var e={type:"resource"};!function(e,t){var o=e("util"),i=o.miFetch2,r=o.GPIPE_URL,a=(o.getChineseMessage,o.getTracedUrl2),n=i({url:r,data:{list:{model:"Couponv2",action:"GetFlashSaleList",parameters:{pid:"",gid:""}}}}).then(function(e){return e.list.data});t.exports=function(){function e(t,o){var i=this;_classCallCheck(this,e);var r=$('[data-id="'+o+'"]');this.props=t,this.$dom=r,this.$$=r.find.bind(r);var a=this;this.$$(".nav-btn").on("tap",function(){var e=1*$(this).data("nav-index");$(this).hasClass("disabled")||a.select(e)}),n.then(function(e){var t=i.handleData(e);if(i.data=t,t){var o=t[0]&&t[0].some(function(e){return e.to_fetch});t[0]&&i.enable(0),t[1]&&i.enable(1),t[0]?(i.select(0),!o&&t[1]&&i.select(1)):t[1]&&i.select(1)}})}return _createClass(e,[{key:"renderProduct",value:function(e){var t=$('\n
\n \n

\n
\n \n '+e.name+'
\n ¥'+formatMoney(e.flash_price,"cent").short+'\n ¥'+formatMoney(e.origin_price,"cent").short+"
\n ");if(e.to_fetch){var o=a({url:"http://m.xiaomiyoupin.com/shop/detail?gid="+e.gid+"&pid="+e.pid,$dom:this.$dom,traceAppend:[e.pid],uid:!1});t.attr("href",o)}else t.append('\n 已抢完\n
');return ua.pc?t.css("zoom","1.3"):ua.iOS&&t.css("zoom","1.1"),t}},{key:"renderPage",value:function(e,t){for(var o=$(''),i=0;i'),a=i;at.name?1:-1:e.ctime-t.ctime});var c={};a.forEach(function(e){e.total<=0&&(e.total=1),e.to_fetch<0&&(e.to_fetch=0),e.to_fetch>e.total&&(e.to_fetch=e.total),1e3*e.start_time>i&&(e.to_fetch=e.total),c[e.start_time]||(c[e.start_time]=[]),c[e.start_time].push(e)});var l=Object.keys(c).sort(function(e,t){return 1*e-1*t}).map(function(e){return 1*e}),p=void 0,g=void 0;l.some(function(e,t){if(t===l.length-1)p||(p=l[t]);else{var o=l[t+1];if(0===t&&e>r)return g=e,!0;e<=r&&o>r&&(p=e,g=o)}});var m=function(e){var o=[];return e.length<=t.props.cnt?e:(e.forEach(function(e){e.to_fetch>0&&o.lengtht-1.5*o&&i[0].offsetParent)||(e(i),!1)})}var r=[];$("img[data-lazy-src]").each(function(){r.push($(this))}),setTimeout(function(){a.scroll(i),i()},500);var a=$(window),n=setTimeout(o,900);window.eventEmitter.on("view-update",function(){o()})}()})