%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; } %>
旅遊咖推薦
咖下單現賺咖幣$<%= app.Util.formatNumber(coin)%>起