|
-
-
- $(document).ready(function(){
-
- initdata();
- })
-
- function initdata(){
- $.ajax({
- url:base_api+"./zz_wxsct/Model/travel/list.php",//请求地址
- type: "post", //请求方式
- data:{},
- dataType: "json",
- success: function (data) {
- console.log(data);
- if(data.code == 0){
- if(data.list.length==0){
- $("#go_reserve").show();
- }else{
- setStorJson("data2",data.list[1]);
- createHtml(data.list);
- }
-
- }else{
-
- }
- },
- fail: function (data) {
- }
- });
- }
-
- function createHtml(data){
- var temp = ""
- for(var i=0;i<data.length;i++){
- var index = "";
-
- if(data[i].year=="即将出行"){
- index = '<div style="margin-right: 0.1rem;margin-top: 0.1rem;text-align: right;" class="ui_p_t05 trip_tx_f11">'
- + '<span style="margin-right: 0.05rem;font-size: 0.11rem;">即将出行</span><img class="trip_img_small_wh" src="images/a4/img_a4_o.png"/>'
- + '</div>'
- }else{
- var result_year=data[i].year.split("-");
- index = '<div style="margin-left: 0.1rem;text-align: right;margin-right: 0.1rem;" class="trip_tx_f11 ub ub-ac">'
- + '<div class="ub-f1 ui_m_r05">'
- + '<div style="color: #999;margin-right: 0.01rem;">'+result_year[1]+'月</div>'
- + '<div style="color: #333;font-size: 0.16rem;">'+result_year[2]+'日</div>'
- + '<div style="color: #999;margin-right: 0.02rem;">'+result_year[0]+'</div>'
- + '</div>'
- + '<img class="trip_img_small_wh" src="images/a4/img_a4_o.png"/>'
- + '</div>'
- }
- temp += '<div style="border-radius: 0.03rem;" class="cell ub">'
- + '<div style="display: inline-block;width: 0.8rem;">'
- +index
- + '</div>'
- + '<div style="margin-right: 0.1rem;" class="ub cell_right_border ub-ver ub-f3 white_bccolor ui_m_t15 w1">'
- + '<div class="ub ub-ae ui_line_b line_color_b ui_p_b05 ui_p_t10">'
- + '<div class="ub ub-ver ub-f1 tx-l ui_p_l20">'
- + '<div class="ulev2 lightblack_color">'+data[i].order_start_time+'</div>'
- + '<div class="trip_tx_f11 fontmiddle_color"><span>'+data[i].order_start_date+' </span><span>'+data[i].week+'</span></div>'
- + '</div>'
- + '<div style="font-size:0.11rem;" class="ub-f1 tx-r ui_p_r20 commongray_color">全程用时:'+data[i].order_used_time+'</div>'
- + '</div>'
- + '<div style="padding-left:0.2rem" class="ub ub-ac ui_line_b_d">'
- + '<div style="width: 0px;height: 0.1rem;border-left: 1px da #ccc;"></div>'
- + '<div class="ub-ver ub-f1">'
- + '<div class="ulev1 ui_p_t15">'
- +data[i].order_start_area_name+' — '+data[i].order_start_res_name
- + '</div>'
- + '<div class="ulev1 ui_p_t05 ui_p_b15">'
- +data[i].order_end_area_name+' — '+data[i].order_end_res_name
- + '</div>'
- + '</div>'
- + '</div>'
- + '<div class="ub ub-ver trip_tx_f13 ui_p_l20 ui_p_t10">'
- + '<div style="font-size:0.13rem;" class="commongray_color">'+data[i].seat_type+' x '+data[i].seat_num+'</div>'
- + '<div style="font-size:0.13rem;" class="commongray_color">车牌号:'+data[i].order_bus_no+'</div>'
- + '<div style="font-size:0.13rem;" class="commongray_color ui_p_b10">司<span style="color:#fff;">白</span>机:'+data[i].order_driver_name+'</div>'
- + '</div>'
- + '<div class="ub">'
- + '<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">'
- + '我要找车'
- + '</div>'
- + '<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">'
- + '电子检票'
- + '</div>'
- + '</div>'
- + '</div>'
- + '</div>'
- }
- $("#trip_list").html(temp);
-
- $(".check_code").click(function(){
- var trip_detail_num = $(this).attr("trip_detail_num")
- setStorJson("trip_detail",data[trip_detail_num]);
- window.location.href="e_ticket.html";
- })
- $(".ditu").click(function() {
- var ifgps = $(this).attr("ifgps");
- if(ifgps=="2"){
- alert("您乘坐的车次暂未指派具体车辆,请在出发前一天18点之后查看车辆位置");
-
- }else if(ifgps=="3"){
- alert("本车次暂不支持车辆定位找车");
-
- }else{
- var bus_num = $(this).attr("bus_num");
- setStorage("bus_num",bus_num);
- setStorage("bus_name",$(this).attr("bus_name"));
- setStorage("bus_phone",$(this).attr("bus_phone"));
- window.location.href="bus_line.html";
-
- }
-
-
- });
-
- }
-
- $("#yuding").click(function(){
- window.location.href="travel_book.html";
- })
|