var Line = new function () { var nowDate = new Date(); var now = new Date(); var nowObj = null; var obj = this; var num = 1; var datepriceflyobj = null; /*弹出层*/ obj.BSortID = "6"; /*预订*/ obj.Order = function (LineID, date) { var url = "/yuding/" + obj.BSortID + "_" + LineID; if (date) { url += "?StartOff=" + date; } else { if ($("#startdate").attr("StartOff") != "") { url += "?StartOff=" + $("#startdate").attr("StartOff"); } } var DegreeIDs = ""; $("input[name='DegreeID']").each(function () { DegreeIDs += ("," + $(this).attr("DegreeID") + "|" + $(this).val()); }); if (DegreeIDs != "") { if (url.indexOf("?") == -1) { url += "?DegreeNum=" + DegreeIDs.substr(1); } else { url += "&DegreeNum=" + DegreeIDs.substr(1); } } location = url; } /*显示日期和价格*/ obj.ShowDatePrice = function () { datepriceflyobj = $("#datepricefly"); var url = location.pathname + "?action=dataprice&month=" + nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "&num=" + num $.getJSON(url, ShowDatePrice_CallBack); }; /*回调函数*/ var ShowDatePrice_CallBack = function (json) { //ShowMonthTitle(); //月份标题 for (var i = 0; i < json.length; i++) { var temDateArray = json[i].gooffdate.split('-'); json[i].gooffdate = new Date(temDateArray[0], temDateArray[1] - 1, temDateArray[2].split(' ')[0]); } $("#calendar1").html(ShowDatePriceMonth(nowDate, json, "one")); $("#calendar2").html(ShowDatePriceMonth(new Date(nowDate.getFullYear(), (nowDate.getMonth() + 1), 1), json, "two")); if ($("#startdatecon").children().size() > 0) { $("#startdatecon").children()[0].click(); } $("li.now[sIndex!=-1]").hover(function () { nowObj = $(this); nowObj.addClass("over"); ShowPriceList(nowObj.attr("sIndex"), json); datepriceflyobj.appendTo(nowObj); datepriceflyobj.css("z-index", "21"); nowObj.css("z-index", "20"); datepriceflyobj.removeClass("right"); if (nowObj.attr("xq") > 4) { //datepriceflyobj.addClass("right"); } datepriceflyobj.show(); //alert(datepriceflyobj.height()); datepriceflyobj.find(".border_s").css("height", datepriceflyobj.find(".border_s").height()); }, function () { $(this).css("z-index", "1"); obj.ClosePriceList(); }); }; obj.ClosePriceList = function () { nowObj.removeClass("over"); datepriceflyobj.hide(); datepriceflyobj.appendTo($(document.body)); } var ShowPriceList = function (sIndex, json) { var str = "参团标准价  格"; if (sIndex != -1) { for (var i = sIndex; i < json.length; i++) { if (json[i].gooffdate > json[sIndex].gooffdate) { break; } if (json[i].isspecials == "True") { str += " "; } else { str += ""; } var temPrice = json[i].price; if (temPrice <= 0) { temPrice = "——  "; } else { temPrice += "元/人"; } str += " " + json[i].dname + "" + temPrice + ""; } } $("#datepriceflytable").html(str); var $orderLink = $("#datepriceflytable_Order"); var gooffdate = json[sIndex].gooffdate.getFullYear() + "-" + (json[sIndex].gooffdate.getMonth() + 1) + "-" + json[sIndex].gooffdate.getDate(); $orderLink.attr("href", $orderLink.attr("defaulrHref") + "?StartOff=" + gooffdate); } /*显示月份日期价格*/ var ShowDatePriceMonth = function (m, json, cal) { var maxDay = (new Date(m.getFullYear(), (m.getMonth() + 1), 0)).getDate(); //最多多少天(下一个月) var nowDay = m.getDate(); //最多多少天(now) var xq = (new Date(m.getFullYear(), (m.getMonth()), 1)).getDay(); //这个月的第一天是星期几(0-6) //var monthStr=m.getFullYear()+"-"+(m.getMonth()+1); var str = ""; var str2 = ""; if (cal == "one") { str = ""; $("#startdatecon").html(""); $("#datetext").html(""); } else { str = "
" + m.getFullYear() + "" + (m.getMonth() + 1) + "
星期日星期一星期二星期三星期四星期五星期六
"; } var e = 0; var jIndex = 0; //json索引 for (var j = 1; j <= 6; j++) { var temstr = "" temstr += ""; for (var i = 1; i <= 7; i++) { if ((j == 1 && i <= xq) || (e >= maxDay)) {//空白部分 temstr += ""; } else { e++; var dayStr = new Date(m.getFullYear(), m.getMonth(), e); //一个月的每天 var deal = ""; //是不是特价 var temPrice = 0; //价格 var sIndex = -1; for (; jIndex < json.length; jIndex++) {//for JSON if (json[jIndex].gooffdate > dayStr) {//大于 break; } if (json[jIndex].gooffdate < dayStr) {//小于 } else {//等于 if (sIndex == -1) { sIndex = jIndex; } if (temPrice == 0) { if (json[jIndex].dname.indexOf("小孩") == -1 && json[jIndex].dname.indexOf("儿童") == -1) { temPrice = json[jIndex].price * 1; } } else if (temPrice > json[jIndex].price * 1) { if (json[jIndex].dname.indexOf("小孩") == -1 && json[jIndex].dname.indexOf("儿童") == -1 && json[jIndex].price * 1 > 0) { temPrice = json[jIndex].price * 1; } } if (json[jIndex].isspecials == "True") {//是不是特价 deal = "deal"; } } } if (temPrice != 0) { temPrice = "¥" + temPrice; } else { temPrice = ""; } if (now <= dayStr) { var cls = ""; if (temPrice != "") { cls = "cur"; } var dealHtml = ""; if (deal != "") { dealHtml = ""; } if (temPrice != "") { temstr += ""; } else { temstr += ""; } if (temPrice != "") { //str2 += "
  • " + (m.getMonth() + 1) + "-" + e + "出发," + temPrice + "元/成人
  • "; } } else {//昨天 temstr += ""; } } } temstr += ""; str += temstr; } str += "
    " + m.getFullYear() + "" + (m.getMonth() + 1) + "
    星期日星期一星期二星期三星期四星期五星期六

    " + e + "

    " + temPrice + "" + dealHtml + "

    " + e + "

    " + temPrice + "" + dealHtml + "

    " + temPrice + "元/成人\">

    " + e + "

    "; //$("#startdatecon").append(str2); return str; } /*修改出发日期*/ obj.Change = function (btn) { $("#startdate").html($("#TourTime li[date='" + $(btn).attr("startdate") + "']").html()); $("#startdate").attr("StartOff", $(btn).attr("startdate")); Scroll(150, 0); changeColour(); } /*下一月*/ obj.NextMonth = function () { nowDate = new Date(nowDate.getFullYear(), (nowDate.getMonth() + 2), 1); // ShowMonthTitle(); obj.ShowDatePrice(); } /*上一月*/ obj.UpMonth = function () { nowDate = new Date(nowDate.getFullYear(), (nowDate.getMonth() - 2), 1); // ShowMonthTitle(); obj.ShowDatePrice(); } /*显示日期和价格*/ obj.ShowDatePriceByDate = function (year, month, _now) { nowDate = new Date(year, (month - 1), 1); now = _now; obj.ShowDatePrice(); } /*显示月份标题*/ var ShowMonthTitle = function () { $("#mothTitle1Up").html(nowDate.getFullYear() + "年" + (nowDate.getMonth() + 1) + "月(鼠标放在团期上查看详细标准)"); //$("#mothTitle1Down").html(nowDate.getFullYear()+"年"+(nowDate.getMonth()+1)+"月"); var nextDate = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 1); //$("#mothTitle2Up").html(nextDate .getFullYear()+"年"+(nextDate.getMonth()+1)+"月"); //$("#mothTitle2Down").html(nextDate .getFullYear()+"年"+(nextDate.getMonth()+1)+"月"); } obj.ShowDestinationDescription = function (t, artID, tagID, tagName) { if (!t.descriptionExist) { var $t = $(t); t.descriptionExist = true; t.descriptionShow = true; var url = "/JavaScript/GetDestinationDescription.ashx?artID=" + artID; $.getJSON(url, function (json) { if (json.length > 0) { var str = ""; // str+=" "; str += "" + tagName + ""; str += json[0].description; str += "更多>>"; str += ""; $t.append(str); if ($t.offset().left < 600) { $t.find(".fly").css("left", "0"); } else { $t.find(".fly").css("left", ($t.width() - 400)); } if (!t.descriptionShow) { $t.find(".fly").hide(); } else { $t.removeClass("destunactive"); $t.addClass("desthover"); $t.find(".fly").show(); } } }); $t.hover(function () { t.descriptionShow = true; $t.removeClass("destunactive"); $t.addClass("desthover"); $t.find(".fly").show(); }, function () { t.descriptionShow = false; //$t.find(".fly").hide(); setTimeout(function () { if (!t.descriptionShow) { $t.addClass("destunactive"); $t.removeClass("desthover"); $t.find(".fly").hide(); } }, 200); }); } } } function limitImage(thispic) { var w=384.1; var h=288.1; if((w/h)>((thispic.width*1.1) / (thispic.height*1.1))&&thispic.height>h) {thispic.height=h;} else if((w/h)<((thispic.width*1.1) / (thispic.height*1.1))&&thispic.width>w) {thispic.width=w;} } var RVisit=new function() { var obj=this; obj.pageSize=5; obj.pageCount=1; var pageIndex=1; var effectID=""; var GetRVisitList=function() { var url=location.pathname+"?action=GetRVisitList&pageSize="+obj.pageSize+"&pageIndex="+pageIndex+"&effectID="+effectID+"&"+Math.random(); $.get(url,function(result){ $("#RVisitListDiv").html(result); }) } obj.ShowEffect=function(eID) { effectID=eID; pageIndex=1; GetRVisitList(); } obj.Page=function(page) { pageIndex=page; GetRVisitList(); } obj.UpPage=function() { if(pageIndex>1) { pageIndex=pageIndex-1; } GetRVisitList(); } obj.NextPage=function(pc) { if(pageIndex1) { pageIndex=pageIndex-1; } GetRVisitList(); } obj.NextPage=function(pc) { if(pageIndex