var submite_success = getStorJson("submite_success"); window.onload = function(){ goHTML = $('#go').html(); backHTML = $('#back').html(); console.log(submite_success); if (submite_success.ifback == 0) { $('#go').removeClass('ui_hide'); $('#back').addClass('ui_hide'); reloadDataInfos(0); } else{ $('#back').removeClass('ui_hide'); $('#go').addClass('ui_hide'); reloadDataInfos(1); } } function reloadDataInfos(ifback){ if (ifback ==0 ) { var go_list = submite_success.go_list; var temp = goHTML; temp = temp.replace('上海',go_list.start_area); temp = temp.replace('(黄浦旅游集散站)',go_list.start_res); temp = temp.replace('乌镇',go_list.end_area); temp = temp.replace('(西栅1号停车场)',go_list.end_res); temp = temp.replace('2016-07-26',go_list.run_date); temp = temp.replace('07:40',go_list.run_time); temp = temp.replace('[普通座]',go_list.site_type); temp = temp.replace('[2]',go_list.num); temp = temp.replace('小橙子',go_list.customer_name); temp = temp.replace('18602525520',go_list.customer_mobile); var aaa = $('#total').html(); aaa = aaa.replace('110',go_list.order_price); $('#total').html(aaa); $('#go').html(temp); }else{ var go_list = submite_success.go_list; var back_list = submite_success.back_list; var temp = backHTML; temp = temp.replace('[去程出发地]',go_list.start_area); temp = temp.replace('去程出发站点',go_list.start_res); temp = temp.replace('[去程目的地]',go_list.end_area); temp = temp.replace('去程目的站点',go_list.end_res); temp = temp.replace('[去程日期]',go_list.run_date); temp = temp.replace('[去程时间]',go_list.run_time); temp = temp.replace('[去程座]',go_list.site_type); temp = temp.replace('[去程数量]',go_list.num); temp = temp.replace('[返程出发地]',back_list.start_area); temp = temp.replace('返程出发站点',back_list.start_res); temp = temp.replace('[返程目的地]',back_list.end_area); temp = temp.replace('返程目的站点',back_list.end_res); temp = temp.replace('[返程日期]',back_list.run_date); temp = temp.replace('[返程时间]',back_list.run_time); temp = temp.replace('[返程座]',back_list.site_type); temp = temp.replace('[返程数量]',back_list.num); temp = temp.replace('小橙子',back_list.customer_name); temp = temp.replace('18602525520',back_list.customer_mobile); var bbb = $('#total').html(); bbb = bbb.replace('110',parseInt(go_list.order_price)+parseInt(back_list.order_price)); $('#total').html(bbb); $('#back').html(temp); } } //查看订单 function viewTheOrder(){ window.location.href = './order_detail.html'; } //返回首页 function backToHome(){ window.location.href = './resever_bus.html'; }