jQuery(document).ready(function () { /*澶撮儴鎼滅储*/ if ($(window).width() < 748) { $('.searchBar a').click(function () { if ($(this).attr('id') != 'click') { $(this).attr('id', 'click'); $('.searchBar-m').show(); } else { $(this).removeAttr('id'); $('.searchBar-m').hide(); } }); } else { $('.searchBar a').click(function () { $('.searchBar-m').slideDown(); }); } $('.searchBar-m a').click(function () { $('.searchBar-m').hide(); }); /*寮瑰嚭鍙嬮摼*/ $('.friendlink,.popup-link').hover( function () { $(this).parent().find('ul').show(); }, function () { $(this).parent().find('ul').hide(); } ); $('.bandwidth-item').click(function () { // 绉婚櫎鎵€鏈夐」鐨刟ctive_band绫 $('.bandwidth-item').removeClass('active_band'); // 缁欏綋鍓嶇偣鍑荤殑椤规坊鍔燼ctive_band绫 $(this).addClass('active_band'); // 鑾峰彇褰撳墠椤圭殑绱㈠紩 var index = $(this).index(); // 鏍规嵁涓嶅悓鐨勭储寮曟浛鎹㈣棰戝拰鏍囬 var videoSrc = '/template/pc/skin/images/come_back_n.mp4'; var titleText = '瑙嗛/鍥惧儚鍘嬬缉10-100鍊嶏紝鑺傜渷90%浼犺緭甯﹀'; switch (index) { case 0: videoSrc = '/template/pc/skin/images/come_back_n.mp4'; titleText = '瑙嗛/鍥惧儚鍘嬬缉10-100鍊嶏紝鑺傜渷90%浼犺緭甯﹀'; // 淇敼鏍囬鏂囨湰 break; case 1: videoSrc = '/template/pc/skin/images/can_be_saved_n.mp4'; titleText = '瑙嗛/鍥惧儚鍘嬬缉10-100鍊嶏紝鑺傜渷90%瀛樺偍鎴愭湰'; // 淇敼鏍囬鏂囨湰 break; case 2: videoSrc = '/template/pc/skin/images/can_see_clearly_n.mp4'; titleText = '涓板瘜鐨勮棰戝寮?杩樺師鎶€鏈紝鍚勭鍦烘櫙鍘嬬缉鍚庤棰戦兘鐪嬪緱娓呮'; // 淇敼鏍囬鏂囨湰 break; } // 鏇挎崲瑙嗛鐨剆rc $('#bandvideo source').attr('src', videoSrc); // 閲嶆柊鍔犺浇瑙嗛骞舵挱鏀 $('#bandvideo')[0].load(); $('#bandvideo')[0].play(); // 鏇存柊鏍囬鏂囨湰 $('#handtitle').text(titleText); }); }); //鐧诲綍娉ㄥ唽tab function setTab(name, cursel, n) { for (i = 1; i <= n; i++) { var menu = document.getElementById(name + i); var con = document.getElementById('con_' + name + '_' + i); menu.className = i == cursel ? 'cur' : ''; con.style.display = i == cursel ? 'block' : 'none'; } } function showErrorMsg(msg) { layer.msg(msg, { icon: 5, time: 2000 }); } function showErrorAlert(msg, icon) { if (!icon && icon != 0) { icon = 5; } layer.alert(msg, { icon: icon, title: false, closeBtn: false }); } // 鍔犺浇灞 function layer_loading(msg) { var loading = layer.msg( msg + '...                璇峰嬁鍒锋柊椤甸潰', { icon: 1, time: 3600000, //1灏忔椂鍚庡悗鑷姩鍏抽棴 shade: [0.2], //0.1閫忔槑搴︾殑鐧借壊鑳屾櫙 } ); //loading灞 var index = layer.load(3, { shade: [0.1, '#fff'], //0.1閫忔槑搴︾殑鐧借壊鑳屾櫙 }); return loading; } // $(document).keydown(function (event) { // if (event.keyCode == 13) { // $('form#popup_login_submit input[name=submit]').trigger("click"); // } // }); function ey_fleshVerify() { var src = __eyou_basefile__ + '?m=api&c=Ajax&a=vertify&type=users_login&r=' + Math.floor(Math.random() * 100); $('form#popup_login_submit #imgVerifys').attr('src', src); } function popup_login_submit() { var username = $('form#popup_login_submit input[name=username]'); var password = $('form#popup_login_submit input[name=password]'); if ($.trim(username.val()) == '') { layer.msg('鐢ㄦ埛鍚嶄笉鑳戒负绌猴紒', { time: 1500, icon: 5 }); username.focus(); return false; } if ($.trim(password.val()) == '') { layer.msg('瀵嗙爜涓嶈兘涓虹┖锛?, { time: 1500, icon: 5 }); password.focus(); return false; } $('form#popup_login_submit input[name=referurl]').val(window.location.href); layer_loading('姝e湪澶勭悊'); $.ajax({ // async:false, url: __eyou_basefile__ + '?m=user&c=Users&a=login', data: $('#popup_login_submit').serialize(), type: 'post', dataType: 'json', success: function (res) { if (1 == res.code) { if (5 == res.data.status) { layer.alert( res.msg, { icon: 5, title: false, closeBtn: false }, function () { window.location.href = res.url; } ); } else { window.location.href = res.url; } } else { layer.closeAll(); if ('vertify' == res.data.status) { ey_fleshVerify(); } if (2 == res.data.status) { showErrorAlert(res.msg, 4); } else { layer.msg(res.msg, { icon: 5, time: 1500 }); } } }, error: function (e) { layer.closeAll(); showErrorAlert(e.responseText); }, }); }