123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- $(function(){
-
- zymedia('video',{autoplay: true});
-
- $('.lpname-title a').on('click',function(){
- $('.submit_area input[name="source"]').val('46');
- $('.input_text').attr('placeholder','输入手机号关注更多楼盘动态');
- $('.bmipc').val('立即关注');
- $(".lpapply").animate({top:"0px"},300);
- $('.keep').show();
- $('.m_videobj').show();
- $('.zy_media').hide();
- })
-
- $('.lpapply_gb').on('click',function(){
- shutFn();
- })
- function shutFn(){
- $('.m_videobj').hide();
- $('.zy_media').show();
- $(".lpapply").animate({top:"-100%"},300);
- $('.keep').hide();
- $('.input_text').attr('placeholder','输入手机号码可免费查看全集');
- $('.submit_area input[name="source"]').val('45');
- $('.bmipc').val('查看视频');
- }
-
- $('.input_text').on('focus',function(){
- $(".lpapply").css("top", "-75px");
- $('.input_text').attr('placeholder','');
- $('.input_text').css('text-align','left');
- })
-
- var lpid = $('.zy_media').attr('data-id');
- $('.submit_area input[name="hid"]').val(lpid);
-
- 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");
- }
- }
- });
- })
-
- 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){
- }
- });
- })
- var cookie = {
-
- set:function(key,val,time){
- var date=new Date();
- var expiresDays=time;
- date.setTime(date.getTime()+expiresDays*24*3600*1000);
- document.cookie=key + "=" + val +";expires="+date.toGMTString();
- },
-
- get:function(key){
-
- var getCookie = document.cookie.replace(/[ ]/g,"");
- var arrCookie = getCookie.split(";")
- var tips;
- for(var i=0;i<arrCookie.length;i++){
- var arr=arrCookie[i].split("=");
- if(key==arr[0]){
- tips=arr[1];
- break;
- }
- }
- return tips;
- },
-
- delete:function(key){
- var date = new Date();
- date.setTime(date.getTime()-10000);
- document.cookie = key + "=v; expires =" +date.toGMTString();
- }
- }
-
-
-
-
-
-
- var coki = cookie.get("ID"+lpid);
-
- if(coki != undefined){
- $('#oid').attr('data-off',coki);
- }
-
- var PublicActions = {
-
- "AjaxSend" :function(e,fnEnd){
- var self = this, result;
-
- var oid = e.CORID,
- url = '/enroll/signup',
- type = "POST",
- async = true;
-
- $('.'+ oid).on('click',function(){
- var $than =$(this);
- $than.attr('disabled','disabled');
- var that = $(this).parents('form.submit_area');
- var data = {},
- ControlSwitch = true;
- that.find('input').each(function () {
- var name = $(this).attr('name');
- if(typeof name == 'string'){
- var txt = $(this).val();
- var InputName = $(this).attr('name');
- txt = self.FilterHTMLTag(txt);
-
- if(InputName == 'mobile'){
- if(txt != ""){
- if(! self.PhoneVerification(txt)){
-
- $('body .alert-container').remove();
- self.hint('请输入正确的手机号码!');
- $than.removeAttr('disabled');
- ControlSwitch = false;
- return false;
- }
- }else {
- $('body .alert-container').remove();
- self.hint('请输入正确的手机号码!');
-
- $than.removeAttr('disabled');
- ControlSwitch = false;
- return false;
- }
- }
- data[InputName]=txt;
- }
- })
- if(ControlSwitch){
- $.ajax({
- type:type,
- url:url,
- data:data,
- async:async,
- dataType:'json',
- error : function(request) {
-
-
- $('body .alert-container').remove();
- self.hint('未提交成功!');
-
- $than.removeAttr('disabled');
- },
- success : function(data) {
- $('body .alert-container').remove();
-
- var msg = data.msg;
- if(data.data != null){
- msg = ReturnInfo(data.data);
-
- fnEnd ? fnEnd() : self.hint(msg);
- $than.removeAttr('disabled');
- return ;
- }
-
- fnEnd ? fnEnd() : self.hint(msg);
-
-
- shutFn();
- $than.removeAttr('disabled');
- cookie.set("ID"+lpid,"0",7);
- $('#oid').attr('data-off',"0");
- }
- });
- event.preventDefault();
- return false;
- }
- })
- },
-
-
- "FilterHTMLTag" : function(htmlStr){
- var msg = htmlStr.replace(/<\/?[^>]*>/g, '');
- 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,
- 'closeTime' : 2000,
- })
- },
- }
-
- PublicActions.AjaxSend(
- {
- CORID:'apply_bmipc',
- }
- );
- })
|