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.
 
 
 
 

110 lines
2.8 KiB

  1. var data = getStorJson("searchData");
  2. var dateStr = getStorage("sendDate");
  3. var aaa = data.bus_type;
  4. var bbb = 1000;
  5. //html()
  6. var HTML = '';
  7. var newHTML='';
  8. var curpage = 1;
  9. window.onload = function(){
  10. HTML = $('#list_info').html();
  11. reloadData();
  12. // $(window).scroll(function() {
  13. // //$(document).scrollTop() 获取垂直滚动的距离
  14. // //$(document).scrollLeft() 这是获取水平滚动条的距离
  15. //// if ($(document).scrollTop() <= 0) {
  16. //// alert("滚动条已经到达顶部为0");
  17. //// }
  18. // if ($(document).scrollTop() >= $(document).height() - $(window).height()) {
  19. // curpage += 1;
  20. // reloadData();
  21. // }
  22. // });
  23. }
  24. //加载数据
  25. function reloadData(){
  26. $.ajax({
  27. url:'./zz-fx/control.php', //请求地址
  28. type: "post", //请求方式
  29. // data: data, //请求参数
  30. data:{
  31. start_area : data.start_area,
  32. end_area : data.end_area,
  33. go_time : data.go_time,
  34. bus_type : data.bus_type,
  35. type:"retrieval_through",
  36. run_type:data.run_type,
  37. currpage:curpage,
  38. pagesize:data.pagesize
  39. },
  40. async:false,
  41. dataType: "json",
  42. success: function (data) {
  43. console.log(data);
  44. if(data.code == 0){
  45. var sum = data.totalnum;
  46. if (sum == 0) {
  47. $('#noinfo').removeClass('ui_hide');
  48. }
  49. reloadInfo(data);
  50. }
  51. },
  52. fail: function (date) {
  53. }
  54. });
  55. }
  56. //填充数据
  57. function reloadInfo(data){
  58. var select_date = $('#select_date').html();
  59. var temp1 = select_date;
  60. temp1 = temp1.replace('[日期]',dateStr);
  61. $('#select_date').html(temp1);
  62. var list = data.list;
  63. for(var i=0;i<list.length;i++){
  64. var tempHTML=HTML;
  65. tempHTML=tempHTML.replace('[出发地]',list[i].start_area_name);
  66. if( list[i].trip_type == 2 ) {
  67. tempHTML = tempHTML.replace('[目的地]', list[i].site_type);
  68. } else {
  69. tempHTML = tempHTML.replace('[目的地]', list[i].end_area_name);
  70. }
  71. tempHTML=tempHTML.replace('[时间]',list[i].start_time);
  72. tempHTML=tempHTML.replace('[价格]',list[i].price);
  73. console.log(list[i].line_id);
  74. tempHTML=tempHTML.replace('[order_id]',list[i].run_id);
  75. tempHTML=tempHTML.replace('[order_idli]',list[i].run_id);
  76. tempHTML=tempHTML.replace('[start_id]',list[i].start_area_id);
  77. tempHTML=tempHTML.replace('[end_id]',list[i].end_area_id);
  78. newHTML+=tempHTML;
  79. }
  80. $('#list_info').html(newHTML);
  81. }
  82. //每个详情的点击事件
  83. function goPayInfo(id,start_id,end_id){
  84. // alert(id);
  85. // var startid = $('#li'+id).attr('startid');
  86. // alert(startid);
  87. // var endid = $('#li'+id).attr('endid');
  88. // alert(endid);
  89. var run_id = id;
  90. var data = {
  91. run_id : run_id,
  92. start_area_id : start_id,
  93. end_area_id : end_id,
  94. bus_type : aaa,
  95. pagesize:bbb
  96. }
  97. setStorJson('payOrderInfo',data);
  98. window.location.href = './submit_order.html';
  99. }