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.
 
 
 
 
 

125 lines
4.6 KiB

  1. $(document).ready(function(){
  2. initdata();
  3. })
  4. function initdata(){
  5. $.ajax({
  6. url:base_api+"./zz_wxsct/Model/travel/list.php",//请求地址
  7. type: "post", //请求方式
  8. data:{},
  9. dataType: "json",
  10. success: function (data) {
  11. console.log(data);
  12. if(data.code == 0){
  13. if(data.list.length==0){
  14. $("#go_reserve").show();
  15. }else{
  16. setStorJson("data2",data.list[1]);
  17. createHtml(data.list);
  18. }
  19. }else{
  20. }
  21. },
  22. fail: function (data) {
  23. }
  24. });
  25. }
  26. function createHtml(data){
  27. var temp = ""
  28. for(var i=0;i<data.length;i++){
  29. var index = "";
  30. if(data[i].year=="即将出行"){
  31. index = '<div style="margin-right: 0.1rem;margin-top: 0.1rem;text-align: right;" class="ui_p_t05 trip_tx_f11">'
  32. + '<span style="margin-right: 0.05rem;font-size: 0.11rem;">即将出行</span><img class="trip_img_small_wh" src="images/a4/img_a4_o.png"/>'
  33. + '</div>'
  34. }else{
  35. var result_year=data[i].year.split("-");
  36. index = '<div style="margin-left: 0.1rem;text-align: right;margin-right: 0.1rem;" class="trip_tx_f11 ub ub-ac">'
  37. + '<div class="ub-f1 ui_m_r05">'
  38. + '<div style="color: #999;margin-right: 0.01rem;">'+result_year[1]+'月</div>'
  39. + '<div style="color: #333;font-size: 0.16rem;">'+result_year[2]+'日</div>'
  40. + '<div style="color: #999;margin-right: 0.02rem;">'+result_year[0]+'</div>'
  41. + '</div>'
  42. + '<img class="trip_img_small_wh" src="images/a4/img_a4_o.png"/>'
  43. + '</div>'
  44. }
  45. temp += '<div style="border-radius: 0.03rem;" class="cell ub">'
  46. + '<div style="display: inline-block;width: 0.8rem;">'
  47. +index
  48. + '</div>'
  49. + '<div style="margin-right: 0.1rem;" class="ub cell_right_border ub-ver ub-f3 white_bccolor ui_m_t15 w1">'
  50. + '<div class="ub ub-ae ui_line_b line_color_b ui_p_b05 ui_p_t10">'
  51. + '<div class="ub ub-ver ub-f1 tx-l ui_p_l20">'
  52. + '<div class="ulev2 lightblack_color">'+data[i].order_start_time+'</div>'
  53. + '<div class="trip_tx_f11 fontmiddle_color"><span>'+data[i].order_start_date+' </span><span>'+data[i].week+'</span></div>'
  54. + '</div>'
  55. + '<div style="font-size:0.11rem;" class="ub-f1 tx-r ui_p_r20 commongray_color">全程用时:'+data[i].order_used_time+'</div>'
  56. + '</div>'
  57. + '<div style="padding-left:0.2rem" class="ub ub-ac ui_line_b_d">'
  58. + '<div style="width: 0px;height: 0.1rem;border-left: 1px da #ccc;"></div>'
  59. + '<div class="ub-ver ub-f1">'
  60. + '<div class="ulev1 ui_p_t15">'
  61. +data[i].order_start_area_name+' — '+data[i].order_start_res_name
  62. + '</div>'
  63. + '<div class="ulev1 ui_p_t05 ui_p_b15">'
  64. +data[i].order_end_area_name+' — '+data[i].order_end_res_name
  65. + '</div>'
  66. + '</div>'
  67. + '</div>'
  68. + '<div class="ub ub-ver trip_tx_f13 ui_p_l20 ui_p_t10">'
  69. + '<div style="font-size:0.13rem;" class="commongray_color">'+data[i].seat_type+' x '+data[i].seat_num+'</div>'
  70. + '<div style="font-size:0.13rem;" class="commongray_color">车牌号:'+data[i].order_bus_no+'</div>'
  71. + '<div style="font-size:0.13rem;" class="commongray_color ui_p_b10">司<span style="color:#fff;">白</span>机:'+data[i].order_driver_name+'</div>'
  72. + '</div>'
  73. + '<div class="ub">'
  74. + '<div ifgps="'+data[i].ifgps+'" bus_phone="'+data[i].driver_mobile+'" bus_name="'+data[i].order_driver_name+'" bus_num="'+data[i].order_bus_no+'" style="border-right:1px solid #f0f2f6;" class="ub-f1 ulev1 bg_color tx-c trip_qrcode_p white_bccolor ui_p_a10 two_btn_border ditu">'
  75. + '我要找车'
  76. + '</div>'
  77. + '<div trip_detail_num="'+i+'" class="ub-f1 bg_color tx-c trip_qrcode_p white_bccolor ui_p_a10 two_btn_border check_code ulev1">'
  78. + '电子检票'
  79. + '</div>'
  80. + '</div>'
  81. + '</div>'
  82. + '</div>'
  83. }
  84. $("#trip_list").html(temp);
  85. $(".check_code").click(function(){
  86. var trip_detail_num = $(this).attr("trip_detail_num")
  87. setStorJson("trip_detail",data[trip_detail_num]);
  88. window.location.href="e_ticket.html";
  89. })
  90. $(".ditu").click(function() {
  91. var ifgps = $(this).attr("ifgps");
  92. if(ifgps=="2"){
  93. alert("您乘坐的车次暂未指派具体车辆,请在出发前一天18点之后查看车辆位置");
  94. }else if(ifgps=="3"){
  95. alert("本车次暂不支持车辆定位找车");
  96. }else{
  97. var bus_num = $(this).attr("bus_num");
  98. setStorage("bus_num",bus_num);
  99. setStorage("bus_name",$(this).attr("bus_name"));
  100. setStorage("bus_phone",$(this).attr("bus_phone"));
  101. window.location.href="bus_line.html";
  102. }
  103. });
  104. }
  105. $("#yuding").click(function(){
  106. window.location.href="travel_book.html";
  107. })