一价全含系列—瑞士深度法意瑞3国12天
function orderline(outtime){
window.top.location="http://www.jhly.cn/Usercenter/Order?lineId=124118&outTime='"+outtime+".";
}
if(!isPC()){
var href = window.location.href;
var lid = href.substring(href.indexOf("tourID=")+7,href.indexOf("&pDate"));
var lid = '124118';
window.location.href="http://m.jhly.cn/Line/details?lid="+lid;
}
$(document).ready(function() {
//滚动定位JS
$.fn.smartFloat = function() {
var position = function(element) {
var top = element.position().top, pos = element.css("position");
$(window).scroll(function() {
var scrolls = $(this).scrollTop();
//滚动时保持导航置顶
if (scrolls > top) {
if (window.XMLHttpRequest) {
element.css({
position: "fixed",
top: 0
});
} else {
element.css({
top: scrolls
});
}
}else {
element.css({
position: pos,
top: top
});
}
//导航卡动态切换
var tab1_top = $('#tab1').offset().top;
var tab2_top = $('#tab2').offset().top;
var tab3_top = $('#tab3').offset().top;
var tab4_top = $('#tab4').offset().top;
var tab5_top = $('#tab5').offset().top;
var tab6_top = $('#tab6').offset().top;
if(scrolls >= tab6_top-50){
set_cur('.tab6');
}else if(scrolls >= tab5_top-50) {
set_cur('.tab5');
} else if(scrolls >= tab4_top-50) {
set_cur('.tab4');
} else if(scrolls >= tab3_top-50) {
set_cur('.tab3');
} else if(scrolls >= tab2_top-50) {
set_cur('.tab2');
} else if(scrolls >= tab1_top) {
set_cur('.tab1');
}
});
};
return $(this).each(function() {
position($(this));
});
};
//绑定
$("#navigation").smartFloat();
});
//切换导航菜单
function set_cur(n) {
if($('.hd a').hasClass('nonce')) {
$('.hd a').removeClass('nonce');
}
$('.hd a' + n).addClass('nonce');
}
//页面定位
function goTo(id){
var top = $("#tab"+id).offset().top;
if($("#navigation").css('position') == "fixed"){
top = top - 40;
}else{
top = top - 81;
}
if(id>1){
$("body,html").animate({
scrollTop: top
}, 0);
}
window.setTimeout("changeBtn("+id+")", 100);
}
function changeBtn(id){
$('.hd a').removeClass('nonce');
$(".tab"+id).toggleClass("nonce");
}
function showYdDiv(){
grayOut(true, {'bgcolor':'#181818','opacity':'70','zindex':'9999990'});//加蒙板
$("#ydDiv").show();
var popMargTop = ($("#ydDiv").height() + 80) / 2;
var popMargLeft = ($("#ydDiv").width() + 80) / 2;
$("#ydDiv").css({
'margin-top' : -popMargTop,
'margin-left' : -popMargLeft
});
}
function hideYdDiv(){
grayOut(false);//取消蒙板
$("#ydDiv").hide();
}
function changeTeamT(){
var val = $("select[name=ydSelect]").val();
var lineId = '124118';
$.ajax({
type: "POST",
url:'http://www.jhly.cn/Home/Route/selPrice',
data:{val:val,lineId:lineId},
success:function(data){
var res = JSON.parse(data);
var json = res.priceList;
//价格体系名称
var pricename = "";
//价格体系 价格
var price = "";
var zaoniaoflag = $("#zaoniaoflag").val();
//早鸟的
if(zaoniaoflag == 1){
for(var i=0;i<json.length;i++){
var vo = json[i];
pricename+="<li id='pricename"+(i+1)+"' name='pricename' "+(i==0?" class='selected'>":">")+"<a href='javascript:javascript:showprice("+(i+1)+")'>"+vo._name+"</a></li>";
price+= "<dl id='w_price"+(i+1)+"' name='w_price'"+(i!=0?" style='display:none'>":">")+"<dt>预售价:</dt><dd class='pri_new'><i>¥</i>"+vo._WebPrice+"<small>/"+(vo._num==1?"":vo._num)+"人</small></dd></dl>"+
"<p class='note' id='d_price"+(i+1)+"' name='d_price'"+(i!=0?" style='display:none'>":">")+"注:"+(vo._describe!=""?vo._describe:"必须网上支付才能享受网上支付价")+"</p>";
}
}else{
for(var i=0;i<json.length;i++){
var vo = json[i];
var priceName1 = "门市价";
var priceName2 = "售价"
var priceval = vo['_salePrice'];
if(vo['_priceyj']!=null && vo['_priceyj'] !=''){
priceName1 = "原价";
priceName2 = "现价";
priceval = vo['_priceyj']+"";
}
pricename+="<li id='pricename"+(i+1)+"' name='pricename' "+(i==0?" class='selected'>":">")+"<a href='javascript:javascript:showprice("+(i+1)+")'>"+vo._name+"</a></li>";
price+= "<dl id='w_price"+(i+1)+"' name='w_price'"+(i!=0?" style='display:none'>":">")+"<dt>"+priceName2+":</dt><dd class='pri_new'><i>¥</i>"+vo._WebPrice+"<small>/"+(vo._num==1?"":vo._num)+"人</small></dd></dl>"+
"<p class='note' id='d_price"+(i+1)+"' name='d_price'"+(i!=0?" style='display:none'>":">")+"注:"+(vo._describe!=""?vo._describe:"必须网上支付才能享受网上支付价")+"</p>";
}
}
$("#pro_options").html("");
$("#pri_box_price").html("");
$("#pri_box_price").append(price);
$("#pro_options").append(pricename);
if(res.flag==0){
$("#yudingHid").hide();
$("#yuding").show();
}else {
$("#yuding").hide();
$("#yudingHid").show();
}
}
});
}
function doYuDing(){
//获取选择的时间
var time = $("select[name=ydSelect]").val();
//获取待HTML标记的价格类型
var typeHTML = $("li[class='selected']").html();
//获取选择的价格类型
var type = $('<p>'+type+'</p>').text();
//99click 传值
var _ozprm="pid99=124118&cid99=13&ozp_color=休闲,度假,深度之旅&ozp_size=12&ozp_class="+type+"&ozp_date1="+time;
//进入预定页面
//线路
window.location.href="http://www.jhly.cn/Usercenter/Makeorder/l124118/t"+time+".html"; }
function showYdDivByDate(firstDate){
var lineId = '124118';
$.ajax({
type: "POST",
url:'http://www.jhly.cn/Home/Route/getTeamtimeJson',
data:{firstDate:firstDate,lineId:lineId},
success:function(data){
$("#PurchasePanel").empty();
var weekArr = data.weekArr;
var timeArr = data.timeArr;
var priceList = data.priceList;
for(var i=0;i<timeArr.length;i++){
$("#PurchasePanel").append("<option value='"+timeArr[i]+"'>出发日期:"+timeArr[i]+weekArr[i]+"</option>");
}
var str = "";
for(var k=0;k<priceList.length;k++){
str+="<span>¥"+priceList[k]._WebPrice+"/位</span>"+priceList[k]._name+"<br/>";
}
$("#priceTd").html("");
$("#priceTd").append(str);
}
});
showYdDiv();
}