|
-
- var order_id = getStorage('order_id');
- var goHTML = '';
- var backHTML = '';
-
-
- window.onload = function(){
-
- goHTML = $('#go').html();
- backHTML = $('#back').html();
-
- $.ajax({
- url:'./zz-fx/control.php', //请求地址
- type: "post", //请求方式
- data:{
- type:"distribut_DropOrder",
- order_id:order_id,
- iffirst:1
- },
- async:false,
- dataType: "json",
- success: function (data) {
- if(data.code == 0){
- console.log(data);
- //展示退单信息
- showRefundOrder(data);
- }else{
- alert(data.info)
- }
- },
- fail: function (date) {
- }
- });
- }
-
- function showRefundOrder(data){
- var list = data.list;
- if (data.ifback == 0) {
- $('#go').removeClass('ui_hide');
- $('#back').addClass('ui_hide');
- $('#attention').addClass('ui_hide');
- var go_list = list.to;
- var temp = goHTML;
- temp = temp.replace('上海(黄浦旅游集散站) - 乌镇(西栅1号停车场)',list.station);
- temp = temp.replace('2016-07-26 07:40',list.run_time);
- temp = temp.replace('普通座 × 2',list.count);
-
- var aaa = $('#total').html();
- aaa = aaa.replace('110',list.order_price);
- $('#total').html(aaa);
- $('#go').html(temp);
- } else{
- $('#back').removeClass('ui_hide');
- $('#go').addClass('ui_hide');
- $('#attention').removeClass('ui_hide');
-
- var go_list = list.to;
- var back_list = list.back;
- var temp = backHTML;
- temp = temp.replace('上海(黄浦旅游集散站) - 乌镇(西栅1号停车场)',go_list.station);
- temp = temp.replace('2016-07-26 07:40',go_list.run_time);
- temp = temp.replace('普通座 × 2',go_list.count);
-
- temp = temp.replace('[乌镇(东栅停车场) - 上海(黄浦旅游集散站)]',back_list.station);
- temp = temp.replace('[2016-07-26 15:40]',back_list.run_time);
- temp = temp.replace('[普通座 × 2]',back_list.count);
-
- var aaa = $('#total').html();
- aaa = aaa.replace('110',go_list.order_price*2);
- $('#total').html(aaa);
- $('#back').html(temp);
- }
- }
-
- //退票
- function confirmBtnDidClicked(){
- $.ajax({
- url:'./zz-fx/control.php', //请求地址
- type: "post", //请求方式
- data:{
- type:"distribut_DropOrder",
- order_id:order_id,
- iffirst:2
- },
- async:false,
- dataType: "json",
- success: function (data) {
- if(data.code == 0){
- window.location.href = './order_detail.html';
- }else{
- alert(data.info)
- }
- },
- fail: function (date) {
- }
- });
- }
|