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.
 
 
 
 

142 lines
4.7 KiB

  1. var submite_success = getStorJson("submite_success");
  2. var login_data = getStorJson("login_data");
  3. var intDiff = parseInt(submite_success.shengyu_time);//倒计时总秒数量
  4. var goHTML = '';
  5. var backHTML = '';
  6. window.onload = function(){
  7. goHTML = $('#go').html();
  8. backHTML = $('#back').html();
  9. console.log(submite_success);
  10. if (submite_success.ifback == 0) {
  11. $('#go').removeClass('ui_hide');
  12. $('#back').addClass('ui_hide');
  13. reloadDataInfos(0);
  14. timer(intDiff);
  15. } else{
  16. $('#back').removeClass('ui_hide');
  17. $('#go').addClass('ui_hide');
  18. reloadDataInfos(1);
  19. timer(intDiff);
  20. }
  21. }
  22. function reloadDataInfos(ifback){
  23. if (ifback ==0 ) {
  24. var go_list = submite_success.go_list;
  25. var temp = goHTML;
  26. temp = temp.replace('上海',go_list.start_area);
  27. temp = temp.replace('(黄浦旅游集散站)',go_list.start_res);
  28. temp = temp.replace('乌镇',go_list.end_area);
  29. temp = temp.replace('(西栅1号停车场)',go_list.end_res);
  30. temp = temp.replace('2016-07-26',go_list.run_date);
  31. temp = temp.replace('07:40',go_list.run_time);
  32. temp = temp.replace('[普通座]',go_list.site_type);
  33. temp = temp.replace('[n]',go_list.num);
  34. temp = temp.replace('小橙子',go_list.customer_name);
  35. temp = temp.replace('18602525520',go_list.customer_mobile);
  36. var aaa = $('#total').html();
  37. aaa = aaa.replace('110',go_list.order_price);
  38. $('#total').html(aaa);
  39. $('#go').html(temp);
  40. }else{
  41. var go_list = submite_success.go_list;
  42. var back_list = submite_success.back_list;
  43. var temp = backHTML;
  44. temp = temp.replace('[去程出发地]',go_list.start_area);
  45. temp = temp.replace('去程出发站点',go_list.start_res);
  46. temp = temp.replace('[去程目的地]',go_list.end_area);
  47. temp = temp.replace('去程目的站点',go_list.end_res);
  48. temp = temp.replace('[去程日期]',go_list.run_date);
  49. temp = temp.replace('[去程时间]',go_list.run_time);
  50. temp = temp.replace('[去程座]',go_list.site_type);
  51. temp = temp.replace('[去程数量]',go_list.num);
  52. temp = temp.replace('[返程出发地]',back_list.start_area);
  53. temp = temp.replace('返程出发站点',back_list.start_res);
  54. temp = temp.replace('[返程目的地]',back_list.end_area);
  55. temp = temp.replace('返程目的站点',back_list.end_res);
  56. temp = temp.replace('[返程日期]',back_list.run_date);
  57. temp = temp.replace('[返程时间]',back_list.run_time);
  58. temp = temp.replace('[返程座]',back_list.site_type);
  59. temp = temp.replace('[返程数量]',back_list.num);
  60. temp = temp.replace('小橙子',back_list.customer_name);
  61. temp = temp.replace('18602525520',back_list.customer_mobile);
  62. var bbb = $('#total').html();
  63. bbb = bbb.replace('110',parseInt(go_list.order_price)+parseInt(back_list.order_price));
  64. console.log(go_list.order_price);
  65. console.log(back_list.order_price);
  66. $('#total').html(bbb);
  67. $('#back').html(temp);
  68. }
  69. }
  70. //二维码支付
  71. $("#pay_code").click(function(){
  72. window.location.href="pay_code_bus.html";
  73. })
  74. //选中微信支付
  75. $("#change_wechat").click(function(){
  76. if($("#duigou").attr("src")=="images/duigou_no.png"){
  77. $("#duigou").attr("src","images/duigou_yes.png");
  78. }else if($("#duigou").attr("src")=="images/duigou_yes.png"){
  79. $("#duigou").attr("src","images/duigou_no.png");
  80. }
  81. })
  82. //支付
  83. $("#wechat_pay").click(function(){
  84. if($("#duigou").attr("src")=="images/duigou_no.png"){
  85. alert("请选择支付方式!");
  86. }else if($('#minute_show').html() == '00分' && $('#second_show').html() == '00秒'){
  87. $('#info').addClass('ui_hide');
  88. $('#outtime').removeClass('ui_hide');
  89. }else{
  90. if(login_data.main_corp_id==4) {
  91. var pay_url = "http://qdh.zhizhuchuxing.cn/";
  92. } else {
  93. var pay_url = "http://wx.zhizhuchuxing.com/";
  94. }
  95. if(login_data.login_type==1){
  96. window.location.href= pay_url + "wechat/WxPay/realpay/onlinePay.php?orderid="+submite_success.order_id+"&ifdisney="+submite_success.ifdisney+"&fx=11&code2=11";
  97. }else{
  98. window.location.href= pay_url + "wechat/WxPay/realpay/onlinePay.php?orderid="+submite_success.order_id+"&ifdisney="+submite_success.ifdisney+"&fx=11";
  99. }
  100. }
  101. })
  102. //倒计时
  103. function timer(intDiff){
  104. window.setInterval(function(){
  105. var day=0,
  106. hour=0,
  107. minute=0,
  108. second=0;//时间默认值
  109. if(intDiff > 0){
  110. day = Math.floor(intDiff / (60 * 60 * 24));
  111. hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
  112. minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60);
  113. second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
  114. }
  115. if (minute <= 9) minute = '0' + minute;
  116. if (second <= 9) second = '0' + second;
  117. $('#minute_show').html(minute+'分');
  118. $('#second_show').html(second+'秒');
  119. intDiff--;
  120. }, 1000);
  121. }
  122. //超时重新预订
  123. function payAgain(){
  124. window.location.href = './resever_bus.html';
  125. }