videolist.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. // 头部搜索 ----------------------------------------
  2. $('.seekinput_search span').on('mousemove', function () { //显示切换框
  3. $('.seekinput_option').show();
  4. })
  5. $('.seek_box').on('mouseleave', function () { //隐藏切换框
  6. $('.seekinput_option').hide();
  7. })
  8. $('.seekinput_option span').eq(1).attr('class', 'on'); //默认
  9. $('.seekinput_search input[qhid="2"]').show(); //默认
  10. $('.seekinput_option span').on('click', function () {
  11. $('.seekinput_search input[type="text"]').hide();
  12. var _html = $(this).html();
  13. $('.seekinput_search span i').html(_html);
  14. $('.seekinput_option').hide();
  15. $(this).attr('class', 'on').siblings().attr('class', '');
  16. var _qhid = $(this).attr('qhid');
  17. $('.seekinput_search input[qhid="' + _qhid + '"]').show(); //选中的搜索输入框
  18. $('.seek_input input[type="button"]').attr('buttonid', _qhid); //选中的 类型 1为 楼盘列表 2为 视频列表
  19. $('.seekinput_search input[type="text"]').val(""); //清空input 内容
  20. })
  21. $('.seek_input input[type="button"]').on('click', function () { //搜索跳转操作
  22. var _buttonid = $(this).attr('buttonid');
  23. var txt = $('.seek_input input[qhid="' + _buttonid + '"]').val();
  24. console.log(_buttonid);
  25. console.log(txt);
  26. if (txt != '') {
  27. switch (_buttonid) {
  28. case '1':
  29. window.open('/house/search?name=' + txt);
  30. break;
  31. case '2':
  32. window.open('/video/videosearch?name=' + txt);
  33. break;
  34. }
  35. }
  36. ;
  37. })
  38. $(document).keydown(function (event) {
  39. if (event.keyCode == 13) {
  40. $('.seek_input input[type="button"]').click();
  41. }
  42. });
  43. // 头部搜索 ----------------------------------------
  44. // 视频看房 ------------------------------------------------------
  45. var videoid = $('.m_videolist_dh .videoclick').eq(0).attr('videoid');
  46. $('.m_videolist_dh .videoclick').eq(0).addClass('on');
  47. ajax_qy();
  48. var being = true;
  49. $('.m_videolist_dh .videoclick').on('mouseover', function () {
  50. if (videoid != $(this).attr('videoid')) {
  51. being = true;
  52. }
  53. videoid = $(this).attr('videoid');
  54. if (being == true) {
  55. ajax_qy();
  56. being = false;
  57. }
  58. $(this).addClass('on').siblings().removeClass('on');
  59. $('.videolist_option p').removeClass('on');
  60. })
  61. $('.videolist_option p').on('mouseover', function () {
  62. if (videoid != $(this).attr('videoid')) {
  63. being = true;
  64. }
  65. videoid = $(this).attr('videoid');
  66. if (being == true) {
  67. ajax_qy();
  68. being = false;
  69. }
  70. $(this).addClass('on').siblings().removeClass('on');
  71. $('.m_videolist_dh .videoclick').removeClass('on');
  72. })
  73. $('.gdclick').on('mousemove', function () {
  74. $('.videolist_option').show();
  75. })
  76. $('.gdclick').on('mouseleave', function () {
  77. $('.videolist_option').hide();
  78. })
  79. function ajax_qy() {
  80. var html = '';
  81. $.ajax({
  82. url: "/video/videolisthouse", // 索取
  83. data: {city: videoid}, //传ID
  84. type: "GET",
  85. dataType: "json",
  86. success: function (data) {//请求成功完成后要执行的方法
  87. var style = $('.m_videolistdata').attr('style');
  88. if (data.code == 200) {
  89. $.each(data.data, function (i, data) {
  90. html += '<li>';
  91. html += '<a target="_blank" href="/video/videodetails/' + data.id + '">';
  92. html += '<div class="m_videolist_img">';
  93. html += '<img class="img" src="' + data.thumb + '" alt="">';
  94. html += '<i class="type">' + data.type + '</i>';
  95. html += '<img class="imgtb" src="./image/videolist_5.png" alt="">';
  96. html += '<div class="text_box">';
  97. html += '<div class="text">';
  98. html += '<p class="Price">约¥' + data.price + '' + data.price_nuit + '</p>';
  99. html += '<p class="sj">' + '(有效期:' + data.time + ')' + '</p>';
  100. html += '<i class="region"><img src="./image/videolist_6.png" alt="">' + data.city_name + '</i>';
  101. html += '</div>';
  102. html += '</div>';
  103. html += '</div>';
  104. html += '<div class="m_videolist_text">';
  105. html += '<em>' + data.name + '</em>';
  106. html += '<p>';
  107. html += '<span>' + data.main_units + '</span>';
  108. html += '<i>|</i>';
  109. html += '<span style="' + style + '">参考收益 ' + data.rent.proportion + '</span>';
  110. html += '</p>';
  111. html += '</div>';
  112. html += '</a>';
  113. html += '</li> ';
  114. });
  115. }
  116. $('.m_videolist ul').html(html);
  117. var _length = data.data.length;
  118. if (_length > 6) {
  119. $('.m_videolist').addClass('on');
  120. } else {
  121. $('.m_videolist').removeClass('on');
  122. }
  123. }
  124. });
  125. }// 视频看房 ------------------------------------------------------
  126. // 玩转海外 ------------------------------------------------------
  127. var _overseasid = $('.m_overseasdh .overseasdhclick').eq(0).attr('overseasid');
  128. $('.m_overseasdh .overseasdhclick').eq(0).addClass('on');
  129. ajax_overseas();
  130. var mbeing = true;
  131. $('.m_overseasdh .overseasdhclick').on('mouseover', function () {
  132. if (_overseasid != $(this).attr('overseasid')) {
  133. mbeing = true;
  134. }
  135. _overseasid = $(this).attr('overseasid');
  136. if (mbeing == true) {
  137. ajax_overseas();
  138. mbeing = false;
  139. }
  140. $(this).addClass('on').siblings().removeClass('on');
  141. $('.overseasdh_option p').removeClass('on');
  142. })
  143. $('.overseasdh_option p').on('mouseover', function () {
  144. if (_overseasid != $(this).attr('overseasid')) {
  145. mbeing = true;
  146. }
  147. _overseasid = $(this).attr('overseasid');
  148. if (mbeing == true) {
  149. ajax_overseas();
  150. mbeing = false;
  151. }
  152. $(this).addClass('on').siblings().removeClass('on');
  153. $('.m_overseasdh .overseasdhclick').removeClass('on');
  154. })
  155. $('.overseasdgj').on('mousemove', function () {
  156. $('.overseasdh_option').show();
  157. })
  158. $('.overseasdgj').on('mouseleave', function () {
  159. $('.overseasdh_option').hide();
  160. })
  161. function ajax_overseas() {
  162. var html = '';
  163. $.ajax({
  164. url: "/video/videolistbottom", // 索取
  165. data: {city: _overseasid}, //传ID
  166. type: "GET",
  167. dataType: "json",
  168. success: function (data) {//请求成功完成后要执行的方法
  169. if (data.code == 200) {
  170. $.each(data.data, function (i, data) {
  171. html += '<li>';
  172. html += '<a target="_blank" href="/video/relevantvideo/' + data.id + '">';
  173. html += '<img src="' + data.thumb + '" alt="">';
  174. html += '<p>';
  175. html += '<span>' + data.title + '</span>';
  176. html += '</p>';
  177. html += '</a>';
  178. html += '</li>';
  179. });
  180. }
  181. $('.m_overseas ul').html(html);
  182. }
  183. });
  184. }// 玩转海外 ------------------------------------------------------
  185. // 直播看房 -------------------------------------------------------
  186. $(function () {
  187. var daId = $('.live_nav span').eq(0).attr('data-id')
  188. var daName = $('.live_nav span').eq(0).attr('data-name')
  189. $('.live_nav span').eq(0).addClass('on');
  190. liveajax(daId);
  191. $('.live_nav').on('click', 'span', function () {
  192. $(this).addClass('on').siblings().removeClass('on');
  193. daId = $(this).attr('data-id');
  194. daName = $(this).attr('data-name');
  195. liveajax(daId);
  196. })
  197. function liveajax(id) {
  198. var html = '';
  199. $.ajax({
  200. url: "/video/livelist", // 索取
  201. data: {name: id}, //传ID
  202. type: "GET",
  203. dataType: "json",
  204. success: function (data) {//请求成功完成后要执行的方法
  205. if (data.code == 200) {
  206. $('.main_li ul').html('');
  207. $.each(data.data, function (i, data) {
  208. switch (data.type) {
  209. case 'all':
  210. // if(id){
  211. // html+= '<li class="swiper-slide ">';
  212. // html+= '<div class="pule_list m_live">';
  213. // html+= '<a href="">';
  214. // html+= '<div class="top_tu">';
  215. // html+= '<div class="text-left">';
  216. // html+= '<i></i>';
  217. // html+= '<span>直播中</span>';
  218. // html+= '<em>20:36</em>';
  219. // html+= '</div>';
  220. // html+= '<p class="bg_img"><img src="/video/image/videolist_4.png" alt=""></p>';
  221. // html+= '</div>';
  222. // html+= '<div class="bottom_text">';
  223. // html+= '<p class="title_m">1帕丁顿商业广场——马尼拉价丁顿商业广场</p>';
  224. // html+= '<p class="text_m c">';
  225. // html+= '<span class="fl"><i><img src="/video/image/xm_tb16.png" alt=""></i><em>海南 文昌</em></span>';
  226. // html+= '<span class="fr"><i><img src="/video/image/xm_tb17.png" alt=""></i><em>156万</em></span>';
  227. // html+= '</p>';
  228. // html+= '</div>';
  229. // html+= '</a>';
  230. // html+= '</div>';
  231. // html+= '</li>';
  232. // }else
  233. if (data.livestate === '回放') {
  234. html += '<li class="swiper-slide">';
  235. html += '<div class="pule_list playback">';
  236. html += '<a href="/video/videodetails/' + data.hid + '?type=live&liveid=' + data.id + '">';
  237. html += '<div class="top_tu">';
  238. html += '<div class="text-left">';
  239. html += '<i></i>';
  240. html += '<span>回放</span>';
  241. html += '<em></em>';
  242. html += '</div>';
  243. html += '<p class="pl_img"><img src="/video/image/xm_tb18.png" alt=""></p>';
  244. html += '<p class="bg_img"><img src="' + data.img + '" alt=""></p>';
  245. html += '</div>';
  246. html += '<div class="bottom_text">';
  247. html += '<p class="title_m">' + data.title + '</p>';
  248. html += '<p class="text_m c">';
  249. html += '<span class="fl"><i><img src="/video/image/xm_tb16.png" alt=""></i><em>' + data.parentCity + ' ' + data.city_name + '</em></span>';
  250. // html+= '<span class="fr"><i><img src="/video/image/xm_tb17.png" alt=""></i><em>156万</em></span>';
  251. html += '</p>';
  252. html += '</div>';
  253. html += '</a>';
  254. html += '</div>';
  255. html += '</li>';
  256. } else if (data.livestate === '预告') {
  257. html += '<li class="swiper-slide">';
  258. html += '<div class="pule_list advance">';
  259. html += '<div class="top_tu">';
  260. html += '<a href="javascript:;" class="live_buttom" data-hid="'+data.hid+'">';
  261. html += '<div class="text-left">';
  262. html += '<i></i>';
  263. html += '<span>预告</span>';
  264. html += '<em>' + data.time + '开播</em>';
  265. html += '</div>';
  266. html += '<p class="pl_img">预约</p>';
  267. html += '<p class="bg_img"><img src="' + data.img + '" alt=""></p>';
  268. html += '</a>';
  269. html += '</div>';
  270. html += '<div class="bottom_text">';
  271. html += '<p class="title_m">' + data.title + '</p>';
  272. html += '<p class="text_m c">';
  273. html += '<span class="fl"><i><img src="/video/image/xm_tb16.png" alt=""></i><em>' + data.parentCity + ' ' + data.city_name + '</em></span>';
  274. // html+= '<span class="fr"><i><img src="/video/image/xm_tb17.png" alt=""></i><em>156万</em></span>';
  275. html += '</p>';
  276. html += '</div>';
  277. html += '</div>';
  278. html += '</li>';
  279. }
  280. break;
  281. case 'advance':
  282. html += '<li class="swiper-slide">';
  283. html += '<div class="pule_list advance">';
  284. html += '<div class="top_tu">';
  285. html += '<a href="javascript:;" class="live_buttom" data-hid="'+data.hid+'">';
  286. html += '<div class="text-left">';
  287. html += '<i></i>';
  288. html += '<span>预告</span>';
  289. html += '<em>' + data.time + '开播</em>';
  290. html += '</div>';
  291. html += '<p class="pl_img">预约</p>';
  292. html += '<p class="bg_img"><img src="' + data.img + '" alt=""></p>';
  293. html += '</a>';
  294. html += '</div>';
  295. html += '<div class="bottom_text">';
  296. html += '<p class="title_m">' + data.title + '</p>';
  297. html += '<p class="text_m c">';
  298. html += '<span class="fl"><i><img src="/video/image/xm_tb16.png" alt=""></i><em>' + data.parentCity + ' ' + data.city_name + '</em></span>';
  299. // html+= '<span class="fr"><i><img src="/video/image/xm_tb17.png" alt=""></i><em>156万</em></span>';
  300. html += '</p>';
  301. html += '</div>';
  302. html += '</div>';
  303. html += '</li>';
  304. break;
  305. }
  306. });
  307. }
  308. $('.main_li ul').html(html);
  309. if (data.data.length > 4) {
  310. var mySwiper1 = new Swiper('.main_li', {
  311. autoplay: 6000, //自动切换
  312. loop: false, //循环
  313. slidesPerView: 4,
  314. observer: true,
  315. spaceBetween: 23,
  316. prevButton: '.swiper-button-prev',
  317. nextButton: '.swiper-button-next',
  318. })
  319. } else {
  320. var mySwiper1 = new Swiper('.main_li', {
  321. autoplay: false, //自动切换
  322. loop: false, //循环
  323. observer: true,
  324. slidesPerView: 4,
  325. spaceBetween: 23,
  326. })
  327. }
  328. }
  329. });
  330. }
  331. // 报名
  332. $('body').on('click', '.live_buttom', function () {
  333. var _hid=$(this).attr('data-hid');
  334. $('.liveBm_box input[name="hid"]').val(_hid)
  335. $('.liveBm').show(30);
  336. $('.liveBm_bg').show();
  337. })
  338. $('.liveBm_bg,.liveBm_gb a').on('click', function () {
  339. $('.liveBm').hide();
  340. $('.liveBm_bg').hide();
  341. $('.liveBm_box input[type="text"]').val('')
  342. })
  343. //报名验证提交的调用 底下报名
  344. PublicAction.AjaxSend({CORID: 'ybm_buttom'/*操作ID*/});
  345. $('.submit_area .ybm_buttom').on('click', function () {
  346. setTimeout(function () {
  347. var _html = $('.alert-container .alert-content').html();
  348. if (_html == '提交成功') {
  349. $('.liveBm').hide();
  350. $('.liveBm_bg').hide();
  351. $('.liveBm_box input[type="text"]').val('');
  352. }
  353. }, 1500)
  354. })
  355. })