var time = 0; var httpData; var order_no = ""; var prod_code = ''; var need_pay = 0; if (window.ActiveXObject) { var myreq = new ActiveXObject("Microsoft.XMLHTTP"); } else { var myreq = new XMLHttpRequest(); } function loadData(){ var order_no = getParameter("order_no"); myreq.open("get", "http://wx.zhizhuchuxing.com/core/order_detail.asp?orderno="+order_no, true); myreq.onreadystatechange = showData; myreq.send(); } var interval = 1000; function showData(){ if (myreq.readyState == 4){ var newstr = myreq.responseText; httpData = JSON.parse(newstr); var c_code = httpData.code; if (c_code == '0'){ order_no = httpData.order_no; prod_code = httpData.prod_code; need_pay = httpData.need_pay; if(httpData.need_pay == 1){ document.getElementById("order_status").style.color="#303030" document.getElementById("status_layout").style.background="#FFFFFF"; document.getElementById("order_status").innerText=httpData.order_status; document.getElementById("to_pay").style.display="block"; document.getElementById("order_no").innerText=httpData.order_no; document.getElementById("order_time").innerText=httpData.order_time; document.getElementById("prod_name").innerText=httpData.prod_name; document.getElementById("submit_text").innerText="去支付"; document.getElementById("order_submit").style.background="#FF8800"; document.getElementById("submit_text").style.color="#FFFFFF" document.getElementById("price").innerText=httpData.price; document.getElementById("user_name").innerText=httpData.customer_name; document.getElementById("user_phone").innerText=httpData.customer_mobile; document.getElementById("user_id").innerText=httpData.customer_id; time = httpData.pay_second; setInterval("ShowCountDown()",1000);//1000为1秒钟 }else{ document.getElementById("order_status").style.color="#FFFFFF" document.getElementById("status_layout").style.background="#C7C7C7"; document.getElementById("order_status").innerText=httpData.order_status; document.getElementById("to_pay").style.display="none"; document.getElementById("order_no").innerText=httpData.order_no; document.getElementById("order_time").innerText=httpData.order_time; document.getElementById("prod_name").innerText=httpData.prod_name; document.getElementById("submit_text").innerText="再次购买"; document.getElementById("order_submit").style.background="#FFFFFF"; document.getElementById("submit_text").style.color="#4D4D4D" document.getElementById("price").innerText=httpData.price; document.getElementById("user_name").innerText=httpData.customer_name; document.getElementById("user_phone").innerText=httpData.customer_mobile; document.getElementById("user_id").innerText=httpData.customer_id; } }else{ alert(httpData.info); return; } } } function ShowCountDown() { if(time <= 0){ return; }else{ alert(time); time = Math.floor(time -1); var leftsecond = time; var minute=Math.floor((leftsecond)/60); var second=Math.floor(leftsecond-minute*60); var cc = document.getElementById("divdown"); } } function getParameter(param) { var query = window.location.search; var iLen = param.length; var iStart = query.indexOf(param); if (iStart == -1)   return ""; iStart += iLen + 1; var iEnd = query.indexOf("&", iStart); if (iEnd == -1)   return query.substring(iStart); return query.substring(iStart, iEnd); } function submit(){ if(need_pay == 1){ var listURL = "./bookingHomePage/onlinePay.html?orderno="+order_no; // 跳转前将URL编码 listURL = encodeURI(listURL); window.location.href = listURL; }else{ var listURL = "./reserve_style2.html?prodcode="+prod_code; // 跳转前将URL编码 listURL = encodeURI(listURL); window.location.href = listURL; } }