|
- var httpData;
-
- if (window.ActiveXObject) {
- var myreq = new ActiveXObject("Microsoft.XMLHTTP");
- } else {
- var myreq = new XMLHttpRequest();
- }
- var cstr1 = '';
- function loadData(){
- var obj1 = document.getElementById('otherorder_list');
- cstr1 = obj1.innerHTML;
- obj1.innerHTML = '';
- var myURL = 'http://wx.zhizhuchuxing.com/core/order_list.asp?tt=' + getDateTime(4);
- myreq.open("get", myURL, true);
- myreq.onreadystatechange = showData;
- myreq.send();
- }
- function showData(){
- if (myreq.readyState == 4){
- var newstr = myreq.responseText;
- httpData = JSON.parse(newstr);
- var c_code = httpData.code;
- if (c_code == '0'){
- var s = '';
- var s2 = '';
- if (httpData.order_list) {
- for (var i = 0; i < httpData.order_list.length; i++) {
- if (httpData.order_list[i].order_type - 0 == 0)
- {
- s += '<div style="display: block; width: 100%;background:#FFFFFF;border-top: 1px solid #E2E2E2; height: 34px; overflow: hidden;" onclick="go_order_details('+'\''+ httpData.order_list[i].order_no+'\')">';
- s += '<span style="float: left; margin-left: 4%; margin-right: 0; margin-top: 16px; margin-bottom: 0; font-size: 15px; color: #808080; line-height: 16px; overflow: hidden;">'+httpData.order_list[i].order_time+'</span>';
- s += '<span style="float: right; margin-right: 4%; margin-left: 0; margin-top: 16px; margin-bottom: 0; font-size: 15px; color: #FF8800; line-height: 16px; overflow: hidden;">'+httpData.order_list[i].order_status+'</span>';
- s += '</div>';
- s += '<div style=" position:relative; width:100%;background:#fff;overflow:hidden;" onclick="go_order_details('+'\''+ httpData.order_list[i].order_no+'\')">';
- s += '<img style="position:absolute; top:13px; left:4%; width:9px; height:39px;" src="img/smalllogo.png" alt="">';
- s += '<div style="float:left;width:100%;">';
- s += '<div style="float:left;width:75%; margin-left:10.5%;">';
- s += '<div style="height:32px; line-height: 32px; width:100%; border-bottom:1px solid #ECEBEE;">';
- s += '<span style="font-size:16px; color:#303030;">'+httpData.order_list[i].start_area+'</span>';
- s += '<span style="float:right;color:#808080;font-size:14px;">'+httpData.order_list[i].go_info+'</span>';
- s += '</div>';
- s += '<div style="32px; line-height: 32px; width:100%;">';
- s += '<span style="font-size:16px;color:#303030;">'+httpData.order_list[i].end_area+'</span>';
- if(httpData.order_list[i].direction == 2){
- s += '<span style="float:right;color:#808080;font-size:14px;">'+httpData.order_list[i].back_info+'</span>';
- }else{
- }
- s += '</div>';
- s += '</div>';
- s += '<div style="float:left;overflow:hidden;margin-top: 8px;padding-bottom:10px;border-bottom:1px solid #ECEBEE;width:98.7%;margin-left:2.89%;">';
- s += '<div style="float:left;color:#808080;font-size:13px;">'+httpData.order_list[i].prod_name+'</div>';
- // s += '<div style="float:left;margin-left:1.5%;">';
- // s += '<img style="width:14px; height:15px;" src="img/car2.png" alt="">';
- // s += '<img style="width:15px; height:15px;" src="img/hotel2.png" alt="">';
- // s += '<img style="width:15px; height:15px;" src="../img/ticket.png" alt=""> ';
- // s += '</div>';
- s += '</div>';
- s += '</div>';
- if(httpData.order_list[i].direction == 2){
- s += '<img style="position:absolute;top:25px;right:6.8%;width:13px; height: 13px;" src="img/exchange.png" alt="">';
- }else{
- s += '<img style="position:absolute;top:25px;right:6.8%;width:13px; height: 13px;" src="img/single_arrow.png" alt="">';
- }
-
- s += '</div>';
- s += '<div style="display: block; width: 100%;background:#FFFFFF; border-bottom: 1px solid #E2E2E2; height: 35px; padding-top: 12px; margin-bottom: 10px;">';
- s += '<span style="float: left; margin-left: 4%; margin-right: 0; margin-bottom: 0; font-size: 20px; color: #FF8800;"><span style="font-size: 12px;">¥</span>'+httpData.order_list[i].price+'</span>';
- if(httpData.order_list[i].need_pay == 1){
- s += '<div style="float: right; width: 72px; height: 26px; line-height: 22px; margin-right: 4%; margin-left: 0;background-color: #FF8800; text-align: center; margin-top: -2px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius:3px;">';
- s += '<span style="font-size: 12px; color: #FFFFFF;" onclick="submit_order('+'\''+httpData.order_list[i].order_no+'\')">去支付</span>';
- s += '</div>';
- }
- s += '<div style="float: right; width: 72px; height: 24px; line-height: 22px; margin-right: 4%; margin-left: 0;background-color: #FFFFFF; text-align: center; border: 1px solid #E2E2E2; margin-top: -2px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius:3px;">';
- s += '<span style=" margin-left: 0; margin-bottom: 0; font-size: 12px; color: #303030;" onclick="go_book('+'\''+httpData.order_list[i].prod_code+'\')">再次购买</span>';
- s += '</div>';
- s += '</div>';
- }else{
- var cstr2 = cstr1;
- cstr2 = cstr2.replace(/\[orderno\]/g,httpData.order_list[i].order_no);
- cstr2 = cstr2.replace(/\[order_time\]/g,httpData.order_list[i].order_time);
- cstr2 = cstr2.replace(/\[order_status\]/g,httpData.order_list[i].order_status);
- cstr2 = cstr2.replace(/\[prod_name\]/g,httpData.order_list[i].prod_name);
- var cstr3 = httpData.order_list[i].go_info;
- cstr3 = cstr3.substr(0,10)
- cstr2 = cstr2.replace(/\[play_date\]/g,'游玩日期:' + cstr3);
- cstr2 = cstr2.replace(/\[price\]/g,httpData.order_list[i].price);
- cstr3 = '';
- if(httpData.order_list[i].need_pay -1 == 0)
- {
- cstr3 = '<div style="float: right; width: 72px; height: 25px; line-height: 22px; margin-right: 4%; margin-left: 0;background-color: #FF8800; text-align: center; margin-top: 10px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius:3px;">';
- cstr3 += '<span style="font-size: 12px; color: #FFFFFF;" onclick="submit_order('+'\''+httpData.order_list[i].order_no+'\')">去支付</span>';
- cstr3 += '</div>';
- }
- cstr3 += '<div style="float: right; width: 72px; height: 24px; line-height: 22px; margin-right: 4%; margin-left: 0;background-color: #FFFFFF; text-align: center; border: 1px solid #E2E2E2; margin-top: 10px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius:3px;">';
- cstr3 += '<span style=" margin-left: 0; margin-bottom: 0; font-size: 12px; color: #303030;" onclick="go_book('+'\''+httpData.order_list[i].prod_code+'\')">再次购买</span>';
- cstr3 += '</div>';
- cstr2 = cstr2.replace(/\[pay_button\]/g,cstr3);
-
- s2 += cstr2;
- /* s2 += '<div style="display: block; width: 100%;background:#FFFFFF;border-top: 1px solid #E2E2E2; height: 34px; overflow: hidden;" onclick="go_order_details('+'\''+ httpData.order_list[i].order_no+'\')">';
- s2 += '<span style="float: left; margin-left: 4%; margin-right: 0; margin-top: 16px; margin-bottom: 0; font-size: 15px; color: #808080; line-height: 16px; overflow: hidden;">'+httpData.order_list[i].order_time+'</span>';
- s2 += '<span style="float: right; margin-right: 4%; margin-left: 0; margin-top: 16px; margin-bottom: 0; font-size: 15px; color: #FF8800; line-height: 16px; overflow: hidden;">'+httpData.order_list[i].order_status+'</span>';
- s2 += '</div>';
- s2 += '<div style=" position:relative; width:100%;background:#fff;overflow:hidden;" onclick="go_order_details('+'\''+ httpData.order_list[i].order_no+'\')">';
- s2 += '<img style="position:absolute; top:13px; left:4%; width:9px; height:39px;" src="img/smalllogo.png" alt="">';
- s2 += '<div style="float:left;width:100%;">';
- s2 += '<div style="float:left;width:75%; margin-left:10.5%;">';
- s2 += '<div style="height:32px; line-height: 32px; width:100%; border-bottom:1px solid #ECEBEE;">';
- s2 += '<span style="font-size:16px; color:#303030;">'+httpData.order_list[i].start_area+'</span>';
- s2 += '<span style="float:right;color:#808080;font-size:14px;">'+httpData.order_list[i].go_info+'</span>';
- s2 += '</div>';
- s2 += '<div style="32px; line-height: 32px; width:100%;">';
- s2 += '<span style="font-size:16px;color:#303030;">'+httpData.order_list[i].end_area+'</span>';
- if(httpData.order_list[i].direction == 2){
- s2 += '<span style="float:right;color:#808080;font-size:14px;">'+httpData.order_list[i].back_info+'</span>';
- }
- s2 += '</div>';
- s2 += '</div>';
- s2 += '<div style="float:left;overflow:hidden;margin-top: 8px;padding-bottom:10px;border-bottom:1px solid #ECEBEE;width:98.7%;margin-left:2.89%;">';
- s2 += '<div style="float:left;color:#808080;font-size:13px;">'+httpData.order_list[i].prod_name+'</div>';
- s2 += '</div>';
- s2 += '</div>';
- if(httpData.order_list[i].direction == 2){
- s2 += '<img style="position:absolute;top:25px;right:6.8%;width:13px; height: 13px;" src="img/exchange.png" alt="">';
- }else{
- s2 += '<img style="position:absolute;top:25px;right:6.8%;width:13px; height: 13px;" src="img/single_arrow.png" alt="">';
- }
-
- s2 += '</div>';
- s2 += '<div style="display: block; width: 100%;background:#FFFFFF; border-bottom: 1px solid #E2E2E2; height: 35px; padding-top: 12px; margin-bottom: 10px;">';
- s2 += '<span style="float: left; margin-left: 4%; margin-right: 0; margin-bottom: 0; font-size: 20px; color: #FF8800;"><span style="font-size: 12px;">¥</span>'+httpData.order_list[i].price+'</span>';
- if(httpData.order_list[i].need_pay == 1){
- s2 += '<div style="float: right; width: 72px; height: 26px; line-height: 22px; margin-right: 4%; margin-left: 0;background-color: #FF8800; text-align: center; margin-top: -2px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius:3px;">';
- s2 += '<span style="font-size: 12px; color: #FFFFFF;" onclick="submit_order('+'\''+httpData.order_list[i].order_no+'\')">去支付</span>';
- s2 += '</div>';
- }
- s2 += '<div style="float: right; width: 72px; height: 24px; line-height: 22px; margin-right: 4%; margin-left: 0;background-color: #FFFFFF; text-align: center; border: 1px solid #E2E2E2; margin-top: -2px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius:3px;">';
- s2 += '<span style=" margin-left: 0; margin-bottom: 0; font-size: 12px; color: #303030;" onclick="go_book('+'\''+httpData.order_list[i].prod_code+'\')">再次购买</span>';
- s2 += '</div>';
- s2 += '</div>'; */
- }
- }}
- document.getElementById("order_list").innerHTML = s;
- document.getElementById("otherorder_list").innerHTML = s2;
- if(document.getElementById("order_list").innerHTML != ''){
- document.getElementById("order_list").style.display ="block";
- document.getElementById("otherorder_list").style.display ="none";
- document.getElementById("null_list").style.display ="none";
- }else{
- document.getElementById("order_list").style.display ="none";
- document.getElementById("otherorder_list").style.display ="none";
- document.getElementById("null_list").style.display ="block";
- }
-
- }else{
- alert(httpData.info);
- return;
- }
- }
- }
- function go_order_details(order_no){
- window.location.href="order_details.html?order_no="+order_no;
- }
- function go_order_details2(order_no){
- window.location.href="order_details2.html?order_no="+order_no;
- }
- function submit_order(order_no){
- var listURL = "./bookingHomePage/onlinePay.html?orderno="+order_no;
- // 跳转前将URL编码
- listURL = encodeURI(listURL);
- window.location.href = listURL;
- }
- function go_book(prod_code){
- var listURL = "./reserve.html?prodcode="+prod_code;
- // 跳转前将URL编码
- listURL = encodeURI(listURL);
- window.location.href = listURL;
- }
- function left_order(){
- document.getElementById("right_order").style.borderBottom="3px solid #F0F0F0";
- document.getElementById("left_order").style.borderBottom="3px solid #00CC9C";
- if(document.getElementById("order_list").innerHTML != ''){
- document.getElementById("order_list").style.display ="block";
- document.getElementById("otherorder_list").style.display ="none";
- document.getElementById("null_list").style.display ="none";
- }else{
- document.getElementById("order_list").style.display ="none";
- document.getElementById("otherorder_list").style.display ="none";
- document.getElementById("null_list").style.display ="block";
- }
- }
- function right_order(){
- document.getElementById("left_order").style.borderBottom="3px solid #F0F0F0";
- document.getElementById("right_order").style.borderBottom="3px solid #00CC9C";
- if(document.getElementById("otherorder_list").innerHTML != ''){
- document.getElementById("order_list").style.display ="none";
- document.getElementById("otherorder_list").style.display ="block";
- document.getElementById("null_list").style.display ="none";
- }else{
- document.getElementById("order_list").style.display ="none";
- document.getElementById("otherorder_list").style.display ="none";
- document.getElementById("null_list").style.display ="block";
- }
- }
- 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;
-
- }
-
-
-
|