No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

98 líneas
2.4 KiB

  1. var order_id = getStorage('order_id');
  2. var goHTML = '';
  3. var backHTML = '';
  4. window.onload = function(){
  5. goHTML = $('#go').html();
  6. backHTML = $('#back').html();
  7. $.ajax({
  8. url:'./zz-fx/control.php', //请求地址
  9. type: "post", //请求方式
  10. data:{
  11. type:"distribut_DropOrder",
  12. order_id:order_id,
  13. iffirst:1
  14. },
  15. async:false,
  16. dataType: "json",
  17. success: function (data) {
  18. if(data.code == 0){
  19. console.log(data);
  20. //展示退单信息
  21. showRefundOrder(data);
  22. }else{
  23. alert(data.info)
  24. }
  25. },
  26. fail: function (date) {
  27. }
  28. });
  29. }
  30. function showRefundOrder(data){
  31. var list = data.list;
  32. if (data.ifback == 0) {
  33. $('#go').removeClass('ui_hide');
  34. $('#back').addClass('ui_hide');
  35. $('#attention').addClass('ui_hide');
  36. var go_list = list.to;
  37. var temp = goHTML;
  38. temp = temp.replace('上海(黄浦旅游集散站) - 乌镇(西栅1号停车场)',list.station);
  39. temp = temp.replace('2016-07-26 07:40',list.run_time);
  40. temp = temp.replace('普通座 × 2',list.count);
  41. var aaa = $('#total').html();
  42. aaa = aaa.replace('110',list.order_price);
  43. $('#total').html(aaa);
  44. $('#go').html(temp);
  45. } else{
  46. $('#back').removeClass('ui_hide');
  47. $('#go').addClass('ui_hide');
  48. $('#attention').removeClass('ui_hide');
  49. var go_list = list.to;
  50. var back_list = list.back;
  51. var temp = backHTML;
  52. temp = temp.replace('上海(黄浦旅游集散站) - 乌镇(西栅1号停车场)',go_list.station);
  53. temp = temp.replace('2016-07-26 07:40',go_list.run_time);
  54. temp = temp.replace('普通座 × 2',go_list.count);
  55. temp = temp.replace('[乌镇(东栅停车场) - 上海(黄浦旅游集散站)]',back_list.station);
  56. temp = temp.replace('[2016-07-26 15:40]',back_list.run_time);
  57. temp = temp.replace('[普通座 × 2]',back_list.count);
  58. var aaa = $('#total').html();
  59. aaa = aaa.replace('110',go_list.order_price*2);
  60. $('#total').html(aaa);
  61. $('#back').html(temp);
  62. }
  63. }
  64. //退票
  65. function confirmBtnDidClicked(){
  66. $.ajax({
  67. url:'./zz-fx/control.php', //请求地址
  68. type: "post", //请求方式
  69. data:{
  70. type:"distribut_DropOrder",
  71. order_id:order_id,
  72. iffirst:2
  73. },
  74. async:false,
  75. dataType: "json",
  76. success: function (data) {
  77. if(data.code == 0){
  78. window.location.href = './order_detail.html';
  79. }else{
  80. alert(data.info)
  81. }
  82. },
  83. fail: function (date) {
  84. }
  85. });
  86. }