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.
 
 
 
 
 
 

163 lines
5.8 KiB

  1. //Created by HBuilder.
  2. //User: Miracle~
  3. //Date: 2016/11/15
  4. //Time: 17:00
  5. //切换出发地
  6. //页面加载
  7. $("#loading_html").show();
  8. window.onload = function() {
  9. baseInfo(791); //默认显示上海
  10. }
  11. function baseInfo(area_id) {
  12. var param = {
  13. cityid: area_id, //起始地点
  14. page: 1, //当前第几页
  15. limit: 1000, //每页多少个
  16. }
  17. ZZLog(base_api + "around/getlist&" + JSON.stringify(param));
  18. $.ajax({
  19. type: "post",
  20. url: base_api + "around/getlist",
  21. data: param,
  22. dataType: 'json',
  23. success: function(res_data) {
  24. ZZLog(res_data);
  25. if(res_data.flag == true) {
  26. base_html(res_data.data.list);
  27. } else {
  28. alert(res_data.mag);
  29. }
  30. },
  31. error: function(e) {
  32. ZZLog(e);
  33. }
  34. });
  35. }
  36. function base_html(data) {
  37. //展示周边游数据
  38. var temp_rim = '';
  39. //==============================
  40. for(var i = 0, j = data.length; i < j; i++) {
  41. var str = '';
  42. switch(data[i].type) {
  43. case '372':
  44. str = 'images/img-zhitongbashi.png';
  45. break;
  46. case '370':
  47. str = 'images/img-chejing.png';
  48. break;
  49. case '376':
  50. str = 'images/img-bashi.png';
  51. break;
  52. case '371':
  53. str = 'images/img-chejiu.png';
  54. break;
  55. default:
  56. break;
  57. }
  58. temp_rim += '<li onclick="rimDidClicked(' + data[i].pro_id + ')" travel_type="' + data[i].type + '" style="background-image: url(' + pic_api + data[i].img + ');height: 1.3rem;border-radius: 0.05rem;" class="ub rim_travel ui_m_l10 ui_m_r10 ui_m_b10 ui_m_r10 ui_m_b10 ub-ver ub-pe">' +
  59. '<img style="height: 0.17rem;position: absolute;top: 0.1rem;" src="' + str + '"/>' +
  60. '<div style="background-color: rgba(0, 0, 0, 0.5);padding-top: 0.06rem;padding-bottom: 0.08rem;padding-right: 0.08rem;padding-left: 0.08rem;border-radius: 0.05rem;" class="ub ub-pe uc-bl1 uc-br1">' +
  61. '<div class="ub-f1 ub ub-ver">' +
  62. '<div style="opacity: 0.8;" class="ulev2 white_color">' + data[i].zname + '</div>' +
  63. '<div style="font-size: 0.11rem;opacity: 0.8;" class="white_color">' + data[i].tickdes + ' </div>' +
  64. '</div>' +
  65. '<div class="ub ub-ae">' +
  66. '<span style="font-size: 0.11rem;opacity: 0.8;" class="white_color">¥</span>' +
  67. '<span style="opacity: 0.8;" class="white_color ulev5">' + parseInt(Math.ceil(data[i].price)) + '</span>' +
  68. '</div>' +
  69. '</div>' +
  70. '</li>'
  71. }
  72. //================================
  73. // for(var i = 0, j = data.length; i < j; i++) {
  74. // temp_rim += '<li onclick="select_pro(' +data[i].pro_id + ') "style="background-image: url(' + pic_api + data[i].img + ');height: 1.3rem;" class="ub rim_travel ui_m_l10 ui_m_r10 ui_m_b10 ui_m_r10 ui_m_b10 ub-ver ub-pe">' +
  75. // '<img style="height: 0.17rem;position: absolute;top: 0.1rem;" src="images/img-zhitongbashi.png"/>' +
  76. // '<div style="background-color: rgba(0, 0, 0, 0.5);padding-top: 0.05rem;" class="ub ub-pe ui_p_l10 ui_p_r10 ui_p_b10 uc-bl1 uc-br1">' +
  77. // '<div class="ub-f1 ub ub-ver">' +
  78. // '<div style="opacity: 0.8;" class="ulev2 white_color ui_m_b05">' + data[i].zname + '</div>' +
  79. // '<div style="font-size: 0.11rem;opacity: 0.8;" class="white_color">' + data[i].tickdes + ' </div>' +
  80. // '</div>' +
  81. // '<div class="ub ub-ae">' +
  82. // '<span style="font-size: 0.11rem;opacity: 0.8;" class="white_color">¥</span>' +
  83. // '<span style="opacity: 0.8;" class="white_color ulev5">' + parseInt(Math.ceil(data[i].price)) + '</span>' +
  84. // '</div>' +
  85. // '</div>' +
  86. // '</li>'
  87. // }
  88. $("#rim_travel").html(temp_rim);
  89. $("#rim_travel").show();
  90. }
  91. function change_start(which_obj) {
  92. var no = $(which_obj).attr("which_span");
  93. if(no == 1) {
  94. //显示上海出发
  95. $("#span_no_1").html("上海出发");
  96. $("#span_no_2").html("杭州");
  97. $("#span_no_3").html("南京");
  98. $("#span_no_1").removeClass("normal");
  99. $("#span_no_2").removeClass("clicker");
  100. $("#span_no_3").removeClass("clicker");
  101. $("#span_no_1").addClass("clicker");
  102. $("#span_no_2").addClass("normal");
  103. $("#span_no_3").addClass("normal");
  104. $("#div_no_1").removeClass("normal_bottom_div");
  105. $("#div_no_2").removeClass("click_bottom_div");
  106. $("#div_no_3").removeClass("click_bottom_div");
  107. $("#div_no_1").addClass("click_bottom_div");
  108. $("#div_no_2").addClass("normal_bottom_div");
  109. $("#div_no_3").addClass("normal_bottom_div");
  110. //获取上海数据
  111. baseInfo(791);
  112. } else if(no == 2) {
  113. //显示苏州出发
  114. $("#span_no_1").html("上海");
  115. $("#span_no_2").html("杭州出发");
  116. $("#span_no_3").html("南京");
  117. $("#span_no_2").removeClass("normal");
  118. $("#span_no_1").removeClass("clicker");
  119. $("#span_no_3").removeClass("clicker");
  120. $("#span_no_2").addClass("clicker");
  121. $("#span_no_1").addClass("normal");
  122. $("#span_no_3").addClass("normal");
  123. $("#div_no_2").removeClass("normal_bottom_div");
  124. $("#div_no_1").removeClass("click_bottom_div");
  125. $("#div_no_3").removeClass("click_bottom_div");
  126. $("#div_no_2").addClass("click_bottom_div");
  127. $("#div_no_1").addClass("normal_bottom_div");
  128. $("#div_no_3").addClass("normal_bottom_div");
  129. //获取苏州数据
  130. baseInfo(923);
  131. } else {
  132. //显示杭州出发
  133. $("#span_no_1").html("上海");
  134. $("#span_no_2").html("杭州");
  135. $("#span_no_3").html("南京出发");
  136. $("#span_no_3").removeClass("normal");
  137. $("#span_no_1").removeClass("clicker");
  138. $("#span_no_2").removeClass("clicker");
  139. $("#span_no_3").addClass("clicker");
  140. $("#span_no_1").addClass("normal");
  141. $("#span_no_2").addClass("normal");
  142. $("#div_no_3").removeClass("normal_bottom_div");
  143. $("#div_no_1").removeClass("click_bottom_div");
  144. $("#div_no_2").removeClass("click_bottom_div");
  145. $("#div_no_3").addClass("click_bottom_div");
  146. $("#div_no_1").addClass("normal_bottom_div");
  147. $("#div_no_2").addClass("normal_bottom_div");
  148. baseInfo(810); //显示南京出发
  149. }
  150. }
  151. function select_pro(pro_id) {
  152. //转跳详情
  153. window.location.href = 'travel_around_detail.html?pro_id=' + pro_id; //地点选择
  154. }
  155. function rimDidClicked(pro_id) {
  156. window.location.href = './travel_around_detail.html?pro_id=' + pro_id;
  157. }