var temp_typeID; var current_prod_code; var isFav=false;//是否是收藏 var m_f_runid = ''; var m_f_godate = ''; var m_f_gotime = ''; var m_f_backdate = ''; var m_f_backtime = ''; function init_page(){ var prod_code = getPar('prod_code'); current_prod_code = prod_code; var type_id = getPar('type_id'); temp_typeID = type_id; var url = "http://xmwxc.zhizhuchuxing.cn/core/detail.asp?prodcode="+prod_code; get_virtual_user_list(url); } function reload_Info(httpData){ var header_center = document.getElementById("header-center"); var centerHTML = ''; centerHTML +='
'; centerHTML +=''; centerHTML +='
'; centerHTML +='
'; var typeStr = ""; typeStr = "船票"; centerHTML +='
'+httpData.prod_name+'
'; centerHTML +='
'; centerHTML +='195'; centerHTML +='
'; centerHTML +='
'; // 执行 header_center.innerHTML = centerHTML; // 三个type var three_type_center = document.getElementById("three-type-center"); var threeHTML = ''; threeHTML +='
'; // circuitry_intro: "出行介绍文字内容包含图片[img]prod_img/001.jpg[/img]出行介绍文字内容包含图片", //station_intro: "上下站点介绍文字内容包含图片[img]prod_img/002.jpg[/img]上下站点介绍文字内容包含图片", //price_intro: "费用介绍文字内容包含图片[img]prod_img/003.jpg[/img]费用介绍文字内容包含图片", //threeHTML +='介绍'; threeHTML +='介绍'; // threeHTML +='上下站点'; //threeHTML +='费用说明'; threeHTML +='费用说明'; threeHTML +='
'; //threeHTML +='
'+subStrFormContext(httpData.circuitry_intro)[1]+'
'; var cstr1 = '

普陀山素有“海天佛国”、“南海圣境”之称,是国家5A级旅游风景区,有普济寺、法雨寺、盘陀庵、灵石庵等寺庙和潮音洞、梵音洞等名胜。

'; threeHTML +='
'+ cstr1 +'
'; //20160509获取初次开班信息 m_f_runid = httpData.f_runid; m_f_godate = httpData.f_godate; m_f_gotime = httpData.f_gotime; m_f_backdate = httpData.f_backdate; m_f_backtime = httpData.f_backtime; // 执行 three_type_center.innerHTML = threeHTML; } // 将出行介绍、上下班点、费用说明三个按钮颜色清空 function clear_type_title_color(){ var chuxingjs = document.getElementById("chuxingjs"); // var shangxiazd = document.getElementById("shangxiazd"); var feiyongsm = document.getElementById("feiyongsm"); chuxingjs.style.color = "#343434"; chuxingjs.style.borderBottomWidth="0px"; // shangxiazd.style.color = "#343434"; // shangxiazd.style.borderBottomWidth="0px"; feiyongsm.style.color = "#343434"; feiyongsm.style.borderBottomWidth="0px"; } // 点击出行介绍 function click_chuxingjs(intro){ clear_type_title_color(); var chuxingjs = document.getElementById("chuxingjs"); change_css_type(chuxingjs); var type_info = document.getElementById("type-info"); var cstr1 = '

普陀山素有“海天佛国”、“南海圣境”之称,是国家5A级旅游风景区,有普济寺、法雨寺、盘陀庵、灵石庵等寺庙和潮音洞、梵音洞等名胜。

'; type_info.innerHTML = cstr1; //type_info.innerHTML=intro; } // 点击上下站点 //function click_shangxiazd(intro){ // clear_type_title_color(); // var shangxiazd = document.getElementById("shangxiazd"); // change_css_type(shangxiazd); // var type_info = document.getElementById("type-info"); // type_info.innerHTML=intro; //} // 点击费用说明 function click_feiyongsm(intro){ clear_type_title_color(); var feiyongsm = document.getElementById("feiyongsm"); change_css_type(feiyongsm); var type_info = document.getElementById("type-info"); //type_info.innerHTML=intro; var cstr1 = '

包含:普陀山大门票(二日可用)、朱家尖至普陀山单程船票、30万保额旅游意外险;

不包含:寺院香花卷,景区小交通。

' cstr1 += '

注:(1) 淡季1月份、12月份门票价格为140元/人

'; cstr1 += '

(2) 旺季2月份至11月份门票介格为160元/人

'; cstr1 += '

(3) 正月初一至初五、五月一日至三日、十月一日至五日上浮至200元/人

'; cstr1 += '

(4) 朱家尖码头---普陀山码头单程船票25元/人

'; cstr1 += '

(5) 景区景点意外险10元/人/单

