')),d=c.clone().css({opacity:0,position:"absolute",width:"1px",height:"1px"});r.append(d);var s=void 0,g=void 0,m=void 0,p=void 0,l=void 0,f=setInterval(function(){if(s=r.height(),g=r.width(),p=d.height(),l=d.height(),m=Math.sqrt(s*s,g*g),s&&g&&p&&l){for(var e=0;e',r={"呼吸":"ease","线性":"linear","弹性":"ease-in-out","大慢小快":"ease-out","大快小慢":"ease-in"},a="animation:scale-"+i+" "+1/e.speed+"s "+r[e.timing]+" infinite alternate",n="translate(-50%,-50%) scale("+e.min+")",c="translate(-50%,-50%) scale("+e.max+")",d="keyframes scale-"+i+" { \n 100% { \n -webkit-transform: "+c+"; \n transform: "+c+"; \n } \n }";$("body").append("\n \n "),o.$dom.append(t)})}(r,o),o.exports&&(d["/cloud/action/scale_effect/scale_effect.js.js"]=o.exports)}(),t.forEach(function(e){e()})}();var m=void 0,p={},l=void 0;window.registerActionMap=p,window.allModuleMap=d,m="/cloud/module/scroll_nav/scroll_nav.action.js",function(){var e={type:"resource"};!function(e,o){var t=e("util"),r=(t.eventEmitter,t.ua);o.exports=function(){function e(o,t){var a=this;i(this,e);var n=this,c=$("[data-id="+t+"]"),d=c.find.bind(c);c.css({"min-height":"65px"}),this.$$=d,this.$dom=c,this.props=o,this.onPulling=!1,d(".item").on("tap",function(e){a.scrollTouch(e)}),d(".pull_item_wrap").on("click",function(e){a.scrollTouch(e)}),d(".pull_more,.pull_div_arr").on("tap",function(){n.onPulling||(n.onPulling=!0,setTimeout(function(){n.onPulling=!1},300),n.pullOrpushNav($(this),n))}),this.render(),r.pc||c.find(".wrap").addClass("hide-scrollbar"),c[0].addEventListener("touchmove",function(e){e.preventDefault()},!1)}return c(e,[{key:"scrollTouch",value:function(e){var o=$(e.target);"A"===o.prop("tagName")&&(this.onTap(o),this.$$(".pull_div").animate({display:"none"}),this.$$(".scroll_cont").show(),e.preventDefault())}},{key:"pullOrpushNav",value:function(e,o){var i=e.attr("class"),t=o.$$(".pull_div").css("display");i.indexOf("onpull")>0&&"none"==t?(o.$$(".more_img").animate({rotate:"180deg"}),o.$$(".scroll_cont").hide(),o.$$(".pull_div").animate({display:"block"})):(o.$$(".more_img").animate({rotate:"180deg"}),o.$$(".scroll_cont").show(),o.$$(".pull_div").animate({display:"none"}))}},{key:"active",value:function(e){var o=this,i=$("#rags-container").width(),t=e.offset();this.iscroll&&this.iscroll.scrollToElement(e[0],700,0-i/2+t.width/2),e.css({color:this.props.colorHighlightText,borderBottom:"2px solid "+this.props.colorHighlightText});var r=this.$dom.find("a");this.$dom.find(".splitter").remove(),r.forEach(function(i,t){var a=r[t+1]===e[0],n=i===e[0];t===r.length-1||a||n||$(i).parent().append('
')})}},{key:"inactive",value:function(e){e.css({color:this.props.colorText,borderBottom:"none"})}},{key:"show",value:function(){var e=this;this.iscroll||setTimeout(function(){e.iscroll=new window.IScroll($(e.$dom[0]).find(".scroll_cont")[0],{mouseWheel:!0,tap:!0,scrollX:!0,scrollY:!1})},200)}},{key:"setUpTargetList",value:function(){var e=this;this.targetList=[],this.props.arr.forEach(function(o){var i=o.id,t=$("#"+i);e.targetList.push({$dom:t})})}},{key:"render",value:function(){var e=this,o=$(window);o.on("scroll",function(){i()}),this.setUpTargetList(),this.show();var i=function(){var i=[],t=o.scrollTop();t>=e.$dom.offset().top+10?(e.$dom.find(".scroll-nav-root").css("padding","0"),e.$dom.find(".scroll_cont").addClass("nav_fixed").removeClass("nav_common").show(),e.$dom.find(".pull_div").addClass("pull_div_fixed").removeClass("pull_div_common").animate({display:"none"})):(e.$dom.find(".scroll_cont").addClass("nav_common").removeClass("nav_fixed"),e.$dom.find(".pull_div").addClass("pull_div_common").removeClass("pull_div_fixed"),e.$dom.find(".scroll-nav-root").css("padding","0 6px")),e.targetList.forEach(function(e,o){var t=e.$dom,r=t.offset();if(r){var a=r.top;i[o]=a}}),i=i.map(function(e,o){var t=1/0;return i.forEach(function(i,r){o!==r&&i>e&&i=n&&t1e8?(t={model:"Cart",action:"add",parameters:{product_id:e,consumption:"1"}},r=s({url:d,$dom:this.props.$sourceDom})):(t={model:"Cart",action:"add",parameters:{pid:e,num:"1"}},r=s({url:m,$dom:this.props.$sourceDom})),this.props.cartExtraParams&&Object.assign(t.parameters,this.props.cartExtraParams),y({data:{detail:t},url:r,$dom:this.props.$sourceDom}).then(function(e){e.detail.code?w(g(e.detail)||"加入购物车失败"):(C.emit("add-cart-success"),i.emit("cart-success"),w(l.app||l.weirdhybrid||$(".editor-fixed-cart-btn").length?"加入购物车成功":"已加入购物车"),o&&o())})}},{key:"renderSection",value:function(e){return'\n '}},{key:"renderTag",value:function(e){return' \n '+e.name+" \n \n "}},{key:"renderFooter",value:function(){return'\n \n '}},{key:"renderPanel",value:function(e,o,i){return'\n
\n
\n \n

\n
\n \n \n
\n \n '+this.renderFooter()+"\n
\n
\n "}},{key:"getDetailWrap",value:function(){var e=this;this.getDetailP||(this.getDetailP=this.getDetail(this.props.gid).then(function(o){Object.assign(e.config,e.handleResult(o))}))}},{key:"onGetDetail",value:function(e){return!e||e.code?void console.log("error getting detail",this.props.gid,e):void(this.config=this.handleResult(e))}},{key:"trigger",value:function(){var o=this;if(window.isEditor)return void w("不支持编辑器内使用");if(!this.fetching){if(!this.config)return void this.getDetail(e({},this.props.gid,!0)).then(function(e){return e=e[o.props.gid],e.code?void w(g(e)):(o.onGetDetail(e),void o.trigger())});var i=0;if(!this.detailResult)return void w("数据加载中...");if(b("trigger-bottom",this.props.$sourceDom),!this.config.list)return this.detailResult&&this.detailgood.code&&w(g(this.detailgood)),void h().then(function(e){e||u()});this.config.list.forEach(function(e){e.inventory&&e.inventory>0&&i++}),i?this.config.list.length>1?(this.emit("show"),this.show()):this.addCart(this.config.list[0].pid):w("商品已售罄")}}},{key:"setMode",value:function(e){var o=this.$$;o(".bottom").hide(),o('.bottom[data-mode="'+e+'"]').show()}},{key:"onPressAddCart",value:function(e){this.addCart(e)}},{key:"onPressCheckout",value:function(){var e=this,o=this.props.$sourceDom;if(!this.selectingProduct)return void w("请先选中商品");if(this.selectingProduct.pid){var i=function(){if(e.selectingProduct.map_id&&"0"!==e.selectingProduct.map_id)return e.exit(),f("/detail?gid="+e.props.gid+"&pid="+e.selectingProduct.pid,{$dom:o}),{v:void 0};var i=void 0;i=l.app?"https://m.xiaomiyoupin.com/shop/check?quickOrder=2&pid="+e.selectingProduct.pid:"https://m.xiaomiyoupin.com/shop/checkshop/check?quickOrder=2&pid="+e.selectingProduct.pid,e.exit(),h().then(function(e){if(e)f(i,{$dom:o});else{var t=s({url:i,$dom:o});u(t)}})}();if("object"==typeof i)return i.v}else this.addCart(this.selectingProduct.mapId,function(){e.exit(),f("/cart",{$dom:o})})}},{key:"onTriggerTag",value:function(){function e(e,o){for(var i in o)if(!e.type[i]||""+e.type[i].tid!=""+o[i])return!1;return!0}var o=this,i=this.$$,t={};i(".tag.active").each(function(){var e=$(this),o=e.parent().data("type-name"),i=e.data("tag");t[o]=i}),i(".tag:not(.active)").addClass("disabled");var r=void 0;this.config.list.forEach(function(o){if(e(o,t)){r=o;for(var a in o.type)t[a]||i('[data-type-name="'+a+"\"] .tag[data-tag='"+o.type[a].tid+"']").removeClass("disabled")}});var a=function(r){var a=Object.assign({},t);delete a[r],o.config.list.forEach(function(o){e(o,a)&&i('[data-type-name="'+r+'"] [data-tag="'+o.type[r].tid+'"]').removeClass("disabled")})};for(var n in t)a(n);Object.keys(t).length===Object.keys(this.config.type).length&&r?(i(".title").text(r.name),i(".price").text("¥"+p(r.price,"cent").short),i(".product-img").attr("src",r.image_url),this.selectingProduct=r,r.inventory?this.setMode("ready"):this.setMode("gone")):(i(".title").text(this.config.info.productName),i(".price").text("¥"+this.config.info.price),i(".product-img").attr("src",this.config.info.image_url),this.selectingProduct=void 0,this.setMode("wait")),this.emit("trigger-tag")}},{key:"show",value:function(){var e=this,o=$(this.renderPanel(this.config.info.productName,this.config.info.price,this.config.info.image_url)),i=o.find.bind(o);this.$$=i;var t=function(o){var t=e.config.type[o],r=$(e.renderSection(o));i(".layer>main").append(r),t.forEach(function(o){r.find("main").append($(e.renderTag(o)))})};for(var r in this.config.type)t(r);i(".add-cart").on("tap",function(){e.onPressAddCart(e.selectingProduct.pid||e.selectingProduct.mapId)}),i(".go-checkout").on("tap",function(){e.onPressCheckout()}),this.onTriggerTag();var a=this;o.on("tap",".tag",function(){var e=$(this),o=e.parent();e.hasClass("disabled")||(e.hasClass("active")?(e.inactive(),o.inactive()):(e.active(),o.active(),e.siblings().inactive()),a.onTriggerTag())});var n=P({$dom:o,cb:function(){return e.emit("exit")},closeOnTap:!1,tapShadowHide:!0,backToExit:!0}),c=n.exit;this.exit=c,o.parent().css({left:0,right:0,"max-width":"none"})}},{key:"handleResult",value:function(e){var o=this;this.detailResult=e;var i={};if(!e.group){var t="none"===this.props.$sourceDom[0].style.display||this.props.$sourceDom.hasClass("hide");return void console.warn("商品信息错误",e,this.props.gid,t?"(已隐藏)":"")}var r=e.group;this.props.pidWhiteList&&this.props.pidWhiteList.match(/[^ ]/)&&!function(){var i=o.props.pidWhiteList.split(/ +/).filter(function(e){return e});e.tag_prop=e.tag_prop.filter(function(e){var o=e.pid;return i.indexOf(""+o)>-1}),e.props=e.props.filter(function(e){var o=e.pid;return i.indexOf(""+o)>-1});var t={};e.tag_prop.forEach(function(e){var o=e.tid;t[o]=!0}),e.group.forEach(function(e){e.tags=e.tags.filter(function(e){var o=e.tid;return t[o]})})}();var a=e.tag_prop;r.forEach(function(e){i[e.name]=[],e.tags.forEach(function(o){i[e.name].push(o)})});var n=e.props.filter(function(e){return"-1"!==e.status&&e.status!==-1}).map(function(e){var o=[],i={};a.forEach(function(i){i.pid===e.pid&&o.push(i.tid)}),r.forEach(function(e){var t=e.name;e.tags.forEach(function(e){var r=o.indexOf(e.tid);r>-1&&(i[t]=e)})});var t=void 0;return t=void 0!==e.onsale?e.onsale?1:0:parseInt(e.inventory),{map_id:e.map_id,pid:e.pid,type:i,price:e.price,inventory:t,image_url:e.img,origin_price:parseInt(e.market_price),name:e.name}}),c={price:p(e.good.price_min,"cent").short,productName:e.good.name,image_url:e.good.pic_url};return{info:c,type:i,list:n}}},{key:"preloadDetail",value:function(e){var o=this;r.getDetailCnt>50?(r.getDetailCnt=0,r.requestQueue=[]):clearTimeout(r.getDetailTimeout),r.requestQueue.push(e),r.getDetailCnt++;var i=r.requestQueue.slice();r.getDetailTimeout=setTimeout(function(){var e={};i.forEach(function(o){e[o.props.gid]=!0}),setTimeout(function(){o.getDetail(e).then(function(e){i.forEach(function(o){var i=o.props.gid;o.onGetDetail(e[i])}),i.length=0})},1e3)})}}]),r}(_);S.requestQueue=[],S.getDetailTimeout=0,S.getDetailCnt=0,r.exports=S}(r,t),t.exports&&(d["/cloud/module/product_big/bottom_window.js"]=t.exports)}(),m="/cloud/module/venue_single_product/venue_single_product.action.js",function(){var e={type:"resource"};!function(e,t){function r(e,o){var i=void 0,t=void 0;return parseInt(e)>1e8?(i={model:"Cart",action:"add",parameters:{product_id:e,consumption:"1"}},t=y({url:T,$dom:o})):(i={model:"Cart",action:"add",parameters:{pid:e,num:"1"}},t=y({url:P,$dom:o})),h({data:{detail:i},url:t,$dom:o}).then(function(e){b(e.detail.code?C(e.detail)||"加入购物车失败":f.app||f.weirdhybrid||$(".editor-fixed-cart-btn").length?"加入购物车成功":"已加入购物车")})}function a(e,o){v&&clearTimeout(v),z.push({gid:e,cb:o}),v=setTimeout(function(){var e=z.slice(0);z.length=0,v=0;var o={model:"Product",action:"GetDetailLite",parameters:{}};o.parameters.gid=e.map(function(e){var o=e.gid;return o});var i=void 0;i="static.home.mi.com"===location.host?P:"/app/shopv3/pipe",h({data:{gid:o},success:function(o){if(o.code)return void b(C(o));var i=o.gid.data;e.forEach(function(e){var o=e.gid,t=e.cb;i[o]&&t(i[o])})},error:function(e){b("获取商品信息失败"),console.warn(e)},url:i,skipLogin:!0})},10)}function d(e,o){var i=e.optional||{},t=e.tag||{},r={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,tagBgImg:"https://shop.io.mi-img.com/app/shop/img?id=shop_afbd3e9203ca5887559d665f6172c625.png&w=120&h=121"};if(o.attr_ext){var a=o.attr_ext;r.name=i.name||a.custom_name,r.summary=i.summary||a.custom_summary,1===a.price_tag&&(r.unit="元起")}return r.name||(r.name=i.name||o.name),r.summary||(r.summary=i.summary||o.summary),o.price_min||(o.price_min=o.price),o.market_price||(o.market_price=o.price_min),i.price&&(o.price_min=Math.round(100*parseFloat(i.price))),i.originalPrice&&(o.market_price=Math.round(100*parseFloat(i.originalPrice))),r.price=l(o.price_min,"cent").short,r.marketPrice=l(o.market_price,"cent").short,r.showMarketPrice=1*o.price_min<1*o.market_price,r.downPriceValue=o.market_price-o.price_min,r.downPrice=l(r.downPriceValue,"cent").short,r.discountText=""+Math.ceil(o.price_min/o.market_price*100)/10,r.discountText=""+r.discountText.replace(/\.\d+/,function(e){return e.slice(0,2)}).replace(/\.0/,""),t.show&&"是"!==t.isUseDefault?(r.showTag=!0,r.tagLineCount=parseInt(t.lines),r.firstTagLine=1===r.tagLineCount?t.text:t.firstLine,r.secondTagLine=2===r.tagLineCount?t.secondLine||"":"",r.tagDifferent=2===r.tagLineCount&&t.different,r.tagBgImg=t.bgImg||"https://shop.io.mi-img.com/app/shop/img?id=shop_c4c9010921186fa4484ac898540d602e.png&w=114&h=132"):(r.showMarketPrice&&(r.showTag=!0,r.secondTagLine=r.downPrice),r.tagBgImg=t.bgImg||"https://shop.io.mi-img.com/app/shop/img?id=shop_c4c9010921186fa4484ac898540d602e.png&w=114&h=132"),o.inventory&&(r.inventory=o.inventory),r}function s(e,o){function i(e){var i="//m.xiaomiyoupin.com/shop/detail?gid="+o.gid;o.pid&&(i+="&pid="+o.pid);var t=o.href||i;return setTimeout(function(){L||u(t,{$dom:a})}),e&&e.stopPropagation(),!1}var t=e.$$,a=e.$dom,n=t(".tag-box"),c=t(".img-box img"),d=t(".btn");m(a);t(".name").html(o.name).on("tap",i),t(".name-extra").html(o.name).on("tap",i),t(".desc").html(o.summary).on("tap",i),t(".desc-extra").html(o.summary).on("tap",i),t(".present-price").html(o.price),o.showMarketPrice&&t(".market-price").html(o.marketPrice+"元").show(),"元起"===o.unit&&t(".price-yen").html(o.unit),o.pid||d.html(o.btnTitle),o.showTag&&(n.addClass("in").css("background-image","url("+o.tagBgImg+")"),1===o.tagLineCount&&n.addClass("one-line"),o.tagDifferent&&n.addClass("different"),n.find(".first-line").html(o.firstTagLine),n.find(".second-line").html(o.secondTagLine)),c.on("tap",i),f.wxminiprogram&&a.on("tap",i),d.on("tap",function(){return d.hasClass("waiting")?void b("抢购还未开始,请保持关注"):d.hasClass("disable")?void(d.hasClass("soldoff")&&b("商品已售罄,下次早点来吧")):d.hasClass("success")?(g(o.gid,o.pid,a,o.btnTitle),void("加入购物车"===o.btnTitle?r(o.pid,a).catch(function(e){b(e)}):i())):void("加入购物车"===o.btnTitle?e.bottomWindow.trigger():i())})}function g(e,o,i,t){function r(e){var o=parseInt(e/3600),i=parseInt(e%3600/60),t=e-3600*o-60*i;return o<10&&(o="0"+o),i<10&&(i="0"+i),t<10&&(t="0"+t),o+":"+i+":"+t}function a(e,o){s.html(r(e--)),c&&clearInterval(c),c=setInterval(function(){e>0?s.html(r(e--)):o()},1e3)}function n(r){function n(){s.removeClass("waiting"),c&&clearInterval(c),!f.inventory||parseInt(f.inventory)<=0?s.html("已售罄").addClass("disable soldoff"):s.html(t).addClass("success toDetail")}var d=r.detail&&r.detail.data,m=r.activity&&r.activity.data,p=null,l=Array.isArray(d.props)&&d.props,f=null;return l&&l.forEach(function(e){e.pid==o&&(f=e)}),f?w().then(function(r){if(!Array.isArray(m)||0===m.length)return n(),Promise.resolve(f);for(var d=0,l=void 0;d-1||l.pids.indexOf(parseInt(o))>-1)&&r>l.start&&rr?(h=u-r,h>86400&&(h=86400),setTimeout(function(){c&&clearInterval(c),g(e,o,i,t)},1e3*h+500)):h=0,0===h)return void n();s.addClass("waiting");var b=parseInt(h/86400);b>1?(s.html("倒计时"+b+"天"),setTimeout(function(){c&&clearInterval(c),g(e,o,i,t)},1e3*(h-24*b*3600))):a(h,function(){return setTimeout(function(){g(e,o,i,t)},1e3)})}else n();return Promise.resolve(f)}):Promise.reject("no pid detail")}var c=void 0,d={activity:{model:"Activity",action:"getAct",parameters:{gid:e}},detail:{model:"Shopv2",action:"getDetail",parameters:{gid:e}}},s=i.find(".btn").removeClass("hide");return h({data:d}).then(n)}function m(e){var o=e.data("editor-trace");return window.articleModeTraceName+"-"+window.articleId+"-"+o}var p=e("mi-home-lib"),l=p.formatMoney,f=p.ua,h=(p.args,p.addParam,p.miFetch2),u=p.jumpTo,b=p.toast,_=p.Rag,C=p.getChineseMessage,w=(p.floatingLayerId,p.getServerTimestamp),y=p.getTracedUrl2,T=p.PIPE_URL,P=(p.SHOPV3_URL,p.GPIPE_URL),S=e("/cloud/module/product_big/bottom_window.js"),v=void 0,z=[],L=!1,k=void 0;$(window).on("scroll",function(){L=!0,k&&clearTimeout(k),k=setTimeout(function(){k=null,L=!1},100)}),t.exports=function(e){function t(e,o){i(this,t),n(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,o),this.initBtnTitle=e.btnTitle,this.init(e,o)}return o(t,e),c(t,[{key:"init",value:function(e){var o=this,i=e.gid,t=e.pid;i&&(t?g(i,t,this.$dom,this.initBtnTitle).then(function(i){var t=d(e,i);s(o,t)}).catch(function(e){return console.log(e)}):a(i,function(t){if(!t)return void console.warn("gid error",i);var r=d(e,t);s(o,r)}),"加入购物车"===e.btnTitle&&(this.bottomWindow=new S({id:"venue-product-floating",gid:e.gid,$sourceDom:this.$dom})))}}]),t}(_)}(r,e),e.exports&&(d["/cloud/module/venue_single_product/venue_single_product.action.js"]=e.exports)}(),m="/cloud/container/venue_card_container/venue_card_container.action.js",function(){var e={type:"resource"};!function(e,o){o.exports=function(){function e(o,t){i(this,e);var r=$('[data-id="'+t+'"]'),a=r.children(),n=a.length;a.eq(Math.floor(Math.random()*n)).show()}return e}()}(r,e),e.exports&&(d["/cloud/container/venue_card_container/venue_card_container.action.js"]=e.exports)}(),m="/cloud/module/venue_main_product_card_b/venue_main_product_card_b.action.js",function(){var e={type:"resource"};!function(e,t){function r(e,o){var i=void 0,t=void 0;return parseInt(e)>1e8?(i={model:"Cart",action:"add",parameters:{product_id:e,consumption:"1"}},t=y({url:T,$dom:o})):(i={model:"Cart",action:"add",parameters:{pid:e,
num:"1"}},t=y({url:P,$dom:o})),h({data:{detail:i},url:t,$dom:o}).then(function(e){b(e.detail.code?C(e.detail)||"加入购物车失败":f.app||f.weirdhybrid||$(".editor-fixed-cart-btn").length?"加入购物车成功":"已加入购物车")})}function a(e,o){v&&clearTimeout(v),z.push({gid:e,cb:o}),v=setTimeout(function(){var e=z.slice(0);z.length=0,v=0;var o={model:"Product",action:"GetDetailLite",parameters:{}};o.parameters.gid=e.map(function(e){var o=e.gid;return o});var i=void 0;i="static.home.mi.com"===location.host?P:"/app/shopv3/pipe",h({data:{gid:o},success:function(o){if(o.code)return void b(C(o));var i=o.gid.data;e.forEach(function(e){var o=e.gid,t=e.cb;i[o]&&t(i[o])})},error:function(e){b("获取商品信息失败"),console.warn(e)},url:i,skipLogin:!0})},10)}function d(e,o){var i=e.optional||{},t=e.tag||{},r={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,tagBgImg:"https://shop.io.mi-img.com/app/shop/img?id=shop_afbd3e9203ca5887559d665f6172c625.png&w=120&h=121"};if(o.attr_ext){var a=o.attr_ext;r.name=i.name||a.custom_name,r.summary=i.summary||a.custom_summary,1===a.price_tag&&(r.unit="元起")}return r.name||(r.name=i.name||o.name),r.summary||(r.summary=i.summary||o.summary),o.price_min||(o.price_min=o.price),o.market_price||(o.market_price=o.price_min),i.price&&(o.price_min=Math.round(100*parseFloat(i.price))),i.originalPrice&&(o.market_price=Math.round(100*parseFloat(i.originalPrice))),r.price=l(o.price_min,"cent").short,r.marketPrice=l(o.market_price,"cent").short,r.showMarketPrice=1*o.price_min<1*o.market_price,r.downPriceValue=o.market_price-o.price_min,r.downPrice=l(r.downPriceValue,"cent").short,r.discountText=""+Math.ceil(o.price_min/o.market_price*100)/10,r.discountText=""+r.discountText.replace(/\.\d+/,function(e){return e.slice(0,2)}).replace(/\.0/,""),t.show&&"是"!==t.isUseDefault?(r.showTag=!0,r.tagLineCount=parseInt(t.lines),r.firstTagLine=1===r.tagLineCount?t.text:t.firstLine,r.secondTagLine=2===r.tagLineCount?t.secondLine||"":"",r.tagDifferent=2===r.tagLineCount&&t.different,r.tagBgImg=t.bgImg||"https://shop.io.mi-img.com/app/shop/img?id=shop_c4c9010921186fa4484ac898540d602e.png&w=114&h=132"):(r.showMarketPrice&&(r.showTag=!0,r.secondTagLine=r.downPrice),r.tagBgImg=t.bgImg||"https://shop.io.mi-img.com/app/shop/img?id=shop_c4c9010921186fa4484ac898540d602e.png&w=114&h=132"),o.inventory&&(r.inventory=o.inventory),r}function s(e,o){function i(e){var i="//m.xiaomiyoupin.com/shop/detail?gid="+o.gid;o.pid&&(i+="&pid="+o.pid);var t=o.href||i;return setTimeout(function(){L||u(t,{$dom:a})}),e&&e.stopPropagation(),!1}var t=e.$$,a=e.$dom,n=t(".tag-box"),c=t(".img-box img"),d=t(".btn");m(a);t(".name").html(o.name).on("tap",i),t(".name-extra").html(o.name).on("tap",i),t(".desc").html(o.summary).on("tap",i),t(".desc-extra").html(o.summary).on("tap",i),t(".present-price").html(o.price),o.showMarketPrice&&t(".market-price").html(o.marketPrice+"元").show(),"元起"===o.unit&&t(".price-yen").html(o.unit),o.pid||d.html(o.btnTitle),o.showTag&&(n.addClass("in").css("background-image","url("+o.tagBgImg+")"),1===o.tagLineCount&&n.addClass("one-line"),o.tagDifferent&&n.addClass("different"),n.find(".first-line").html(o.firstTagLine),n.find(".second-line").html(o.secondTagLine)),c.on("tap",i),f.wxminiprogram&&a.on("tap",i),d.on("tap",function(){return d.hasClass("waiting")?void b("抢购还未开始,请保持关注"):d.hasClass("disable")?void(d.hasClass("soldoff")&&b("商品已售罄,下次早点来吧")):d.hasClass("success")?(g(o.gid,o.pid,a,o.btnTitle),void("加入购物车"===o.btnTitle?r(o.pid,a).catch(function(e){b(e)}):i())):void("加入购物车"===o.btnTitle?e.bottomWindow.trigger():i())})}function g(e,o,i,t){function r(e){var o=parseInt(e/3600),i=parseInt(e%3600/60),t=e-3600*o-60*i;return o<10&&(o="0"+o),i<10&&(i="0"+i),t<10&&(t="0"+t),o+":"+i+":"+t}function a(e,o){s.html(r(e--)),c&&clearInterval(c),c=setInterval(function(){e>0?s.html(r(e--)):o()},1e3)}function n(r){function n(){s.removeClass("waiting"),c&&clearInterval(c),!f.inventory||parseInt(f.inventory)<=0?s.html("已售罄").addClass("disable soldoff"):s.html(t).addClass("success toDetail")}var d=r.detail&&r.detail.data,m=r.activity&&r.activity.data,p=null,l=Array.isArray(d.props)&&d.props,f=null;return l&&l.forEach(function(e){e.pid==o&&(f=e)}),f?w().then(function(r){if(!Array.isArray(m)||0===m.length)return n(),Promise.resolve(f);for(var d=0,l=void 0;d-1||l.pids.indexOf(parseInt(o))>-1)&&r>l.start&&rr?(h=u-r,h>86400&&(h=86400),setTimeout(function(){c&&clearInterval(c),g(e,o,i,t)},1e3*h+500)):h=0,0===h)return void n();s.addClass("waiting");var b=parseInt(h/86400);b>1?(s.html("倒计时"+b+"天"),setTimeout(function(){c&&clearInterval(c),g(e,o,i,t)},1e3*(h-24*b*3600))):a(h,function(){return setTimeout(function(){g(e,o,i,t)},1e3)})}else n();return Promise.resolve(f)}):Promise.reject("no pid detail")}var c=void 0,d={activity:{model:"Activity",action:"getAct",parameters:{gid:e}},detail:{model:"Shopv2",action:"getDetail",parameters:{gid:e}}},s=i.find(".btn").removeClass("hide");return h({data:d}).then(n)}function m(e){var o=e.data("editor-trace");return window.articleModeTraceName+"-"+window.articleId+"-"+o}var p=e("mi-home-lib"),l=p.formatMoney,f=p.ua,h=(p.args,p.addParam,p.miFetch2),u=p.jumpTo,b=p.toast,_=p.Rag,C=p.getChineseMessage,w=(p.floatingLayerId,p.getServerTimestamp),y=p.getTracedUrl2,T=p.PIPE_URL,P=(p.SHOPV3_URL,p.GPIPE_URL),S=e("/cloud/module/product_big/bottom_window.js"),v=void 0,z=[],L=!1,k=void 0;$(window).on("scroll",function(){L=!0,k&&clearTimeout(k),k=setTimeout(function(){k=null,L=!1},100)}),t.exports=function(e){function t(e,o){i(this,t),n(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,o),this.initBtnTitle=e.btnTitle,this.init(e,o)}return o(t,e),c(t,[{key:"init",value:function(e){var o=this,i=e.gid,t=e.pid;i&&(t?g(i,t,this.$dom,this.initBtnTitle).then(function(i){var t=d(e,i);s(o,t)}).catch(function(e){return console.log(e)}):a(i,function(t){if(!t)return void console.warn("gid error",i);var r=d(e,t);s(o,r)}),"加入购物车"===e.btnTitle&&(this.bottomWindow=new S({id:"venue-product-floating",gid:e.gid,$sourceDom:this.$dom})))}}]),t}(_)}(r,e),e.exports&&(d["/cloud/module/venue_main_product_card_b/venue_main_product_card_b.action.js"]=e.exports)}(),m="/cloud/container/pure_container/pure_container.action.js",function(){var e={type:"resource"};!function(e,o){}(r,e),e.exports&&(d["/cloud/container/pure_container/pure_container.action.js"]=e.exports)}(),m="/cloud/module/rec_meeting_two/rec_meeting_two.action.js",function(){var e={type:"resource"};!function(e,t){var r=e("mi-home-lib"),a=r.Rag;t.exports=function(e){function t(){i(this,t);for(var e=arguments.length,o=Array(e),r=0;r