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.
 
 
 
 
 
 

352 lines
14 KiB

  1. var trip_type = 146;
  2. var current_page = 1;
  3. var page_size = 1000;
  4. $(document).ready(function(){
  5. $("#loading_html").show();
  6. initdata();
  7. })
  8. function initdata(){
  9. $.ajax({
  10. url:base_api+"mytrip/index",//请求地址
  11. type: "post", //请求方式
  12. data:{
  13. current_page:current_page,
  14. type:trip_type,
  15. page_size:page_size
  16. },
  17. dataType: "json",
  18. success: function (data) {
  19. console.log(data);
  20. if(data.flag){
  21. current_page = data.data.page.current_page;
  22. if(data.data.list.length==0){
  23. if(trip_type == "146"){
  24. $("#go_reserve").show();
  25. }else{
  26. $("#go_reserve_end").show();
  27. }
  28. }else{
  29. load_createHtml(data.data.list);
  30. }
  31. }else{
  32. alert(data.msg)
  33. }
  34. },
  35. fail: function (data) {
  36. }
  37. });
  38. }
  39. function page_tech(){
  40. current_page = parseInt(current_page)+1;
  41. $.ajax({
  42. url:base_api+"mytrip/index",//请求地址
  43. type: "post", //请求方式
  44. data:{
  45. current_page:current_page,
  46. type:trip_type,
  47. page_size:page_size
  48. },
  49. dataType: "json",
  50. success: function (data) {
  51. console.log(data);
  52. if(data.flag){
  53. page_createHtml(data.data.list);
  54. }else{
  55. }
  56. },
  57. fail: function (data) {
  58. }
  59. });
  60. }
  61. function load_createHtml(data){
  62. var temp = ""
  63. for(var i=0;i<data.length;i++){
  64. //82普通车票
  65. if(data[i].type=="369"){
  66. var trip_time=data[i].run_date.split("-");
  67. temp += '<div style="min-height: 1.8rem;" class="cell ub">'
  68. + '<div class="ub ub-ver ub-f1 w1">'
  69. + '<div style="margin-left: 0.05rem;text-align: right;width: 0.59rem;" class="trip_tx_f11 ub ub-ac">'
  70. + '<div style="margin-right:0.07rem;" class="ub-f1">'
  71. + '<div style="color: #438c8c;font-size: 0.14rem;">'+data[i].run_time+'</div>'
  72. + '<div style="color: #2f323e;" class="ulev2">'+trip_time[2]+'日</div>'
  73. + '<div style="color: #868787;">'+trip_time[1]+'月</div>'
  74. + '</div>'
  75. + '<img class="trip_img_small_wh" src="images/a4/img_a4_o.png"/>'
  76. + '</div>'
  77. + '</div>'
  78. + '<div style="margin-right: 0.1rem;margin-bottom: 0.3rem;border-radius: 0.05rem;" class="ub ub-ver ub-f4 w1">'
  79. + '<div style="border-bottom: 1px dashed #f0f2f6;" class="ub white_bccolor yuanjiao_t ui_p_t10 ui_p_b10 ui_p_l15 ui_p_r15">'
  80. + '<img style="width: 0.15rem;margin-right: 0.05rem;" src="images/img_travel.png"/>'
  81. + '<div class="ub-f1 fontmiddle_color">周边游</div>'
  82. + '</div>'
  83. + '<div class="ub ub-ver yuanjiao_b white_bccolor ui_m_b05 outer_line_down_color">'
  84. + '<li class="ub disney_bus ui_p_a15">'
  85. + '<div class="ub ub-f1 ub-ver">'
  86. + '<div class="lightblack_color ulev2">'+data[i].line_name+'</div>'
  87. + '<div style="margin-top: 0.05rem;font-size: 0.13rem;" class="fontmiddle_color">'+data[i].line_add+'</div>'
  88. + '</div>'
  89. + '</li>'
  90. + '</div>'
  91. + '</div>'
  92. + '</div>'
  93. }else{
  94. var trip_time=data[i].run_date.split("-");
  95. var new_time = data[i].minutes;
  96. var click_btn = "";
  97. if(trip_type == "146"){
  98. click_btn = '<div class="ub">'
  99. + '<div order_id="'+data[i].order_id+'" style="border-radius: 0.05rem;margin-right: 0.03rem;" class="ub ub-f1 bg_color tx-c trip_qrcode_p white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac check_code outer_line_down_color">'
  100. + '<img class="trip_img_location_wh" src="images/ic_erweima.png"/>'
  101. + '<div id="">电子车票</div>'
  102. + '</div>'
  103. + '<div order_id="'+data[i].order_id+'" run_date="'+data[i].run_date+'" style="border-radius: 0.05rem;margin-left: 0.03rem;" class="ub ub-f1 bg_color tx-c white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac ditu outer_line_down_color">'
  104. + '<img class="trip_img_wh" src="images/ic_zhaoche.png"/>'
  105. + '<div id="">我要找车</div>'
  106. + '</div>'
  107. + '</div>'
  108. }else if(trip_type == "147"){
  109. click_btn = '<div class="ub">'
  110. + '<div order_id="'+data[i].order_id+'" style="border-radius: 0.05rem;margin-right: 0.03rem;" class="ub ub-f1 bg_color tx-c trip_qrcode_p white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac check_code outer_line_down_color">'
  111. + '<img class="trip_img_location_wh" src="images/ic_erweima_dis.png"/>'
  112. + '<div style="color:#cccccc;">电子车票</div>'
  113. + '</div>'
  114. + '<div order_id="'+data[i].order_id+'" run_date="'+data[i].run_date+'" style="border-radius: 0.05rem;margin-left: 0.03rem;" class="ub ub-f1 bg_color tx-c white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac ditu outer_line_down_color">'
  115. + '<img class="trip_img_wh" src="images/img_zhaoche_dis.png"/>'
  116. + '<div style="color:#cccccc;">我要找车</div>'
  117. + '</div>'
  118. + '</div>'
  119. }
  120. temp += '<div style="min-height: 1.8rem;" class="cell ub">'
  121. + '<div class="ub ub-ver ub-f1 w1">'
  122. + '<div style="margin-left: 0.05rem;text-align: right;width: 0.59rem;" class="trip_tx_f11 ub ub-ac">'
  123. + '<div style="margin-right:0.07rem;" class="ub-f1">'
  124. + '<div style="color: #438c8c;font-size: 0.14rem;">'+data[i].run_time+'</div>'
  125. + '<div style="color: #2f323e;" class="ulev2">'+trip_time[2]+'日</div>'
  126. + '<div style="color: #868787;">'+trip_time[1]+'月</div>'
  127. + '</div>'
  128. + '<img class="trip_img_small_wh" src="images/a4/img_a4_o.png"/> '
  129. + '</div>'
  130. + '</div>'
  131. + '<div style="margin-right: 0.1rem;margin-bottom: 0.3rem;border-radius: 0.05rem;" class="ub ub-ver ub-f4 w1">'
  132. + '<div style="border-bottom: 1px dashed #f0f2f6;" class="ub white_bccolor yuanjiao_t">'
  133. + '<div style="padding-bottom:0.09rem;" class="ub-f1 ui_p_t10 ui_p_l15 ui_p_r15 fontmiddle_color">全程用时:'+new_time+'</div>'
  134. + '</div>'
  135. + '<div class="ub ub-ver yuanjiao_b white_bccolor ui_m_b05 outer_line_down_color">'
  136. + '<li class="ub disney_bus ui_p_a15">'
  137. + '<img style="height: 0.42rem;margin-top: 0.07rem;" class="ui_p_r05 ui_p_l05" src="images/img_points@2x.png"/>'
  138. + '<div class="ub ub-f1 ub-ver">'
  139. + '<div class="lightblack_color ulev1"><span style="color:#1b1a20;" class="ulev2 ui_m_r05">'+data[i].start_area_name+'</span><span style="font-size: 0.13rem;">'+data[i].start_res_name+'</span></div>'
  140. + '<div style="margin-top: 0.13rem;" class="lightblack_color ulev1"><span style="color:#1b1a20;" class="ulev2 ui_m_r05">'+data[i].end_area_name+'</span><span style="font-size: 0.13rem;">'+data[i].end_res_name+'</span></div>'
  141. + '</div>'
  142. + '</li>'
  143. + '</div>'
  144. + click_btn
  145. + '</div>'
  146. + '</div>'
  147. }
  148. }
  149. $("#trip_list").html(temp);
  150. $(".check_code").click(function(){
  151. var order_id = $(this).attr("order_id");
  152. window.location.href="e_ticket.html?order_id="+order_id;
  153. })
  154. $(".ditu").click(function() {
  155. var order_id = $(this).attr("order_id");
  156. var run_date = $(this).attr("run_date");
  157. $.ajax({
  158. url:base_api+"weUser/journey/findCar",//请求地址
  159. type: "post", //请求方式
  160. data:{order_id:order_id,run_date:run_date},
  161. dataType: "json",
  162. success: function (data) {
  163. console.log(data);
  164. if(data.flag == true){
  165. window.location.href="search_bus.html?order_id="+order_id+"&run_date="+run_date;
  166. }else{
  167. alert(data.msg);
  168. }
  169. },
  170. fail: function (data) {
  171. }
  172. });
  173. });
  174. if(trip_type == "147"){
  175. $(".check_code").off("click");
  176. $(".ditu").off("click");
  177. }
  178. }
  179. function page_createHtml(data){
  180. var temp = ""
  181. for(var i=0;i<data.length;i++){
  182. //82普通车票
  183. if(data[i].type=="369"){
  184. var trip_time=data[i].run_date.split("-");
  185. temp += '<div style="min-height: 1.8rem;" class="cell ub">'
  186. + '<div class="ub ub-ver ub-f1 w1">'
  187. + '<div style="margin-left: 0.05rem;text-align: right;width: 0.59rem;" class="trip_tx_f11 ub ub-ac">'
  188. + '<div style="margin-right:0.07rem;" class="ub-f1">'
  189. + '<div style="color: #438c8c;font-size: 0.14rem;">'+data[i].run_time+'</div>'
  190. + '<div style="color: #2f323e;" class="ulev2">'+trip_time[2]+'日</div>'
  191. + '<div style="color: #868787;">'+trip_time[1]+'月</div>'
  192. + '</div>'
  193. + '<img class="trip_img_small_wh" src="images/a4/img_a4_o.png"/>'
  194. + '</div>'
  195. + '</div>'
  196. + '<div style="margin-right: 0.1rem;margin-bottom: 0.3rem;border-radius: 0.05rem;" class="ub ub-ver ub-f4 w1">'
  197. + '<div style="border-bottom: 1px dashed #f0f2f6;" class="ub white_bccolor yuanjiao_t ui_p_t10 ui_p_b10 ui_p_l15 ui_p_r15">'
  198. + '<img style="width: 0.15rem;margin-right: 0.05rem;" src="images/img_travel.png"/>'
  199. + '<div class="ub-f1 fontmiddle_color">周边游</div>'
  200. + '</div>'
  201. + '<div class="ub ub-ver yuanjiao_b white_bccolor ui_m_b05 outer_line_down_color">'
  202. + '<li class="ub disney_bus ui_p_a15">'
  203. + '<div class="ub ub-f1 ub-ver">'
  204. + '<div class="lightblack_color ulev2">'+data[i].line_name+'</div>'
  205. + '<div style="margin-top: 0.05rem;font-size: 0.13rem;" class="fontmiddle_color">'+data[i].line_add+'</div>'
  206. + '</div>'
  207. + '</li>'
  208. + '</div>'
  209. + '</div>'
  210. + '</div>'
  211. }else{
  212. var trip_time=data[i].run_date.split("-");
  213. var new_time = data[i].minutes;
  214. var click_btn = "";
  215. if(trip_type == "146"){
  216. click_btn = '<div class="ub">'
  217. + '<div order_id="'+data[i].order_id+'" style="border-radius: 0.05rem;margin-right: 0.03rem;" class="ub ub-f1 bg_color tx-c trip_qrcode_p white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac check_code outer_line_down_color">'
  218. + '<img class="trip_img_location_wh" src="images/ic_erweima.png"/>'
  219. + '<div id="">电子车票</div>'
  220. + '</div>'
  221. + '<div order_id="'+data[i].order_id+'" run_date="'+data[i].run_date+'" style="border-radius: 0.05rem;margin-left: 0.03rem;" class="ub ub-f1 bg_color tx-c white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac ditu outer_line_down_color">'
  222. + '<img class="trip_img_wh" src="images/ic_zhaoche.png"/>'
  223. + '<div id="">我要找车</div>'
  224. + '</div>'
  225. + '</div>'
  226. }else if(trip_type == "147"){
  227. click_btn = '<div class="ub">'
  228. + '<div order_id="'+data[i].order_id+'" style="border-radius: 0.05rem;margin-right: 0.03rem;" class="ub ub-f1 bg_color tx-c trip_qrcode_p white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac check_code outer_line_down_color">'
  229. + '<img class="trip_img_location_wh" src="images/ic_erweima_dis.png"/>'
  230. + '<div style="color:#cccccc;">电子车票</div>'
  231. + '</div>'
  232. + '<div order_id="'+data[i].order_id+'" run_date="'+data[i].run_date+'" style="border-radius: 0.05rem;margin-left: 0.03rem;" class="ub ub-f1 bg_color tx-c white_bccolor ui_p_a10 white_bccolor ub-pc ub-ac ditu outer_line_down_color">'
  233. + '<img class="trip_img_wh" src="images/img_zhaoche_dis.png"/>'
  234. + '<div style="color:#cccccc;">我要找车</div>'
  235. + '</div>'
  236. + '</div>'
  237. }
  238. temp += '<div style="min-height: 1.8rem;" class="cell ub">'
  239. + '<div class="ub ub-ver ub-f1 w1">'
  240. + '<div style="margin-left: 0.05rem;text-align: right;width: 0.59rem;" class="trip_tx_f11 ub ub-ac">'
  241. + '<div style="margin-right:0.07rem;" class="ub-f1">'
  242. + '<div style="color: #438c8c;font-size: 0.14rem;">'+data[i].run_time+'</div>'
  243. + '<div style="color: #2f323e;" class="ulev2">'+trip_time[2]+'日</div>'
  244. + '<div style="color: #868787;">'+trip_time[1]+'月</div>'
  245. + '</div>'
  246. + '<img class="trip_img_small_wh" src="images/a4/img_a4_o.png"/> '
  247. + '</div>'
  248. + '</div>'
  249. + '<div style="margin-right: 0.1rem;margin-bottom: 0.3rem;border-radius: 0.05rem;" class="ub ub-ver ub-f4 w1">'
  250. + '<div style="border-bottom: 1px dashed #f0f2f6;" class="ub white_bccolor yuanjiao_t">'
  251. + '<div style="padding-bottom:0.09rem;" class="ub-f1 ui_p_t10 ui_p_l15 ui_p_r15 fontmiddle_color">全程用时:'+new_time+'</div>'
  252. + '</div>'
  253. + '<div class="ub ub-ver yuanjiao_b white_bccolor ui_m_b05 outer_line_down_color">'
  254. + '<li class="ub disney_bus ui_p_a15">'
  255. + '<img style="height: 0.42rem;margin-top: 0.07rem;" class="ui_p_r05 ui_p_l05" src="images/img_points@2x.png"/>'
  256. + '<div class="ub ub-f1 ub-ver">'
  257. + '<div class="lightblack_color ulev1"><span style="color:#1b1a20;" class="ulev2 ui_m_r05">'+data[i].start_area_name+'</span><span style="font-size: 0.13rem;">'+data[i].start_res_name+'</span></div>'
  258. + '<div style="margin-top: 0.13rem;" class="lightblack_color ulev1"><span style="color:#1b1a20;" class="ulev2 ui_m_r05">'+data[i].end_area_name+'</span><span style="font-size: 0.13rem;">'+data[i].end_res_name+'</span></div>'
  259. + '</div>'
  260. + '</li>'
  261. + '</div>'
  262. + click_btn
  263. + '</div>'
  264. + '</div>'
  265. }
  266. }
  267. $("#trip_list").append(temp);
  268. $(".check_code").click(function(){
  269. var order_id = $(this).attr("order_id");
  270. window.location.href="e_ticket.html?order_id="+order_id;
  271. })
  272. $(".ditu").click(function() {
  273. var order_id = $(this).attr("order_id");
  274. var run_date = $(this).attr("run_date");
  275. $.ajax({
  276. url:base_api+"weUser/journey/findCar",//请求地址
  277. type: "post", //请求方式
  278. data:{order_id:order_id,run_date:run_date},
  279. dataType: "json",
  280. success: function (data) {
  281. console.log(data);
  282. if(data.flag == true){
  283. window.location.href="search_bus.html?order_id="+order_id+"&run_date="+run_date;
  284. }else{
  285. alert(data.msg);
  286. }
  287. },
  288. fail: function (data) {
  289. }
  290. });
  291. });
  292. if(trip_type == "147"){
  293. $(".check_code").off("click");
  294. $(".ditu").off("click");
  295. }
  296. }
  297. $("#yuding").click(function(){
  298. window.location.href="travel_book.html";
  299. });
  300. $("#go_bind").click(function(){
  301. window.location.href="bind_order.html";
  302. });
  303. function cut_head(obj1,obj2){
  304. trip_type = obj2;
  305. current_page = 1;
  306. $(".top_noselected").removeClass("top_selected");
  307. $(obj1).children().addClass("top_selected");
  308. $("#trip_list").html("");
  309. $("#go_reserve").hide();
  310. $("#go_reserve_end").hide();
  311. initdata();
  312. }