src="jquery-2.2.4.min.js"; language="JavaScript"; //结算信息 window.onload = function() { initHtml(); } //点击了关闭 function click_cancel(father_name, self_name) { if(father_name) { var father = $(father_name); center_show(father); } else { $('.mask').css('display', 'none'); } $(self_name).css('display', 'none'); } //请求订单-短信通知 function get_order_send_message(mes_url) { $.getJSON(mes_url, function(res_data) { if(res_data['code'] != "0") { $('#ht_tr_mes_one').html(''); alert(res_data['info']); } if(res_data['message'].length <= 0) { $('#ht_tr_mes_one').html(''); return; } $('.notifacation').html('短信通知:' + res_data['message'].length + '条'); // $('#span_info_noti').html('短信通知:'+res_data['message'].length+'条'); console.log("短信" + mes_url); console.log(res_data); var ht_tr_mes_one_str = $('#ht_tr_mes_one').prop('outerHTML'); var ht_send_message_list = $('#ht_send_message_list'); var order_send_message_arr = res_data['message']; if(order_send_message_arr == undefined) { return; } var mesHTML = ''; for(var i = 0; i < order_send_message_arr.length; i++) { var dict = order_send_message_arr[i]; var HTML = ht_tr_mes_one_str; HTML = HTML.replace('[内容]', dict['send_mobile'] + ":" + dict['message']); HTML = HTML.replace('[操作人]', dict['user_name']); HTML = HTML.replace('[发送时间]', dict['send_time']); mesHTML += HTML; } console.log(mesHTML); ht_send_message_list.html(mesHTML); }); } //点击了三个固定的 function click_show_div(objName, self_obj) { var obj = $(objName); if(obj.css('display') == 'none') { center_show(obj); } else { obj.css('display', 'none'); } } //点击了第二级 function click_two_show_div(father_name, self_name) { var father = $(father_name); var self = $(self_name); father.css('display', 'none'); center_show(self); } //居中显示 var tempDiv = null; function center_show(show_div) { tempDiv = show_div; //显示蒙板 show_div.css('display', 'block'); show_div.css('z-index', 10); show_div.css('background-color', 'white'); show_div.css('position', 'fixed'); var w = show_div.css('width'); var h = show_div.css('height'); w = w.substr(0, w.length - 2); h = h.substr(0, h.length - 2); // var s_left=(window.screen.availWidth-w)/2 +"px"; // var s_top=(window.screen.availHeight-h)/2 +'px'; var s_left = (window.innerWidth - w) / 2 + 'px'; var s_top = (window.innerHeight - h) / 2 + 'px'; show_div.css('left', s_left); show_div.css('top', s_top); $('.mask').css('display', 'block'); } //点击蒙板 function hide_all() { $('.mask').css('display', 'none'); tempDiv.css('display', 'none'); } function getPar(par) { //获取当前URL var local_url = document.location.href; local_url = decodeURI(local_url); //获取要取得的get参数位置 var get = local_url.indexOf(par + "="); if(get == -1) { return ""; } //截取字符串 var get_par = local_url.slice(par.length + get + 1); //判断截取后的字符串是否还有其他get参数 var nextPar = get_par.indexOf("&"); if(nextPar != -1) { get_par = get_par.slice(0, nextPar); } return get_par; } var orderid = getPar("order_id"); //var status=getQueryString("status"); var url = "./st-xm/Api/order_details_qianlvhs.php?order_id=" + orderid; $.getJSON(url, function(res_data) { var jieguo = res_data; console.log(url); console.log(jieguo); if(jieguo.code == 0) { var order_no = jieguo.order_no; var order_status = jieguo.order_status; var order_source = jieguo.order_source; var order_status = jieguo.order_status; var sales = jieguo.sales; var order_sub = jieguo.order_sub; $('.order_no').html("订单号:" + order_no); $('.order_status').html(order_status); $('.order_source').html("订单来源:" + order_source); $('.sales').html("销售方式:" + sales); if(order_status == '待支付') { time = jieguo.pay_second; ShowCountDown(); setInterval("ShowCountDown()", 1000); //1000为1秒钟 $('#order-ticket').addClass('hide'); $('#order-complete').addClass('hide'); $('#order-cancel').addClass('hide'); $('#order-pay .order_sub_date').html(order_sub.order_sub_date); $('#order-pay .order_sub_time').html(order_sub.order_sub_time); $('#order-pay').css("display", "block"); } else if(order_status == '已出票') { var order_pay_success = jieguo.order_pay_success; var order_ticket_success = jieguo.order_ticket_success; $('#order-pay').addClass('hide'); $('#order-complete').addClass('hide'); $('#order-cancel').addClass('hide'); $('#order-ticket .order_sub_date').html(order_sub.order_sub_date); $('#order-ticket .order_sub_time').html(order_sub.order_sub_time); $('#order-ticket .order_pay_success_date').html(order_pay_success.order_pay_success_date); $('#order-ticket .order_pay_success_time').html(order_pay_success.order_pay_success_time); $('#order-ticket .order_ticket_success_date').html(order_ticket_success.order_ticket_success_date); $('#order-ticket .order_ticket_success_time').html(order_ticket_success.order_ticket_success_time); $('#order-ticket').css("display", "block"); } else if(order_status == '已完成') { var order_pay_success = jieguo.order_pay_success; var order_ticket_success = jieguo.order_ticket_success; var order_travel_success = jieguo.order_travel_success; $('#order-pay').addClass('hide'); $('#order-ticket').addClass('hide'); $('#order-cancel').addClass('hide'); $('#order-complete .order_sub_date').html(order_sub.order_sub_date); $('#order-complete .order_sub_time').html(order_sub.order_sub_time); $('#order-complete .order_pay_success_date').html(order_pay_success.order_pay_success_date); $('#order-complete .order_pay_success_time').html(order_pay_success.order_pay_success_time); $('#order-complete .order_ticket_success_date').html(order_ticket_success.order_ticket_success_date); $('#order-complete .order_ticket_success_time').html(order_ticket_success.order_ticket_success_time); $('#order-complete .order_travel_success_date').html(order_travel_success.order_travel_success_date); $('#order-complete').css("display", "block"); } else if(order_status == '已取消') { var order_cancel = jieguo.order_cancel; $('#order-pay').addClass('hide'); $('#order-ticket').addClass('hide'); $('#order-complete').addClass('hide'); $('#order-cancel .order_sub_date').html(order_sub.order_sub_date); $('#order-cancel .order_sub_time').html(order_sub.order_sub_time); $('#order-cancel .order_cancel_reason').html(order_cancel.order_cancel_reason); $('#order-cancel .order_cancel_date').html(order_cancel.order_cancel_date); $('#order-cancel .order_cancel_time').html(order_cancel.order_cancel_time); $('#order-cancel').css("display", "block"); } var line_info = jieguo.line_info; var insertTable = ""; for(var item in line_info) { insertTable += "" + line_info[item].line_code + "" + line_info[item].line_name + "" + line_info[item].start_area + "" + line_info[item].end_area + ""; var start_time = ''; var car_number = ''; var seat = ''; var ticket_name = ''; var seat_number = ''; var if_print = ''; var if_meal = ''; var if_bounce = ''; var price = ''; for(var item1 in line_info[item].tickets) { (line_info[item].tickets[item1].if_print == 0) ? aif_print = "否": aif_print = "是"; (line_info[item].tickets[item1].if_meal == 0) ? aif_meal = "否": aif_meal = "是"; (line_info[item].tickets[item1].if_bounce == 0) ? aif_bounce = "否": aif_bounce = "已退票"; if(line_info[item].tickets[item1].if_bounce != 0) { start_time += "
" + line_info[item].tickets[item1].start_time + "
"; car_number += "
" + line_info[item].tickets[item1].car_number + "
"; seat += "
" + line_info[item].tickets[item1].seat + "
"; ticket_name += "
" + line_info[item].tickets[item1].ticket_name + "
"; seat_number += "
" + line_info[item].tickets[item1].seat_number + "
"; if_print += "
" + aif_print + "
"; if_meal += "
" + aif_meal + "
"; if_bounce += "
" + aif_bounce + "
"; price += "
¥" + line_info[item].tickets[item1].price + "
"; } else { start_time += "
" + line_info[item].tickets[item1].start_time + "
"; car_number += "
" + line_info[item].tickets[item1].car_number + "
"; seat += "
" + line_info[item].tickets[item1].seat + "
"; ticket_name += "
" + line_info[item].tickets[item1].ticket_name + "
"; seat_number += "
" + line_info[item].tickets[item1].seat_number + "
"; if_print += "
" + aif_print + "
"; if_meal += "
" + aif_meal + "
"; if_bounce += "
" + aif_bounce + "
"; price += "
¥" + line_info[item].tickets[item1].price + "
"; } } insertTable += "" + start_time + "" + car_number + "" + seat + "" + ticket_name + "" + seat_number + "" + if_print + "" + if_meal + "" + if_bounce + "" + price + ""; } insertTable += "总额¥" + jieguo.total_rmb + ""; //console.log(insertTable); $('#sample-table-1 tbody').html(insertTable); //循环添加乘客信息 // var customer_info=jieguo['customer_info']; // var HTML=''; // for (var i=0,m=customer_info.length;i3 && colIndex==0){ // tempHTML+='
'; // tempHTML+='

