\n '):u.append('\n
\n ')}),Promise.all(g.map(function(e){return n(e.img)})).then(function(){s||u.removeClass("hide")})}return _inherits(t,e),t}(r)}(require,e),e.exports&&(allModuleMap["/cloud/module/smart_nav_bar/smart_nav_bar.action.js"]=e.exports)}(),currentProcessingModule="/cloud/container/venue_card_container/venue_card_container.action.js",function(){var e={type:"resource"};!function(e,t){t.exports=function(){function e(t,i){_classCallCheck(this,e);var o=$('[data-id="'+i+'"]'),r=o.children(),a=r.length;r.eq(Math.floor(Math.random()*a)).show()}return e}()}(require,e),e.exports&&(allModuleMap["/cloud/container/venue_card_container/venue_card_container.action.js"]=e.exports)}(),function(){var e={type:"resource"};!function(e,t){var i=e("mi-home-lib"),o=i.PIPE_URL,r=i.getTracedUrl2,a=i.getChineseMessage,n=i.GPIPE_URL,d=i.formatMoney,c=i.ua,s=i.jumpTo,l=i.getLogin,u=i.jumptoLogin,p=i.countEvent,h=i.EventEmitter,g=i.eventEmitter,m=i.toast,f=i.miFetch2,v=i.isEditor,w=i.showBottomWindow2,b=function(e){function t(e){_classCallCheck(this,t),_get(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.fetching=!1,this.props=e,v||this.preloadDetail(this)}return _inherits(t,e),_createClass(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 m(a(o));o=o.result;var r={};for(var n in e)r[n]=o[n];t.fetching=!1,i(r)},error:function(e){console.log(2,e),o(e)}})})}},{key:"addCart",value:function(e,t){var i=this,d=void 0,s=void 0;return parseInt(e)>1e8?(d={model:"Cart",action:"add",parameters:{product_id:e,consumption:"1"}},s=r({url:o,$dom:this.props.$sourceDom})):(d={model:"Cart",action:"add",parameters:{pid:e,num:"1"}},s=r({url:n,$dom:this.props.$sourceDom})),this.props.cartExtraParams&&Object.assign(d.parameters,this.props.cartExtraParams),f({data:{detail:d},url:s,$dom:this.props.$sourceDom}).then(function(e){e.detail.code?m(a(e.detail)||"加入购物车失败"):(g.emit("add-cart-success"),i.emit("cart-success"),m(c.app||c.weirdhybrid||$(".editor-fixed-cart-btn").length?"加入购物车成功":"已加入购物车"),t&&t())})}},{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,t,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(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 m("不支持编辑器内使用");if(!this.fetching){if(!this.config)return void this.getDetail(_defineProperty({},this.props.gid,!0)).then(function(t){return t=t[e.props.gid],t.code?void m(a(t)):(e.onGetDetail(t),void e.trigger())});var t=0;if(!this.detailResult)return void m("数据加载中...");if(p("trigger-bottom",this.props.$sourceDom),!this.config.list)return this.detailResult&&this.detailgood.code&&m(a(this.detailgood)),void l().then(function(e){e||u()});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):m("商品已售罄")}}},{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 m("请先选中商品");if(this.selectingProduct.pid){var i=function(){if(e.selectingProduct.map_id&&"0"!==e.selectingProduct.map_id)return e.exit(),s("https://m.xiaomiyoupin.com/shop/detail?gid="+e.props.gid+"&pid="+e.selectingProduct.pid,{$dom:t}),{v:void 0};var i=void 0;i=c.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(),l().then(function(e){if(e)s(i,{$dom:t});else{var o=r({url:i,$dom:t});u(o)}})}();if("object"==typeof i)return i.v}else this.addCart(this.selectingProduct.mapId,function(){e.exit(),s("https://m.xiaomiyoupin.com/shop/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 r=void 0;this.config.list.forEach(function(t){if(e(t,o)){r=t;for(var a in t.type)o[a]||i('[data-type-name="'+a+"\"] .tag[data-tag='"+t.type[a].tid+"']").removeClass("disabled")}});var a=function(r){var a=Object.assign({},o);delete a[r],t.config.list.forEach(function(t){e(t,a)&&i('[data-type-name="'+r+'"] [data-tag="'+t.type[r].tid+'"]').removeClass("disabled")})};for(var n in o)a(n);Object.keys(o).length===Object.keys(this.config.type).length&&r?(i(".title").text(r.name),i(".price").text("¥"+d(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,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],r=$(e.renderSection(t));i(".layer>main").append(r),o.forEach(function(t){r.find("main").append($(e.renderTag(t)))})};for(var r in this.config.type)o(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;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()),a.onTriggerTag())});var n=w({$dom:t,cb:function(){return e.emit("exit")},closeOnTap:!1,tapShadowHide:!0,backToExit:!0}),d=n.exit;this.exit=d,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 r=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 a=e.tag_prop;r.forEach(function(e){i[e.name]=[],e.tags.forEach(function(t){i[e.name].push(t)})});var n=e.props.filter(function(e){return"-1"!==e.status&&e.status!==-1}).map(function(e){var t=[],i={};a.forEach(function(i){i.pid===e.pid&&t.push(i.tid)}),r.forEach(function(e){var o=e.name;e.tags.forEach(function(e){var r=t.indexOf(e.tid);r>-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:d(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 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}(h);b.requestQueue=[],b.getDetailTimeout=0,b.getDetailCnt=0,t.exports=b}(require,e),e.exports&&(allModuleMap["/cloud/module/product_big/bottom_window.js"]=e.exports)}(),currentProcessingModule="/cloud/module/venue_main_product_card_a/venue_main_product_card_a.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=v({url:w,$dom:t})):(i={model:"Cart",action:"add",parameters:{pid:e,num:"1"}},o=v({url:b,$dom:t})),u({data:{detail:i},url:o,$dom:t}).then(function(e){h(e.detail.code?m(e.detail)||"加入购物车失败":l.app||l.weirdhybrid||$(".editor-fixed-cart-btn").length?"加入购物车成功":"已加入购物车")})}function o(e,t){y&&clearTimeout(y),C.push({gid:e,cb:t}),y=setTimeout(function(){var e=C.slice(0);C.length=0,y=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?b:"/app/shopv3/pipe",u({data:{gid:t},success:function(t){if(t.code)return void h(m(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){h("获取商品信息失败"),console.warn(e)},url:i,skipLogin:!0})},10)}function r(e,t){var i=e.optional||{},o=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(t.attr_ext){var a=t.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||t.name),r.summary||(r.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))),r.price=s(t.price_min,"cent").short,r.marketPrice=s(t.market_price,"cent").short,r.showMarketPrice=1*t.price_min<1*t.market_price,r.downPriceValue=t.market_price-t.price_min,r.downPrice=s(r.downPriceValue,"cent").short,r.discountText=""+Math.ceil(t.price_min/t.market_price*100)/10,r.discountText=""+r.discountText.replace(/\.\d+/,function(e){return e.slice(0,2)}).replace(/\.0/,""),o.show?(r.showTag=!0,r.tagLineCount=parseInt(o.lines),r.firstTagLine=1===r.tagLineCount?o.text:o.firstLine,r.secondTagLine=2===r.tagLineCount?o.secondLine||"":"",r.tagDifferent=2===r.tagLineCount&&o.different,r.tagBgImg=o.bgImg||"https://shop.io.mi-img.com/app/shop/img?id=shop_afbd3e9203ca5887559d665f6172c625.png&w=120&h=121"):r.showMarketPrice&&(r.showTag=!0,r.secondTagLine=r.downPrice),t.inventory&&(r.inventory=t.inventory),r}function a(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 p(o,{$dom:a}),e&&e.stopPropagation(),!1}var r=e.$$,a=e.$dom,c=r(".tag-box"),s=r(".img-box img"),u=r(".btn");d(a);r(".name").html(t.name).on("tap",o),r(".desc").html(t.summary).on("tap",o),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||u.html(t.btnTitle),t.showTag&&(c.addClass("in").css("background-image","url("+t.tagBgImg+")"),1===t.tagLineCount&&c.addClass("one-line"),t.tagDifferent&&c.addClass("different"),c.find(".first-line").html(t.firstTagLine),c.find(".second-line").html(t.secondTagLine)),s.on("tap",o),l.wxminiprogram&&a.on("tap",o),u.on("tap",function(){return u.hasClass("waiting")?void h("抢购还未开始,请保持关注"):u.hasClass("disable")?void(u.hasClass("soldoff")&&h("商品已售罄,下次早点来吧")):u.hasClass("success")?(n(t.gid,t.pid,a,t.btnTitle),void("加入购物车"===t.btnTitle?i(t.pid,a).catch(function(e){h(e)}):o())):void("加入购物车"===t.btnTitle?e.bottomWindow.trigger():o())})}function n(e,t,i,o){function r(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 a(e,t){l.html(r(e--)),c&&clearInterval(c),c=setInterval(function(){e>0?l.html(r(e--)):t()},1e3)}function d(r){function d(){l.removeClass("waiting"),c&&clearInterval(c),!g.inventory||parseInt(g.inventory)<=0?l.html("已售罄").addClass("disable soldoff"):l.html(o).addClass("success toDetail")}var s=r.detail&&r.detail.data,u=r.activity&&r.activity.data,p=null,h=Array.isArray(s.props)&&s.props,g=null;return h&&h.forEach(function(e){e.pid==t&&(g=e)}),g?f().then(function(r){if(!Array.isArray(u)||0===u.length)return d(),Promise.resolve(g);for(var s=0,h=void 0;s-1||h.pids.indexOf(parseInt(t))>-1)&&r>h.start&&rr?(m=f-r,m>86400&&(m=86400),setTimeout(function(){c&&clearInterval(c),n(e,t,i,o)},1e3*m+500)):m=0,0===m)return void d();l.addClass("waiting");var v=parseInt(m/86400);v>1?(l.html("倒计时"+v+"天"),setTimeout(function(){c&&clearInterval(c),n(e,t,i,o)},1e3*(m-24*v*3600))):a(m,function(){return setTimeout(function(){n(e,t,i,o)},1e3)})}else d();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}}},l=i.find(".btn").removeClass("hide");return u({data:s}).then(d)}function d(e){var t=e.data("editor-trace");return window.articleModeTraceName+"-"+window.articleId+"-"+t}var c=e("mi-home-lib"),s=c.formatMoney,l=c.ua,u=(c.args,c.addParam,c.miFetch2),p=c.jumpTo,h=c.toast,g=c.Rag,m=c.getChineseMessage,f=(c.floatingLayerId,c.getServerTimestamp),v=c.getTracedUrl2,w=c.PIPE_URL,b=(c.SHOPV3_URL,c.GPIPE_URL),_=e("/cloud/module/product_big/bottom_window.js"),y=void 0,C=[];t.exports=function(e){function t(e,i){_classCallCheck(this,t),_get(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,i),this.initBtnTitle=e.btnTitle,this.init(e,i)}return _inherits(t,e),_createClass(t,[{key:"init",value:function(e){var t=this,i=e.gid,d=e.pid;i&&(d?n(i,d,this.$dom,this.initBtnTitle).then(function(i){var o=r(e,i);a(t,o)}).catch(function(e){return console.log(e)}):o(i,function(o){if(!o)return void console.warn("gid error",i);var n=r(e,o);a(t,n)}),"加入购物车"===e.btnTitle&&(this.bottomWindow=new _({id:"venue-product-floating",gid:e.gid,$sourceDom:this.$dom})))}}]),t}(g)}(require,e),e.exports&&(allModuleMap["/cloud/module/venue_main_product_card_a/venue_main_product_card_a.action.js"]=e.exports)}(),currentProcessingModule="/cloud/module/crowdfunding_small/crowdfunding_small.action.js",function(){var e={type:"resource"};!function(e,t){var i=e("mi-home-lib"),o=i.jumpTo,r=i.Rag,a=i.formatMoney;t.exports=function(e){function t(e,i){_classCallCheck(this,t),_get(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,i),this.fetchData(e.gid)}return _inherits(t,e),_createClass(t,[{key:"fetchData",value:function(e){var t=this;$.ajax({type:"GET",url:'//m.xiaomiyoupin.com/app/shop/jsonp?k=test&m=Product&a=GetDetail&p={"gid":'+e+"}",dataType:"jsonp",success:function(e){var i=e&&0===e.code&&e.data;i&&t.renderDom(i)}})}},{key:"renderDom",value:function(e){var t=this.$$,i=this.props,r=this.$dom,n=t(".title"),d=t(".desc"),c=t(".priceNum"),s=t(".saledCount"),l=t(".fundBase"),u=t(".percent"),p=t(".processShadow"),h=function(){var t=1e3*e.crowdfunding.end-Date.now();return parseInt(t/864e5)}();i.includeQi||t(".qi").hide(),n.html(i.title||e.goods.name),d.html(i.desc||e.goods.summary),c.html(a(i.price||e.goods.market_price,"cent").short),s.html(e.crowdfunding.saled_count),l.html("/"+e.crowdfunding.target_count+"人支持/剩余"+h+"天"),u.html(e.crowdfunding.progress+"%"),e.crowdfunding.progress<100&&p.css("width",100-e.crowdfunding.progress+"%"),r.on("tap",function(){return o(i.href||"//m.xiaomiyoupin.com/shop/detail?gid="+i.gid,{$dom:r})})}}]),t}(r)}(require,e),e.exports&&(allModuleMap["/cloud/module/crowdfunding_small/crowdfunding_small.action.js"]=e.exports)}(),function(){var e={type:"resource"};!function(e,t){var i=e("util"),o=i.eventEmitter;t.exports=function(e){function t(){function e(e){var t=e.children()[0].scrollHeight,i=1*(e.css("border-bottom-width").match(/^[\d.]+/)||[0])[0],o=1*(e.css("border-top-width").match(/^[\d.]+/)||[0])[0];return t+i+o}var t=function(t){var i=r[t];if(i.length<2)return"continue";var o=Math.max.apply(Math,_toConsumableArray(i.map(e)));i.forEach(function(e){e.css("min-height",o+"px")})};for(var i in r){t(i)}}function i(){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=i,i(),o.on("base-width-change",function(e){if(e!==n){n=e;for(var t in r){var o=r[t];o.length<2||o.forEach(function(e){e.css("min-height","0px")})}i()}}))}}(require,e),e.exports&&(allModuleMap["/cloud/container/horizontal_layout/adjust-height.js"]=e.exports)}(),currentProcessingModule="/cloud/container/horizontal_layout/horizontal_layout.action.js",function(){var e={type:"resource"};!function(e,t){var i=e("/cloud/container/horizontal_layout/adjust-height.js");t.exports=function(){function e(t,o){_classCallCheck(this,e);var r=$("[data-id="+o+"]"),a=r.find.bind(r);this.$$=a,this.$dom=r,i(this.$dom),"等高"===t.mode&&this.syncHeight()}return _createClass(e,[{key:"heightAdjust",value:function(){}},{key:"syncHeight",value:function(){function e(e){var t=e.match(/[?&]w=(\d+)\b/),i=e.match(/[?&]h=(\d+)\b/);return t&&i?{width:1*t[1],height:1*i[1]}:(toast("图片链接缺少尺寸参数:"+e),{width:0,height:0})}var t=this.$dom.children();this.$dom.addClass("stretch");var i=[],o=[],r=0,a=1,n=!0;t.each(function(t){var i=$(this),r=void 0;r="IMG"===i.prop("tagName")?i:i.find("img");var d=r.attr("src")||r.data("lazy-src"),c=e(d),s=c.width,l=c.height;if(o[t]={width:s,height:l},!s||!l)return void(n=!1);var u=a/l;parseInt(u)!==u&&(a*=l)}),n&&(t.each(function(e){var t=o[e],n=t.width,d=t.height;i[e]=a/d*n,r+=i[e]}),t.each(function(e){$(this).css("width",100*i[e]/r+"%")}))}}]),e}()}(require,e),e.exports&&(allModuleMap["/cloud/container/horizontal_layout/horizontal_layout.action.js"]=e.exports)}(),currentProcessingModule="/cloud/module/video3/video3.action.js",function(){var e={type:"resource"};!function(e,t){var i=e("mi-home-lib"),o=i.Rag,r=i.countEvent,a=i.importScript;t.exports=function(e){function t(){var e=this;_classCallCheck(this,t);for(var i=arguments.length,o=Array(i),n=0;n=t)&&(r.push(e),!0)}),r.join(",")}var r=arguments.length<=3||void 0===arguments[3]?d:arguments[3],c={unit:"元",name:"",src:"",descr:"",price:"",marketPrice:"",showMarketPrice:"",showTag:e.showTag,goods_type:t.goods_type,status:t.status};if(t.attr_ext){var s=t.attr_ext;(1===s.price_tag||e.daiqi)&&(c.unit="元起"),s.custom_name&&!e.name&&(c.name=s.custom_name),s.custom_summary&&!e.descr&&(c.descr=s.custom_summary)}return c.name||(c.name=e.name||t.name),e.src?c.src=e.src:e.imgType?"800图"===e.imgType?c.src=t.img800:"场景图"===e.imgType&&(c.src=t.album_url):e.showWhiteProductImage?c.src=t.pic_url:c.src=t.album_url,"undefined"!=typeof a&&a.android&&(c.src=n(c.src,"t","webp")),c.descr||(e.descr?c.descr=e.descr:i?c.descr=o(t.summary,18):c.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)),c.showBtn=!0,(t.crowdfunding||2===t.type)&&(c.showBtn=!1),c.price=r(t.price_min,"cent").short,c.marketPrice=r(t.market_price,"cent").short,c.showMarketPrice=1*t.price_min<1*t.market_price,c.downPriceValue=t.market_price-t.price_min,c.downPrice=r(c.downPriceValue,"cent").short,c.downPriceText="直降"+c.downPrice+"元",c.discountText=""+Math.ceil(t.price_min/t.market_price*100)/10,c.discountText=""+c.discountText.replace(/\.\d+/,function(e){return e.slice(0,2)}).replace(/\.0/,""),c}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('")}var r=e('[data-editor-tag-name="horizontal_border_label"]'),a=e('[data-editor-tag-name="circle-background-double-line"]'),n=r.find(".tag-content"),d=a.find(".tag-content");if(r.length&&t.showMarketPrice&&(n.text()||(n.text(t.downPriceText),r.children().show())),a.length&&t.showMarketPrice&&(!d.text()||!d.text().trim()))if(a.find('[data-auto-mode="××折"]').length)d.html(''+t.discountText+'折
'),a.children().show();else{var c="";t.downPriceValue>1e5&&(c="#ffea00"),d.html('直降
'+t.downPrice+"
"),a.children().show()}}var r=e("mi-home-lib"),a=r.ua,n=r.addParam,d=r.formatMoney,c="product2-floating-layer";t.exports={getFinalInfo:i,renderFinalInfo:o,floatingLayerId:c}}(require,e),e.exports&&(allModuleMap["/cloud/module/product_big/util.js"]=e.exports)}(),function(){var e={type:"resource"};!function(e,t){var i=e("mi-home-lib"),o=i.formatMoney,r=i.ua,a=i.setTrace,n=(i.addParam,i.miFetch2),d=i.jumpTo,c=i.toast,s=i.Rag,l=i.GPIPE_URL,u=i.getChineseMessage,p=e("/cloud/module/product_big/util.js"),h=p.getFinalInfo,g=p.renderFinalInfo,m=p.floatingLayerId,f=e("/cloud/module/product_big/bottom_window.js"),v=void 0,w=window.publicAttribute["产品模块"]&&window.publicAttribute["产品模块"].neigou,b=[];t.exports=function(e){function t(e,i){var o=this;_classCallCheck(this,t),_get(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,i),e.inFirstPage?this.init(e,i):setTimeout(function(){o.init(e,i)},500)}return _inherits(t,e),_createClass(t,[{key:"replaceA",value:function(){var e=this;try{var t=function(){var t=e.$$(".img-link"),i=t.attr("href"),o=t.children();if(!t[0])return{v:void 0};var r=$(t[0].outerHTML.replace(//g,"/div>"));r.empty(),r.append(o),t.replaceWith(r),r.originalOn("tap",function(){d(i,{$dom:e.$dom})})}();if("object"==typeof t)return t.v}catch(e){c(e.message)}}},{key:"init",value:function(e){var i=this,n=this.$dom,d=this.$$,c=e.gid;if(!(!c||w&&window.isEditor)){r.pc&&1===window.devicePixelRatio&&n.find(".top-a-wrap").css("border","1px solid rgb(204,204,204)");var s=d(".img-link"),l=d("a.buy-btn-wrap"),u=$().add(s).add(l),p=void 0;p=e.href?e.href:"//m.xiaomiyoupin.com/shop/detail?gid="+c,u.attr("href",p),this.href=p,a(u),r.pc||this.replaceA(),d(".bottom-btn").on("tap",function(){"加入购物车"===e.btn&&i.countEvent("addcart")}),"加入购物车"===e.btn&&!function(){var t=new f({id:m,gid:c,$sourceDom:n,pidWhiteList:e.pidWhiteList});d(".bottom-btn.cart-btn").on("click",function(){t.trigger()})}();var v=n.parent().is('[data-name="horizontal_layout"],[data-name="test_container"],[data-name="horizontal_scroll_container"],.horizontal_scroll_container_body,.horizontal-adjust-wrapper');this.isSmall=v;var b=d(".top-wrap");r.android&&b.addClass("android"),r.iOS&&b.addClass("iOS"),r.pc&&b.addClass("pc"),v?b.addClass("thin"):b.addClass("big"),("没按钮"===e.btn||r.weirdhybrid)&&(this.nobutton=!0,b.addClass("nobutton")),t.getDetail(c,function(t){if(!t)return void console.warn("gid error",c);var r=h(e,t,v,o);i.finalInfo=r,g(d,r,e),i.afterRender()})}}},{key:"afterRender",value:function(){function e(){var e=i.parent()[0].containerAdjustHeight;e&&e()}function t(){n&&n.css("position","static").removeClass("loading"),a.removeClass("loading").css({"min-height":"0px"}),r?a.css("padding-top","100%"):a.css("padding-top","0px")}var i=this.$dom,o=this.$$,r=this.isSmall,a=o(".img-link"),n=o(".product");e(),n.length?n[0].naturalWidth?t():n.on("load",t):t(),this.afterAfterRender&&this.afterAfterRender()}}],[{key:"getDetail",value:function(e,t){v&&clearTimeout(v),b.push({gid:e,cb:t}),v=setTimeout(function(){var e=b.slice(0);b.length=0,v=0;var t={model:"Product",action:w?"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?l:"/app/shopv3/pipe",n({data:{gid:t},success:function(t){if(t.code)return void c(u(t));var i=t.gid.data,o=function(t){e.forEach(function(e){var o=e.gid,r=e.cb;t===""+o&&r(i[t])})};for(var r in i)o(r)},error:function(e){c("获取商品信息失败"),console.warn(e)},url:w?"/app/shopv3/pipe":i,skipLogin:!w})},100)}}]),t}(s)}(require,e),e.exports&&(allModuleMap["/cloud/module/product_big/action.js"]=e.exports)}(),currentProcessingModule="/cloud/module/product_with_tags/product_with_tags.action.js",function(){var e={type:"resource"};!function(e,t){var i=e("/cloud/module/product_big/action.js");t.exports=function(e){function t(){_classCallCheck(this,t);for(var e=arguments.length,i=Array(e),o=0;o'),"footer"===t.mode?c.css("bottom","0"):c.css("top","0")),n.css("background-color",t.colorBg).css("pointer-events","all"),c.width($("#wrap").width()),o.on("base-width-change",function(e){c.width(e)}),$(document.body).append(c),c.append(n);var s=this;n[0].addEventListener("tap",function(e){var t=$(e.target);"A"===t.prop("tagName")&&(s.onTap(t),e.preventDefault())}),this.render(),this.setScrolling(!1),r.pc||n.find(".wrap").addClass("hide-scrollbar"),this.updateOffsetHeight(),n[0].addEventListener("touchmove",function(e){e.preventDefault()},!1),o.on("view-update",this.setUpTargetList.bind(this))}return _createClass(e,[{key:"updateOffsetHeight",value:function(){this.offsetHeight=this.$dom.height()}},{key:"setScrolling",value:function(e){this.scrolling=e,e?this.$dom.find(".wrap").addClass("prevent"):this.$dom.find(".wrap").removeClass("prevent")}},{key:"active",value:function(e,t){var i=this,o=t.preventCheckingScroll;o&&(this.preventCheckingScroll=!0);var r=(this.$dom.find(".wrap"),$("#rags-container").width()),a=e.offset(),n=a.left+0+a.width/2-r/2;n<=0&&(n=0);this.iscroll&&this.iscroll.scrollToElement(e[0],700,0-r/2+a.width/2),e.css({color:this.props.colorHighlightText,backgroundColor:this.props.colorHighlightBg});var d=this.$dom.find("a");this.$dom.find(".splitter").remove(),d.forEach(function(t,o){var r=d[o+1]===e[0],a=t===e[0];o===d.length-1||r||a||$(t).parent().append('')})}},{key:"inactive",value:function(e){e.css({color:this.props.colorText,backgroundColor:this.props.colorBg})}},{key:"show",value:function(){var e=this;this.iscroll||setTimeout(function(){e.iscroll=new window.IScroll(e.$dom[0],{mouseWheel:!0,tap:!0,scrollX:!0,scrollY:!1})},200),this.$dom.show()}},{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),i=!0;t.on("scroll",function(){i=!0}),this.setUpTargetList();var o=function(){var i=[],o=t.scrollTop();o+=e.offsetHeight-5,e.targetList.forEach(function(e,t){var o=e.$dom,r=o.offset();if(r){var a=r.top;i[t]=a}}),i=i.map(function(e,t){var o=1/0;return i.forEach(function(i,r){t!==r&&i>e&&i=a&&o与有品走近鹿客',content:"Loock.鹿客是云丁网络技术(北京)有限公司(简称“云丁科技”)旗下围绕家居智能安全针对家用市场创立的品牌。\n鹿客(Loock)品牌目前拥有Touch(智能门锁)、T1 pro(智能门锁)、Classic(智能指纹锁)、Cat(鹿客猫眼)、Monitor(门窗传感器)、Bell(门铃)等多款智能家居安防产品,其中多款产品荣获 iF设计奖、Reddot设计奖、中国好设计奖等知名奖项。\nLOOCK,是LOOK与LOCK的结合变型, LOOK意为“看见”,LOCK代表云丁科技的初心和主力产品“锁”。\nLOOCK鹿客,不仅代表着云丁用心守护家人的初心,也寓意——让更多人,看见家的美好。\n云丁科技致力于打造全球领先的智能家居安全产品和服务,希望用科技让每个人的居住更安全。其家用品牌LOOCK鹿客,将为更多家庭提供安全保障和便捷服务。"},"editor-rag-77"),$('[data-id="editor-rag-91"]').length&&new allModuleMap["/cloud/module/scroll_footer/scroll_footer.action.js"]({colorHighlightBg:"#576d88",colorHighlightText:"#ddeaf8",colorBg:"#ddeaf8",colorText:"#576d88",arr:[{id:"h",text:"鹿客热卖"},{id:"a",text:"caty智能猫眼"},{id:"b",text:"OJJ智能锁"},{id:"c",text:"Classic智能锁"},{id:"d",text:"Q2智能锁"},{id:"e",text:"智能联动"},{id:"f",text:"走近鹿客"},{id:"g",text:"鹿客推荐"}],mode:"header"},"editor-rag-91")})