|
- var data = getStorJson("searchData");
- var dateStr = getStorage("sendDate");
- var aaa = data.bus_type;
- var bbb = 1000;
- //html()
- var HTML = '';
-
- var newHTML='';
-
- var curpage = 1;
-
- window.onload = function(){
- HTML = $('#list_info').html();
- reloadData();
-
- // $(window).scroll(function() {
- // //$(document).scrollTop() 获取垂直滚动的距离
- // //$(document).scrollLeft() 这是获取水平滚动条的距离
- //// if ($(document).scrollTop() <= 0) {
- //// alert("滚动条已经到达顶部为0");
- //// }
- // if ($(document).scrollTop() >= $(document).height() - $(window).height()) {
- // curpage += 1;
- // reloadData();
- // }
- // });
-
- }
-
-
- //加载数据
- function reloadData(){
- $.ajax({
- url:'./zz-fx/control.php', //请求地址
- type: "post", //请求方式
- // data: data, //请求参数
- data:{
- start_area : data.start_area,
- end_area : data.end_area,
- go_time : data.go_time,
- bus_type : data.bus_type,
- type:"retrieval_through",
- run_type:data.run_type,
- currpage:curpage,
- pagesize:data.pagesize
- },
- async:false,
- dataType: "json",
- success: function (data) {
- console.log(data);
- if(data.code == 0){
- var sum = data.totalnum;
- if (sum == 0) {
- $('#noinfo').removeClass('ui_hide');
- }
- reloadInfo(data);
- }
- },
- fail: function (date) {
- }
- });
- }
-
- //填充数据
- function reloadInfo(data){
- var select_date = $('#select_date').html();
- var temp1 = select_date;
- temp1 = temp1.replace('[日期]',dateStr);
- $('#select_date').html(temp1);
- var list = data.list;
-
- for(var i=0;i<list.length;i++){
- var tempHTML=HTML;
- tempHTML=tempHTML.replace('[出发地]',list[i].start_area_name);
- if( list[i].trip_type == 2 ) {
- tempHTML = tempHTML.replace('[目的地]', list[i].site_type);
- } else {
- tempHTML = tempHTML.replace('[目的地]', list[i].end_area_name);
- }
- tempHTML=tempHTML.replace('[时间]',list[i].start_time);
- tempHTML=tempHTML.replace('[价格]',list[i].price);
- console.log(list[i].line_id);
- tempHTML=tempHTML.replace('[order_id]',list[i].run_id);
- tempHTML=tempHTML.replace('[order_idli]',list[i].run_id);
- tempHTML=tempHTML.replace('[start_id]',list[i].start_area_id);
- tempHTML=tempHTML.replace('[end_id]',list[i].end_area_id);
- newHTML+=tempHTML;
- }
- $('#list_info').html(newHTML);
- }
-
- //每个详情的点击事件
- function goPayInfo(id,start_id,end_id){
- // alert(id);
- // var startid = $('#li'+id).attr('startid');
- // alert(startid);
- // var endid = $('#li'+id).attr('endid');
- // alert(endid);
- var run_id = id;
- var data = {
- run_id : run_id,
- start_area_id : start_id,
- end_area_id : end_id,
- bus_type : aaa,
- pagesize:bbb
- }
- setStorJson('payOrderInfo',data);
- window.location.href = './submit_order.html';
- }
|