You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

677 rivejä
20 KiB

  1. //Author:zhangsq
  2. //Date:20160826
  3. //Description:查询结果
  4. var goinfoHTML = '';
  5. var backinfoHTML = '';
  6. //记录去程时间
  7. var go_date = '';
  8. //去程的出发地站点数组
  9. var go_stares_ary = '';
  10. //去程的目的地站点数组
  11. var go_endres_ary = '';
  12. //返程的出发地站点数组
  13. var back_stares_ary = '';
  14. //返程的目的地站点数组
  15. var back_endres_ary = '';
  16. //记录map info
  17. var map_info = '';
  18. //站点下弹框
  19. var resHTML = '';
  20. //乘客人弹层的html
  21. var passHTML = '';
  22. //ticket_id
  23. var ticket_id_back = '';
  24. var ticket_id_go = '';
  25. var ticket_id_back_back ='';
  26. var run_id_go = '';
  27. var run_id_back = '';
  28. //乘客数量
  29. var passCount = 0;
  30. //记录乘客人的数组
  31. var passAry = '';
  32. //记录是否选择返程 0为单一去程
  33. var ifselback = 0;
  34. //选择不同的站点弹层
  35. var sel_res_div = '';
  36. $(document).ready(function(){
  37. })
  38. window.onload = function(){
  39. $("#loadingToast").show();
  40. //去程的html
  41. goinfoHTML = $('#goinfo').html();
  42. //返程的html
  43. backinfoHTML = $('#backinfo').html();
  44. //站点html 下弹框
  45. resHTML = $('#wei_info').html();
  46. //乘客人的弹层
  47. passHTML = $('#wei_info_passenger').html();
  48. //加载乘客人信息
  49. reloadPassangersInfo();
  50. //判断返程
  51. var go_ticketid = getPar('go_ticket_id');
  52. if (go_ticketid == '') {
  53. $('#discount').removeClass('ui_hide');
  54. $('#hideback').addClass('ui_hide');
  55. $('#backinfo').addClass('ui_hide');
  56. ifselback = 0
  57. //加载去程的信息
  58. reloadGoInfo();
  59. } else{
  60. $("#loadingToast").show();
  61. $('#add_back').addClass('ui_hide');
  62. $('#discount').addClass('ui_hide');
  63. ifselback = 1;
  64. //加载去程和返程信息
  65. reloadBackInfo(go_ticketid);
  66. }
  67. }
  68. //加载乘客人信息
  69. function reloadPassangersInfo(){
  70. var url=base_api+"./zz_wxsct/control.php";
  71. var parm={
  72. type:"order_getcustomer"
  73. }
  74. $.post(url,parm,function(res_data){
  75. res_data=JSON.parse(res_data);
  76. ZZLog(res_data);
  77. if (res_data.code == 0) {
  78. passCount = res_data.list.length;
  79. passAry = res_data.list;
  80. }
  81. });
  82. }
  83. //页面开始 加载去程信息
  84. function reloadGoInfo(){
  85. var run_id = getPar('run_id');
  86. var start_area_id = getPar('start_area_id');
  87. var end_area_id = getPar('end_area_id');
  88. var start_res_id = getPar('start_res_id');
  89. var end_res_id = getPar('end_res_id');
  90. var url=base_api+"./zz_wxsct/control.php";
  91. var parm={
  92. type:"bus_detail_info_go",
  93. run_id:run_id,
  94. start_area_id:start_area_id,
  95. end_area_id:end_area_id,
  96. start_res_id:start_res_id,
  97. end_res_id:end_res_id
  98. }
  99. ZZLog(url+JSON.stringify(parm));
  100. $.post(url,parm,function(res_data){
  101. res_data=JSON.parse(res_data);
  102. ZZLog(res_data);
  103. if (res_data.code == 0) {
  104. // 替换去程信息
  105. replaceGoInfo(res_data);
  106. setStorJson('go_data',res_data);
  107. } else{
  108. alert(res_data.info);
  109. }
  110. });
  111. }
  112. //替换去程信息
  113. function replaceGoInfo(data){
  114. if (data.list.bus_type == '256'){
  115. $('#start_res').addClass('ui_hide');
  116. $('#end_res').addClass('ui_hide');
  117. }else{
  118. $('#start_res').removeClass('ui_hide');
  119. $('#end_res').removeClass('ui_hide');
  120. }
  121. var list = data.list;
  122. var temphtml = goinfoHTML;
  123. var nowdate = getDateTime(0);
  124. var selmonth = getMonthAndDayByDate(list.run_date,'month');
  125. var selday = getMonthAndDayByDate(list.run_date,'day');
  126. go_date = list.run_date;
  127. if (nowdate == list.run_date) {
  128. temphtml = temphtml.replace('[日期]',selmonth+'月'+selday+'日'+'  今天');
  129. }else{
  130. temphtml = temphtml.replace('[日期]',selmonth+'月'+selday+'日');
  131. }
  132. temphtml = temphtml.replace('[去程时间]',list.start_time);
  133. temphtml = temphtml.replace('[出发地]',list.start_area_name);
  134. temphtml = temphtml.replace('[出发地站点]',list.start_res_name);
  135. temphtml = temphtml.replace('[目的地]',list.end_area_name);
  136. temphtml = temphtml.replace('[目的地站点]',list.end_res_name);
  137. // temphtml = temphtml.replace('[日程]','全程'+list.distance+'公里');
  138. // temphtml = temphtml.replace('[用时]',list.center_time);
  139. temphtml = temphtml.replace('[go_line_id]',list.line_id);
  140. temphtml = temphtml.replace('[go_ticket_id]',list.ticket.ticket_id_go);
  141. temphtml = temphtml.replace('[startarea_goid]',list.start_area_id);
  142. temphtml = temphtml.replace('[startres_goid]',list.start_res_id);
  143. temphtml = temphtml.replace('[endarea_goid]',list.end_area_id);
  144. temphtml = temphtml.replace('[endres_goid]',list.end_res_id);
  145. temphtml = temphtml.replace('[run_id_go]',list.run_id);
  146. temphtml = temphtml.replace('[价格]',list.ticket.go_price);
  147. $('#goinfo').html(temphtml);
  148. $('#distance_back').html('全程'+list.distance+'公里');
  149. $('#usetime_back').html(list.center_time);
  150. ticket_id_back = list.ticket.ticket_id_back;
  151. ticket_id_go = list.ticket.ticket_id_go;
  152. run_id_go = list.run_id;
  153. var temphtml1 = $('#seatInfo').html();
  154. temphtml1 = temphtml1.replace('[普通座]',list.ticket.site);
  155. temphtml1 = temphtml1.replace('[单程]',list.ticket.run_type);
  156. if (list.ticket.discount_price == '0') {
  157. temphtml1 = temphtml1.replace('[优惠]','无往返优惠');
  158. }else{
  159. temphtml1 = temphtml1.replace('[优惠]','往返优惠'+list.ticket.discount_price+'元');
  160. }
  161. $('#seatInfo').html(temphtml1);
  162. //去程的出发地、目的地数组
  163. go_stares_ary = list.start_res_array;
  164. go_endres_ary = list.end_res_array;
  165. //记录地图信息
  166. map_info = list['map'];
  167. //选择站点的下侧弹层
  168. $("#start_area").click(function(){
  169. $("#mask").css("display","block");
  170. $('#res_div').css("display","block");
  171. sel_res_div = 'startres_goid';
  172. upDiv(go_stares_ary,'start_res_go','go');
  173. $("#weui_actionsheet").addClass("weui_actionsheet_toggle");
  174. })
  175. $("#end_area").click(function(){
  176. $("#mask").css("display","block");
  177. $('#res_div').css("display","block");
  178. sel_res_div = 'endres_goid';
  179. upDiv(go_endres_ary,'end_res_go','go');
  180. $("#weui_actionsheet").addClass("weui_actionsheet_toggle");
  181. })
  182. $('#mask').click(function(){
  183. $("#mask").css("display","none");
  184. $('#res_div').css("display","none");
  185. $('#continue_add').css("display","none");
  186. $('#add_pass').css("display","none");
  187. $("#weui_actionsheet").removeClass("weui_actionsheet_toggle");
  188. })
  189. $('#total_div').removeClass('ui_hide');
  190. $("#loadingToast").hide();
  191. }
  192. //选择返程
  193. function selectBackInfo(){
  194. var go_ticket_id = $('#go_id_info').attr('go_ticket_id');
  195. var data = {
  196. back : 'back',
  197. go_date : go_date,
  198. go_ticket_id : go_ticket_id
  199. }
  200. setStorJson('goListInfo',data);
  201. ifselback = 1;
  202. window.location.href = './calendar.html?go_ticket_id='+go_ticket_id+'&go_date='+go_date+'&from=fill_order';
  203. }
  204. //取消返程
  205. function hideBackInfo(){
  206. $('#discount').removeClass('ui_hide');
  207. $('#hideback').addClass('ui_hide');
  208. $('#backinfo').addClass('ui_hide');
  209. $('#add_back').removeClass('ui_hide');
  210. ifselback = 0;
  211. }
  212. //跳转地图
  213. function goToMapInfo(){
  214. setStorJson('goMapInfo',map_info);
  215. window.location.href = './navigation_map.html';
  216. }
  217. ////选择站点的下侧弹层
  218. //$("#start_res_go").click(function(){
  219. //// upDiv(start_station_list,'start_res_go','go');
  220. // $("#mask").css("display","block");
  221. // $("#weui_actionsheet").addClass("weui_actionsheet_toggle");
  222. //})
  223. //$("#end_res_go").click(function(){
  224. // upDiv(end_station_list,'end_res_go','go');
  225. // $("#mask").css("display","block");
  226. // $("#weui_actionsheet").addClass("weui_actionsheet_toggle");
  227. //})
  228. //
  229. //$('#mask').click(function(){
  230. // $("#mask").css("display","none");
  231. // $("#weui_actionsheet").removeClass("weui_actionsheet_toggle");
  232. //})
  233. //修改去程票种的信息
  234. function changeTicketInfoGo(){
  235. var type = 'bus_detail_ticket_go';
  236. var run_id = $('#hiderun').html();
  237. var start_area_id = $('#stare_area_id').attr('startarea_goid');
  238. var start_res_id = $('#start_res_go').attr('startres_goid');
  239. var end_area_id = $('#end_area_id').attr('endarea_goid');
  240. var end_res_id = $('#end_res_go').attr('endres_goid');
  241. var data = {
  242. type:type,
  243. run_id:run_id,
  244. start_area_id:start_area_id,
  245. start_res_id:start_res_id,
  246. end_area_id:end_area_id,
  247. end_res_id:end_res_id
  248. }
  249. ZZLog('参数')
  250. ZZLog(data);
  251. $.ajax({
  252. url:base_api+'./zz_wxsct/control.php',
  253. type: "post",
  254. data: data,
  255. dataType: "json",
  256. success: function (data) {
  257. if(data.code == 0){
  258. console.log(data);
  259. //替换去程票种数量信息
  260. showCountInfoByBack(data.list);
  261. }else{
  262. alert(data.info)
  263. }
  264. },
  265. fail: function (data) {
  266. alert(data.info);
  267. }
  268. });
  269. }
  270. //加载去程和返程信息
  271. function reloadBackInfo(go_ticket_id){
  272. //得到去程的信息 并填充
  273. var godata = getStorJson('go_data');
  274. replaceGoInfo(godata);
  275. var run_id = getPar('run_id');
  276. $('#loadingToast').show();
  277. var url=base_api+"./zz_wxsct/control.php";
  278. var parm={
  279. type:"bus_detail_info_back",
  280. run_id:run_id,
  281. ticket_id:go_ticket_id
  282. }
  283. ZZLog(url+JSON.stringify(parm));
  284. $.post(url,parm,function(res_data){
  285. res_data=JSON.parse(res_data);
  286. ZZLog('返程');
  287. ZZLog(res_data);
  288. if (res_data.code == 0) {
  289. // 替换去程信息
  290. replaceBackInfo(res_data);
  291. setStorJson('back_data',res_data);
  292. } else{
  293. alert(res_data.info);
  294. }
  295. });
  296. }
  297. //替换返程日期
  298. function replaceBackInfo(data){
  299. if (data.list.bus_type == '256'){
  300. $('#start_res_back').addClass('ui_hide');
  301. $('#end_res_back').addClass('ui_hide');
  302. }else{
  303. $('#start_res_back').removeClass('ui_hide');
  304. $('#end_res_back').removeClass('ui_hide');
  305. }
  306. var list = data.list;
  307. var temphtml = backinfoHTML;
  308. var nowdate = getDateTime(0);
  309. var selmonth = getMonthAndDayByDate(list.run_date,'month');
  310. var selday = getMonthAndDayByDate(list.run_date,'day');
  311. if (nowdate == list.run_date) {
  312. temphtml = temphtml.replace('[返程日期]',selmonth+'月'+selday+'日'+'  今天');
  313. }else{
  314. temphtml = temphtml.replace('[返程日期]',selmonth+'月'+selday+'日');
  315. }
  316. temphtml = temphtml.replace('[返程时间]',list.start_time);
  317. temphtml = temphtml.replace('[返程出发地]',list.start_area_name);
  318. temphtml = temphtml.replace('[返程出发地站点]',list.start_res_name);
  319. temphtml = temphtml.replace('[返程目的地]',list.end_area_name);
  320. temphtml = temphtml.replace('[返程目的地站点]',list.end_res_name);
  321. // temphtml = temphtml.replace('[日程]','全程'+list.distance+'公里');
  322. // temphtml = temphtml.replace('[用时]',list.center_time);
  323. temphtml = temphtml.replace('[back_line_id]',list.line_id);
  324. temphtml = temphtml.replace('[back_ticket_id]',list.ticket.ticket_id_go);
  325. temphtml = temphtml.replace('[startarea_backid]',list.start_area_id);
  326. temphtml = temphtml.replace('[startres_backid]',list.start_res_id);
  327. temphtml = temphtml.replace('[endarea_backid]',list.end_area_id);
  328. temphtml = temphtml.replace('[endres_backid]',list.end_res_id);
  329. temphtml = temphtml.replace('[run_id_back]',list.run_id);
  330. temphtml = temphtml.replace('[返程价格]',list.ticket.price);
  331. $('#backinfo').html(temphtml);
  332. ticket_id_back_back = list.ticket.ticket_id;
  333. run_id_back = list.run_id;
  334. // ticket_id_go = list.ticket.ticket_id_go;
  335. //去程的出发地、目的地数组
  336. back_stares_ary = list.start_res_array;
  337. back_endres_ary = list.end_res_array;
  338. //记录地图信息
  339. // map_info = list['map'];
  340. //选择站点的下侧弹层
  341. $("#back_start_area").click(function(){
  342. $("#mask").css("display","block");
  343. $('#res_div').css("display","block");
  344. sel_res_div = 'startres_goid';
  345. upDiv(back_stares_ary,'start_res_back','back');
  346. $("#weui_actionsheet").addClass("weui_actionsheet_toggle");
  347. })
  348. $("#back_end_area").click(function(){
  349. $("#mask").css("display","block");
  350. $('#res_div').css("display","block");
  351. sel_res_div = 'endres_goid';
  352. upDiv(back_endres_ary,'end_res_back','back');
  353. $("#weui_actionsheet").addClass("weui_actionsheet_toggle");
  354. })
  355. $('#mask').click(function(){
  356. $("#mask").css("display","none");
  357. $('#res_div').css("display","none");
  358. $('#continue_add').css("display","none");
  359. $('#add_pass').css("display","none");
  360. $("#weui_actionsheet").removeClass("weui_actionsheet_toggle");
  361. })
  362. $('#hideback').removeClass('ui_hide');
  363. $('#backinfo').removeClass('ui_hide');
  364. $("#loadingToast").hide();
  365. }
  366. //添加乘客
  367. function addPassanger(){
  368. if (passCount == 0) {
  369. $("#mask").css("display","block");
  370. $('#add_pass').css("display","block");
  371. $("#weui_actionsheet").addClass("weui_actionsheet_toggle");
  372. } else{
  373. var html = '';
  374. for (var i = 0 ; i < passAry.length; i ++) {
  375. var tempHTML = passHTML;
  376. tempHTML = tempHTML.replace('[乘客]',passAry[i].name);
  377. tempHTML = tempHTML.replace('[证件]',passAry[i].id_num);
  378. tempHTML = tempHTML.replace('[changeid]',passAry[i].id);
  379. tempHTML = tempHTML.replace('[img]','img'+passAry[i].id);
  380. tempHTML = tempHTML.replace('[selid]',passAry[i].id);
  381. // tempHTML = tempHTML.replace('[showtime]',data.station[i].start_time);
  382. // tempHTML = tempHTML.replace('images/a3/ic_select_sel.png','images/a3/ic_select_nor.png');
  383. html += tempHTML;
  384. }
  385. $('#wei_info_passenger').html(html);
  386. $("#mask").css("display","block");
  387. $('#continue_add').css("display","block");
  388. $("#weui_actionsheet").addClass("weui_actionsheet_toggle");
  389. // $('.weui_actionsheet_cell').click(function(){
  390. $('#ok').click(function(){
  391. var newhtml = '';
  392. $('.selectInfo').each(function(){
  393. var str = '<div class="ub line_color_b ui_line_b ui_p_b15 passinfo" >'
  394. +'<div class="ub-f1 ui_p_t15 ui_p_t15 ulev1" style="color: black;width:1%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;">'+$(this).parent().children().eq(0).text()+'</div>'
  395. +'<div class="ub-f1 ui_p_t15 ui_p_t15 lightgray_color" style="width:1%">'+$(this).parent().children().eq(1).text()+'</div>'
  396. +'<div class="ub-f1 ui_p_t15 ui_p_t15 ui_p_l5 ui_p_r30 text_right" onclick="delThis(this)">'
  397. +'<img src="images/a3/ic_delete.png" style="width: 0.2rem;"/>'
  398. +'</div>'
  399. +'</div>'
  400. newhtml += str;
  401. })
  402. $('#fill_info').html(newhtml);
  403. $('#mask').click();
  404. countTotal();
  405. })
  406. $('#add_pass_info').click(function(){
  407. goToAddPassangers();
  408. })
  409. // })
  410. }
  411. }
  412. //删除某一个乘车人信息
  413. function delThis(obj){
  414. $(obj).parent().remove();
  415. countTotal();
  416. }
  417. //计算购买总数
  418. function countTotal() {
  419. var count = $('#fill_info').children().length;
  420. $('#people_count').html(count);
  421. if (ifselback == 1) {
  422. $('#count_price').html(count*$('#back_price').html());
  423. }else{
  424. $('#count_price').html(count*$('#go_price').html());
  425. }
  426. }
  427. //修改乘客信息
  428. function changeinfo(id){
  429. var temp = getPar('go_ticket_id');
  430. var run_id = getPar('run_id');
  431. var start_area_id = getPar('start_area_id');
  432. var end_area_id = getPar('end_area_id');
  433. var start_res_id = getPar('start_res_id');
  434. var end_res_id = getPar('end_res_end');
  435. if (temp == '') {
  436. var urlstr = './wirte_order.html?run_id='+run_id+'&start_area_id='+start_area_id+'&end_area_id='+end_area_id+'&start_res_id='+start_res_id+'&end_res_id='+end_res_id+'&man_id='+id;
  437. window.open(urlstr);
  438. }else{
  439. var urlstr = './wirte_order.html?run_id='+run_id+'&start_area_id='+start_area_id+'&end_area_id='+end_area_id+'&start_res_id='+start_res_id+'&end_res_id='+end_res_id+'&go_ticket_id='+temp+'&man_id='+id;
  440. window.open(urlstr);
  441. }
  442. }
  443. //选中乘客
  444. function selectInfo(selid,obj){
  445. if (obj.id == 0) {
  446. $('#img'+selid).addClass('selectInfo');
  447. $('#img'+selid).attr('src','images/a3/ic_select_sel.png');
  448. obj.id = 1;
  449. } else{
  450. $('#img'+selid).removeClass('selectInfo');
  451. $('#img'+selid).attr('src','images/a3/ic_select_nor.png');
  452. obj.id = 0;
  453. }
  454. // $('#img'+selid).addClass('selectInfo');
  455. // $('#img'+selid).attr('src','images/a3/ic_select_sel.png')
  456. }
  457. //跳转添加乘客界面
  458. function goToAddPassangers(){
  459. var temp = getPar('go_ticket_id');
  460. var run_id = getPar('run_id');
  461. var start_area_id = getPar('start_area_id');
  462. var end_area_id = getPar('end_area_id');
  463. var start_res_id = getPar('start_res_id');
  464. var end_res_id = getPar('end_res_end');
  465. if (temp == '') {
  466. window.location.href = './wirte_order.html?run_id='+run_id+'&start_area_id='+start_area_id+'&end_area_id='+end_area_id+'&start_res_id='+start_res_id+'&end_res_id='+end_res_id;
  467. }else{
  468. window.location.href = './wirte_order.html?run_id='+run_id+'&start_area_id='+start_area_id+'&end_area_id='+end_area_id+'&start_res_id='+start_res_id+'&end_res_id='+end_res_id+'&go_ticket_id='+temp;
  469. }
  470. }
  471. //支付按钮的点击
  472. function payBtnDidClicked(){
  473. var custmer = $('#custmer').val();
  474. var tel = $('#tel').val();
  475. if (custmer =='') {
  476. alert('请输入联系人!');
  477. return;
  478. } else if(tel == ''){
  479. alert('请输入手机号!');
  480. return;
  481. }
  482. $("#loadingToast").show();
  483. var newstr = '';
  484. $('.passinfo').each(function(){
  485. var str = $(this).children().eq(0).text()+'*'+$(this).children().eq(1).text();
  486. newstr += str + '/';
  487. })
  488. var passenger = newstr.substring(0,newstr.length-1);
  489. //联系人 乘客人信息
  490. var customer = '{,'+custmer+',1,'+tel+',,,,0,,,'+passenger+'}';
  491. var prod = '';
  492. var count = $('#people_count').html();
  493. if (ifselback == 0) {
  494. prod = '{m'+ticket_id_go+'p'+count+'|r'+run_id_go+'}'
  495. }else{
  496. //判断是否 有返程优惠
  497. if (ticket_id_back == '') {
  498. prod = '{m'+ticket_id_go+'p'+count+'|r'+run_id_go+'}'
  499. } else{
  500. prod = '{m'+ticket_id_back+'p'+count+'|r'+run_id_go+'}'
  501. }
  502. }
  503. var ifback = ifselback;
  504. var back_prod = '{m'+ticket_id_back_back+'p'+count+'|r'+run_id_back+'}';
  505. var data = {
  506. type : 'order_submit',
  507. prod : prod,
  508. ifback : ifselback,
  509. back_prod : back_prod,
  510. customer :customer
  511. }
  512. ZZLog('提交传参')
  513. ZZLog(data);
  514. var url=base_api+"./zz_wxsct/control.php";
  515. var parm=data;
  516. $.post(url,parm,function(res_data){
  517. res_data=JSON.parse(res_data);
  518. ZZLog(res_data);
  519. if (res_data.code == 0) {
  520. $("#loadingToast").hide();
  521. window.location.href = './pay_success.html';
  522. }else{
  523. alert(res_data.info);
  524. }
  525. });
  526. }
  527. //展示去程票种 修改后的信息
  528. function showCountInfoByBack(data){
  529. map_info = data['map'];
  530. var temphtml1 = $('#seatInfo').html();
  531. temphtml1 = temphtml1.replace('[普通座]',data.ticket.site);
  532. temphtml1 = temphtml1.replace('[单程]',data.ticket.run_type);
  533. if (data.ticket.discount_price == '0') {
  534. temphtml1 = temphtml1.replace('[优惠]','无往返优惠');
  535. }else{
  536. temphtml1 = temphtml1.replace('[优惠]','往返优惠'+data.ticket.discount_price+'元');
  537. }
  538. $('#seatInfo').html(temphtml1);
  539. $('#go_price').html(data.ticket.go_price);
  540. $('#gotime').html(data.start_time);
  541. $('#distance').html('全程'+data.distance+'公里');
  542. $('#usetime').html(data.center_time);
  543. ticket_id_back = data.ticket.ticket_id_back;
  544. ticket_id_go = data.ticket.ticket_id_go;
  545. }
  546. //上弹框的内容封装
  547. function upDiv(data,select_id,goBack){
  548. var sel = $('#'+select_id).attr(sel_res_div);
  549. var html = '';
  550. for (var i = 0 ; i < data.station.length; i ++) {
  551. var tempHTML = resHTML;
  552. tempHTML = tempHTML.replace('示例菜单',data.station[i].res_name);
  553. tempHTML = tempHTML.replace('[res_id]',data.station[i].res_id);
  554. tempHTML = tempHTML.replace('[showtime]',data.station[i].start_time);
  555. if (sel == data.station[i].res_id) {
  556. tempHTML = tempHTML.replace('images/a3/ic_select_nor.png','images/a3/ic_select_sel.png');
  557. } else{
  558. tempHTML = tempHTML.replace('images/a3/ic_select_nor.png','images/a3/ic_select_nor.png');
  559. }
  560. // tempHTML = tempHTML.replace('images/a3/ic_select_sel.png','images/a3/ic_select_nor.png');
  561. html += tempHTML;
  562. }
  563. $('#wei_info').html(html);
  564. // html = html.replace('[poi]',data.area_name)
  565. $('#poi').html(data.area_name);
  566. $('#actionsheet_cancel').click(function(){
  567. $('#mask').click();
  568. })
  569. $('.weui_actionsheet_cell').click(function(){
  570. $('#'+select_id).html(this.innerHTML);
  571. $('#'+select_id).attr(sel_res_div,this.id);
  572. var seltime = $(this).attr('showtime');
  573. //添加选中图片
  574. // $(this).parent().eq(1).attr('src','images/a3/ic_select_sel.png');
  575. $('gotime').html(seltime);
  576. $('#mask').click();
  577. //修改去程的票种信息
  578. changeTicketInfoGo();
  579. })
  580. }
  581. //截取日期参数
  582. function getMonthAndDayByDate(datestr,info){
  583. var dateAry = datestr.split('-');
  584. var cNewTimeStr;
  585. switch(info){
  586. case 'year':
  587. cNewTimeStr = dateAry[0];
  588. break;
  589. case 'month':
  590. cNewTimeStr = dateAry[1];
  591. break;
  592. default:
  593. cNewTimeStr = dateAry[2];
  594. break;
  595. }
  596. return cNewTimeStr;
  597. }