|
- var trip_type = 146;
- var current_page = 1;
- var page_size = 1000;
-
- $(document).ready(function(){
- $("#loading_html").show();
- initdata();
-
- })
-
- function initdata(){
- $.ajax({
- url:base_api+"mytrip/index",//请求地址
- type: "post", //请求方式
- data:{
- current_page:current_page,
- type:trip_type,
- page_size:page_size
- },
- dataType: "json",
- success: function (data) {
- console.log(data);
- if(data.flag){
-
- current_page = data.data.page.current_page;
-
- if(data.data.list.length==0){
- if(trip_type == "146"){
- $("#go_reserve").show();
- }else{
- $("#go_reserve_end").show();
- }
- }else{
- load_createHtml(data.data.list);
- }
-
- }else{
- alert(data.msg)
- }
- },
- fail: function (data) {
- }
- });
- }
-
- function page_tech(){
- current_page = parseInt(current_page)+1;
- $.ajax({
- url:base_api+"mytrip/index",//请求地址
- type: "post", //请求方式
- data:{
- current_page:current_page,
- type:trip_type,
- page_size:page_size
- },
- dataType: "json",
- success: function (data) {
- console.log(data);
- if(data.flag){
-
- page_createHtml(data.data.list);
-
- }else{
-
- }
- },
- fail: function (data) {
- }
- });
- }
-
- function load_createHtml(data){
- var temp = ""
- for(var i=0;i<data.length;i++){
- //82普通车票
- if(data[i].type=="369"){
- var trip_time=data[i].run_date.split("-");
- temp += '<div style="min-height: 1.8rem;" class="cell ub">'
- + '<div class="ub ub-ver ub-f1 w1">'
- + '<div style="margin-left: 0.05rem;text-align: right;width: 0.59rem;" class="trip_tx_f11 ub ub-ac">'
- + '<div style="margin-right:0.07rem;" class="ub-f1">'
- + '<div style="color: #438c8c;font-size: 0.14rem;">'+data[i].run_time+'</div>'
- + '<div style="color: #2f323e;" class="ulev2">'+trip_time[2]+'日</div>'
- + '<div style="color: #868787;">'+trip_time[1]+'月</div>'
- + '</div>'
- + '<img class="trip_img_small_wh" src="images/a4/img_a4_o.png"/>'
- + '</div>'
- + '</div>'
- + '<div style="margin-right: 0.1rem;margin-bottom: 0.3rem;border-radius: 0.05rem;" class="ub ub-ver ub-f4 w1">'
- + '<div style="border-bottom: 1px dashed #f0f2f6;" class="ub white_bccolor yuanjiao_t ui_p_t10 ui_p_b10 ui_p_l15 ui_p_r15">'
- + '<img style="width: 0.15rem;margin-right: 0.05rem;" src="images/img_travel.png"/>'
- + '<div class="ub-f1 fontmiddle_color">周边游</div>'
- + '</div>'
- + '<div class="ub ub-ver yuanjiao_b white_bccolor ui_m_b05 outer_line_down_color">'
- + '<li class="ub disney_bus ui_p_a15">'
- + '<div class="ub ub-f1 ub-ver">'
- + '<div class="lightblack_color ulev2">'+data[i].line_name+'</div>'
- + '<div style="margin-top: 0.05rem;font-size: 0.13rem;" class="fontmiddle_color">'+data[i].line_add+'</div>'
- + '</div>'
- + '</li>'
- + '</div>'
- + '</div>'
- + '</div>'
-
- }else{
- var trip_time=data[i].run_date.split("-");
- var new_time = data[i].minutes;
- var click_btn = "";
- if(trip_type == "146"){
- click_btn = '<div class="ub">'
- + '<div order_id="'+data[i].order_id+'" style="border-radius: 0.05rem;margin-right: 0.03rem;" class="ub ub-f1 bg_color tx-c trip_qrcode_p white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac check_code outer_line_down_color">'
- + '<img class="trip_img_location_wh" src="images/ic_erweima.png"/>'
- + '<div id="">电子车票</div>'
- + '</div>'
- + '<div order_id="'+data[i].order_id+'" run_date="'+data[i].run_date+'" style="border-radius: 0.05rem;margin-left: 0.03rem;" class="ub ub-f1 bg_color tx-c white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac ditu outer_line_down_color">'
- + '<img class="trip_img_wh" src="images/ic_zhaoche.png"/>'
- + '<div id="">我要找车</div>'
- + '</div>'
- + '</div>'
- }else if(trip_type == "147"){
- click_btn = '<div class="ub">'
- + '<div order_id="'+data[i].order_id+'" style="border-radius: 0.05rem;margin-right: 0.03rem;" class="ub ub-f1 bg_color tx-c trip_qrcode_p white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac check_code outer_line_down_color">'
- + '<img class="trip_img_location_wh" src="images/ic_erweima_dis.png"/>'
- + '<div style="color:#cccccc;">电子车票</div>'
- + '</div>'
- + '<div order_id="'+data[i].order_id+'" run_date="'+data[i].run_date+'" style="border-radius: 0.05rem;margin-left: 0.03rem;" class="ub ub-f1 bg_color tx-c white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac ditu outer_line_down_color">'
- + '<img class="trip_img_wh" src="images/img_zhaoche_dis.png"/>'
- + '<div style="color:#cccccc;">我要找车</div>'
- + '</div>'
- + '</div>'
- }
- temp += '<div style="min-height: 1.8rem;" class="cell ub">'
- + '<div class="ub ub-ver ub-f1 w1">'
- + '<div style="margin-left: 0.05rem;text-align: right;width: 0.59rem;" class="trip_tx_f11 ub ub-ac">'
- + '<div style="margin-right:0.07rem;" class="ub-f1">'
- + '<div style="color: #438c8c;font-size: 0.14rem;">'+data[i].run_time+'</div>'
- + '<div style="color: #2f323e;" class="ulev2">'+trip_time[2]+'日</div>'
- + '<div style="color: #868787;">'+trip_time[1]+'月</div>'
- + '</div>'
- + '<img class="trip_img_small_wh" src="images/a4/img_a4_o.png"/> '
- + '</div>'
- + '</div>'
- + '<div style="margin-right: 0.1rem;margin-bottom: 0.3rem;border-radius: 0.05rem;" class="ub ub-ver ub-f4 w1">'
-
- + '<div style="border-bottom: 1px dashed #f0f2f6;" class="ub white_bccolor yuanjiao_t">'
- + '<div style="padding-bottom:0.09rem;" class="ub-f1 ui_p_t10 ui_p_l15 ui_p_r15 fontmiddle_color">全程用时:'+new_time+'</div>'
- + '</div>'
- + '<div class="ub ub-ver yuanjiao_b white_bccolor ui_m_b05 outer_line_down_color">'
- + '<li class="ub disney_bus ui_p_a15">'
- + '<img style="height: 0.42rem;margin-top: 0.07rem;" class="ui_p_r05 ui_p_l05" src="images/img_points@2x.png"/>'
- + '<div class="ub ub-f1 ub-ver">'
- + '<div class="lightblack_color ulev1"><span style="color:#1b1a20;" class="ulev2 ui_m_r05">'+data[i].start_area_name+'</span><span style="font-size: 0.13rem;">'+data[i].start_res_name+'</span></div>'
- + '<div style="margin-top: 0.13rem;" class="lightblack_color ulev1"><span style="color:#1b1a20;" class="ulev2 ui_m_r05">'+data[i].end_area_name+'</span><span style="font-size: 0.13rem;">'+data[i].end_res_name+'</span></div>'
- + '</div>'
- + '</li>'
- + '</div>'
- + click_btn
- + '</div>'
- + '</div>'
- }
-
- }
- $("#trip_list").html(temp);
-
- $(".check_code").click(function(){
- var order_id = $(this).attr("order_id");
- window.location.href="e_ticket.html?order_id="+order_id;
- })
-
- $(".ditu").click(function() {
-
- var order_id = $(this).attr("order_id");
- var run_date = $(this).attr("run_date");
- $.ajax({
- url:base_api+"weUser/journey/findCar",//请求地址
- type: "post", //请求方式
- data:{order_id:order_id,run_date:run_date},
- dataType: "json",
- success: function (data) {
- console.log(data);
- if(data.flag == true){
-
- window.location.href="search_bus.html?order_id="+order_id+"&run_date="+run_date;
-
- }else{
- alert(data.msg);
- }
- },
- fail: function (data) {
-
- }
- });
-
- });
- if(trip_type == "147"){
- $(".check_code").off("click");
- $(".ditu").off("click");
- }
-
- }
-
-
- function page_createHtml(data){
- var temp = ""
- for(var i=0;i<data.length;i++){
- //82普通车票
- if(data[i].type=="369"){
- var trip_time=data[i].run_date.split("-");
- temp += '<div style="min-height: 1.8rem;" class="cell ub">'
- + '<div class="ub ub-ver ub-f1 w1">'
- + '<div style="margin-left: 0.05rem;text-align: right;width: 0.59rem;" class="trip_tx_f11 ub ub-ac">'
- + '<div style="margin-right:0.07rem;" class="ub-f1">'
- + '<div style="color: #438c8c;font-size: 0.14rem;">'+data[i].run_time+'</div>'
- + '<div style="color: #2f323e;" class="ulev2">'+trip_time[2]+'日</div>'
- + '<div style="color: #868787;">'+trip_time[1]+'月</div>'
- + '</div>'
- + '<img class="trip_img_small_wh" src="images/a4/img_a4_o.png"/>'
- + '</div>'
- + '</div>'
- + '<div style="margin-right: 0.1rem;margin-bottom: 0.3rem;border-radius: 0.05rem;" class="ub ub-ver ub-f4 w1">'
- + '<div style="border-bottom: 1px dashed #f0f2f6;" class="ub white_bccolor yuanjiao_t ui_p_t10 ui_p_b10 ui_p_l15 ui_p_r15">'
- + '<img style="width: 0.15rem;margin-right: 0.05rem;" src="images/img_travel.png"/>'
- + '<div class="ub-f1 fontmiddle_color">周边游</div>'
- + '</div>'
- + '<div class="ub ub-ver yuanjiao_b white_bccolor ui_m_b05 outer_line_down_color">'
- + '<li class="ub disney_bus ui_p_a15">'
- + '<div class="ub ub-f1 ub-ver">'
- + '<div class="lightblack_color ulev2">'+data[i].line_name+'</div>'
- + '<div style="margin-top: 0.05rem;font-size: 0.13rem;" class="fontmiddle_color">'+data[i].line_add+'</div>'
- + '</div>'
- + '</li>'
- + '</div>'
- + '</div>'
- + '</div>'
-
- }else{
- var trip_time=data[i].run_date.split("-");
- var new_time = data[i].minutes;
- var click_btn = "";
- if(trip_type == "146"){
- click_btn = '<div class="ub">'
- + '<div order_id="'+data[i].order_id+'" style="border-radius: 0.05rem;margin-right: 0.03rem;" class="ub ub-f1 bg_color tx-c trip_qrcode_p white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac check_code outer_line_down_color">'
- + '<img class="trip_img_location_wh" src="images/ic_erweima.png"/>'
- + '<div id="">电子车票</div>'
- + '</div>'
- + '<div order_id="'+data[i].order_id+'" run_date="'+data[i].run_date+'" style="border-radius: 0.05rem;margin-left: 0.03rem;" class="ub ub-f1 bg_color tx-c white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac ditu outer_line_down_color">'
- + '<img class="trip_img_wh" src="images/ic_zhaoche.png"/>'
- + '<div id="">我要找车</div>'
- + '</div>'
- + '</div>'
- }else if(trip_type == "147"){
- click_btn = '<div class="ub">'
- + '<div order_id="'+data[i].order_id+'" style="border-radius: 0.05rem;margin-right: 0.03rem;" class="ub ub-f1 bg_color tx-c trip_qrcode_p white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac check_code outer_line_down_color">'
- + '<img class="trip_img_location_wh" src="images/ic_erweima_dis.png"/>'
- + '<div style="color:#cccccc;">电子车票</div>'
- + '</div>'
- + '<div order_id="'+data[i].order_id+'" run_date="'+data[i].run_date+'" style="border-radius: 0.05rem;margin-left: 0.03rem;" class="ub ub-f1 bg_color tx-c white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac ditu outer_line_down_color">'
- + '<img class="trip_img_wh" src="images/img_zhaoche_dis.png"/>'
- + '<div style="color:#cccccc;">我要找车</div>'
- + '</div>'
- + '</div>'
- }
- temp += '<div style="min-height: 1.8rem;" class="cell ub">'
- + '<div class="ub ub-ver ub-f1 w1">'
- + '<div style="margin-left: 0.05rem;text-align: right;width: 0.59rem;" class="trip_tx_f11 ub ub-ac">'
- + '<div style="margin-right:0.07rem;" class="ub-f1">'
- + '<div style="color: #438c8c;font-size: 0.14rem;">'+data[i].run_time+'</div>'
- + '<div style="color: #2f323e;" class="ulev2">'+trip_time[2]+'日</div>'
- + '<div style="color: #868787;">'+trip_time[1]+'月</div>'
- + '</div>'
- + '<img class="trip_img_small_wh" src="images/a4/img_a4_o.png"/> '
- + '</div>'
- + '</div>'
- + '<div style="margin-right: 0.1rem;margin-bottom: 0.3rem;border-radius: 0.05rem;" class="ub ub-ver ub-f4 w1">'
-
- + '<div style="border-bottom: 1px dashed #f0f2f6;" class="ub white_bccolor yuanjiao_t">'
- + '<div style="padding-bottom:0.09rem;" class="ub-f1 ui_p_t10 ui_p_l15 ui_p_r15 fontmiddle_color">全程用时:'+new_time+'</div>'
- + '</div>'
- + '<div class="ub ub-ver yuanjiao_b white_bccolor ui_m_b05 outer_line_down_color">'
- + '<li class="ub disney_bus ui_p_a15">'
- + '<img style="height: 0.42rem;margin-top: 0.07rem;" class="ui_p_r05 ui_p_l05" src="images/img_points@2x.png"/>'
- + '<div class="ub ub-f1 ub-ver">'
- + '<div class="lightblack_color ulev1"><span style="color:#1b1a20;" class="ulev2 ui_m_r05">'+data[i].start_area_name+'</span><span style="font-size: 0.13rem;">'+data[i].start_res_name+'</span></div>'
- + '<div style="margin-top: 0.13rem;" class="lightblack_color ulev1"><span style="color:#1b1a20;" class="ulev2 ui_m_r05">'+data[i].end_area_name+'</span><span style="font-size: 0.13rem;">'+data[i].end_res_name+'</span></div>'
- + '</div>'
- + '</li>'
- + '</div>'
- + click_btn
- + '</div>'
- + '</div>'
- }
-
- }
- $("#trip_list").append(temp);
-
- $(".check_code").click(function(){
- var order_id = $(this).attr("order_id");
- window.location.href="e_ticket.html?order_id="+order_id;
- })
- $(".ditu").click(function() {
-
- var order_id = $(this).attr("order_id");
- var run_date = $(this).attr("run_date");
- $.ajax({
- url:base_api+"weUser/journey/findCar",//请求地址
- type: "post", //请求方式
- data:{order_id:order_id,run_date:run_date},
- dataType: "json",
- success: function (data) {
- console.log(data);
- if(data.flag == true){
-
- window.location.href="search_bus.html?order_id="+order_id+"&run_date="+run_date;
-
- }else{
- alert(data.msg);
- }
- },
- fail: function (data) {
-
- }
- });
-
- });
- if(trip_type == "147"){
- $(".check_code").off("click");
- $(".ditu").off("click");
- }
-
- }
-
-
-
-
- $("#yuding").click(function(){
- window.location.href="travel_book.html";
- });
- $("#go_bind").click(function(){
- window.location.href="bind_order.html";
- });
-
- function cut_head(obj1,obj2){
- trip_type = obj2;
- current_page = 1;
- $(".top_noselected").removeClass("top_selected");
- $(obj1).children().addClass("top_selected");
- $("#trip_list").html("");
- $("#go_reserve").hide();
- $("#go_reserve_end").hide();
- initdata();
- }
|