'; // tempHTML+='

'; // tempHTML+='

'; // tempHTML+='
'; // } // tempHTML+='
'; // tempHTML+='

联系人:'+dict['CUSTOMER_NAME']+'

'; // tempHTML+='

手机:'+dict['CUSTOMER_MOBILE']+'

'; // tempHTML+='

'+dict['TYPE_NAME']+':'+dict['CUSTOMER_ID_NO']+'

'; // tempHTML+='
'; // HTML+=tempHTML; // } // HTML+='
'; // HTML+='
'; // $('#customer').html(HTML); $('#customer_name').html("联系人:" + jieguo['customer_info'][0]['CUSTOMER_NAME']); $('#customer_mobile').html("手机号:" + jieguo['customer_info'][0]['CUSTOMER_MOBILE']); $('#customer_id').html(jieguo['customer_info'][0]['TYPE_NAME'] + ":" + jieguo['customer_info'][0]['CUSTOMER_ID_NO']); $('#order_remark').val(jieguo['customer_info'][0]['CUSTOMER_MEMO']); var driver=jieguo['driver'][0]; $('#send_bus_no').html("车牌号:" + driver['bus_no']); $('#send_driver_name').html("司机姓名:" + driver['driver_name']); $('#send_driver_mobile').html("司机姓名:" + driver['driver_mobile']); $("#xm_show").css("display", "block"); var msg_url = "./st-xm/Api/order_details_qianlvhs.php?method=get_msg&order_id=" + orderid; get_order_send_message(msg_url); $("#cancel").click(function() { var cancel = window.prompt("请输入取消原因",""); $("#cancel").attr("disabled", "disabled"); var url = "./st-xm/Api/order_list.php?method=cancelOrder&reason="+cancel+"&clock="+CurrentTime()+"&order_id=" + order_no; $.getJSON(url, function(res_data) { if(res_data['code'] != "0") { alert(res_data['info']); } alert('取消成功'); location.replace(location.href); }) }); } else { $("#xm_show").html(''); alert(jieguo.info); } }); //时间倒计时 function ShowCountDown() { time = Math.floor(time - 1); var leftsecond = time; minute = Math.floor((leftsecond) / 60); var second = Math.floor(leftsecond - minute * 60); cc = document.getElementById("countdown"); if(time < 0) { return; } if(second < 10 && minute > 9) { cc.innerHTML = minute + "分0" + second + "秒"; } else if(second < 10 && minute < 10) { cc.innerHTML = '0' + minute + "分:0" + second + "秒"; } else if(second > 9 && minute < 10) { cc.innerHTML = '0' + minute + "分:" + second + "秒"; } else { cc.innerHTML = minute + "分:" + second + "秒"; } } //订单详情页结算信息 function initHtml() { } //获取当前时间 function CurrentTime() { var now = new Date(); var year = now.getFullYear(); //年 var month = now.getMonth() + 1; //月 var day = now.getDate(); //日 var hh = now.getHours(); //时 var mm = now.getMinutes(); //分 var ss = now.getSeconds(); //秒 var clock = year + "-"; if(month < 10) clock += "0"; clock += month + "-"; if(day < 10) clock += "0"; clock += day + " "; if(hh < 10) clock += "0"; clock += hh + ":"; if (mm < 10) clock += '0'; clock += mm + ":"; if (ss < 10) clock += '0'; clock += ss; return(clock); }/** * Created by Administrator on 2016/9/7. */ /** * Created by Administrator on 2016/10/11. */