25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

109 lines
3.8 KiB

  1. var time = 0;
  2. var httpData;
  3. var order_no = "";
  4. var prod_code = '';
  5. var need_pay = 0;
  6. if (window.ActiveXObject) {
  7. var myreq = new ActiveXObject("Microsoft.XMLHTTP");
  8. } else {
  9. var myreq = new XMLHttpRequest();
  10. }
  11. function loadData(){
  12. var order_no = getParameter("order_no");
  13. myreq.open("get", "http://wx.zhizhuchuxing.com/core/order_detail.asp?orderno="+order_no, true);
  14. myreq.onreadystatechange = showData;
  15. myreq.send();
  16. }
  17. var interval = 1000;
  18. function showData(){
  19. if (myreq.readyState == 4){
  20. var newstr = myreq.responseText;
  21. httpData = JSON.parse(newstr);
  22. var c_code = httpData.code;
  23. if (c_code == '0'){
  24. order_no = httpData.order_no;
  25. prod_code = httpData.prod_code;
  26. need_pay = httpData.need_pay;
  27. if(httpData.need_pay == 1){
  28. document.getElementById("order_status").style.color="#303030"
  29. document.getElementById("status_layout").style.background="#FFFFFF";
  30. document.getElementById("order_status").innerText=httpData.order_status;
  31. document.getElementById("to_pay").style.display="block";
  32. document.getElementById("order_no").innerText=httpData.order_no;
  33. document.getElementById("order_time").innerText=httpData.order_time;
  34. document.getElementById("prod_name").innerText=httpData.prod_name;
  35. document.getElementById("submit_text").innerText="去支付";
  36. document.getElementById("order_submit").style.background="#FF8800";
  37. document.getElementById("submit_text").style.color="#FFFFFF"
  38. document.getElementById("price").innerText=httpData.price;
  39. document.getElementById("user_name").innerText=httpData.customer_name;
  40. document.getElementById("user_phone").innerText=httpData.customer_mobile;
  41. document.getElementById("user_id").innerText=httpData.customer_id;
  42. time = httpData.pay_second;
  43. setInterval("ShowCountDown()",1000);//1000为1秒钟
  44. }else{
  45. document.getElementById("order_status").style.color="#FFFFFF"
  46. document.getElementById("status_layout").style.background="#C7C7C7";
  47. document.getElementById("order_status").innerText=httpData.order_status;
  48. document.getElementById("to_pay").style.display="none";
  49. document.getElementById("order_no").innerText=httpData.order_no;
  50. document.getElementById("order_time").innerText=httpData.order_time;
  51. document.getElementById("prod_name").innerText=httpData.prod_name;
  52. document.getElementById("submit_text").innerText="再次购买";
  53. document.getElementById("order_submit").style.background="#FFFFFF";
  54. document.getElementById("submit_text").style.color="#4D4D4D"
  55. document.getElementById("price").innerText=httpData.price;
  56. document.getElementById("user_name").innerText=httpData.customer_name;
  57. document.getElementById("user_phone").innerText=httpData.customer_mobile;
  58. document.getElementById("user_id").innerText=httpData.customer_id;
  59. }
  60. }else{
  61. alert(httpData.info);
  62. return;
  63. }
  64. }
  65. }
  66. function ShowCountDown() {
  67. if(time <= 0){
  68. return;
  69. }else{
  70. alert(time);
  71. time = Math.floor(time -1);
  72. var leftsecond = time;
  73. var minute=Math.floor((leftsecond)/60);
  74. var second=Math.floor(leftsecond-minute*60);
  75. var cc = document.getElementById("divdown");
  76. }
  77. }
  78. function getParameter(param)
  79. {
  80. var query = window.location.search;
  81. var iLen = param.length;
  82. var iStart = query.indexOf(param);
  83. if (iStart == -1)
  84.   return "";
  85. iStart += iLen + 1;
  86. var iEnd = query.indexOf("&", iStart);
  87. if (iEnd == -1)
  88.   return query.substring(iStart);
  89. return query.substring(iStart, iEnd);
  90. }
  91. function submit(){
  92. if(need_pay == 1){
  93. var listURL = "./bookingHomePage/onlinePay.html?orderno="+order_no;
  94. // 跳转前将URL编码
  95. listURL = encodeURI(listURL);
  96. window.location.href = listURL;
  97. }else{
  98. var listURL = "./reserve_style2.html?prodcode="+prod_code;
  99. // 跳转前将URL编码
  100. listURL = encodeURI(listURL);
  101. window.location.href = listURL;
  102. }
  103. }