lpindex.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. $(function () {
  2. // 房贷计算 下拉框
  3. $(".lst_box").on({
  4. mouseover: function () {
  5. $(this).children("i").addClass('cur')
  6. $(this).children(".lst_cun").show();
  7. },
  8. mouseout: function () {
  9. $(this).children("i").removeClass('cur')
  10. $(this).children(".lst_cun").hide();
  11. }
  12. });
  13. })
  14. // v2 轮播
  15. $(document).ready(function(){
  16. var index=0;
  17. var length=$(".js_yv2_banner_image ul li").length;
  18. var i=1;
  19. //关键函数:通过控制i ,来显示图片
  20. function showImg(i){
  21. $(".js_yv2_banner_image ul li").eq(i).stop(true,true).fadeIn(800).siblings("li").hide();
  22. $(".js_small_list ul li").eq(i).addClass("on").siblings().removeClass("on");
  23. $('body .video_puic').find('video').trigger("pause");
  24. $('body .video_puic').find('video').removeClass('play');
  25. $('body .video_puic').find('video').addClass('pause');
  26. }
  27. function slideNext(){
  28. if(index >= 0 && index < length-1) {
  29. ++index;
  30. showImg(index);
  31. }else{
  32. showImg(0);
  33. index=0;
  34. aniPx=(length-5)*132+'px'; //所有图片数 - 可见图片数 * 每张的距离 = 最后一张滚动到第一张的距离
  35. $(".js_small_list ul li").animate({ "left": "+="+aniPx },200);
  36. i=1;
  37. return false;
  38. }
  39. if(i<0 || i>length-5) {return false;}
  40. $(".js_small_list ul li").animate({ "left": "-=132px" },200)
  41. i++;
  42. }
  43. function slideFront(){
  44. if(index >= 1 ) {
  45. --index;
  46. showImg(index);
  47. }
  48. if(i<2 || i>length+5) {return false;}
  49. $(".js_small_list ul li").animate({ "left": "+=132px" },200)
  50. i--;
  51. }
  52. $(".js_yv2_banner_image ul li").eq(0).show();
  53. $(".js_small_list ul li").eq(0).addClass("on");
  54. $(".js_small_list ul").width((length*132)+'px')
  55. $(".js_left_btn").click(function(){
  56. slideFront();
  57. })
  58. $(".js_right_btn").click(function(){
  59. slideNext();
  60. })
  61. $(".js_small_list ul li").click(function(){
  62. index = $(".js_small_list ul li").index(this);
  63. showImg(index);
  64. });
  65. var randomX = 0;
  66. var randomY = 14;
  67. var randvalue = parseInt(Math.random() * (randomX - randomY + 1) + randomY);
  68. $('.yv2Home_zx_r em img').attr('src','/overseas/img/v2image/tx_ico'+randvalue+'.png');
  69. })
  70. // 楼盘首页 户型 ajax
  71. $(function () {
  72. var typeId=$('.js_yv2_Homehx_nav a').eq(0).attr('data-type')
  73. var typeHid=$('.js_yv2_Homehx_nav a').eq(0).attr('data-hid')
  74. $('.js_yv2_Homehx_nav a').eq(0).addClass('on').siblings().removeAttr('on')
  75. typeList(typeId,typeHid)
  76. $('.js_yv2_Homehx_nav a').on('click',function(){
  77. typeId=$(this).attr('data-type')
  78. typeHid=$(this).attr('data-hid')
  79. $(this).addClass('on').siblings().removeClass('on');
  80. typeList(typeId,typeHid)
  81. })
  82. })
  83. function typeList(typeid,hid){
  84. $.post('/json/housetypeall', {hid: hid, type_id: typeid, csrf_token_f: csrfToken}, function (data) {
  85. var echodataUl = $('.js_yv2_Homehx_list ul');
  86. echodataUl.html('');
  87. var data = data.data;
  88. var html = '';
  89. $.each(data, function (key, val) {
  90. if(key<3){
  91. var randomX = 0;
  92. var randomY = 14;
  93. var randvalue = parseInt(Math.random() * (randomX - randomY + 1) + randomY);
  94. html += '<li>';
  95. html += '<div class="left_main">';
  96. html += '<a href="/house/typedetails/'+val.hid+'?daid='+key+'&type_id='+val.type_id+'">';
  97. html += '<div class="left_img">';
  98. html += '<img src="'+val.img+'" alt="">';
  99. if (val.type_id=='vr') {
  100. html += '<div class="vvid_pic_ico vr-animation-forever"></div>';
  101. };
  102. html += '</div>';
  103. html += '<div class="right_text">';
  104. html += '<p class="hx_m">'+val.title+'</p>';
  105. html += '<p class="js_m">'+val.indoor_info+'</p>';
  106. html += '<p class="mj_m">(建筑面积) '+val.area+'</p>';
  107. html += '<p class="style_m">';
  108. html += '<i>户型方正</i>';
  109. html += '<i>南北通透</i>';
  110. html += '</p>';
  111. html += '</div>';
  112. html += '</a>';
  113. html += '</div>';
  114. html += '<div class="hx_hqbj">';
  115. html += '<a href="javascript:;" class="pic_jjtz" data-buttom="立即获取报价" data-title="户型报价" data-hid="'+val.hid+'" data-text="提交号码可获取户型报价、首付、月供 详细报价单。" data-source="128">';
  116. html += '<p class="ico"><img src="/overseas/img/v2image/tx_ico'+randvalue+'.png" alt=""></p>';
  117. html += '<p class="text_m">户型报价</p>';
  118. html += '</a>';
  119. html += '</div>';
  120. html += '</li>';
  121. }
  122. })
  123. echodataUl.html(html);
  124. })
  125. }
  126. /* v2 新增 悬挂扫码 */
  127. $('.js_honeganbi').on('click',function(){
  128. $('.js_yv2_saomaBox').hide();
  129. })
  130. var _liUrl=$('#yv2_saomaBox').attr('src');
  131. var qrcode = new QRCode(document.getElementById('yv2_saomaBox'), {
  132. width : 122, //设置宽高
  133. height : 122,
  134. });
  135. qrcode.makeCode(_liUrl);
  136. /*-----------------------------------------百度地图-----------------------------------------------------------*/
  137. // 楼盘首页地图
  138. $(function () {
  139. //获取周边配套
  140. $('.y_lpmap_lsit ul li').on('click', function () {
  141. $(this).addClass('on').siblings().removeClass('on');
  142. var _data = $(this).find('span').text(); //选择中的内容
  143. var _longitude = $('#y_lpmap').attr('data-jwd'); //获取经纬度
  144. var pintx = _longitude.split(',')[0];
  145. var pinty = _longitude.split(',')[1];
  146. _longitude = new BMap.Point(pintx, pinty);
  147. doSearch(_data, _longitude);//调用地图弹窗
  148. })
  149. });
  150. // 百度地图API功能
  151. var map = new BMap.Map("y_lpmap");
  152. var _lTude = $('#y_lpmap').attr('data-jwd'); //获取经纬度
  153. var _lJg = $('#y_lpmap').attr('data-jg'); //获取楼盘价格
  154. var _lTitle = $('#y_lpmap').attr('data-title'); //获取楼盘标题
  155. var pintx = _lTude.split(',')[0];
  156. var pinty = _lTude.split(',')[1];
  157. _lTude = new BMap.Point(pintx, pinty);
  158. map.centerAndZoom(_lTude, 15);
  159. map.enableScrollWheelZoom(); //启用滚轮放大缩小,默认禁用
  160. // 复杂的自定义覆盖物
  161. function ComplexCustomOverlay(_lTude, text, mouseoverText) {
  162. this._point = _lTude;
  163. this._text = text;
  164. this._overText = mouseoverText;
  165. }
  166. ComplexCustomOverlay.prototype = new BMap.Overlay();
  167. ComplexCustomOverlay.prototype.initialize = function (map) {
  168. this._map = map;
  169. var div = this._div = document.createElement("div");
  170. div.style.position = "absolute";
  171. div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
  172. div.style.backgroundColor = "#EE5D5B";
  173. div.style.border = "1px solid #BC3B3A";
  174. div.style.color = "white";
  175. div.style.height = "12px";
  176. div.style.padding = "2px";
  177. div.style.lineHeight = "10px";
  178. div.style.whiteSpace = "nowrap";
  179. div.style.MozUserSelect = "none";
  180. div.style.fontSize = "12px"
  181. var span = this._span = document.createElement("span");
  182. div.appendChild(span);
  183. span.appendChild(document.createTextNode(this._text));
  184. var that = this;
  185. var arrow = this._arrow = document.createElement("div");
  186. arrow.style.background = "url(http://map.baidu.com/fwmap/upload/r/map/fwmap/static/house/images/label.png) no-repeat";
  187. arrow.style.position = "absolute";
  188. arrow.style.width = "11px";
  189. arrow.style.height = "10px";
  190. arrow.style.top = "16px";
  191. arrow.style.left = "10px";
  192. arrow.style.overflow = "hidden";
  193. div.appendChild(arrow);
  194. div.onmouseover = function () {
  195. this.style.backgroundColor = "#6BADCA";
  196. this.style.borderColor = "#3487ab";
  197. this.getElementsByTagName("span")[0].innerHTML = that._overText;
  198. arrow.style.backgroundPosition = "0px -20px";
  199. }
  200. div.onmouseout = function () {
  201. this.style.backgroundColor = "#EE5D5B";
  202. this.style.borderColor = "#BC3B3A";
  203. this.getElementsByTagName("span")[0].innerHTML = that._text;
  204. arrow.style.backgroundPosition = "0px 0px";
  205. }
  206. map.getPanes().labelPane.appendChild(div);
  207. return div;
  208. }
  209. ComplexCustomOverlay.prototype.draw = function () {
  210. var map = this._map;
  211. var pixel = map.pointToOverlayPixel(this._point);
  212. this._div.style.left = pixel.x - parseInt(this._arrow.style.left) + "px";
  213. this._div.style.top = pixel.y - 30 + "px";
  214. }
  215. var txt = _lTitle, mouseoverTxt = txt + " " + _lJg;
  216. var myCompOverlay = new ComplexCustomOverlay(_lTude, _lTitle, mouseoverTxt);
  217. map.addOverlay(myCompOverlay);
  218. //map展现结果的地图实例
  219. //autoViewport检索结束后是否自动调整地图视野,false 不调整地图视野
  220. var local = new BMap.LocalSearch(map, {renderOptions: {map: map, autoViewport: true}});
  221. //地址检索
  222. function doSearch(Odata, Opoint) {
  223. var address = Odata;
  224. local.searchNearby(address, Opoint);
  225. }
  226. /*----------------------------------地图END--------------------------------------------*/
  227. // 价格走势
  228. var dom = document.getElementById("container");
  229. var myChart = echarts.init(dom);
  230. var app = {};
  231. var dataText = $('.js_y_lptitle h2').text();
  232. var dataYear = [];
  233. var dataPrice = [];
  234. var oid = $('.js_y_lptitle').attr('data-id'); //获取楼盘ID
  235. $.ajax({
  236. type: 'POST',
  237. url: '/json/houseprice',
  238. data: {id: oid, csrf_token_f: csrfToken},
  239. async: false,
  240. dataType: 'json',
  241. success: function (data) {
  242. if (data.code == 200) {
  243. // console.log(data)
  244. var data = data.data;
  245. dataPrice = data.data;
  246. dataYear = data.categories;
  247. } else {
  248. $('.y_lptrend').hide();
  249. }
  250. }
  251. })
  252. // console.log(dataPrice)
  253. // console.log(dataYear)
  254. option = null;
  255. option = {
  256. tooltip: {
  257. trigger: 'axis'
  258. },
  259. legend: {
  260. // data:['碧桂园房价','陵水房价'],
  261. data: [dataText], //楼盘名称
  262. right: '50px',
  263. },
  264. xAxis: {
  265. type: 'category',
  266. boundaryGap: false,
  267. data: dataYear //日期
  268. },
  269. yAxis: {
  270. type: 'value',
  271. axisLabel: {
  272. formatter: '{value}元/㎡'
  273. }
  274. },
  275. series: [
  276. {
  277. name: dataText, //楼盘名称
  278. type: 'line',
  279. data: dataPrice, //价格
  280. color: ['#00aeff'],
  281. symbolSize: 8,
  282. itemStyle: {
  283. normal: {
  284. color: '#00aeff',
  285. borderColor: '#00aeff',
  286. }
  287. },
  288. }
  289. // {
  290. // name:'碧桂园房价',
  291. // type:'line',
  292. // data:[4000, 6000, 7500, 9000, 12000, 1490, 20000],
  293. // color:['#ffa800'],
  294. // symbolSize:8,
  295. // itemStyle:{
  296. // normal:{
  297. // color:'#ffa800',
  298. // borderColor:'#ffa800',
  299. // }
  300. // },
  301. // }
  302. ]
  303. };
  304. if (option && typeof option === "object") {
  305. myChart.setOption(option, true);
  306. }
  307. /*---------------------------------房价走趋 END-----------------------------------------*/
  308. $(function () {
  309. var xc_leng = $('.y_lpphoto_list ul li').length;
  310. if (xc_leng <= 4) {
  311. $('.js_prev,.js_next').hide();
  312. }
  313. })
  314. document.addEventListener('DOMContentLoaded', function () {
  315. var multiSlides = document.querySelector('.js_multislides');
  316. lory(multiSlides, {
  317. // infinite: 1, //设置循环分页
  318. slidesToScroll: 1
  319. });
  320. });
  321. //收藏本站
  322. $(function () {
  323. $('.y_lpguanzhu a').on('click', function () {
  324. AddFavorite('我的网站', location.href);
  325. $(this).find('i img').attr('src', '/image/ico_10.png');
  326. })
  327. })
  328. function AddFavorite(title, url) {
  329. try {
  330. window.external.addFavorite(url, title);
  331. } catch (e) {
  332. try {
  333. window.sidebar.addPanel(title, url, "");
  334. } catch (e) {
  335. alert("抱歉,您所使用的浏览器无法完成此操作。\n\n加入收藏失败,请使用Ctrl+D进行添加");
  336. }
  337. }
  338. }
  339. // 楼盘首页 推荐同价位楼盘
  340. $(function () {
  341. $('#y_lpdtpc_nav2 ul li').eq(0).click();
  342. //报名验证及提交的调用
  343. PublicAction.AjaxSend(
  344. {
  345. CORID: 'apply_submit', /*操作ID*/
  346. }
  347. );
  348. //报名验证及提交的调用
  349. PublicAction.AjaxSend(
  350. {
  351. CORID: 'js_homeButtom', /*操作ID*/
  352. }
  353. );
  354. })
  355. /*楼盘首页 推荐同价位楼盘*/
  356. $('#y_lpdtpc_nav2 ul li').click(function () {
  357. $(this).addClass('on').siblings().removeClass('on');
  358. var dataid = $(this).attr('data-id');
  359. var type = $(this).attr('name');
  360. var valdata = $(this).attr('valdata');
  361. $.post('/json/tall', {type: type, csrf_token_f: csrfToken, content: valdata}, function (data) {
  362. var echodataUl = $('.y_lpdtpc_list ul');
  363. echodataUl.html('');
  364. var data = data.data;
  365. var html = '';
  366. $.each(data, function (key, val) {
  367. var pic = val.sale_price;
  368. pic = '<i style="color:#ccc;font-size:12px;display:inline-block;margin-right:5px;">参考价格</i>' + val.sale_price + val.price_unit;
  369. if (val.sale_price == 0 || val.sale_price == null || val.sale_price == '') {
  370. pic = '待定';
  371. }
  372. html = '<li>';
  373. html += '<div class="y_love_list_main">';
  374. html += '<div class="y_tu">';
  375. html += '<a target="_blank" href="/house/' + val.id + '"><img src="' + val.thumb + '" alt=""></a>';
  376. html += '</div>';
  377. html += '<div class="y_text">';
  378. html += '<h2><a target="_blank" href="/house/' + val.id + '">' + val.name + '</a><i>[' + val.city_name + ']</i></h2>';
  379. html += '<p class="y_pic">';
  380. html += '<span>' + pic + '</span>';
  381. html += '<i class="rq" style="color:#c2bfbf;font-size:12px;margin-top:2px;display: block;">有效期至:' + v3Time + '</i>';
  382. html += '</p>';
  383. html += '</div>';
  384. html += '</div>';
  385. html += '</li>';
  386. echodataUl.append(html);
  387. })
  388. })
  389. });
  390. // $('.w-commonality .rq').html('(参考有效期:'+htmltime+')'); //有效期 调用方法在public.js
  391. listvideo();
  392. function listvideo() {
  393. $('.js_yv2_banner_image ul').on('click', '.video_puic', function () {
  394. if ($(this).find('video').hasClass('pause')) {
  395. $(this).find('p.video_puic_img').hide();
  396. $(this).find('p.video_puic_ico').hide();
  397. $(this).find('video').trigger("play");
  398. $(this).find('video').removeClass('pause');
  399. $(this).find('video').addClass('play');
  400. } else {
  401. $(this).find('video').trigger("pause");
  402. $(this).find('video').removeClass('play');
  403. $(this).find('video').addClass('pause');
  404. }
  405. })
  406. }
  407. $('.small_list ul li,.small_box .left_btn,.small_box .right_btn').on('click', function () {
  408. $('.js_yv2_banner_image ul .video_puic').find('p.video_puic_img').show();
  409. $('.js_yv2_banner_image ul .video_puic').find('p.video_puic_ico').show();
  410. $('.js_yv2_banner_image ul .video_puic video').trigger("pause");
  411. $('.js_yv2_banner_image ul .video_puic video').removeClass('play');
  412. $('.js_yv2_banner_image ul .video_puic video').addClass('pause');
  413. })
  414. //视频播放js
  415. $(function(){
  416. /*-----------------------------------音频--------------------------------------------*/
  417. // 音频播放
  418. var audio = document.getElementById("lplive_vid");
  419. var btn = document.getElementById("lplive");
  420. var musitime= 0;
  421. var cubicle = "true";
  422. if (btn) {
  423. btn.onclick = function () {
  424. var domeid=$('#sxbmdata').attr('data-id')
  425. if (domeid!='' && domeid!=null ) {
  426. $('#sxbmdata').attr('data-type','false')
  427. $('#lplive').attr('data-boole','false')
  428. $('.m_videobj').hide();
  429. $('.m_video_img').hide();
  430. $('#lplive_vid').show();
  431. audio.play();
  432. }else{
  433. $('#sxbmdata').attr('data-type','true')
  434. $('#lplive').attr('data-boole','true')
  435. $('.m_videobj').hide();
  436. $('.m_video_img').hide();
  437. if(musitime >= 600 && cubicle == "true"){
  438. AudioWind_live(); //视频报名窗口
  439. return false;
  440. }
  441. audio.play();
  442. watchMusicTime_vid()
  443. }
  444. }
  445. };
  446. // // 获取全部语音
  447. $('.y_reduced2_bg , .y_reduced2_gb a').on('click',function(){
  448. $('.y_reduced2').hide();
  449. $('.m_form_button2').removeClass('wcontrol')
  450. $('.y_reduced2_bg').hide();
  451. $('.m_videobj').show();
  452. $('.m_video_img').show();
  453. $('#lplive_vid').show();
  454. })
  455. // // 语音讲房报名窗口
  456. function AudioWind_live(){
  457. $('.y_reduced2').show();
  458. $('.y_reduced2_bg').show();
  459. audio.pause()
  460. }
  461. //监听音乐实时播放的时间
  462. function watchMusicTime_vid(){
  463. console.log(1)
  464. let _this = this;
  465. //监听播放时间
  466. // let musicDom = document.getElementsByTagName('audio')[0];//获取Audio的DOM节点
  467. let musicDom = audio;//获取Audio的DOM节点
  468. //使用事件监听方式捕捉事件
  469. musicDom.addEventListener("timeupdate",function(){//监听音频播放的实时时间事件
  470. cubicle = $('#lplive').attr('data-boole'); //2019-11-20 把获取报名成功后,可以继续播放的状态放置这里
  471. // console.log(musicDom.duration)//播放时间
  472. let timeDisplay;
  473. //用秒数来显示当前播放进度
  474. timeDisplay = Math.floor(musicDom.currentTime);//获取实时时间
  475. musitime = timeDisplay;
  476. // console.log(timeDisplay)
  477. // 处理 10秒内试听
  478. // console.log(cubicle)
  479. if(timeDisplay >= 600 && cubicle == "true"){
  480. audio.pause();
  481. AudioWind_live(); //视频报名窗口
  482. }
  483. //处理时间
  484. //分钟
  485. let minute = timeDisplay / 60;
  486. let minutes = parseInt(minute);
  487. if (minutes < 10) {
  488. minutes = "0" + minutes;
  489. }
  490. //秒
  491. let second = timeDisplay % 60;
  492. let seconds = Math.round(second);
  493. if (seconds < 10) {
  494. seconds = "0" + seconds;
  495. }
  496. let shun= minutes+":"+seconds;//将实时时间存储到vuex中
  497. // console.log(shun)
  498. // console.log(_this.$store.state.realMusicTime);
  499. },false);
  500. }
  501. /*-------------------------------------------------------------------------------*/
  502. // 获取验证码
  503. var urlstr = window.location.href;
  504. var matchdata = urlstr.match(/\.com(\/\w+)/)[1];
  505. var phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/;//手机号正则
  506. var count = 60; //间隔函数,1秒执行
  507. var InterValObj1; //timer变量,控制时间
  508. var curCount1;//当前剩余秒数
  509. $('#btnSendCode1').on('click',function(){
  510. sendMessage1();
  511. })
  512. // 提交
  513. $('.m_reduced_r2 #buttom_m').on('click',function(){
  514. var phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/;//手机号正则
  515. var phone = $.trim($('#phone1').val());
  516. var code = $.trim($('#code').val());
  517. if (!phoneReg.test(phone)) {
  518. // alert(" 请输入有效的手机号码");
  519. $('.zhanghao b.hint-text').show();
  520. $('#phone1').addClass('on');
  521. return false;
  522. }else{
  523. $('.zhanghao b.hint-text').hide();
  524. $('#phone1').removeClass('on');
  525. }
  526. if (code!='') {
  527. $('.mima b.hint-text').hide();
  528. $('#code').removeClass('on');
  529. }else{
  530. // alert(data.msg);
  531. $('.mima b.hint-text').show();
  532. $('#code').addClass('on');
  533. return false;
  534. }
  535. // alert(password);
  536. $.ajax({
  537. type: "POST",
  538. url: matchdata+"/public/checkcode",
  539. data: {mobile:phone,code:code,csrf_token_f: csrfToken},
  540. dataType: "json",
  541. success:function(data){
  542. if(data.code == 200) {
  543. // loginAlert('报名成功!',2000)
  544. $('.y_reduced2').hide();
  545. $('.y_reduced2_bg').hide();
  546. $('#sxbmdata').attr('data-type','false');
  547. $('#sxbmdata').attr('data-id',phone);
  548. $('#lplive').attr('data-boole','false');
  549. $('.m_videobj').hide();
  550. $('#lplive_vid').show();
  551. $('.m_video_img').hide();
  552. audio.play();
  553. $('.m_reduced_r2 .buttom_m2').click();
  554. }else{
  555. loginAlert(data.msg,2000)
  556. return false;
  557. }
  558. }
  559. });
  560. PublicAction.AjaxSend(
  561. {
  562. CORID:'buttom_m2', /*操作ID*/
  563. }
  564. );
  565. })
  566. /*第一*/
  567. function sendMessage1() {
  568. curCount1 = count;
  569. var phone = $.trim($('#phone1').val());
  570. if (!phoneReg.test(phone)) {
  571. $('.zhanghao b.hint-text').show();
  572. $('#phone1').addClass('on');
  573. return false;
  574. }else{
  575. $('.zhanghao b.hint-text').hide();
  576. $('#phone1').removeClass('on');
  577. }
  578. //设置button效果,开始计时
  579. $("#btnSendCode1").attr("disabled", "true");
  580. $("#btnSendCode1").val( '('+ curCount1 + ")秒再获取");
  581. InterValObj1 = window.setInterval(SetRemainTime1, 1000); //启动计时器,1秒执行一次
  582. //向后台发送处理数据
  583. $.ajax({
  584. type: "POST",
  585. url: matchdata+"/public/sendcode",
  586. data: {mobilephone:phone,csrf_token_f: csrfToken},
  587. dataType: "json",
  588. success:function(data){
  589. // console.log(data.code);
  590. if(data.code == 200){
  591. //短信成功弹窗
  592. loginAlert(data.msg,2000)
  593. $('.mima b.hint-text').hide();
  594. $('#code').removeClass('on');
  595. }else{
  596. loginAlert(data.msg+',请重新发送!',2000)
  597. curCount1 = 0;
  598. window.clearInterval(InterValObj1);//停止计时器
  599. $("#btnSendCode1").removeAttr("disabled");//启用按钮
  600. $("#btnSendCode1").val("重新发送");
  601. $('.mima b.hint-text').show();
  602. $('#code').addClass('on');
  603. return false;
  604. }
  605. }
  606. });
  607. }
  608. function SetRemainTime1() {
  609. if (curCount1 == 0) {
  610. window.clearInterval(InterValObj1);//停止计时器
  611. $("#btnSendCode1").removeAttr("disabled");//启用按钮
  612. $("#btnSendCode1").val("重新发送");
  613. $("#btnSendCode1").css('color','#2DB1FB')
  614. }else {
  615. curCount1--;
  616. $("#btnSendCode1").val( '('+ curCount1 + ")秒再获取");
  617. $("#btnSendCode1").css('color','#999')
  618. }
  619. }
  620. function loginAlert(txt,time){
  621. /*调用方法*/
  622. var M = {};
  623. if(M.dialog1){
  624. return M.dialog1.show();
  625. }
  626. M.dialog1 = jqueryAlert({
  627. 'content' : txt, //txt 提示内容
  628. 'closeTime' : time,
  629. })
  630. }
  631. })