<%i var tourBoxClassName = []; var focusGroup = group[0]; var show_price = focusGroup.group_price; var diff_price = 0; /* 旅遊咖推薦 */ if (["", null, undefined].indexOf(tripRecommend) == -1 && tripRecommend) { tourBoxClassName.push("tripRecommend"); } /* 清倉標籤 */ var orgPrice = false; if (["",null,undefined].indexOf(focusGroup.tags_json["7_25"]) == -1) { orgPrice = focusGroup.tags_json["7_25"][0]; tourBoxClassName.push("saleBox"); } if (!orgPrice && ["",null,undefined].indexOf(focusGroup.tags_json["27_99"]) == -1) { orgPrice = focusGroup.tags_json["27_99"][0]; tourBoxClassName.push("saleBox"); } var tourURL = baseUrl + "detail?tour_key=" + tour.tour_key; var focusTourURL = tourURL + "&group_code=" + focusGroup.group_code; /* 取出要顯示的地點 */ var tourLoacation = {}; var loactionListSort = ["country","region","subregion"]; for (var i in loactionListSort) { var tmpLocation = ""; var last = false; if ( ["",null,undefined].indexOf(tour[ loactionListSort[i] + "_list" ].replace(/\|/ig, "")) == -1 ) { tmpLocation = tour[ loactionListSort[i] + "_list" ]; } else{ tmpLocation = tour[ loactionListSort[i-1] + "_list" ]; last = true; } tmpLocation = tmpLocation.substr(1, tmpLocation.length -2).split("||"); if ( (tmpLocation.length <= 1 && i < loactionListSort.length -1 ) && !last) { continue; } else { tourLoacation[loactionListSort[i]] = tmpLocation; break; } } var loactionSchema = {}; var loactionListSort = ["Country","Region"]; for (var i in loactionListSort) { var tmpLocation = ""; var last = false; var tmpKey = loactionListSort[i].toLowerCase(); if ( ["",null,undefined].indexOf(tour[ loactionListSort[i] + "_list" ]) == -1 ) { tmpLocation = tour[ tmpKey + "_list" ]; } else{ tmpLocation = tour[ tmpKey + "_list" ]; last = true; } tmpLocation = tmpLocation.substr(1, tmpLocation.length -2).split("||"); loactionSchema[loactionListSort[i]] = tmpLocation; } /* 旅遊咖優惠 */ var discount_total_price = 0; var feedback_coin = 0; if (focusGroup.discountSN.length > 0) { for (var i in focusGroup.discountSN) { if (["",null,undefined].indexOf(eventDiscount[ focusGroup.discountSN[i] ] ) == -1) { switch (eventDiscount[ focusGroup.discountSN[i] ].type) { case "1": feedback_coin += parseInt(eventDiscount[focusGroup.discountSN[i]].price) * 0.01; break; case "2": case "3": discount_total_price += parseInt(eventDiscount[ focusGroup.discountSN[i] ].price); break; case "7": discount_total_price += Math.ceil((show_price * parseInt(eventDiscount[ focusGroup.discountSN[i] ].price) * 0.01)); break; } } } } if(discount_total_price > 0) { show_price = parseInt(focusGroup.group_price) - discount_total_price; } if (orgPrice || discount_total_price > 0) { diff_price = orgPrice ? orgPrice - parseInt(focusGroup.group_price) + discount_total_price : discount_total_price; } if (feedback_coin === 0) { feedback_coin = jsVars.rule.feedback_coin; } coin = Math.floor(show_price * feedback_coin); /* 旅行社優惠 */ var agencyTags = []; /* var groupRawTagsIDs = ("|"+Object.keys(focusGroup.tags_format.raw).join("||")+"|").match(/\|7_[0-9]{1,}\|/g); if (["",null,undefined].indexOf(groupRawTagsIDs) == -1 && groupRawTagsIDs.length > 0) { for (var i in groupRawTagsIDs) { var key = groupRawTagsIDs[i].substr(1,groupRawTagsIDs[i].length - 2); agencyTags.push(focusGroup.tags_format.raw[key].name); } } */ /* 團顯示標籤 */ var showTags = []; if (["",null,undefined].indexOf(focusGroup.tags_display) == -1 ){ var maxShowCount = 5; for (var i = 0; i < focusGroup.tags_display.length; i ++) { if (["聯營團體"].indexOf(focusGroup.tags_display[i].name) == -1) { showTags.push(focusGroup.tags_display[i]); } if (showTags.length >= maxShowCount) { break; } } } var trackTag = ""; var trackUrl = ""; if (focusGroup.tags_format.keys.indexOf('27_101') !== -1) { trackTag = focusGroup.tags_format.raw['27_101'].name; trackUrl = baseUrl + 'operation/' + focusGroup.tags_format.raw['27_101'].value; } %>

旅遊咖推薦

<% if (diff_price) {%>
-$<%= app.Util.formatNumber( diff_price )%>
<%} %>
<% if (trackTag) {%> <%= trackTag %> <% }%>
<% var groupTourStatus = null; var groupTourStatusStr = null; if (focusGroup.tags_format.all.indexOf("清倉") >=0) { groupTourStatus = "clearance"; groupTourStatusStr = "清倉秒殺"; } else if (focusGroup.tags_format.all.indexOf("保證成團") >=0) { groupTourStatus = "guarantee"; groupTourStatusStr = "保證成團"; } else if (focusGroup.tags_format.all.indexOf("即將成團") >=0) { groupTourStatus = "upcoming"; groupTourStatusStr = "即將成團"; } %>
比較行程
收藏行程

<% for (var i in tourLoacation) {%> <%=tourLoacation[i].join("、")%> <% }%>

<% if (diff_price) {%>
-$<%= app.Util.formatNumber( diff_price )%>
<%} %>
  • 金質旅書
  • <% if (agencyTags.length > 0 ) {%>
  • 旅行社優惠 <% for (var agencyTagIndex in agencyTags){%> <%=agencyTags[agencyTagIndex]%> <% }%>
  • <% }%> <% if (tour.tags_format.all.indexOf("聯營團體") != -1) {%>
  • 聯營團體
  • <% }%> <% for (var i = 0; i < showTags.length; i++) {%>
  • <%=showTags[i].name%>
  • <% }%>
<% _.each(group, function(group_one){ var groupTourStatus = null; var groupTourStatusStr = null; /* 團未狀態 */ var groupRawTagsIDs = ("|"+Object.keys(group_one.tags_format.raw).join("||")+"|").match(/\|6_[0-9]{1,}\|/g); if (["",null,undefined].indexOf(groupRawTagsIDs) == -1 && groupRawTagsIDs.length> 0) { for (var i in groupRawTagsIDs) { var key = groupRawTagsIDs[i].substr(1,groupRawTagsIDs[i].length - 2); if (key !== '6_66') { groupTourStatusStr = group_one.tags_format.raw[key].name; break; } } } if(groupTourStatusStr != null) { if (groupTourStatusStr.indexOf("清倉") >=0) { groupTourStatus = "clearance"; } else if (groupTourStatusStr.indexOf("保證成團") >=0) { groupTourStatus = "guarantee"; } else if (groupTourStatusStr.indexOf("即將成團") >=0) { groupTourStatus = "upcoming"; } else { groupTourStatus = "upcoming"; } } else if (group_one.sell > 0) { groupTourStatus = "selled"; groupTourStatusStr = "可售" + group_one.sell +"位"; } %> <%});%>
<%=tour.SP%>