$(function(){ // 视频播放插件 zymedia('video',{autoplay: true}); // 点击关注报名 $('.lpname-title a').on('click',function(){ $('.submit_area input[name="source"]').val('138'); $('.input_text').attr('placeholder','输入手机号关注更多楼盘动态'); $('.bmipc').val('立即关注'); $(".lpapply2").animate({top:"160px"},300); $('.keep').show(); }) // 关闭按钮 $('.lpapply2_gb').on('click',function(){ shutFn(); }) function shutFn(){ $(".lpapply2").animate({top:"-100%"},300); $('.keep').hide(); $('.input_text').attr('placeholder','输入手机号码可免费查看全集'); $('.submit_area input[name="source"]').val('138'); $('.bmipc').val('查看视频'); } // 处理报名窗口获取焦点后向上收 $('.input_text').on('focus',function(){ $(".lpapply2").css("top", "60px"); $('.input_text').attr('placeholder',''); $('.input_text').css('text-align','left'); }) // 获取楼盘ID var lpid = $('.zy_media').attr('data-id'); $('.submit_area input[name="hid"]').val(lpid); //修改报名窗口的楼盘ID // 点赞特效 提交 id 及 1 代表点赞,2 代表取消 var objo = new Object(); $('.give').on('click',function(){ var that = $(this); if(that.hasClass('oin')){ that.removeClass('oin') }else { that.addClass('oin'); } objo.id = that.attr('data-id') objo.type = that.attr('data-type') $.ajax({ url:'/video/plays', dataType:"json", type:'GET', data:{id:objo.id,thumbs_up:objo.type}, success:function(data){ if(data.code == 200){ console.log("提交成功!") that.attr('data-type',"1"); //这里的 1 是返回点赞成功或取消的值 } } }); }) // 监听播放按钮,点击播放次数 document.getElementsByClassName("poay")[0].addEventListener("click", function() { var id = $("#oid").attr('data-id'); $.ajax({ url:'/video/plays', dataType:"json", type:'GET', data:{id:id}, success:function(data){ } }); }) /*-------------------------------------------cookie方法封装--------------------------------------------------------------------*/ var cookie = { //设置cookie方法 set:function(key,val,time){ var date=new Date(); //获取当前时间 var expiresDays=time; //将date设置为n天以后的时间 date.setTime(date.getTime()+expiresDays*24*3600*1000); //格式化为cookie识别的时间 document.cookie=key + "=" + val +";expires="+date.toGMTString(); //设置cookie }, //获取cookie方法 get:function(key){ /*获取cookie参数*/ var getCookie = document.cookie.replace(/[ ]/g,""); //获取cookie,并且将获得的cookie格式化,去掉空格字符 var arrCookie = getCookie.split(";") //将获得的cookie以"分号"为标识 将cookie保存到arrCookie的数组中 var tips; //声明变量tips for(var i=0;i]*>/g, ''); //去除HTML Tag return msg; }, /*-----------------------------------------------------------------------------------------*/ /* 电话验证 */ "PhoneVerification" : function (tel) { var pattern = /(13\d|14[57]|15[^4,\D]|17[678]|18\d)\d{8}$|170[059]\d{7}$/, str = tel; return pattern.test(tel); }, /*-----------------------------------------------------------------------------------------*/ /* 提示方法优化 */ "hint":function(txt){ /*调用方法*/ var M = {}; if(M.dialog1){ return M.dialog1.show(); } M.dialog1 = jqueryAlert({ 'content' : txt, //txt 提示内容 'closeTime' : 2000, }) }, } //报名验证及提交的调用 PublicActions.AjaxSend( { CORID:'apply_bmipc', /*操作ID*/ } ); })