'; type_info.innerHTML=cstr1; } // 改变三个type的样式 function change_css_type(type){ type.style.borderBottomWidth="2px"; type.style.borderBottomStyle="solid"; type.style.borderBottomColor="#00cc9c"; } // foot上的收藏和立即预订 //function click_fav(){ // var fav = document.getElementById("fav"); // if(fav.innerHTML=="收藏"){ // isFav = true; // var url = "http://xmwxc.zhizhuchuxing.cn/core/keep.asp?prodcode="+current_prod_code; // get_virtual_user_list(url); // } //} // 收藏产品 //function fav_product(httpData){ // var fav = document.getElementById("fav"); // if(httpData.code=="0"){ // alert("收藏成功!"); // fav.innerHTML="已收藏"; // fav.style.backgroundColor='gray'; // fav.disabled=true; // }else{ // alert("收藏失败!"); // fav.innerHTML="已收藏"; // } //} function click_bookNow(){ var listURL = "../reserve_style2.html?prodcode=" + current_prod_code + '&runid=' + m_f_runid + '&m_godate=' + m_f_godate + '&m_gotime=' + m_f_gotime + '&m_backdate=' + m_f_backdate + '&m_backtime=' + m_f_backtime; // 跳转前将URL编码 listURL = encodeURI(listURL); window.location.href = listURL; } // 从内容中截取图片名称 function subStrFormContext(context){ var imgName=""; var i = context.indexOf("[img]"); var j = context.indexOf("[/img]"); if (j-i>0 && i>=0) { imgName=context.substring(i+5,j); // 去掉[img][/img]的文本内容 var str1 = context.substring(0,i); var str2 = context.substring(j+6,context.length); var str = str1+str2; } var img_str = new Array(); img_str.push(imgName); //0 img_str.push(str); //1 img_str.push(str1); //2 img_str.push(str2); //3 return img_str; } // 从上一页的链接上获取参数 function getPar(par){ //获取当前URL var local_url = document.location.href; // 接收的时候将URL 解码 local_url = decodeURI(local_url); //获取要取得的get参数位置 var get = local_url.indexOf(par +"="); if(get == -1){ return false; } //截取字符串 var get_par = local_url.slice(par.length + get + 1); //判断截取后的字符串是否还有其他get参数 var nextPar = get_par.indexOf("&"); if(nextPar != -1){ get_par = get_par.slice(0, nextPar); } return get_par; } /*======================网络请求的Ajax的代码=======================*/ // 创建一个Ajax对象 if (window.ActiveXObject){ var myreq = new ActiveXObject("Microsoft.XMLHTTP"); }else{ var myreq = new XMLHttpRequest(); } // 请求方法,传入URL function get_virtual_user_list(myURL) { var tnowtime = getDateTime(4); // m_url = 接口 // var myURL = m_url + 'op=userlink&vuser=' + cvuserid + '&tt=' + tnowtime; // var myURL = "http://xmwxc.zhizhuchuxing.cn/core/area_target.asp?keyword="; myreq.open("get",myURL,true); // 接收的数据交给哪个函数处理 myreq.onreadystatechange = show_user_list; myreq.send(); } function show_user_list() { if (myreq.readyState == 4) { // newstr 就是接收到的数据 var newstr = myreq.responseText; var httpData=JSON.parse(newstr); // if (isFav==false) { reload_Info(httpData); }else{ // 收藏 fav_product(httpData); } } } function getDateTime(nTypeFlag) { var tNowTime = new Date(); var myYear = ';' + tNowTime.getFullYear() + ';'; var myMonth = ';' + (tNowTime.getMonth()+1-0) + ';'; var myDay = ';' + tNowTime.getDate()+ ';'; var myHour = ';' + tNowTime.getHours()+ ';'; var myMinu = ';' + tNowTime.getMinutes()+ ';'; var mySecond = ';' + tNowTime.getSeconds()+ ';'; if (myMonth.length < 4) myMonth = '0' + myMonth; if (myDay.length < 4) myDay = '0' + myDay; if (myHour.length < 4) myHour = '0' + myHour; if (myMinu.length < 4) myMinu = '0' + myMinu; if (mySecond.length < 4) mySecond = '0' + mySecond; var cNewTimeStr; //alert(tNowTime); switch (nTypeFlag+1-1) { case 0: cNewTimeStr = myYear + '-' + myMonth + '-' + myDay; break; case 1: cNewTimeStr = myYear + myMonth + myDay; break; case 2: cNewTimeStr = myHour + ':' + myMinu + ':' + mySecond; break; case 3: cNewTimeStr = myHour + myMinu + mySecond; break; case 4: cNewTimeStr = myYear + myMonth + myDay + myHour + myMinu + mySecond; break; case 5: cNewTimeStr = myYear + '年' + myMonth + '月' + myDay + '日'; break; case 6: cNewTimeStr = myYear; break; case 7: cNewTimeStr = myYear + '-' + myMonth; break; default: cNewTimeStr = myYear + '-' + myMonth + '-' + myDay + ' ' + myHour + ':' + myMinu + ':' + mySecond; break; } cNewTimeStr = cNewTimeStr.replace(/;/g,""); return cNewTimeStr; }