Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

716 wiersze
22 KiB

  1. var httpData;
  2. if (window.ActiveXObject) {
  3. var myreq = new ActiveXObject("Microsoft.XMLHTTP");
  4. } else {
  5. var myreq = new XMLHttpRequest();
  6. }
  7. function loadData(){
  8. myreq.open("get", "/core/detail.asp?prodcode="+m_projcode, true);
  9. myreq.onreadystatechange = showData;
  10. myreq.send();
  11. }
  12. function showData(){
  13. if (myreq.readyState == 4){
  14. var newstr = myreq.responseText;
  15. httpData = JSON.parse(newstr);
  16. document.getElementById("start_area").innerText=httpData.start_area;
  17. document.getElementById("go_info").innerText=httpData.run_info;
  18. document.getElementById("end_area").innerText=httpData.end_area;
  19. if(httpData.direction == 1){
  20. document.getElementById("back_info").style.display="none";
  21. document.getElementById("exchangelogo").src="./img/single_arrow.png";
  22. }else{
  23. document.getElementById("back_info").style.display="block";
  24. document.getElementById("exchangelogo").src="img/exchange.png";
  25. document.getElementById("back_info").innerText=httpData.back_run_info;
  26. }
  27. document.getElementById("prod_name").innerText=httpData.prod_name;
  28. if(httpData.if_bus == "1"){
  29. document.getElementById("if_bus").style.display = "inline";
  30. }else{
  31. document.getElementById("if_bus").style.display = "none";
  32. }
  33. if(httpData.if_hotel == "1"){
  34. document.getElementById("if_hotel").style.display = "inline";
  35. }else{
  36. document.getElementById("if_hotel").style.display = "none";
  37. }
  38. if(httpData.if_sightspot == "1"){
  39. document.getElementById("if_sightspot").style.display = "inline";
  40. }else{
  41. document.getElementById("if_sightspot").style.display = "none";
  42. }
  43. if(!runid){
  44. }else{
  45. var tnowtime = getDateTime(4);
  46. var myURL = m_url + 'op=ticket&tt=' + tnowtime + '&projcode=' + m_projcode + '&runid=' + runid;
  47. myreq.open("get",myURL,true);
  48. myreq.onreadystatechange = show_ticket;
  49. myreq.send(null);
  50. }
  51. }
  52. }
  53. var m_url = '/core/partner.asp?';
  54. var m_godate = '';
  55. var m_gotime = '';
  56. var m_backdate = '';
  57. var m_backtime = '';
  58. var m_projcode = '';
  59. var m_go_run_id = '';
  60. var arrayGoDate = new Array();
  61. var arrayBackDate = new Array();
  62. var arrayTicket = new Array();
  63. var total = '';
  64. var num ='';
  65. var userId = '';
  66. var linkName = '';
  67. var linkPhone = '';
  68. var linkIdno = '';
  69. var runid = '';
  70. var m_godate = '';
  71. var m_gotime = '';
  72. var m_backdate = '';
  73. var m_backtime = '';
  74. var ticket = '';
  75. var arrayTicketbak = new Array();
  76. window.onload = function()
  77. {
  78. m_projcode = getPar('prodcode');
  79. ticket = getPar('ticket');
  80. if(!ticket){
  81. arrayTicketbak.length = 0;
  82. }else{
  83. arrayTicketbak.length = 0;
  84. var arrT = ticket.split("|");
  85. for(var i = 0; i < arrT.length; i++){
  86. var arrP = arrT[i].split("P");
  87. if(arrP.length == 2){
  88. arrayTicketbak[i] = new Array();
  89. arrayTicketbak[i][0] = arrP[0];
  90. arrayTicketbak[i][1] = arrP[1];
  91. }
  92. }
  93. }
  94. runid = getPar('runid');
  95. m_godate = getPar('m_godate');
  96. m_gotime = getPar('m_gotime');
  97. m_backdate = getPar('m_backdate');
  98. m_backtime = getPar('m_backtime');
  99. userId = getPar('user_id');
  100. if(!userId){
  101. }else{
  102. linkName = getPar('link_name');
  103. linkPhone = getPar('link_phone');
  104. linkIdno = getPar('link_idno');
  105. set_contacts(userId, linkName, linkPhone, linkIdno);
  106. }
  107. if(!m_godate || !m_gotime){
  108. }else{
  109. var obj1 = document.getElementById('show_go_run_info');
  110. obj1.innerHTML = m_godate + ' ' + m_gotime + "&nbsp;&nbsp";
  111. }
  112. if(!m_backdate || !m_backtime){
  113. document.getElementById('back_time').style.display = "none"
  114. }else{
  115. document.getElementById('back_time').style.display = "block"
  116. var obj1 = document.getElementById('show_back_run_info');
  117. obj1.innerHTML = m_backdate + ' ' + m_backtime + "&nbsp;&nbsp";
  118. }
  119. //m_projcode = 'HPTPZyx'; //调试代码
  120. loadData();
  121. //此处还需添加其他获取产品详细信息并显示的代码
  122. }
  123. function go_date() {
  124. var listURL = "./select_date.html?prodcode="+m_projcode;
  125. if(!userId){
  126. }else{
  127. listURL += ("&user_id="+userId+"&link_name="+linkName+"&link_phone="+linkPhone+"&link_idno="+linkIdno);
  128. }
  129. // 跳转前将URL编码
  130. listURL = encodeURI(listURL);
  131. window.location.href = listURL;
  132. }
  133. function get_backrundate(gorunid) {
  134. m_go_run_id = gorunid;
  135. var myURL = m_url + 'op=backdate&projcode=' + m_projcode + '&runid=' + gorunid;
  136. myreq.open("get",myURL,true);
  137. myreq.onreadystatechange = show_backrundate;
  138. myreq.send(null);
  139. }
  140. function show_gorundate()
  141. {
  142. if (myreq.readyState == 4)
  143. {
  144. var newstr = myreq.responseText;
  145. httpData = JSON.parse(newstr);
  146. var c_code = httpData.code;
  147. if (c_code == '0')
  148. {
  149. arrayGoDate.length = 0;
  150. for (var i = 0;i<httpData.date_list.length;i++)
  151. {
  152. arrayGoDate[i] = httpData.date_list[i].godate;
  153. }
  154. }else{
  155. alert(httpData.info);
  156. return;
  157. }
  158. if (arrayGoDate.length > 0)
  159. {
  160. show_calendar(arrayGoDate[0],0);
  161. }else{
  162. alert('没有可选择的发车日期');
  163. show_calendar(getDateTime(0)) ;
  164. }
  165. }
  166. }
  167. function show_backrundate()
  168. {
  169. arrayBackDate.length = 0;
  170. if (myreq.readyState == 4){
  171. var newstr = myreq.responseText;
  172. document.getElementById('div_date_runlist').innerHTML = '';
  173. httpData = JSON.parse(newstr);
  174. var c_code = httpData.code;
  175. if (c_code == '0')
  176. {
  177. for (var i = 0;i<httpData.date_list.length;i++)
  178. {
  179. arrayBackDate[i] = httpData.date_list[i].backdate;
  180. }
  181. }else{
  182. alert(httpData.info);
  183. return;
  184. }
  185. if (arrayBackDate.length > 0) show_calendar(arrayBackDate[0],1);
  186. }
  187. }
  188. function show_calendar(cshowdate,goback)
  189. {
  190. var arrayRunDate = new Array();
  191. if (goback == 0)
  192. {
  193. arrayRunDate = arrayGoDate;
  194. }else{
  195. arrayRunDate = arrayBackDate;
  196. }
  197. var cnowdate = str2date(cshowdate);
  198. var cnowyear = cnowdate.getYear();
  199. var cnowfullyear = cnowdate.getFullYear();
  200. var cnowmonth = cnowdate.getMonth();
  201. var ddate1 = new Date(cnowfullyear,cnowmonth+1,1);
  202. var denddate = new Date(ddate1-86400000);
  203. var cendday = denddate.getDate();
  204. var clistdateweek = 0;
  205. var cnowdate2 = parseInt(cnowmonth)+1;
  206. cnowdate2 = cnowfullyear + '年' + cnowdate2 + '月';
  207. var cnowdate3 = cnowfullyear + '-' + cnowmonth + '-1';
  208. var cshow1 = '<span class="span_move_month" id="span_last_month" onclick="show_next_calendar(\'' + cnowdate3 + '\',0,' + goback + ')" ><<</span>';
  209. cshow1 += '<span id="span_now_month" >' + cnowdate2 + '</span>';
  210. cshow1 += '<span class="span_move_month" id="span_next_month" onclick="show_next_calendar(\'' + cnowdate3 + '\',2,' + goback + ')" >>></span>';
  211. document.getElementById('div_date_run_date').innerHTML = cshow1;
  212. var cshow = '<span class="span_calendar_title" >星期一</span><span class="span_calendar_title" >星期二</span><span class="span_calendar_title" >星期三</span><span class="span_calendar_title" >星期四</span><span class="span_calendar_title" >星期五</span><span class="span_calendar_title" >星期六</span><span class="span_calendar_title" >星期日</span>';
  213. var nnum1 = 0;
  214. var dgodate = str2date(arrayRunDate[0]);
  215. var nnum2 = arrayRunDate.length;
  216. for (var i=1;i<=cendday;i++)
  217. {
  218. var clistdate = new Date(cnowfullyear,cnowmonth,i);
  219. clistdateweek = clistdate.getDay();
  220. if (i==1)
  221. {
  222. if (clistdateweek == 0) clistdateweek = 7;
  223. for (var j=1;j<clistdateweek;j++)
  224. {
  225. cshow += '<span class="span_calendar_blank" >&nbsp;</span>';
  226. }
  227. }
  228. while ((dgodate - clistdate < 0) && (nnum1 < nnum2))
  229. {
  230. nnum1++;
  231. if (nnum1<arrayRunDate.length) dgodate = str2date(arrayRunDate[nnum1]);
  232. }
  233. var c11 = clistdate.getYear();
  234. var c12 = clistdate.getMonth();
  235. var c13 = clistdate.getDate();
  236. var c21 = dgodate.getYear();
  237. var c22 = dgodate.getMonth();
  238. var c23 = dgodate.getDate();
  239. if (c11==c21 && c12==c22 && c13==c23 && arrayRunDate.length>0)
  240. {
  241. if (goback == 0)
  242. {
  243. cshow += '<span class="span_calendar_enable" onclick=get_gorun(\'' + arrayRunDate[nnum1] + '\')>' + i + '</span>';
  244. }else{
  245. cshow += '<span class="span_calendar_enable" onclick=get_backrun(\'' + arrayRunDate[nnum1] + '\')>' + i + '</span>';
  246. }
  247. }else{
  248. cshow += '<span class="span_calendar_disable" >' + i + '</span>';
  249. }
  250. }
  251. if (clistdateweek>0)
  252. {
  253. for (var i=clistdateweek;i<7;i++)
  254. {
  255. cshow += '<span class="span_calendar_blank" >&nbsp;</span>';
  256. }
  257. }
  258. document.getElementById('div_date_calendar1').innerHTML = cshow;
  259. }
  260. function get_gorun(godate)
  261. {
  262. var tnowtime = getDateTime(4);
  263. m_godate = godate;
  264. var myURL = m_url + 'op=gorun&tt=' + tnowtime + '&projcode=' + m_projcode + '&godate=' + godate;
  265. myreq.open("get",myURL,true);
  266. myreq.onreadystatechange = show_gorun;
  267. myreq.send(null);
  268. }
  269. function get_backrun(backdate)
  270. {
  271. var runid = m_go_run_id;
  272. m_backdate = backdate;
  273. var myURL = m_url + 'op=backrun&runid=' + runid + '&projcode=' + m_projcode + '&backdate=' + backdate;
  274. myreq.open("get",myURL,true);
  275. myreq.onreadystatechange = show_backrun;
  276. myreq.send(null);
  277. }
  278. function show_gorun()
  279. {
  280. if (myreq.readyState == 4)
  281. {
  282. var newstr = myreq.responseText;
  283. var cshow ='';
  284. httpData = JSON.parse(newstr);
  285. var c_code = httpData.code;
  286. if (c_code == '0')
  287. {
  288. var nnum1 = httpData.go_run_list.length;
  289. if (nnum1 -0>0)
  290. {
  291. cshow = '<ul>';
  292. for (var i=0;i<httpData.go_run_list.length;i++)
  293. {
  294. //此处以后应加上runback的处理代码
  295. cshow += '<li onclick="get_next(\'' + httpData.go_run_list[i].runid + '\',\'' + httpData.go_run_list[i].runback + '\',\'' + httpData.go_run_list[i].runtime + '\')">' + httpData.go_run_list[i].runinfo + '</li>';
  296. }
  297. cshow += '</ul>';
  298. }
  299. var obj1 = document.getElementById('div_date_runlist');
  300. obj1.innerHTML = cshow;
  301. }else{
  302. alert(httpData.info);
  303. return;
  304. }
  305. }
  306. }
  307. function show_backrun()
  308. {
  309. if (myreq.readyState == 4)
  310. {
  311. var newstr = myreq.responseText;
  312. var cshow ='';
  313. httpData = JSON.parse(newstr);
  314. var c_code = httpData.code;
  315. if (c_code == '0')
  316. {
  317. var nnum1 = httpData.back_run_list.length;
  318. if (nnum1 -0>0)
  319. {
  320. cshow = '<ul>';
  321. for (var i=0;i<httpData.back_run_list.length;i++)
  322. {
  323. cshow += '<li onclick="get_ticket(\'' + httpData.back_run_list[i].runid +'\',\'' + httpData.back_run_list[i].runtime + '\',1)">' + httpData.back_run_list[i].runinfo + '</li>';
  324. }
  325. cshow += '</ul>';
  326. }
  327. var obj1 = document.getElementById('div_date_runlist');
  328. obj1.innerHTML = cshow;
  329. }else{
  330. alert(httpData.info);
  331. return;
  332. }
  333. }
  334. }
  335. function get_next(gorunid,ifback,runtime)
  336. {
  337. m_ifback = ifback;
  338. m_gotime = runtime;
  339. var obj1 = document.getElementById('show_go_run_info');
  340. obj1.innerHTML = '出行时间:' + m_godate + ' ' + m_gotime+ "&nbsp;&nbsp";
  341. if (ifback == '0')
  342. {
  343. get_ticket(gorunid,'',0);
  344. }else{
  345. //此处添加选返程日期的代码
  346. document.getElementById('div_date_run_title').innerHTML = '请选择返程日期';
  347. get_backrundate(gorunid);
  348. return;
  349. }
  350. }
  351. function get_ticket(runid,runtime,goback)
  352. {
  353. if (goback-1 == 0)
  354. {
  355. m_backtime = runtime;
  356. var obj1 = document.getElementById('show_back_run_info');
  357. obj1.innerHTML = '返程时间:' + m_backdate + ' ' + m_backtime+ "&nbsp;&nbsp";
  358. }
  359. var tnowtime = getDateTime(4);
  360. var myURL = m_url + 'op=ticket&tt=' + tnowtime + '&projcode=' + m_projcode + '&runid=' + runid;
  361. myreq.open("get",myURL,true);
  362. myreq.onreadystatechange = show_ticket;
  363. myreq.send(null);
  364. }
  365. function show_ticket()
  366. {
  367. if (myreq.readyState == 4)
  368. {
  369. var newstr = myreq.responseText;
  370. httpData = JSON.parse(newstr);
  371. var c_code = httpData.code;
  372. if (c_code == '0')
  373. {
  374. arrayTicket.length = 0;
  375. for (var i=0;i<httpData.ticket_list.length;i++)
  376. {
  377. arrayTicket[i] = new Array();
  378. arrayTicket[i][0] = httpData.ticket_list[i].ticketid;
  379. arrayTicket[i][1] = httpData.ticket_list[i].ticketname;
  380. arrayTicket[i][2] = httpData.ticket_list[i].ticketprice;
  381. arrayTicket[i][3] = httpData.ticket_list[i].ticketcount;
  382. arrayTicket[i][4] = parseInt(0);
  383. if(arrayTicketbak.length > 0){
  384. for(var j = 0; j < arrayTicketbak.length; j++){
  385. if(arrayTicket[i][0] == arrayTicketbak[j][0]){
  386. arrayTicket[i][4] = parseInt(arrayTicketbak[j][1]);
  387. }
  388. }
  389. }else{
  390. arrayTicket[i][4] = parseInt(0);
  391. }
  392. }
  393. }else{
  394. alert(httpData.info);
  395. return;
  396. }
  397. show_ticket1();
  398. }
  399. }
  400. function show_ticket1(){
  401. var nnum1 = arrayTicket.length;
  402. var cshow = '';
  403. total = 0;
  404. num = 0;
  405. for (var i=0;i<nnum1;i++){
  406. cshow += '<div style="float:left;height:77px; width:95.7%; border-bottom:1px solid #E2E2E2;margin-left:4.3%;">';
  407. cshow += '<div style="height:28px;color:#4d4d4d;font-size:15px;margin-top:10px;margin-left:22.22%;">' + arrayTicket[i][1] + '</div>';
  408. cshow += '<div style="overflow:hidden;margin-left:22.22%;">';
  409. cshow += '<span style="float:left;font-size:13px; color:#ff8800; font-weight:bold;margin-top:6px;">¥</span>';
  410. cshow += '<span style="float:left;font-size:17px; color:#ff8800; font-weight:bold;margin-top:3px;">'+arrayTicket[i][2]+'</span>';
  411. cshow += '<table style="heigh:24px;width:30%;float:right;border:1px solid #dbdbdb;margin-right:4%;">';
  412. cshow += '<tr style=" font-size:11px;">';
  413. cshow += '<td style="border-right:1px solid #dbdbdb;text-align:center;color:#33d6b0;font-size:16px;font-weight:bold;width:29%;" onclick="subtraction('+'\''+ i+'\')">-</td>';
  414. cshow += '<td style="border-right:1px solid #dbdbdb;text-align:center;width:42%;">'+ arrayTicket[i][4] +'</td>';
  415. cshow += '<td style="text-align:center;color:#33d6b0;font-size:16px;font-weight:bold;width:29%;" onclick="add('+'\''+ i+'\')">+</td>';
  416. cshow += '</tr>';
  417. cshow += '</table>';
  418. cshow += '<span style="float:right;font-size:14px;margin-right:9%;margin-top:3px; color: #808080;">充足</span>';
  419. cshow += '</div>';
  420. cshow += '</div>';
  421. total = (parseInt(total)-0) + (arrayTicket[i][2]*arrayTicket[i][4]-0);
  422. num = (parseInt(num)-0) + (arrayTicket[i][4]-0);
  423. }
  424. var obj1 = document.getElementById('ticket');
  425. obj1.innerHTML = cshow;
  426. var obj2 = document.getElementById('back_ticket');
  427. obj2.style.display = 'block';
  428. document.getElementById("amount_price").innerText = total;
  429. if(!num || !userId){
  430. document.getElementById("submit_order").style.background="#EBEBEB"
  431. document.getElementById("symbol").style.display="none";
  432. document.getElementById("arrow").style.display="none";
  433. document.getElementById("amount_price").style.display="none";
  434. }else{
  435. document.getElementById("submit_order").style.background="#FF8800";
  436. document.getElementById("symbol").style.display="block";
  437. document.getElementById("arrow").style.display="block";
  438. document.getElementById("amount_price").style.display="block";
  439. }
  440. }
  441. function subtraction(i){
  442. if(arrayTicket[i][4] <= 0){
  443. }else{
  444. arrayTicket[i][4] = parseInt(arrayTicket[i][4])-1;
  445. show_ticket1();
  446. }
  447. }
  448. function add(i){
  449. if(arrayTicket[i][4] >= 0 && arrayTicket[i][4] < arrayTicket[i][3]){
  450. arrayTicket[i][4] = (parseInt(arrayTicket[i][4])-0)+1;
  451. show_ticket1();
  452. }else{
  453. }
  454. }
  455. function customer_list() {
  456. var listURL = "./select_contacts.html?prodcode="+m_projcode;
  457. ticket = '';
  458. for(var i = 0; i < arrayTicket.length; i++){
  459. ticket += arrayTicket[i][0]+"P" + arrayTicket[i][4] + "|";
  460. }
  461. if(!ticket){
  462. }else{
  463. listURL += "&ticket="+ticket;
  464. }
  465. if(!runid){
  466. }else{
  467. listURL += "&runid="+runid;
  468. if(!m_godate || !m_gotime){
  469. }else{
  470. listURL += "&m_godate="+m_godate;
  471. listURL += "&m_gotime="+m_gotime;
  472. }
  473. if(!m_backdate || !m_backtime){
  474. }else{
  475. listURL += "&m_backdate="+m_backdate;
  476. listURL += "&m_backtime="+m_backtime;
  477. }
  478. }
  479. // 跳转前将URL编码
  480. listURL = encodeURI(listURL);
  481. window.location.href = listURL;
  482. }
  483. function set_contacts(link_id, link_name, link_phone, link_idno) {
  484. document.getElementById("linkman1").style.display = "none";
  485. document.getElementById("linkman2").style.display = "block";
  486. document.getElementById("id_one").value = link_id;
  487. document.getElementById("name_one").innerText = link_name;
  488. document.getElementById("phone_one").innerText = link_phone;
  489. document.getElementById("idno_one").innerText = link_idno;
  490. if(!num || !userId){
  491. document.getElementById("submit_order").style.background="#EBEBEB"
  492. document.getElementById("symbol").style.display="none";
  493. document.getElementById("arrow").style.display="none";
  494. document.getElementById("amount_price").style.display="none";
  495. }else{
  496. document.getElementById("submit_order").style.background="#FF8800";
  497. document.getElementById("symbol").style.display="block";
  498. document.getElementById("arrow").style.display="block";
  499. document.getElementById("amount_price").style.display="block";
  500. }
  501. }
  502. function show_next_calendar(cshowdate,dealflag,goback)
  503. {
  504. var cnowdate = str2date(cshowdate);
  505. var cnowyear = cnowdate.getYear();
  506. var cnowfullyear = cnowdate.getFullYear();
  507. var cnowmonth = cnowdate.getMonth();
  508. var ddate1 = new Date(cnowfullyear,cnowmonth+dealflag,1);
  509. var cnextfullyear = ddate1.getFullYear();
  510. var cnextmonth = ddate1.getMonth();
  511. var cnextdate = parseInt(cnextmonth)+1;
  512. cnextdate = cnextfullyear + '-' + cnextdate + '-1';
  513. show_calendar(cnextdate,goback);
  514. }
  515. function str2date(DateStr){
  516. if(typeof DateStr=="undefined")return new Date();
  517. if(typeof DateStr=="date")return DateStr;
  518. var converted = Date.parse(DateStr);
  519. var myDate = new Date(converted);
  520. if(isNaN(myDate)){
  521. DateStr=DateStr.replace(/:/g,"-");
  522. DateStr=DateStr.replace(" ","-");
  523. DateStr=DateStr.replace(".","-");
  524. var arys= DateStr.split('-');
  525. switch(arys.length){
  526. case 7 : myDate = new Date(arys[0],--arys[1],arys[2],arys[3],arys[4],arys[5],arys[6]);
  527. break;
  528. case 6 : myDate = new Date(arys[0],--arys[1],arys[2],arys[3],arys[4],arys[5]);
  529. break;
  530. default: myDate = new Date(arys[0],--arys[1],arys[2]);
  531. break;
  532. };
  533. };
  534. return myDate;
  535. }
  536. function getPar(par){
  537. //获取当前URL
  538. var local_url = document.location.href;
  539. local_url = decodeURI(local_url);
  540. //获取要取得的get参数位置
  541. var get = local_url.indexOf(par +"=");
  542. if(get == -1){
  543. return false;
  544. }
  545. //截取字符串
  546. var get_par = local_url.slice(par.length + get + 1);
  547. //判断截取后的字符串是否还有其他get参数
  548. var nextPar = get_par.indexOf("&");
  549. if(nextPar != -1){
  550. get_par = get_par.slice(0, nextPar);
  551. }
  552. return get_par;
  553. }
  554. function getDateTime(nTypeFlag)
  555. {
  556. var tNowTime = new Date();
  557. var myYear = ';' + tNowTime.getFullYear() + ';';
  558. var myMonth = ';' + (tNowTime.getMonth()+1-0) + ';';
  559. var myDay = ';' + tNowTime.getDate()+ ';';
  560. var myHour = ';' + tNowTime.getHours()+ ';';
  561. var myMinu = ';' + tNowTime.getMinutes()+ ';';
  562. var mySecond = ';' + tNowTime.getSeconds()+ ';';
  563. if (myMonth.length < 4) myMonth = '0' + myMonth;
  564. if (myDay.length < 4) myDay = '0' + myDay;
  565. if (myHour.length < 4) myHour = '0' + myHour;
  566. if (myMinu.length < 4) myMinu = '0' + myMinu;
  567. if (mySecond.length < 4) mySecond = '0' + mySecond;
  568. var cNewTimeStr;
  569. //alert(tNowTime);
  570. switch (nTypeFlag+1-1)
  571. {
  572. case 0:
  573. cNewTimeStr = myYear + '-' + myMonth + '-' + myDay;
  574. break;
  575. case 1:
  576. cNewTimeStr = myYear + myMonth + myDay;
  577. break;
  578. case 2:
  579. cNewTimeStr = myHour + ':' + myMinu + ':' + mySecond;
  580. break;
  581. case 3:
  582. cNewTimeStr = myHour + myMinu + mySecond;
  583. break;
  584. case 4:
  585. cNewTimeStr = myYear + myMonth + myDay + myHour + myMinu + mySecond;
  586. break;
  587. case 5:
  588. cNewTimeStr = myYear + '年' + myMonth + '月' + myDay + '日';
  589. break;
  590. case 6:
  591. cNewTimeStr = myYear;
  592. break;
  593. case 7:
  594. cNewTimeStr = myYear + '-' + myMonth;
  595. break;
  596. default:
  597. cNewTimeStr = myYear + '-' + myMonth + '-' + myDay + ' ' + myHour + ':' + myMinu + ':' + mySecond;
  598. break;
  599. }
  600. cNewTimeStr = cNewTimeStr.replace(/;/g,"");
  601. return cNewTimeStr;
  602. }
  603. function submit_order(){
  604. if(!num || !userId){
  605. document.getElementById("submit_order").style.background="#EBEBEB"
  606. document.getElementById("symbol").style.display="none";
  607. document.getElementById("arrow").style.display="none";
  608. document.getElementById("amount_price").style.display="none";
  609. }else{
  610. document.getElementById("submit_order").style.background="#FF8800";
  611. document.getElementById("symbol").style.display="block";
  612. document.getElementById("arrow").style.display="block";
  613. document.getElementById("amount_price").style.display="block";
  614. var ticket = '';
  615. var customer = '';
  616. var name_one = document.getElementById("name_one").innerText;
  617. var phone_one = document.getElementById("phone_one").innerText
  618. var idno_one = document.getElementById("idno_one").innerText
  619. for(var i = 0; i < arrayTicket.length; i++){
  620. ticket += arrayTicket[i][0]+"P" + arrayTicket[i][4] + "|";
  621. }
  622. customer = "{|" + name_one + "|" + phone_one + "|" + idno_one + "|}";
  623. var tnowtime = getDateTime(4);
  624. var myURL = m_url + 'op=lock&projcode=' + m_projcode + '&tt=' + tnowtime + '&ticket=' + ticket + '&customer=' + customer;
  625. myreq.open("get",myURL,true);
  626. myreq.onreadystatechange = submit_my_order;
  627. myreq.send(null);
  628. }
  629. }
  630. function submit_my_order(){
  631. if (myreq.readyState == 4){
  632. var newstr = myreq.responseText;
  633. var cshow ='';
  634. httpData = JSON.parse(newstr);
  635. var c_code = httpData.code;
  636. if (c_code == '0'){
  637. //alert(httpData.tradeno);
  638. var listURL = "./bookingHomePage/onlinePay.html?orderno="+httpData.tradeno;
  639. // 跳转前将URL编码
  640. listURL = encodeURI(listURL);
  641. window.location.href = listURL;
  642. }else{
  643. alert(httpData.info);
  644. return;
  645. }
  646. }
  647. }
  648. var arrowtype = '0';
  649. function arrow_show(){
  650. var a = document.getElementById("arrow");
  651. var show_list = document.getElementById("show_list");
  652. if(arrowtype == 0){
  653. if(arrayTicket.length > 0){
  654. var s = '';
  655. for (var i=0;i<arrayTicket.length;i++){
  656. if(arrayTicket[i][4] > 0){
  657. arrowtype = '1';
  658. s += '<div style="overflow:hidden;width:100%;height:45px;line-height:45px; border-top:1px solid #E2E2E2; color:#303030;font-size:14px;font-family:‘黑体’;">';
  659. s += '<span style="float:left; margin-left: 4%;">'+arrayTicket[i][1]+'</span> ';
  660. s += '<span style="float:right;color:#adadad;font-size:11px;margin-right:3.3%;">×'+arrayTicket[i][4]+'</span>';
  661. s += '<span style="float:right;color:#ff8800;margin-right:1.5%;font-weight:bold;"><span style="margin-right:2px;">¥</span>'+arrayTicket[i][2]+'</span>';
  662. s += '</div>';
  663. }
  664. }
  665. if(arrowtype == 1){
  666. a.src = "../img/down_arrow.png";
  667. document.getElementById("mask").style.display="block";
  668. show_list.style.display = "block";
  669. document.getElementById("ticket_list").innerHTML = s;
  670. }
  671. }
  672. }else{
  673. arrowtype = '0';
  674. a.src = "../img/up_arrow.png";
  675. document.getElementById("mask").style.display="none";
  676. show_list.style.display = "none";
  677. }
  678. }
  679. function hide_mask_type(){
  680. arrowtype = '0';
  681. document.getElementById("mask").style.display="none";
  682. document.getElementById("show_list").style.display="none";
  683. document.getElementById("arrow").src = "../img/up_arrow.png";
  684. }
  685. function notes(){
  686. var listURL = "./notes.html?prodcode="+m_projcode;
  687. // 跳转前将URL编码
  688. listURL = encodeURI(listURL);
  689. window.location.href = listURL;
  690. }