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.
 
 
 
 
 
 

154 lines
3.7 KiB

  1. var run_date=getPar('run_date'); //出发日期
  2. var run_date_str=getPar('run_date_str');
  3. var month = new Date().getMonth();
  4. var today = new Date().getDate();
  5. //var today = 15;
  6. var year = new Date().getFullYear();
  7. var startarea = '';
  8. $(document).ready(function(){
  9. ifattention();
  10. startarea = getStorage("start_add");
  11. if(startarea=="nj"){
  12. $('#nanjingimg').attr('src','public/images/ic_select_nor2.png');
  13. $('#nantongimg').attr('src','public/images/ic_select_dis.png');
  14. }else if(startarea=="nt"){
  15. $('#nantongimg').attr('src','public/images/ic_select_nor2.png');
  16. $('#nanjingimg').attr('src','public/images/ic_select_dis.png');
  17. }else{
  18. $('#nantongimg').attr('src','public/images/ic_select_dis.png');
  19. $('#nanjingimg').attr('src','public/images/ic_select_dis.png');
  20. }
  21. if(run_date){
  22. //alert(run_date)
  23. $('#run_date').text(run_date_str);
  24. }else{
  25. //alert(run_date)
  26. var cur_date_m_d=getDateTime(0);
  27. cur_date_m_d=cur_date_m_d.substring(5);
  28. cur_date_m_d=cur_date_m_d.replace('-','月');
  29. cur_date_m_d=cur_date_m_d+'日';
  30. run_date=getDateTime(0);
  31. //run_date = "2016-09-15";
  32. $('#run_date').text(cur_date_m_d);
  33. //$('#run_date').text("09月15日");
  34. }
  35. var year = getMonthAndDayByDate(run_date,'year');
  36. var month = getMonthAndDayByDate(run_date,'month');
  37. var day = getMonthAndDayByDate(run_date,'day');
  38. var str = year+ '/' +month +'/'+day;
  39. var week = getWeekDay(str);
  40. $('#run_day').text(run_date==getDateTime(0)?'今天':week);
  41. })
  42. $("#select_time").click(function(){
  43. setStorage("start_add",startarea);
  44. window.location.href="calendar.html?from=index";
  45. })
  46. //$("#query").click(function(){
  47. // var go_add = $("#start_add").text();
  48. // var prod_id = "";
  49. // var go_date = "";
  50. // if(run_date==""){
  51. // go_date = year+'-'+month+'-15';
  52. // // go_date = year+'-'+month+'-'+today;
  53. //
  54. // }else{
  55. // go_date = run_date;
  56. // }
  57. // if(go_add=="南京"){
  58. // prod_id = "449860";
  59. // }else if(go_add=="南通"){
  60. // prod_id = "449865";
  61. // }
  62. // window.location.href="query_result.html?prod_id="+prod_id+"&time="+go_date;
  63. //
  64. //})
  65. function selectNanjing(nanjing){
  66. startarea = nanjing;
  67. $('#nanjingimg').attr('src','public/images/ic_select_nor2.png');
  68. $('#nantongimg').attr('src','public/images/ic_select_dis.png');
  69. $('#line1').addClass('high_light');
  70. $('#line2').removeClass('high_light');
  71. }
  72. function selectNantong(nantong){
  73. startarea = nantong;
  74. $('#nantongimg').attr('src','public/images/ic_select_nor2.png');
  75. $('#nanjingimg').attr('src','public/images/ic_select_dis.png');
  76. $('#line1').removeClass('high_light');
  77. $('#line2').addClass('high_light');
  78. }
  79. function searchInfo(){
  80. if (startarea != 'nj'&&startarea != 'nt') {
  81. alert('请选择出发线路');
  82. return;
  83. }else{
  84. var prod_id = startarea;
  85. var go_date = "";
  86. if(run_date==""){
  87. go_date = year+'-'+month+'-15';
  88. // go_date = year+'-'+month+'-'+today;
  89. }else{
  90. go_date = run_date;
  91. }
  92. clearStorage("start_add");
  93. window.location.href="query_result.html?prod_id="+prod_id+"&time="+go_date;
  94. }
  95. }
  96. $("#close_btn").click(function(){
  97. $("#code").hide();
  98. });
  99. $("#code_show").click(function(){
  100. $("#code").show();
  101. });
  102. function ifattention(){
  103. $.ajax({
  104. url:"http://wx.zhizhuchuxing.com/ZZDZ2/application/custom_made/control.php", //请求地址
  105. data:{type:"order_isregister"},
  106. type: "post",
  107. dataType: "json",
  108. success: function (data) {
  109. console.log(data);
  110. if(data.code == 0){
  111. if(data.if_attention == 0){
  112. var guanzhu = getStorage('guanzhu');
  113. if(guanzhu==1){
  114. }else{
  115. setStorage("guanzhu","1")
  116. $("#code").show();
  117. }
  118. $("#code_show").show();
  119. }else{
  120. $("#code").hide();
  121. $("#code_show").hide();
  122. }
  123. }else{
  124. alert(data.info);
  125. }
  126. }
  127. });
  128. }