/*邮轮*/
var Cruise = new function () {
var nowDate = new Date();
var now = new Date(); /*当前时间*/
var nowObj = null;
var obj = this;
var num = 1;
var datepriceflyobj = null; /*弹出层*/
obj.BSortID = "33";
/*************************************************邮轮*********************************************************/
/*显示日期和价格*/
obj.ShowDatePrice = function () {
datepriceflyobj = $("#datepricefly"); /*弹出层*/
var url = location.pathname + "?action=dataprice&month=" + nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1);
$.getJSON(url, ShowDatePrice_CallBack);
};
var lineDate = "";
/*显示日期下的航线基本信息*/
obj.ShowLineInfo = function (lineids, mdate) {
var url = location.pathname + "?action=showline&lineids=" + lineids;
lineDate = mdate;
$.getJSON(url, ShowLineInfo_CallBack);
};
/*显示日期下的航线基本信息_回调函数*/
var ShowLineInfo_CallBack = function (json) {
var str = "
";
str += "
" + lineDate.split('-')[1] + "月" + lineDate.split('-')[2] + "日" + "航次
";
str += "
";
for (var i = 0; i < json.length; i++) {
str += "
";
str += "
";
str += "

";
str += "
";
str += "
";
str += "
";
str += "
";
str += "

";
str += "
";
str += "
";
str += "
";
str += "
";
str += "- 编 号:" + json[i].lineid + "
"
str += "- 行程天数:" + json[i].days + "天
";
str += "- 出发城市:" + json[i].cityname + "
";
str += "- 航行区域:" + json[i].areaname + "
";
str += "
";
str += "
¥" + json[i].defaultprice + "起
查看详情";
str += "
";
str += "
";
str += "
";
str += "
";
str += "
";
str += "
";
}
str += "
";
str += "
";
str += "
";
$("#cruise_voyage_date_vlist").html(str);
$("#cruise_voyage_date_vlist").stop().animate({ left: "0px" }, "slow");
};
/*隐藏日期下和航线基本信息*/
obj.HideLineInfo = function () {
$("#cruise_voyage_date_vlist").stop().animate({ left: "-1190px" }, "slow");
};
var postNum = 1;
/*回调函数*/
var ShowDatePrice_CallBack = function (json) {
/*没有团期显示下一个月
if (json.length == 0 && postNum == 1) {
postNum++;
nowDate = new Date(nowDate.getFullYear(), (nowDate.getMonth() + 1), 1);
obj.ShowDatePrice();
return false;
} else if (json.length == 0 && postNum == 2) {
postNum++;
nowDate = new Date(nowDate.getFullYear(), (nowDate.getMonth() - 1), 1);
obj.ShowDatePrice();
return false;
}*/
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]);
}
var htmlStr = ShowDatePriceMonth(nowDate, json, "one");
$("#Calendar").html(htmlStr);
};
/*显示月份日期价格*/
var ShowDatePriceMonth = function (m, json, cal) {
/*最多多少天(下一个月)*/
var maxDay = (new Date(m.getFullYear(), (m.getMonth() + 1), 0)).getDate();
/*获取当前日(1-31)*/
var nowDay = m.getDate();
/*获取当前星期X(0-6,0代表星期天)*/
var xq = (new Date(m.getFullYear(), (m.getMonth()), 1)).getDay();
var str = "