//普通车
var commonHTML = '';
//周边游
var traveHTML = '';
//已完成
var didHTML = '';
var inghave = '';
var didhasno = '';
$("#loading_html").show();
window.onload = function(){
//样式分两大块、普通车、周边游
commonHTML = $('.common_bus').prop('outerHTML');
traveHTML = $('.around_trave').prop('outerHTML');
//didHTML = $('#did').html();
$.ajax({
url:base_api + "order/orderlist", //请求地址
data:{},
type: "post", //请求方式
async:false,
dataType: "json",
success: function (data) {
console.log(data);
if(data.flag == true){
didhasno = data.data.doing.length;
inghave = data.data.done.length;
reloadData(data);
selectStatus(0);
}else{
alert(data.msg);
}
}
});
}
//订单状态的切换和筛选
function selectStatus(selectStatus){
if (selectStatus == 0) {
$('#hasnoinfo').addClass('ui_hide');
$('#going').addClass('title_line');
$('#going').removeClass('commongray_color');
$('#completed').addClass('commongray_color');
$('#completed').removeClass('title_line');
$('#ing').removeClass('ui_hide');
$('#did').addClass('ui_hide');
if (didhasno == 0) {
$('#hasnoinfo').removeClass('ui_hide');
}else{
$('#hasnoinfo').addClass('ui_hide');
}
} else{
$('#hasnoinfo').addClass('ui_hide');
$('#completed').addClass('title_line');
$('#completed').removeClass('commongray_color');
$('#going').addClass('commongray_color');
$('#going').removeClass('title_line');
$('#did').removeClass('ui_hide');
$('#ing').addClass('ui_hide');
if (inghave == 0) {
$('#hasnoinfo').removeClass('ui_hide');
}else{
$('#hasnoinfo').addClass('ui_hide');
}
}
}
//加载数据
function reloadData(data){
var inglist = data.data.doing;
var didlist = data.data.done;
var newHTML = '';
var newHTML1 = '';
for(var i=0;i