¥'+t.FEzj+""}else{o='
");a.html(n,e(r.join("")).render(t));if(t.type!==2){i.on("#J_WrtMoretxt","mouseenter mouseleave",function(){a.toggleClass(this.parentNode,"tb-hover")})}}function p(t){var o,n,s;var l=true;var c='
\u66f4\u591a {{#each FEgiftsList as value index}}
\u7b2c{{value[0]}}-{{value[1]}} \u4f4d\u4ed8\u5b9a\u91d1\u7684\u987e\u5ba2\u9001{{value[2]}}
{{/each}}';if(!t.FEgiftsList.length)return;o=a.create('
- \u8d60\u54c1
');n=a.create('
');n.innerHTML=e(c).render(t);a.append(n,o);a.insertBefore(o,a.parent(a.parent(r)));if(t.status==2){s=a.get("#J_tb-wrt-addBtn");if(t.FEgiftsList.length>1){a.addClass(n,"tb-wrt-hasAddBtn");i.on(s,"click",function(){if(l){a.addClass(n,"tb-wrt-addCotent-open");l=false}else{a.removeClass(n,"tb-wrt-addCotent-open");l=true}})}}}var h={resetHeader:function(t){var e=this;if(e.headerText){if(e.isWider){a.css(".tm-yushou-steps","width","475px")}a.text(e.headerText,t.yushouTexts[0])}},initMidBanner:function(t){t.tempTitle=g_config.bizTag&16384?true:false;var i=g_config.bizTag&16384?"\u55b5\u9c9c\u751f":"\u5929\u732b\u9884\u552e",o=['
'+i,'{{#if ysTitle && !tempTitle}}
{{ysTitle}}{{/if}}\u5168\u8fc7\u7a0b:
','
','- ',"",'
','- ','{{step1Text}}{{tipText}}
',"{{#if !isEnd}}",'- \u5269\u4f59\uff1a
',"{{/if}}","
",'',"{{#if step2}}",'- ','
','- \u4ed8\u5c3e\u6b3e
','- {{step2Time}}
',"- \u5b9e\u9645\u65f6\u95f4\u53ef\u80fd\u63d0\u524d\u6216\u5ef6\u540e2\u5c0f\u65f6
",'',"{{/if}}",'- ','
','- {{step3Text}}
','- {{step3Time}}
','','- ',"",'
','- \u53d1\u8d27
','- {{step4Time}}
',"
"];var n=e(o.join("")).render(t);a.html("#tm-yushou-process-banner",n)},formatDate:function(t){var e=new Date(parseInt(t));return e.getMonth()+1+"\u6708"+e.getDate()+"\u65e5 "+e.getHours()+"\u65f6"},showDate:function(t,e){return h.formatDate(t)+" - "+h.formatDate(e)},getRenderData:function(t){var e=t.yushouTexts,a=["","\u672a\u5f00\u59cb","\u9884\u5b9a\u4e2d","\u5df2\u7ed3\u675f"],i=this;if(!e)return;var o={isEnd:t.status==3,ysTitle:e[1],tipText:t.fullPayment?"":"("+a[t.status]+"!)",step1Text:e[2],step2:e[3]!=-1,step3Text:e[4],step3Time:"",step4Time:t.shipTime||""};if(o.step2){o.step2Time=h.showDate(t.tailStartUtcTime,t.tailEndUtcTime);o.sepLine=""}else{o.sepLine="tm-big-mid-x"}return o},initView:function(e){var i=this;var o=e.yushouTexts[0];i.isWider=false;if(o&&o.length>4){i.isWider=true}if((window.g_config.bizTag&16384)==16384){i.headerText=a.get(".J_ysHeaderText");h.resetHeader(e);a.get(".tm-yushou-header-banner")&&a.show(".tm-yushou-header-banner");a.get("#tm-yushou-footer")&&a.show("#tm-yushou-footer")}var n=h.getRenderData(e);h.initMidBanner(n);if(e.status===2||e.status===1){t.use("malldetail/control/timer",function(t,a){new a({leftTime:e.remainTime,container:".J_step1Time",template:4,tpl:"{date}"}).onStop(function(){window.location.reload()})})}}};function v(o){var n;var l={notSell:function(){a.addClass("#J_StrPrice","del");a.addClass(n,"tb-wrt-wrTuanStep-unTime");a.hide("#J_tb-wrt-addBtn")},Sell:function(t){a.addClass("#J_StrPrice","del");if(r){a.addClass(a.parent(r),"tb-btn-wanrentuan")}}};var d=function(t){var a=t.getFullYear();var i=t.getMinutes();var o="{{#if y}}{{y}}\u5e74{{/if}}{{M}}\u6708{{d}}\u65e5 {{h}}:{{m}}";return e(o).render({y:a==(new Date).getFullYear()?null:a,M:t.getMonth()+1,d:t.getDate(),h:t.getHours(),m:i>9?i:"0"+i})};var u={statu1:function(){l["notSell"]();var e=a.create('
\u5f00\u59cb\u9884\u552e\u63d0\u9192\u6211');var o=a.parent(r);a.insertAfter(e,o);a.addClass(o,"tb-wrTuan-unStart");i.on(e,"click",function(){t.use("malldetail/control/reminder,malldetail/control/reminder.css",function(t,e){e.show({onLogin:TShop.onLogin,isDaily:TShop.isDaily(),dialogIndex:999999+3,getItemId:function(){return g_config.itemId}})});return false})},statu2:function(){l["Sell"](o);if(o.type===1&&o.fullPayment||o.type===2){if(r){a.addClass(a.parent(r),"tb-wrTuan-immOrder")}}},statu3:function(){l["notSell"](o);a.addClass(a.parent(r),"tb-wrTuan-isOver");a.addClass(n,"tb-wrt-wrTuanStep-isOver")}};f(o);p(o);h.initView(o);if(o.FELeveTipArr[o.FEstepCur]){o["isFEStepCur"]=true}else{o["isFEStepCur"]=false}var v=a.get(".tm-fcs-panel");if(o.type==1||o.type==2){v=a.get(".tb-meta")||v}a.insertAfter(a.create(e(c).render(o)),v);n=a.get(".tb-wrTuan");m(o);u["statu"+o.status]&&u["statu"+o.status]();if(o.type===2){t.use("malldetail/model/product",function(t,e){e.onChange("sellCount",function(t){if(!t||typeof t.sellCount!="number"){return}a.html(".tb-wrt-num",t.sellCount)})})}s=true}return{init:function(t){l=t;r=t.linkBuy;TShop.codeTrack(19,"mod.yushou.init","trade.sku.focus");if(!s){n=a.get("dd","#J_PromoPrice");v(u(t.wanrentuanInfo,t.serverStartTime));o.fixHover("#J_WrtMoretxt","touch")}}}},{requires:["template","dom","event","malldetail/common/util","malldetail/sku/yushou.css"]});