You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

263 lines
14 KiB

  1. var httpData;
  2. if (window.ActiveXObject) {
  3. var myreq = new ActiveXObject("Microsoft.XMLHTTP");
  4. } else {
  5. var myreq = new XMLHttpRequest();
  6. }
  7. var cstr1 = '';
  8. function loadData(){
  9. var obj1 = document.getElementById('otherorder_list');
  10. cstr1 = obj1.innerHTML;
  11. obj1.innerHTML = '';
  12. var myURL = 'http://xmwxc.zhizhuchuxing.cn/core/order_list.asp?tt=' + getDateTime(4);
  13. myreq.open("get", myURL, true);
  14. myreq.onreadystatechange = showData;
  15. myreq.send();
  16. }
  17. function showData(){
  18. if (myreq.readyState == 4){
  19. var newstr = myreq.responseText;
  20. httpData = JSON.parse(newstr);
  21. var c_code = httpData.code;
  22. if (c_code == '0'){
  23. var s = '';
  24. var s2 = '';
  25. if (httpData.order_list) {
  26. for (var i = 0; i < httpData.order_list.length; i++) {
  27. if (httpData.order_list[i].order_type - 0 == 0)
  28. {
  29. 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+'\')">';
  30. 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>';
  31. 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>';
  32. s += '</div>';
  33. s += '<div style=" position:relative; width:100%;background:#fff;overflow:hidden;" onclick="go_order_details('+'\''+ httpData.order_list[i].order_no+'\')">';
  34. s += '<img style="position:absolute; top:13px; left:4%; width:9px; height:39px;" src="img/smalllogo.png" alt="">';
  35. s += '<div style="float:left;width:100%;">';
  36. s += '<div style="float:left;width:75%; margin-left:10.5%;">';
  37. s += '<div style="height:32px; line-height: 32px; width:100%; border-bottom:1px solid #ECEBEE;">';
  38. s += '<span style="font-size:16px; color:#303030;">'+httpData.order_list[i].start_area+'</span>';
  39. s += '<span style="float:right;color:#808080;font-size:14px;">'+httpData.order_list[i].go_info+'</span>';
  40. s += '</div>';
  41. s += '<div style="32px; line-height: 32px; width:100%;">';
  42. s += '<span style="font-size:16px;color:#303030;">'+httpData.order_list[i].end_area+'</span>';
  43. if(httpData.order_list[i].direction == 2){
  44. s += '<span style="float:right;color:#808080;font-size:14px;">'+httpData.order_list[i].back_info+'</span>';
  45. }else{
  46. }
  47. s += '</div>';
  48. s += '</div>';
  49. 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%;">';
  50. s += '<div style="float:left;color:#808080;font-size:13px;">'+httpData.order_list[i].prod_name+'</div>';
  51. // s += '<div style="float:left;margin-left:1.5%;">';
  52. // s += '<img style="width:14px; height:15px;" src="img/car2.png" alt="">';
  53. // s += '<img style="width:15px; height:15px;" src="img/hotel2.png" alt="">';
  54. // s += '<img style="width:15px; height:15px;" src="../img/ticket.png" alt=""> ';
  55. // s += '</div>';
  56. s += '</div>';
  57. s += '</div>';
  58. if(httpData.order_list[i].direction == 2){
  59. s += '<img style="position:absolute;top:25px;right:6.8%;width:13px; height: 13px;" src="img/exchange.png" alt="">';
  60. }else{
  61. s += '<img style="position:absolute;top:25px;right:6.8%;width:13px; height: 13px;" src="img/single_arrow.png" alt="">';
  62. }
  63. s += '</div>';
  64. s += '<div style="display: block; width: 100%;background:#FFFFFF; border-bottom: 1px solid #E2E2E2; height: 35px; padding-top: 12px; margin-bottom: 10px;">';
  65. 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>';
  66. if(httpData.order_list[i].need_pay == 1){
  67. 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;">';
  68. s += '<span style="font-size: 12px; color: #FFFFFF;" onclick="submit_order('+'\''+httpData.order_list[i].order_no+'\')">去支付</span>';
  69. s += '</div>';
  70. }
  71. 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;">';
  72. s += '<span style=" margin-left: 0; margin-bottom: 0; font-size: 12px; color: #303030;" onclick="go_book('+'\''+httpData.order_list[i].prod_code+'\')">再次购买</span>';
  73. s += '</div>';
  74. s += '</div>';
  75. }else{
  76. var cstr2 = cstr1;
  77. cstr2 = cstr2.replace(/\[orderno\]/g,httpData.order_list[i].order_no);
  78. cstr2 = cstr2.replace(/\[order_time\]/g,httpData.order_list[i].order_time);
  79. cstr2 = cstr2.replace(/\[order_status\]/g,httpData.order_list[i].order_status);
  80. cstr2 = cstr2.replace(/\[prod_name\]/g,httpData.order_list[i].prod_name);
  81. var cstr3 = httpData.order_list[i].go_info;
  82. cstr3 = cstr3.substr(0,10)
  83. cstr2 = cstr2.replace(/\[play_date\]/g,'游玩日期:' + cstr3);
  84. cstr2 = cstr2.replace(/\[price\]/g,httpData.order_list[i].price);
  85. cstr3 = '';
  86. if(httpData.order_list[i].need_pay -1 == 0)
  87. {
  88. 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;">';
  89. cstr3 += '<span style="font-size: 12px; color: #FFFFFF;" onclick="submit_order('+'\''+httpData.order_list[i].order_no+'\')">去支付</span>';
  90. cstr3 += '</div>';
  91. }
  92. 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;">';
  93. cstr3 += '<span style=" margin-left: 0; margin-bottom: 0; font-size: 12px; color: #303030;" onclick="go_book('+'\''+httpData.order_list[i].prod_code+'\')">再次购买</span>';
  94. cstr3 += '</div>';
  95. cstr2 = cstr2.replace(/\[pay_button\]/g,cstr3);
  96. s2 += cstr2;
  97. /* 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+'\')">';
  98. 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>';
  99. 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>';
  100. s2 += '</div>';
  101. s2 += '<div style=" position:relative; width:100%;background:#fff;overflow:hidden;" onclick="go_order_details('+'\''+ httpData.order_list[i].order_no+'\')">';
  102. s2 += '<img style="position:absolute; top:13px; left:4%; width:9px; height:39px;" src="img/smalllogo.png" alt="">';
  103. s2 += '<div style="float:left;width:100%;">';
  104. s2 += '<div style="float:left;width:75%; margin-left:10.5%;">';
  105. s2 += '<div style="height:32px; line-height: 32px; width:100%; border-bottom:1px solid #ECEBEE;">';
  106. s2 += '<span style="font-size:16px; color:#303030;">'+httpData.order_list[i].start_area+'</span>';
  107. s2 += '<span style="float:right;color:#808080;font-size:14px;">'+httpData.order_list[i].go_info+'</span>';
  108. s2 += '</div>';
  109. s2 += '<div style="32px; line-height: 32px; width:100%;">';
  110. s2 += '<span style="font-size:16px;color:#303030;">'+httpData.order_list[i].end_area+'</span>';
  111. if(httpData.order_list[i].direction == 2){
  112. s2 += '<span style="float:right;color:#808080;font-size:14px;">'+httpData.order_list[i].back_info+'</span>';
  113. }
  114. s2 += '</div>';
  115. s2 += '</div>';
  116. 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%;">';
  117. s2 += '<div style="float:left;color:#808080;font-size:13px;">'+httpData.order_list[i].prod_name+'</div>';
  118. s2 += '</div>';
  119. s2 += '</div>';
  120. if(httpData.order_list[i].direction == 2){
  121. s2 += '<img style="position:absolute;top:25px;right:6.8%;width:13px; height: 13px;" src="img/exchange.png" alt="">';
  122. }else{
  123. s2 += '<img style="position:absolute;top:25px;right:6.8%;width:13px; height: 13px;" src="img/single_arrow.png" alt="">';
  124. }
  125. s2 += '</div>';
  126. s2 += '<div style="display: block; width: 100%;background:#FFFFFF; border-bottom: 1px solid #E2E2E2; height: 35px; padding-top: 12px; margin-bottom: 10px;">';
  127. 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>';
  128. if(httpData.order_list[i].need_pay == 1){
  129. 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;">';
  130. s2 += '<span style="font-size: 12px; color: #FFFFFF;" onclick="submit_order('+'\''+httpData.order_list[i].order_no+'\')">去支付</span>';
  131. s2 += '</div>';
  132. }
  133. 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;">';
  134. s2 += '<span style=" margin-left: 0; margin-bottom: 0; font-size: 12px; color: #303030;" onclick="go_book('+'\''+httpData.order_list[i].prod_code+'\')">再次购买</span>';
  135. s2 += '</div>';
  136. s2 += '</div>'; */
  137. }
  138. }}
  139. document.getElementById("order_list").innerHTML = s;
  140. document.getElementById("otherorder_list").innerHTML = s2;
  141. if(document.getElementById("order_list").innerHTML != ''){
  142. document.getElementById("order_list").style.display ="block";
  143. document.getElementById("otherorder_list").style.display ="none";
  144. document.getElementById("null_list").style.display ="none";
  145. }else{
  146. document.getElementById("order_list").style.display ="none";
  147. document.getElementById("otherorder_list").style.display ="none";
  148. document.getElementById("null_list").style.display ="block";
  149. }
  150. }else{
  151. alert(httpData.info);
  152. return;
  153. }
  154. }
  155. }
  156. function go_order_details(order_no){
  157. window.location.href="order_details.html?order_no="+order_no;
  158. }
  159. function go_order_details2(order_no){
  160. window.location.href="order_details2.html?order_no="+order_no;
  161. }
  162. function submit_order(order_no){
  163. var listURL = "./bookingHomePage/onlinePay.html?orderno="+order_no;
  164. // 跳转前将URL编码
  165. listURL = encodeURI(listURL);
  166. window.location.href = listURL;
  167. }
  168. function go_book(prod_code){
  169. var listURL = "./reserve.html?prodcode="+prod_code;
  170. // 跳转前将URL编码
  171. listURL = encodeURI(listURL);
  172. window.location.href = listURL;
  173. }
  174. function left_order(){
  175. document.getElementById("right_order").style.borderBottom="3px solid #F0F0F0";
  176. document.getElementById("left_order").style.borderBottom="3px solid #00CC9C";
  177. if(document.getElementById("order_list").innerHTML != ''){
  178. document.getElementById("order_list").style.display ="block";
  179. document.getElementById("otherorder_list").style.display ="none";
  180. document.getElementById("null_list").style.display ="none";
  181. }else{
  182. document.getElementById("order_list").style.display ="none";
  183. document.getElementById("otherorder_list").style.display ="none";
  184. document.getElementById("null_list").style.display ="block";
  185. }
  186. }
  187. function right_order(){
  188. document.getElementById("left_order").style.borderBottom="3px solid #F0F0F0";
  189. document.getElementById("right_order").style.borderBottom="3px solid #00CC9C";
  190. if(document.getElementById("otherorder_list").innerHTML != ''){
  191. document.getElementById("order_list").style.display ="none";
  192. document.getElementById("otherorder_list").style.display ="block";
  193. document.getElementById("null_list").style.display ="none";
  194. }else{
  195. document.getElementById("order_list").style.display ="none";
  196. document.getElementById("otherorder_list").style.display ="none";
  197. document.getElementById("null_list").style.display ="block";
  198. }
  199. }
  200. function getDateTime(nTypeFlag)
  201. {
  202. var tNowTime = new Date();
  203. var myYear = ';' + tNowTime.getFullYear() + ';';
  204. var myMonth = ';' + (tNowTime.getMonth()+1-0) + ';';
  205. var myDay = ';' + tNowTime.getDate()+ ';';
  206. var myHour = ';' + tNowTime.getHours()+ ';';
  207. var myMinu = ';' + tNowTime.getMinutes()+ ';';
  208. var mySecond = ';' + tNowTime.getSeconds()+ ';';
  209. if (myMonth.length < 4) myMonth = '0' + myMonth;
  210. if (myDay.length < 4) myDay = '0' + myDay;
  211. if (myHour.length < 4) myHour = '0' + myHour;
  212. if (myMinu.length < 4) myMinu = '0' + myMinu;
  213. if (mySecond.length < 4) mySecond = '0' + mySecond;
  214. var cNewTimeStr;
  215. //alert(tNowTime);
  216. switch (nTypeFlag+1-1)
  217. {
  218. case 0:
  219. cNewTimeStr = myYear + '-' + myMonth + '-' + myDay;
  220. break;
  221. case 1:
  222. cNewTimeStr = myYear + myMonth + myDay;
  223. break;
  224. case 2:
  225. cNewTimeStr = myHour + ':' + myMinu + ':' + mySecond;
  226. break;
  227. case 3:
  228. cNewTimeStr = myHour + myMinu + mySecond;
  229. break;
  230. case 4:
  231. cNewTimeStr = myYear + myMonth + myDay + myHour + myMinu + mySecond;
  232. break;
  233. case 5:
  234. cNewTimeStr = myYear + '年' + myMonth + '月' + myDay + '日';
  235. break;
  236. case 6:
  237. cNewTimeStr = myYear;
  238. break;
  239. case 7:
  240. cNewTimeStr = myYear + '-' + myMonth;
  241. break;
  242. default:
  243. cNewTimeStr = myYear + '-' + myMonth + '-' + myDay + ' ' + myHour + ':' + myMinu + ':' + mySecond;
  244. break;
  245. }
  246. cNewTimeStr = cNewTimeStr.replace(/;/g,"");
  247. return cNewTimeStr;
  248. }