Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

3 роки тому
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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://xmwxc.zhizhuchuxing.cn/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("start_area").innerText=httpData.start_area;
  35. document.getElementById("go_info").innerText=httpData.go_info;
  36. document.getElementById("end_area").innerText=httpData.end_area;
  37. if(httpData.direction == 1){
  38. document.getElementById("back_info").style.display="none";
  39. }else{
  40. document.getElementById("back_info").style.display="block";
  41. document.getElementById("back_info").innerText=httpData.back_info;
  42. }
  43. document.getElementById("prod_name").innerText=httpData.prod_name;
  44. document.getElementById("submit_text").innerText="去支付";
  45. document.getElementById("order_submit").style.background="#FF8800";
  46. document.getElementById("submit_text").style.color="#FFFFFF"
  47. document.getElementById("price").innerText=httpData.price;
  48. document.getElementById("user_name").innerText=httpData.customer_name;
  49. document.getElementById("user_phone").innerText=httpData.customer_mobile;
  50. document.getElementById("user_id").innerText=httpData.customer_id;
  51. time = httpData.pay_second;
  52. setInterval("ShowCountDown()",1000);//1000为1秒钟
  53. }else{
  54. document.getElementById("order_status").style.color="#FFFFFF"
  55. document.getElementById("status_layout").style.background="#C7C7C7";
  56. document.getElementById("order_status").innerText=httpData.order_status;
  57. document.getElementById("to_pay").style.display="none";
  58. document.getElementById("order_no").innerText=httpData.order_no;
  59. document.getElementById("order_time").innerText=httpData.order_time;
  60. document.getElementById("start_area").innerText=httpData.start_area;
  61. document.getElementById("go_info").innerText=httpData.go_info;
  62. document.getElementById("end_area").innerText=httpData.end_area;
  63. if(httpData.direction == 1){
  64. document.getElementById("back_info").style.display="none";
  65. }else{
  66. document.getElementById("back_info").style.display="block";
  67. document.getElementById("back_info").innerText=httpData.back_info;
  68. }
  69. document.getElementById("prod_name").innerText=httpData.prod_name;
  70. document.getElementById("submit_text").innerText="再次购买";
  71. document.getElementById("order_submit").style.background="#FFFFFF";
  72. document.getElementById("submit_text").style.color="#4D4D4D"
  73. document.getElementById("price").innerText=httpData.price;
  74. document.getElementById("user_name").innerText=httpData.customer_name;
  75. document.getElementById("user_phone").innerText=httpData.customer_mobile;
  76. document.getElementById("user_id").innerText=httpData.customer_id;
  77. }
  78. }else{
  79. alert(httpData.info);
  80. return;
  81. }
  82. }
  83. }
  84. function ShowCountDown() {
  85. if(time <= 0){
  86. return;
  87. }else{
  88. alert(time);
  89. time = Math.floor(time -1);
  90. var leftsecond = time;
  91. var minute=Math.floor((leftsecond)/60);
  92. var second=Math.floor(leftsecond-minute*60);
  93. var cc = document.getElementById("divdown");
  94. }
  95. }
  96. function getParameter(param)
  97. {
  98. var query = window.location.search;
  99. var iLen = param.length;
  100. var iStart = query.indexOf(param);
  101. if (iStart == -1)
  102.   return "";
  103. iStart += iLen + 1;
  104. var iEnd = query.indexOf("&", iStart);
  105. if (iEnd == -1)
  106.   return query.substring(iStart);
  107. return query.substring(iStart, iEnd);
  108. }
  109. function submit(){
  110. if(need_pay == 1){
  111. var listURL = "./bookingHomePage/onlinePay.html?orderno="+order_no;
  112. // 跳转前将URL编码
  113. listURL = encodeURI(listURL);
  114. window.location.href = listURL;
  115. }else{
  116. var listURL = "./reserve.html?prodcode="+prod_code;
  117. // 跳转前将URL编码
  118. listURL = encodeURI(listURL);
  119. window.location.href = listURL;
  120. }
  121. }