')),s=a.clone().css({opacity:0,position:"absolute",width:"1px",height:"1px"});n.append(s);var d=void 0,m=void 0,l=void 0,u=void 0,p=void 0,g=setInterval(function(){if(d=n.height(),m=n.width(),u=s.height(),p=s.height(),l=Math.sqrt(d*d,m*m),d&&m&&u&&p){for(var e=0;e1&&o.$container.each(function(){new a(this,t)}),o.config=$.extend(i,t),o.init=function(){o.$moveContainer=o.$container.find(o.config.moverContainer);var e=o.$moveContainer.html();o.$moveContainer.append(e),o.$sliderItem=o.$moveContainer.find(o.config.sliderItemClass),o.len=o.$sliderItem.length/2,o.config.moveDis=50,o.initCss(),o.config.autoPlay&&setTimeout(function(){o.move()},o.config.autoPlay)},o.initCss=function(){var e=o.config.showNum*o.config.moveDis;o.$container.css({height:e}),o.setDomStyle(0,o.config.showNum)},o.setDomStyle=function(e,t){o.$moveContainer.css({top:0}),o.config.cur=e,o.$sliderItem.eq(e).prevAll().css({opacity:0}),o.$sliderItem.eq(e+t-1).nextAll().css({opacity:0})},o.move=function(){var e=o.config.cur,t=o.config.showNum,i=o.config.durtion<500?500:o.config.durtion,n=(e+1)*o.config.moveDis;o.$sliderItem.eq(e).animate({opacity:.5},200),o.$sliderItem.eq(e+t).animate({opacity:1},i),o.$moveContainer.animate({top:-n},i,function(){o.$sliderItem.eq(e).css({opacity:1}),e+1==o.len?o.setDomStyle(0,t):o.config.cur++,setTimeout(function(){o.move()},o.config.autoPlay)})})}var c=i("mi-home-lib");t(c),e(function(e,t){r(),t.$dom.css("overflow-y","hidden");for(var i='',o=0;o ',i+=""+e.bubble_conts[o].title+"",i+=""+e.bubble_conts[o].summary+" ",i+='',i+=""}i+="",t.$dom.append(i);var s={showNum:3,autoPlay:2e3,durtion:1e3},d=new a(".m-slider-wrap",s);d.init(),t.$dom.on("click",".slider-item",function(){var e=$(this).attr("data-url");e&&"undefined"!=e&&jumpTo(e,{$dom:t.$dom})}),t.onPress(function(){})})}(a,i),i.exports&&(m["/cloud/action/banner_bubble/banner_bubble.js.js"]=i.exports)}(),n.forEach(function(e){e()})}();var p=void 0,g={},h=void 0;window.registerActionMap=g,window.allModuleMap=m,p="/cloud/container/venue_container/venue_container.action.js",function(){var e={type:"resource"};!function(e,t){}(a,e),e.exports&&(m["/cloud/container/venue_container/venue_container.action.js"]=e.exports)}(),function(){var e={type:"resource"};!function(e,t){var r=e("mi-home-lib"),a=r.PIPE_URL,c=r.getTracedUrl2,m=r.getChineseMessage,l=r.GPIPE_URL,u=r.formatMoney,p=r.ua,g=r.jumpTo,h=r.getLogin,f=r.jumptoLogin,v=r.countEvent,b=r.EventEmitter,_=r.eventEmitter,w=r.toast,y=r.miFetch2,T=r.isEditor,x=r.showBottomWindow2,C=function(e){function t(e){n(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.fetching=!1,this.props=e,T||this.preloadDetail(this)}return o(t,e),d(t,[{key:"getDetail",value:function(e){var t=this;this.fetching=!0;var i={};for(var o in e)i[o]={model:"Shopv2",action:"getDetail",parameters:{gid:o}};return new Promise(function(i,o){return $.ajax({type:"GET",data:{gids:JSON.stringify(Object.keys(e).map(function(e){return 1*e}))},url:"/app/shop/product",success:function(o){if(o.code)return void w(m(o));o=o.result;var n={};for(var r in e)n[r]=o[r];t.fetching=!1,i(n)},error:function(e){console.log(2,e),o(e)}})})}},{key:"addCart",value:function(e,t){var i=this,o=void 0,n=void 0;return parseInt(e)>1e8?(o={model:"Cart",action:"add",parameters:{product_id:e,consumption:"1"}},n=c({url:a,$dom:this.props.$sourceDom})):(o={model:"Cart",action:"add",parameters:{pid:e,num:"1"}},n=c({url:l,$dom:this.props.$sourceDom})),this.props.cartExtraParams&&Object.assign(o.parameters,this.props.cartExtraParams),y({data:{detail:o},url:n,$dom:this.props.$sourceDom}).then(function(e){e.detail.code?w(m(e.detail)||"加入购物车失败"):(_.emit("add-cart-success"),i.emit("cart-success"),w(p.app||p.weirdhybrid||$(".editor-fixed-cart-btn").length?"加入购物车成功":"已加入购物车"),t&&t())})}},{key:"renderSection",value:function(e){return'\n \n '+e+' \n \n \n \n \n '}},{key:"renderTag",value:function(e){return' \n '+e.name+" \n \n "}},{key:"renderFooter",value:function(){return'\n \n '}},{key:"renderPanel",value:function(e,t,i){return'\n \n \n \n \n \n \n '+e+'\n ¥'+t+'\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(t){Object.assign(e.config,e.handleResult(t))}))}},{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 e=this;if(window.isEditor)return void w("不支持编辑器内使用");if(!this.fetching){if(!this.config)return void this.getDetail(i({},this.props.gid,!0)).then(function(t){return t=t[e.props.gid],t.code?void w(m(t)):(e.onGetDetail(t),void e.trigger())});var t=0;if(!this.detailResult)return void w("数据加载中...");if(v("trigger-bottom",this.props.$sourceDom),!this.config.list)return this.detailResult&&this.detailgood.code&&w(m(this.detailgood)),void h().then(function(e){e||f()});this.config.list.forEach(function(e){e.inventory&&e.inventory>0&&t++}),t?this.config.list.length>1?(this.emit("show"),this.show()):this.addCart(this.config.list[0].pid):w("商品已售罄")}}},{key:"setMode",value:function(e){var t=this.$$;t(".bottom").hide(),t('.bottom[data-mode="'+e+'"]').show()}},{key:"onPressAddCart",value:function(e){this.addCart(e)}},{key:"onPressCheckout",value:function(){var e=this,t=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(),g("/detail?gid="+e.props.gid+"&pid="+e.selectingProduct.pid,{$dom:t}),{v:void 0};var i=void 0;i=p.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)g(i,{$dom:t});else{var o=c({url:i,$dom:t});f(o)}})}();if("object"==typeof i)return i.v}else this.addCart(this.selectingProduct.mapId,function(){e.exit(),g("/cart",{$dom:t})})}},{key:"onTriggerTag",value:function(){function e(e,t){for(var i in t)if(!e.type[i]||""+e.type[i].tid!=""+t[i])return!1;return!0}var t=this,i=this.$$,o={};i(".tag.active").each(function(){var e=$(this),t=e.parent().data("type-name"),i=e.data("tag");o[t]=i}),i(".tag:not(.active)").addClass("disabled");var n=void 0;this.config.list.forEach(function(t){if(e(t,o)){n=t;for(var r in t.type)o[r]||i('[data-type-name="'+r+"\"] .tag[data-tag='"+t.type[r].tid+"']").removeClass("disabled")}});var r=function(n){var r=Object.assign({},o);delete r[n],t.config.list.forEach(function(t){e(t,r)&&i('[data-type-name="'+n+'"] [data-tag="'+t.type[n].tid+'"]').removeClass("disabled")})};for(var a in o)r(a);Object.keys(o).length===Object.keys(this.config.type).length&&n?(i(".title").text(n.name),i(".price").text("¥"+u(n.price,"cent").short),i(".product-img").attr("src",n.image_url),this.selectingProduct=n,n.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,t=$(this.renderPanel(this.config.info.productName,this.config.info.price,this.config.info.image_url)),i=t.find.bind(t);this.$$=i;var o=function(t){var o=e.config.type[t],n=$(e.renderSection(t));i(".layer>main").append(n),o.forEach(function(t){n.find("main").append($(e.renderTag(t)))})};for(var n in this.config.type)o(n);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 r=this;t.on("tap",".tag",function(){var e=$(this),t=e.parent();e.hasClass("disabled")||(e.hasClass("active")?(e.inactive(),t.inactive()):(e.active(),t.active(),e.siblings().inactive()),r.onTriggerTag())});var a=x({$dom:t,cb:function(){return e.emit("exit")},closeOnTap:!1,tapShadowHide:!0,backToExit:!0}),c=a.exit;this.exit=c,t.parent().css({left:0,right:0,"max-width":"none"})}},{key:"handleResult",value:function(e){var t=this;this.detailResult=e;var i={};if(!e.group){var o="none"===this.props.$sourceDom[0].style.display||this.props.$sourceDom.hasClass("hide");return void console.warn("商品信息错误",e,this.props.gid,o?"(已隐藏)":"")}var n=e.group;this.props.pidWhiteList&&this.props.pidWhiteList.match(/[^ ]/)&&!function(){var i=t.props.pidWhiteList.split(/ +/).filter(function(e){return e});e.tag_prop=e.tag_prop.filter(function(e){var t=e.pid;return i.indexOf(""+t)>-1}),e.props=e.props.filter(function(e){var t=e.pid;return i.indexOf(""+t)>-1});var o={};e.tag_prop.forEach(function(e){var t=e.tid;o[t]=!0}),e.group.forEach(function(e){e.tags=e.tags.filter(function(e){var t=e.tid;return o[t]})})}();var r=e.tag_prop;n.forEach(function(e){i[e.name]=[],e.tags.forEach(function(t){i[e.name].push(t)})});var a=e.props.filter(function(e){return"-1"!==e.status&&e.status!==-1}).map(function(e){var t=[],i={};r.forEach(function(i){i.pid===e.pid&&t.push(i.tid)}),n.forEach(function(e){var o=e.name;e.tags.forEach(function(e){var n=t.indexOf(e.tid);n>-1&&(i[o]=e)})});var o=void 0;return o=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:o,image_url:e.img,origin_price:parseInt(e.market_price),name:e.name}}),c={price:u(e.good.price_min,"cent").short,productName:e.good.name,image_url:e.good.pic_url};return{info:c,type:i,list:a}}},{key:"preloadDetail",value:function(e){var i=this;t.getDetailCnt>50?(t.getDetailCnt=0,t.requestQueue=[]):clearTimeout(t.getDetailTimeout),t.requestQueue.push(e),t.getDetailCnt++;var o=t.requestQueue.slice();t.getDetailTimeout=setTimeout(function(){var e={};o.forEach(function(t){e[t.props.gid]=!0}),setTimeout(function(){i.getDetail(e).then(function(e){o.forEach(function(t){var i=t.props.gid;t.onGetDetail(e[i])}),o.length=0})},1e3)})}}]),t}(b);C.requestQueue=[],C.getDetailTimeout=0,C.getDetailCnt=0,t.exports=C}(a,e),e.exports&&(m["/cloud/module/product_big/bottom_window.js"]=e.exports)}(),p="/cloud/module/venue_single_product/venue_single_product.action.js",function(){var e={type:"resource"};!function(e,t){function i(e,t){var i=void 0,o=void 0;return parseInt(e)>1e8?(i={model:"Cart",action:"add",parameters:{product_id:e,consumption:"1"}},o=y({url:T,$dom:t})):(i={model:"Cart",action:"add",parameters:{pid:e,num:"1"}},o=y({url:x,$dom:t})),h({data:{detail:i},url:o,$dom:t}).then(function(e){v(e.detail.code?_(e.detail)||"加入购物车失败":g.app||g.weirdhybrid||$(".editor-fixed-cart-btn").length?"加入购物车成功":"已加入购物车")}).catch(function(e){})}function r(e,t){k&&clearTimeout(k),P.push({gid:e,cb:t}),k=setTimeout(function(){var e=P.slice(0);P.length=0,k=0;var t={model:"Product",action:"GetDetailLite",parameters:{}};t.parameters.gid=e.map(function(e){var t=e.gid;return t});var i=void 0;i="static.home.mi.com"===location.host?x:"/app/shopv3/pipe",h({data:{gid:t},success:function(t){if(t.code)return void v(_(t));var i=t.gid.data;e.forEach(function(e){var t=e.gid,o=e.cb;i[t]&&o(i[t])})},error:function(e){v("获取商品信息失败"),console.warn(e)},url:i,skipLogin:!0})},10)}function a(e,t){var i=e.optional||{},o=e.tag||{},n={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(t.attr_ext){var r=t.attr_ext;n.name=i.name||r.custom_name,n.summary=i.summary||r.custom_summary,1===r.price_tag&&(n.unit="元起")}return n.name||(n.name=i.name||t.name),n.summary||(n.summary=i.summary||t.summary),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))),n.price=p(t.price_min,"cent").short,n.marketPrice=p(t.market_price,"cent").short,n.showMarketPrice=1*t.price_min<1*t.market_price,n.downPriceValue=t.market_price-t.price_min,n.downPrice=p(n.downPriceValue,"cent").short,n.discountText=""+Math.ceil(t.price_min/t.market_price*100)/10,n.discountText=""+n.discountText.replace(/\.\d+/,function(e){return e.slice(0,2)}).replace(/\.0/,""),o.show&&"是"!==o.isUseDefault?(n.showTag=!0,n.tagLineCount=parseInt(o.lines),n.firstTagLine=1===n.tagLineCount?o.text:o.firstLine,n.secondTagLine=2===n.tagLineCount?o.secondLine||"":"",n.tagDifferent=2===n.tagLineCount&&o.different,n.tagBgImg=o.bgImg||"https://shop.io.mi-img.com/app/shop/img?id=shop_c4c9010921186fa4484ac898540d602e.png&w=114&h=132"):(n.showMarketPrice&&(n.showTag=!0,n.secondTagLine=n.downPrice),n.tagBgImg=o.bgImg||"https://shop.io.mi-img.com/app/shop/img?id=shop_c4c9010921186fa4484ac898540d602e.png&w=114&h=132"),t.inventory&&(n.inventory=t.inventory),n}function c(e,t){function o(e){var i="//m.xiaomiyoupin.com/shop/detail?gid="+t.gid;t.pid&&(i+="&pid="+t.pid);var o=t.href||i;return setTimeout(function(){I||f(o,{$dom:r})}),e&&e.stopPropagation(),!1}var n=e.$$,r=e.$dom,a=n(".tag-box"),c=n(".img-box img"),s=n(".btn");l(r);n(".name").html(t.name).on("tap",o),n(".name-extra").html(t.name).on("tap",o),n(".desc").html(t.summary).on("tap",o),n(".desc-extra").html(t.summary).on("tap",o),n(".present-price").html(t.price),t.showMarketPrice&&n(".market-price").html(t.marketPrice+"元").show(),"元起"===t.unit&&n(".price-yen").html(t.unit),t.pid||s.html(t.btnTitle),t.showTag&&(a.addClass("in").css("background-image","url("+t.tagBgImg+")"),1===t.tagLineCount&&a.addClass("one-line"),t.tagDifferent&&a.addClass("different"),a.find(".first-line").html(t.firstTagLine),a.find(".second-line").html(t.secondTagLine)),c.on("tap",o),g.wxminiprogram&&r.on("tap",o),s.on("tap",function(){return s.hasClass("waiting")?void v("抢购还未开始,请保持关注"):s.hasClass("disable")?void(s.hasClass("soldoff")&&v("商品已售罄,下次早点来吧")):s.hasClass("success")?(m(t.gid,t.pid,r,t.btnTitle),void("加入购物车"===t.btnTitle?i(t.pid,r).catch(function(e){v(e)}):o())):void("加入购物车"===t.btnTitle?e.bottomWindow.trigger():o())})}function m(e,t,i,o){function n(e){var t=parseInt(e/3600),i=parseInt(e%3600/60),o=e-3600*t-60*i;return t<10&&(t="0"+t),i<10&&(i="0"+i),o<10&&(o="0"+o),t+":"+i+":"+o}function r(e,t){d.html(n(e--)),c&&clearInterval(c),c=setInterval(function(){e>0?d.html(n(e--)):t()},1e3)}function a(n){function a(){d.removeClass("waiting"),c&&clearInterval(c),!g.inventory||parseInt(g.inventory)<=0?d.html("已售罄").addClass("disable soldoff"):d.html(o).addClass("success toDetail")}var s=n.detail&&n.detail.data,l=n.activity&&n.activity.data,u=null,p=Array.isArray(s.props)&&s.props,g=null;return p&&p.forEach(function(e){e.pid==t&&(g=e)}),g?w().then(function(n){if(!Array.isArray(l)||0===l.length)return a(),Promise.resolve(g);for(var s=0,p=void 0;s-1||p.pids.indexOf(parseInt(t))>-1)&&n>p.start&&nn?(h=f-n,h>86400&&(h=86400),setTimeout(function(){c&&clearInterval(c),m(e,t,i,o)},1e3*h+500)):h=0,0===h)return void a();d.addClass("waiting");var v=parseInt(h/86400);v>1?(d.html("倒计时"+v+"天"),setTimeout(function(){c&&clearInterval(c),m(e,t,i,o)},1e3*(h-24*v*3600))):r(h,function(){return setTimeout(function(){m(e,t,i,o)},1e3)})}else a();return Promise.resolve(g)}):Promise.reject("no pid detail")}var c=void 0,s={activity:{model:"Activity",action:"getAct",parameters:{gid:e}},detail:{model:"Shopv2",action:"getDetail",parameters:{gid:e}}},d=i.find(".btn").removeClass("hide");return h({data:s}).then(a)}function l(e){var t=e.data("editor-trace");return window.articleModeTraceName+"-"+window.articleId+"-"+t}var u=e("mi-home-lib"),p=u.formatMoney,g=u.ua,h=(u.args,u.addParam,u.miFetch2),f=u.jumpTo,v=u.toast,b=u.Rag,_=u.getChineseMessage,w=(u.floatingLayerId,u.getServerTimestamp),y=u.getTracedUrl2,T=u.PIPE_URL,x=(u.SHOPV3_URL,u.GPIPE_URL),C=e("/cloud/module/product_big/bottom_window.js"),k=void 0,P=[],I=!1,S=void 0;$(window).on("scroll",function(){I=!0,S&&clearTimeout(S),S=setTimeout(function(){S=null,I=!1},100)}),t.exports=function(e){function t(e,i){n(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,i),this.initBtnTitle=e.btnTitle,this.init(e,i)}return o(t,e),d(t,[{key:"init",value:function(e){var t=this,i=e.gid,o=e.pid;i&&(o?m(i,o,this.$dom,this.initBtnTitle).then(function(i){var o=a(e,i);c(t,o)}).catch(function(e){return console.log(e)}):r(i,function(o){if(!o)return void console.warn("gid error",i);var n=a(e,o);c(t,n)}),"加入购物车"===e.btnTitle&&(this.bottomWindow=new C({id:"venue-product-floating",gid:e.gid,$sourceDom:this.$dom})))}}]),t}(b)}(a,e),e.exports&&(m["/cloud/module/venue_single_product/venue_single_product.action.js"]=e.exports)}(),p="/cloud/container/pure_container/pure_container.action.js",function(){var e={type:"resource"};!function(e,t){}(a,e),e.exports&&(m["/cloud/container/pure_container/pure_container.action.js"]=e.exports)}(),p="/cloud/module/rec_meeting_two/rec_meeting_two.action.js",function(){var e={type:"resource"};!function(e,t){var i=e("mi-home-lib"),r=i.Rag;t.exports=function(e){function t(){n(this,t);for(var e=arguments.length,i=Array(e),o=0;o0&&"none"==o?(t.$$(".more_img").animate({rotate:"180deg"}),t.$$(".scroll_cont").hide(),t.$$(".pull_div").animate({display:"block"})):(t.$$(".more_img").animate({rotate:"180deg"}),t.$$(".scroll_cont").show(),t.$$(".pull_div").animate({display:"none"}))}},{key:"active",value:function(e){var t=this,i=$("#rags-container").width(),o=e.offset();this.iscroll&&this.iscroll.scrollToElement(e[0],700,0-i/2+o.width/2),e.css({color:this.props.colorHighlightText,borderBottom:"2px solid "+this.props.colorHighlightText});var n=this.$dom.find("a");this.$dom.find(".splitter").remove(),n.forEach(function(i,o){var r=n[o+1]===e[0],a=i===e[0];o===n.length-1||r||a||$(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(t){var i=t.id,o=$("#"+i);e.targetList.push({$dom:o})})}},{key:"render",value:function(){var e=this,t=$(window);t.on("scroll",function(){i()}),this.setUpTargetList(),this.show();var i=function(){var i=[],o=t.scrollTop();o>=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,t){var o=e.$dom,n=o.offset();if(n){var r=n.top;i[t]=r}}),i=i.map(function(e,t){var o=1/0;return i.forEach(function(i,n){t!==n&&i>e&&i=r&&o"),l=0;l=t)&&(n.push(e),!0)}),n.join(",")}var n=arguments.length<=3||void 0===arguments[3]?c:arguments[3],s={unit:"元",name:"",src:"",descr:"",price:"",marketPrice:"",showMarketPrice:"",showTag:e.showTag,goods_type:t.goods_type,status:t.status};if(t.attr_ext){var d=t.attr_ext;(1===d.price_tag||e.daiqi)&&(s.unit="元起"),d.custom_name&&!e.name&&(s.name=d.custom_name),d.custom_summary&&!e.descr&&(s.descr=d.custom_summary)}return s.name||(s.name=e.name||t.name),e.src?s.src=e.src:e.imgType?"800图"===e.imgType||t.album_url.match(/mp4$/)?s.src=t.img800:"场景图"===e.imgType&&(s.src=t.album_url):e.showWhiteProductImage||t.album_url.match(/mp4$/)?s.src=t.pic_url:s.src=t.album_url,"undefined"!=typeof r&&r.android&&(s.src=a(s.src,"t","webp")),s.descr||(e.descr?s.descr=e.descr:i?s.descr=o(t.summary,18):s.descr=t.summary),t.market_price||(t.market_price=t.price_min),e.price&&(t.price_min=Math.round(100*e.price)),e.priceOriginal&&(t.market_price=Math.round(100*e.priceOriginal)),s.showBtn=!0,(t.crowdfunding||2===t.type)&&(s.showBtn=!1),s.price=n(t.price_min,"cent").short,s.marketPrice=n(t.market_price,"cent").short,s.showMarketPrice=1*t.price_min<1*t.market_price,s.downPriceValue=t.market_price-t.price_min,s.downPrice=n(s.downPriceValue,"cent").short,s.downPriceText="直降"+s.downPrice+"元",s.discountText=""+Math.ceil(t.price_min/t.market_price*100)/10,s.discountText=""+s.discountText.replace(/\.\d+/,function(e){return e.slice(0,2)}).replace(/\.0/,""),s}function o(e,t){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];if(e(".unit").text(t.unit),i.static||(e(".product-name").html(t.name),e(".product-descr").html(t.descr)),e(".price-wrap .num").text(t.price),t.showMarketPrice&&(e(".price-wrap-market").show(),e(".price-wrap-market .num").text(t.marketPrice),t.showTag&&e(".link-wrap>.tag").show().text(t.downPriceText)),t.showBtn||e(".bottom-btn").hide(),t.status===-1){var o=void 0;t.status===-1?o="商品已下架":0===t.status&&(o="商品未上架"),e(".top-wrap").addClass("inactive").append('\n \n '+o+"\n \n ")}var n=e('[data-editor-tag-name="horizontal_border_label"]'),r=e('[data-editor-tag-name="circle-background-double-line"]'),a=n.find(".tag-content"),c=r.find(".tag-content");if(n.length&&t.showMarketPrice&&(a.text()||(a.text(t.downPriceText),n.children().show())),r.length&&t.showMarketPrice&&(!c.text()||!c.text().trim()))if(r.find('[data-auto-mode="××折"]').length)c.html(''+t.discountText+'折'),r.children().show();else{var s="";t.downPriceValue>1e5&&(s="#ffea00"),c.html('直降'+t.downPrice+""),r.children().show()}}var n=e("mi-home-lib"),r=n.ua,a=n.addParam,c=n.formatMoney,s="product2-floating-layer";t.exports={getFinalInfo:i,renderFinalInfo:o,floatingLayerId:s}}(a,e),e.exports&&(m["/cloud/module/product_big/util.js"]=e.exports)}(),function(){var e={type:"resource"};!function(e,t){var i=e("mi-home-lib"),r=i.formatMoney,a=i.ua,c=i.setTrace,m=(i.addParam,i.miFetch2),l=i.jumpTo,u=i.toast,p=i.Rag,g=i.GPIPE_URL,h=i.getChineseMessage,f=e("/cloud/module/product_big/util.js"),v=f.getFinalInfo,b=f.renderFinalInfo,_=f.floatingLayerId,w=e("/cloud/module/product_big/bottom_window.js"),y=void 0,T=window.publicAttribute["产品模块"]&&window.publicAttribute["产品模块"].neigou,x=[];t.exports=function(e){function t(e,i){var o=this;n(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,i),e.inFirstPage?this.init(e,i):setTimeout(function(){o.init(e,i)},500)}return o(t,e),d(t,[{key:"replaceA",value:function(){var e=this;try{var t=function(){var t=e.$$("a.img-link"),i=t.attr("href"),o=t.children();if(!t[0])return{v:void 0};var n=$(t[0].outerHTML.replace(//g,"/div>"));n.empty(),n.append(o),t.replaceWith(n),n.originalOn("tap",function(){l(i,{$dom:e.$dom,weak:!0})})}();if("object"==typeof t)return t.v}catch(e){u(e.message)}}},{key:"init",value:function(e){var i=this,o=this.$dom,n=this.$$,s=e.gid;if(!(!s||T&&window.isEditor)){a.pc&&1===window.devicePixelRatio&&o.find(".top-a-wrap").css("border","1px solid rgb(204,204,204)");var d=n(".img-link"),m=n("a.buy-btn-wrap"),l=$().add(d).add(m),u=void 0;u=e.href?e.href:"//m.xiaomiyoupin.com/shop/detail?gid="+s,l.attr("href",u),this.href=u,c(l),a.pc||this.replaceA(),n(".bottom-btn").on("tap",function(){"加入购物车"===e.btn&&i.countEvent("addcart")}),"加入购物车"===e.btn&&!function(){var t=new w({id:_,gid:s,$sourceDom:o,pidWhiteList:e.pidWhiteList});n(".bottom-btn.cart-btn").on("click",function(){t.trigger()})}();var p=o.parent().is('[data-name="horizontal_layout"],[data-name="test_container"],[data-name="horizontal_scroll_container"],.horizontal_scroll_container_body,.horizontal-adjust-wrapper');this.isSmall=p;var g=n(".top-wrap");a.android&&g.addClass("android"),a.iOS&&g.addClass("iOS"),a.pc&&g.addClass("pc"),p?g.addClass("thin"):g.addClass("big"),("没按钮"===e.btn||a.weirdhybrid)&&(this.nobutton=!0,g.addClass("nobutton")),t.getDetail(s,function(t){if(!t)return void console.warn("gid error",s);var o=v(e,t,p,r);i.finalInfo=o,b(n,o,e),i.afterRender()})}}},{key:"afterRender",value:function(){function e(){var e=i.parent()[0].containerAdjustHeight;e&&e()}function t(){a&&a.css("position","static").removeClass("loading"),r.removeClass("loading").css({"min-height":"0px"}),n?r.css("padding-top","100%"):r.css("padding-top","0px")}var i=this.$dom,o=this.$$,n=this.isSmall,r=o(".img-link"),a=o(".product");e(),a.length?a[0].naturalWidth?t():a.on("load",t):t(),this.afterAfterRender&&this.afterAfterRender()}}],[{key:"getDetail",value:function(e,t){y&&clearTimeout(y),x.push({gid:e,cb:t}),y=setTimeout(function(){var e=x.slice(0);x.length=0,y=0;var t={model:"Product",action:T?"GetDetailLiteWithAct":"GetDetailLite",parameters:{}};t.parameters.gid=e.map(function(e){var t=e.gid;return t});var i=void 0;i="static.home.mi.com"===location.host?g:"/app/shopv3/pipe",m({data:{gid:t},success:function(t){if(t.code)return void u(h(t));var i=t.gid.data,o=function(t){e.forEach(function(e){var o=e.gid,n=e.cb;t===""+o&&n(i[t])})};for(var n in i)o(n)},error:function(e){u("获取商品信息失败"),console.warn(e)},url:T?"/app/shopv3/pipe":i,skipLogin:!T})},100)}}]),t}(p)}(a,e),e.exports&&(m["/cloud/module/product_big/action.js"]=e.exports)}(),p="/cloud/module/product_medium2/product_medium2.action.js",function(){var e={type:"resource"};!function(e,t){var i=e("/cloud/module/product_big/action.js"),r=e("mi-home-lib"),a=(r.toast,r.YoupinImg,!1),c=void 0;$(window).on("scroll",function(){a=!0,c&&clearTimeout(c),c=setTimeout(function(){c=null,a=!1},100)}),t.exports=function(e){function t(){var e=this;n(this,t);for(var i=arguments.length,o=Array(i),r=0;r