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.
 
 
 
 

758 line
24 KiB

  1. var login_data = getStorJson("login_data");
  2. var data = getStorJson("payOrderInfo");
  3. //记录出发地站点数组
  4. var start_station_list = '';
  5. //记录目的地站点数组
  6. var end_station_list = '';
  7. //记录返程出发地站点数组
  8. var back_start_station_list = '';
  9. //记录返程目的地站点数组
  10. var back_end_station_list = '';
  11. //记录是否选择返程状态
  12. var ifback = 0;
  13. //上弹框
  14. var wei_infoHTML = '';
  15. //返程的startid
  16. var back_start_id = ''
  17. //返程的end_id
  18. var back_end_id = ''
  19. //返程结果的html()
  20. var HTML = '';
  21. //返程的html()
  22. var backHTML = '';
  23. //总页面html
  24. var allHTML = '';
  25. //票种数量的html
  26. var count_html = '';
  27. //去程和往返的交集库存
  28. var stockCount = 0;
  29. //定义一个 只记录去程库存 一般取消返程选中时 重置去程库存
  30. var stockCountTemp = 0;
  31. //记录可选择的票种数量
  32. var ticketCount = 0;
  33. //去程单价
  34. var go_price = "";
  35. var newHTML = '';
  36. var curpage = 1;
  37. var thisdataStrShow = '';
  38. //去程
  39. var run_id = '';
  40. var line_id = '';
  41. var line_type = '';
  42. var ticket_id = '';
  43. var start_area_id = '';
  44. var end_area_id = '';
  45. //返程
  46. var back_run_id = '';
  47. var back_line_id = '';
  48. var back_ticket_id = '';
  49. var compare_data = '';
  50. window.onload = function () {
  51. wei_infoHTML = $('#wei_info').html();
  52. HTML = $('#list_info').html();
  53. backHTML = $('#select_back_div').html();
  54. allHTML = $('#back_info').html();
  55. count_html = $('#seat_count_info').html();
  56. var run_id = data.run_id;
  57. var start_area_id = data.start_area_id;
  58. var end_area_id = data.end_area_id;
  59. //返程
  60. back_start_id = data.end_area_id;
  61. back_end_id = data.start_area_id;
  62. //展示去程信息
  63. showGoInfo(run_id, start_area_id, end_area_id);
  64. }
  65. //展示去程信息
  66. function showGoInfo(run_id, start_area_id, end_area_id) {
  67. $.ajax({
  68. url: './zz-fx/control.php',
  69. type: "post",
  70. data: {
  71. run_id: run_id,
  72. start_area_id: start_area_id,
  73. end_area_id: end_area_id,
  74. back: 1,
  75. type: "retrieval_site",
  76. operate: 'initial'
  77. },
  78. dataType: "json",
  79. success: function (data) {
  80. if (data.code == 0) {
  81. console.log(data);
  82. //去程信息的数据交互
  83. goInfoReloadData(data.list);
  84. }
  85. },
  86. fail: function (data) {
  87. // 此处放失败后执行的代码
  88. }
  89. });
  90. }
  91. //去程信息的数据交互
  92. function goInfoReloadData(data) {
  93. var go_info_HTML = $('#go_info').html();
  94. var temp = go_info_HTML;
  95. // temp = temp.replace('7月28日',data.date);
  96. var month = getMonthAndDayByDate(data.run_date, 'month');
  97. if (month != '10' && month != '11' && month != '12') {
  98. month = month.substring(1, month.length);
  99. }
  100. var day = getMonthAndDayByDate(data.run_date, 'day');
  101. temp = temp.replace('7月28日', month + '月' + day + '日');
  102. compare_data = data.run_date;
  103. temp = temp.replace('[出发地]', data.start_area_name);
  104. temp = temp.replace('[目的地]', data.end_area_name);
  105. start_area_id = data.start_area_id;
  106. end_area_id = data.end_area_id;
  107. $('#go_info').html(temp);
  108. start_station_list = data.start_res_arr;
  109. end_station_list = data.end_res_arr;
  110. $('#up_station_time').html(data.select_start_res.res_time + ' ' + data.select_start_res.res_name);
  111. $('#up_station_time').attr('valId', data.select_start_res.res_id);
  112. $('#down_station_time').html(data.select_end_res.res_time + ' ' + data.select_end_res.res_name);
  113. $('#down_station_time').attr('valId', data.select_end_res.res_id);
  114. run_id = data.run_id;
  115. line_id = data.line_id;
  116. var start_id = $('#up_station_time').attr('valid');
  117. var end_id = $('#down_station_time').attr('valid');
  118. ticket = data.ticket;
  119. line_type = data.line_type;
  120. //在展示数据后 继续调用票种价格等相关信息
  121. showCountInfoByGo(data.ticket_info);
  122. }
  123. //替换去程票种数量信息
  124. function showCountInfoByGo(data) {
  125. var html1 = '';
  126. var temp1 = count_html;
  127. go_price = data.price;
  128. temp1 = temp1.replace('[普通座]', data.seat_type_name);
  129. temp1 = temp1.replace('50元', data.price);
  130. //数量
  131. var maxCount = data.stock > 20 ? 20 : data.stock;
  132. maxCount = maxCount > 0 ? maxCount : 0;
  133. stockCount = maxCount;
  134. stockCountTemp = maxCount;
  135. html1 += temp1;
  136. $('#seat_count_info').html(html1);
  137. ticket_id = data.ticket_id;
  138. countPrice();
  139. }
  140. //增加购买数量
  141. function addition() {
  142. if (ticketCount < stockCount) {
  143. ticketCount++;
  144. $('#adult').val(ticketCount);
  145. } else {
  146. alert('无法购买更多!');
  147. }
  148. countPrice();
  149. }
  150. //减法购买数量
  151. function subtraction() {
  152. if (ticketCount > 0) {
  153. ticketCount--;
  154. $('#adult').val(ticketCount);
  155. } else {
  156. alert('请选择正确的票种数量!');
  157. }
  158. countPrice();
  159. }
  160. //上弹框的内容封装
  161. function upDiv(data, select_id, goBack) {
  162. var html = '';
  163. for (var i = 0; i < data.length; i++) {
  164. var tempHTML = wei_infoHTML;
  165. tempHTML = tempHTML.replace('示例菜单', data[i].res_time + ' ' + data[i].res_name);
  166. tempHTML = tempHTML.replace('[id]', data[i].res_id);
  167. html += tempHTML;
  168. }
  169. $('#wei_info').html(html);
  170. $('.weui_actionsheet_cell').click(function () {
  171. if (this.innerHTML == '取消') {
  172. $('#mask').click();
  173. return;
  174. } else {
  175. $('#' + select_id).html(this.innerHTML);
  176. $('#' + select_id).attr('valid', this.id);
  177. $('#mask').click();
  178. }
  179. //alert(goBack);
  180. if (goBack == 'go') { // 去程
  181. var start_id = $('#up_station_time').attr('valid');
  182. var end_id = $('#down_station_time').attr('valid');
  183. if (select_id == "up_station_time") {//去程 上
  184. $.ajax({
  185. url: './zz-fx/control.php',
  186. type: "post",
  187. data: {
  188. run_id: run_id,
  189. start_res_id: start_id,
  190. end_area_id: end_area_id,
  191. back: 1,
  192. type: "retrieval_site",
  193. operate: 'start',
  194. line_type: line_type
  195. },
  196. dataType: "json",
  197. success: function (data) {
  198. if (data.code == 0) {
  199. console.log(data);
  200. //下车站点替换
  201. end_station_list = data.list.end_res_arr;
  202. $('#down_station_time').html(data.list.select_end_res.res_time + ' ' + data.list.select_end_res.res_name);
  203. $('#down_station_time').attr('valId', data.list.select_end_res.res_id);
  204. //替换去程票种数量信息
  205. showCountInfoByGo(data.list.ticket_info);
  206. }
  207. },
  208. fail: function (data) {
  209. // 此处放失败后执行的代码
  210. }
  211. });
  212. } else { //去程 下
  213. $.ajax({
  214. url: './zz-fx/control.php',
  215. type: "post",
  216. data: {
  217. run_id: run_id,
  218. start_res_id: start_id,
  219. end_res_id: end_id,
  220. back: 1,
  221. type: "retrieval_site",
  222. operate: 'end',
  223. line_type: line_type
  224. },
  225. dataType: "json",
  226. success: function (data) {
  227. if (data.code == 0) {
  228. console.log(data);
  229. //替换去程票种数量信息
  230. showCountInfoByGo(data.list.ticket_info);
  231. }
  232. },
  233. fail: function (data) {
  234. // 此处放失败后执行的代码
  235. }
  236. });
  237. }
  238. } else { // 返程
  239. var go_start_res_id = $('#up_station_time').attr('valid');
  240. var go_end_res_id = $('#down_station_time').attr('valid');
  241. var back_start_station_id = $('#back_up_station_time').attr('valid');
  242. var back_end_station_id = $('#back_down_station_time').attr('valid');
  243. if(select_id == 'back_up_station_time'){ //返程 上
  244. $.ajax({
  245. url: './zz-fx/control.php',
  246. type: "post",
  247. data: {
  248. go_run_id:run_id,
  249. go_start_res_id:go_start_res_id,
  250. go_end_res_id:go_end_res_id,
  251. run_id: back_run_id,
  252. start_res_id: back_start_station_id,
  253. end_area_id: start_area_id,
  254. line_type:line_type,
  255. back: 2,
  256. type: "retrieval_site",
  257. operate: 'start'
  258. },
  259. dataType: "json",
  260. success: function (data) {
  261. if (data.code == 0) {
  262. console.log(data);
  263. data = data.list;
  264. //替换去程票种数量信息
  265. back_end_station_list = data.end_res_arr;
  266. $('#back_down_station_time').html(data.select_end_res.res_time + ' ' + data.select_end_res.res_name);
  267. $('#back_down_station_time').attr('valId', data.select_end_res.res_id);
  268. showCountInfoByBack(data.ticket_info);
  269. }
  270. },
  271. fail: function (data) {
  272. // 此处放失败后执行的代码
  273. }
  274. });
  275. }else{ // 返程 下
  276. $.ajax({
  277. url: './zz-fx/control.php',
  278. type: "post",
  279. data: {
  280. go_run_id:run_id,
  281. go_start_res_id:go_start_res_id,
  282. go_end_res_id:go_end_res_id,
  283. run_id: back_run_id,
  284. start_res_id: back_start_station_id,
  285. end_res_id: back_end_station_id,
  286. line_type:line_type,
  287. back: 2,
  288. type: "retrieval_site",
  289. operate: 'start'
  290. },
  291. dataType: "json",
  292. success: function (data) {
  293. if (data.code == 0) {
  294. console.log(data);
  295. data = data.list;
  296. //替换去程票种数量信息
  297. showCountInfoByBack(data.ticket_info);
  298. }
  299. },
  300. fail: function (data) {
  301. // 此处放失败后执行的代码
  302. }
  303. });
  304. }
  305. }
  306. })
  307. }
  308. //选择站点的下侧弹层
  309. $("#start_area").click(function () {
  310. upDiv(start_station_list, 'up_station_time', 'go');
  311. $("#mask").css("display", "block");
  312. $("#weui_actionsheet").addClass("weui_actionsheet_toggle");
  313. })
  314. $("#end_area").click(function () {
  315. upDiv(end_station_list, 'down_station_time', 'go');
  316. $("#mask").css("display", "block");
  317. $("#weui_actionsheet").addClass("weui_actionsheet_toggle");
  318. })
  319. $('#mask').click(function () {
  320. $("#mask").css("display", "none");
  321. $("#weui_actionsheet").removeClass("weui_actionsheet_toggle");
  322. })
  323. //选择返程
  324. $(document).ready(function () {
  325. var tomonth = new Date();
  326. $("#ifback").on("click", function () {
  327. if (ifback == 1) {
  328. ifback = 0;
  329. $('#back_info').addClass('ui_hide');
  330. $('#ifandback').addClass('ui_hide');
  331. stockCount = stockCountTemp;
  332. $('#adult').val(0);
  333. ticketCount = 0;
  334. var start_id = $('#up_station_time').attr('valid');
  335. var end_id = $('#down_station_time').attr('valid');
  336. $.ajax({
  337. url: './zz-fx/control.php',
  338. type: "post",
  339. data: {
  340. run_id: run_id,
  341. line_id: line_id,
  342. start_id: start_id,
  343. end_id: end_id,
  344. tickets: ticket,
  345. back: 1,
  346. type: "retrieval_tickets"
  347. },
  348. dataType: "json",
  349. success: function (data) {
  350. if (data.code == 0) {
  351. console.log(data);
  352. //替换去程票种数量信息
  353. showCountInfoByGo(data.list);
  354. }
  355. },
  356. fail: function (data) {
  357. // 此处放失败后执行的代码
  358. }
  359. });
  360. } else {
  361. addmouth($(".month"), tomonth.getFullYear(), tomonth.getMonth());
  362. $(".month").show();
  363. $("#order_detail_info").hide();
  364. $("#back_info").removeClass('ui_hide');
  365. $('#ifandback').removeClass('ui_hide');
  366. $('#cancle').html('取消');
  367. ticketCount = 0;
  368. selectDate();
  369. }
  370. });
  371. })
  372. //点击取消按钮
  373. function cancleShow() {
  374. ifback = 0;
  375. $('#back_info').addClass('ui_hide');
  376. $('#ifandback').addClass('ui_hide');
  377. $('#cancle').html('>');
  378. stockCount = stockCountTemp;
  379. $('#adult').val(0);
  380. ticketCount = 0;
  381. var start_id = $('#up_station_time').attr('valid');
  382. var end_id = $('#down_station_time').attr('valid');
  383. $.ajax({
  384. url: './zz-fx/control.php',
  385. type: "post",
  386. data: {
  387. run_id: run_id,
  388. line_id: line_id,
  389. start_id: start_id,
  390. end_id: end_id,
  391. tickets: ticket,
  392. back: 1,
  393. type: "retrieval_tickets"
  394. },
  395. dataType: "json",
  396. success: function (data) {
  397. if (data.code == 0) {
  398. console.log(data);
  399. //替换去程票种数量信息
  400. showCountInfoByGo(data.list);
  401. }
  402. },
  403. fail: function (data) {
  404. // 此处放失败后执行的代码
  405. }
  406. });
  407. }
  408. //重新选择
  409. function selectAgain() {
  410. var tomonth = new Date();
  411. addmouth($(".month"), tomonth.getFullYear(), tomonth.getMonth());
  412. $(".month").show();
  413. $("#order_detail_info").hide();
  414. $("#back_info").removeClass('ui_hide');
  415. $('#ifandback').removeClass('ui_hide');
  416. $('#cancle').html('取消');
  417. ticketCount = 0;
  418. selectDate();
  419. }
  420. //选中日期
  421. function selectDate() {
  422. $(".canday").on("click", function () {
  423. ifback = 1;
  424. if ($(this).html() == "今天") {
  425. var seldate = new Date().getDate();
  426. } else {
  427. var seldate = $(this).html();
  428. }
  429. var yearmonth = $(".currentdate").html().split("年");
  430. if (yearmonth[1] != 10 && yearmonth[1] != 11 && yearmonth[1] != 12) {
  431. var show_yearmonth = '0' + yearmonth[1];
  432. } else {
  433. var show_yearmonth = yearmonth[1];
  434. }
  435. if (seldate < 10) {
  436. var show_seldate = '0' + seldate;
  437. } else {
  438. var show_seldate = seldate;
  439. }
  440. //前台展示
  441. thisdataStrShow = yearmonth[1] + '月' + seldate + '日';
  442. //后台传参
  443. var thisdataStrSend = yearmonth[0] + "-" + show_yearmonth + "-" + show_seldate;
  444. if (compare_data > thisdataStrSend) {
  445. console.log(compare_data + '+' + thisdataStrSend)
  446. alert('返程日期不能小于出发日期!');
  447. return;
  448. } else {
  449. //根据返程日期 调用数据
  450. reloadBackData(thisdataStrSend);
  451. }
  452. //获取星期
  453. var thisdata = yearmonth[0] + "/" + yearmonth[1] + "/" + seldate;
  454. var select_week = getWeekDay(thisdata);
  455. $('#adult').val(0);
  456. //根据返程日期 调用数据
  457. // reloadBackData(thisdataStrSend);
  458. })
  459. }
  460. //加载返程数据
  461. function reloadBackData(backtime) {
  462. $.ajax({
  463. url: './zz-fx/control.php', //请求地址
  464. type: "post", //请求方式
  465. // data: data, //请求参数
  466. data: {
  467. start_area: back_start_id,
  468. end_area: back_end_id,
  469. go_time: backtime,
  470. bus_type: data.bus_type,
  471. type: "retrieval_through",
  472. run_type: 1,
  473. currpage: 1,
  474. pagesize: data.pagesize
  475. },
  476. async: false,
  477. dataType: "json",
  478. success: function (data) {
  479. console.log(data);
  480. if (data.code == 0) {
  481. var sum = data.totalnum;
  482. if (sum == 0) {
  483. alert('没有返程相关班次,请重新选择!')
  484. return;
  485. } else {
  486. $(".month").hide();
  487. $('#ifandback').removeClass('ui_hide');
  488. $('#back_search_results').removeClass('ui_hide');
  489. $('#order_detail_info').addClass('ui_hide');
  490. //替换返程数据信息
  491. replaceBackInfo(data);
  492. }
  493. }
  494. },
  495. fail: function (date) {
  496. }
  497. });
  498. }
  499. //替换返程数据信息
  500. function replaceBackInfo(data) {
  501. var list = data.list;
  502. $('#select_date_a').html(thisdataStrShow);
  503. newHTML = '';
  504. for (var i = 0; i < list.length; i++) {
  505. var tempHTML = HTML;
  506. tempHTML = tempHTML.replace('[出发地]', list[i].start_area_name);
  507. tempHTML = tempHTML.replace('[目的地]', list[i].end_area_name);
  508. tempHTML = tempHTML.replace('[时间]', list[i].start_time);
  509. tempHTML = tempHTML.replace('[价格]', list[i].price);
  510. console.log(list[i].line_id);
  511. tempHTML = tempHTML.replace('[order_id]', list[i].run_id);
  512. tempHTML = tempHTML.replace('[order_idli]', list[i].run_id);
  513. tempHTML = tempHTML.replace('[start_id]', list[i].start_area_id);
  514. tempHTML = tempHTML.replace('[end_id]', list[i].end_area_id);
  515. tempHTML = tempHTML.replace('[start_name]', '\'' + list[i].start_area_name + '\'');
  516. tempHTML = tempHTML.replace('[end_name]', '\'' + list[i].end_area_name + '\'');
  517. newHTML += tempHTML;
  518. }
  519. $('#list_info').html(newHTML);
  520. }
  521. //每个详情的点击事件
  522. function goPayInfo(id, start_id, end_id, start_name, end_name) {
  523. var go_start_res_id = $('#up_station_time').attr('valid');
  524. var go_end_res_id = $('#down_station_time').attr('valid');
  525. $('#order_detail_info').removeClass('ui_hide');
  526. $('#order_detail_info').show();
  527. $('#back_search_results').addClass('ui_hide');
  528. var newhtml = '';
  529. var temp = allHTML;
  530. temp = temp.replace('7月28日', thisdataStrShow);
  531. temp = temp.replace('[出发地]', start_name);
  532. temp = temp.replace('[目的地]', end_name);
  533. $('#back_info').html(temp);
  534. $.ajax({
  535. url: './zz-fx/control.php',
  536. type: "post",
  537. data: {
  538. go_run_id: run_id,
  539. go_start_res_id: go_start_res_id,
  540. go_end_res_id: go_end_res_id,
  541. run_id: id,
  542. start_area_id: start_id,
  543. end_area_id: end_id,
  544. back: 2,
  545. type: "retrieval_site",
  546. operate: 'initial'
  547. },
  548. dataType: "json",
  549. success: function (data) {
  550. if (data.code == 0) {
  551. console.log(data);
  552. //返程信息的数据交互
  553. backInfoReloadData(data.list);
  554. }
  555. },
  556. fail: function (data) {
  557. // 此处放失败后执行的代码
  558. }
  559. });
  560. }
  561. //返程站点信息的数据交互
  562. function backInfoReloadData(data) {
  563. back_start_station_list = data.start_res_arr;
  564. back_end_station_list = data.end_res_arr;
  565. $('#back_up_station_time').html(data.select_start_res.res_time + ' ' + data.select_start_res.res_name);
  566. $('#back_up_station_time').attr('valId', data.select_start_res.res_id);
  567. $('#back_down_station_time').html(data.select_end_res.res_time + ' ' + data.select_end_res.res_name);
  568. $('#back_down_station_time').attr('valId', data.select_end_res.res_id);
  569. //选择站点的下侧弹层
  570. $("#back_up_station").click(function () {
  571. upDiv(back_start_station_list, 'back_up_station_time', 'back');
  572. $("#mask").css("display", "block");
  573. $("#weui_actionsheet").addClass("weui_actionsheet_toggle");
  574. })
  575. $("#back_down_station").click(function () {
  576. upDiv(back_end_station_list, 'back_down_station_time', 'back');
  577. $("#mask").css("display", "block");
  578. $("#weui_actionsheet").addClass("weui_actionsheet_toggle");
  579. })
  580. back_run_id = data.run_id;
  581. back_line_id = data.line_id;
  582. //替换去程票种数量信息
  583. showCountInfoByBack(data.ticket_info);
  584. }
  585. //返程票种数量相关信息
  586. function showCountInfoByBack(data) {
  587. var html1 = '';
  588. var temp1 = count_html;
  589. temp1 = temp1.replace('[普通座]', data.seat_type_name);
  590. temp1 = temp1.replace('50元', data.price);
  591. //数量
  592. var maxCount = data.stock > 20 ? 20 : data.stock;
  593. maxCount = maxCount > 0 ? maxCount : 0;
  594. stockCount = maxCount < stockCount ? maxCount : stockCount;
  595. html1 += temp1;
  596. $('#seat_count_info').html(html1);
  597. $('#ifandback').removeClass('ui_hide');
  598. //把票种数据存入ifandback中
  599. var json_str = JSON.stringify(data);
  600. $('#ifandback').attr('data_str',json_str);
  601. back_ticket_id = data.ticket_id;
  602. countPrice();
  603. }
  604. //计算价格
  605. function countPrice() {
  606. var price = $('#ticket_price').html();
  607. var count = $('#adult').val();
  608. var totalPrice = count * price;
  609. $('#total_price').html('¥' + totalPrice);
  610. }
  611. //支付按钮
  612. function payBtnDidCLicked() {
  613. var linkman = $('#linkman').val();
  614. var telnum = $('#telnum').val();
  615. var phoneRe = /^1[3|4|5|7|8]\d{9}$/;
  616. if (linkman == "" || telnum == "") {
  617. alert('联系人信息输入不完整 !');
  618. return;
  619. }
  620. if (!phoneRe.test(telnum)) {
  621. alert('请输入正确的手机号!')
  622. return;
  623. }
  624. ;
  625. var tic_count = $('#adult').val();
  626. var peoInfo = '{' + linkman + ',' + telnum + ',}';
  627. if (tic_count == 0) {
  628. alert('购买数量为空!');
  629. return;
  630. }
  631. if (ifback == 0) {
  632. var tic_price = $('#ticket_price').html();
  633. var ticket_info = '{1,' + run_id + ',' + ticket_id + ',' + tic_price + ',' + tic_count + '}';
  634. $("#loadingToast").show();
  635. } else {
  636. var json_str = $('#ifandback').attr('data_str');
  637. var ticket_data = JSON.parse(json_str);
  638. var go_ticket_info = '{1,' + ticket_data.go_run_id + ',' + ticket_data.go_ticket_id + ',' + ticket_data.go_discount_price + ',' + tic_count + '}';
  639. var back_ticket_info = '{2,' + ticket_data.back_run_id + ',' + ticket_data.back_ticket_id + ',' + ticket_data.back_discount_price + ',' + tic_count + '}';
  640. var ticket_info = go_ticket_info + back_ticket_info;
  641. $("#loadingToast").show();
  642. }
  643. // var data = {
  644. // ticket_info: ticket_info,
  645. // customer_info: peoInfo,
  646. // run_id:run_id,
  647. // type: "distribut_OrderUp1"
  648. // };
  649. // console.log(data);
  650. // return 123;
  651. $.ajax({
  652. url: './zz-fx/control.php',
  653. type: "post",
  654. data: {
  655. ticket_info: ticket_info,
  656. customer_info: peoInfo,
  657. run_id:run_id,
  658. type: "distribut_OrderUp1"
  659. },
  660. dataType: "json",
  661. success: function (data) {
  662. $("#loadingToast").hide();
  663. $(".weui_toast").hide();
  664. if (data.code == 0) {
  665. console.log(data);
  666. if (login_data.pay_status == "0") {
  667. setStorJson("submite_success", data);
  668. window.location.href = "pay_order.html";
  669. } else if (login_data.pay_status == "1") {
  670. setStorJson("submite_success", data);
  671. window.location.href = "submite_success.html";
  672. }
  673. } else {
  674. alert(data.info);
  675. }
  676. },
  677. fail: function (data) {
  678. // 此处放失败后执行的代码
  679. }
  680. });
  681. }