function fileSelected(params) { var file = document.getElementById('fileToUpload').files[0]; // 获取选择后的文件 var fd = new FormData(); if (file) { // fd.append("fileToUpload", document.getElementById('fileToUpload').files[0]); } } $('.search_submit').on('click', function (e) { e.stopPropagation(); e.preventDefault(); var kw = $(this).siblings('input').val(); toHeaderSearch(kw); }) $("#keyword").on('keypress', function (e) { var keycode = e.keyCode; var searchName = $(this).val(); if (keycode == '13') { e.preventDefault(); toHeaderSearch(searchName); } }); $(".search-input").on('keypress', function (e) { var keycode = e.keyCode; var searchName = $(this).val(); if (keycode == '13') { e.preventDefault(); toHeaderSearch(searchName); } }); /*$('#user-head-img').mouseover(function (e) { initUserData() var _this = $(this) var timer = null; clearTimeout(timer); timer = setTimeout(function (params) { var clientX = e.clientX; var clientY = e.clientY; if (_this.hasClass('active')) { return; } _this.addClass('active'); $('#user_info_box').css('top', 70 + 'px'); $('#user_info_box').css('right', 10 + 'px'); $('#user_info_box').stop().fadeIn(); }, 300) });*/ $('#user_info_box').hover( function (e) { e.stopPropagation(); e.preventDefault(); $(this).css('dispaly', 'block'); }, function (e) { e.stopPropagation(); e.preventDefault(); $(this).stop().fadeOut(); $('#user-head-img').removeClass('active'); } ); $('#h5-header-more').click(function (e) { e.stopPropagation() $(this).toggleClass('active') var _nav = $('#header-h5-nav') if ($(this).hasClass('active')) { _nav.slideDown() $('.ladder-player-icon').css("z-index", "999") } else { _nav.slideUp() $('.ladder-player-icon').css("z-index", "9999") } }) $('#header-h5-nav-close').click(function (e) { e.stopPropagation() var _nav = $('#header-h5-nav') _nav.slideUp() $('#h5-header-more').removeClass('active') $('.ladder-player-icon').css("z-index", "9999") }) $('.footer.h5 a').click(function (e) { loadInstall() }) $('#header .down').click(function (e) { loadInstall() }) $('.back').click(function (e) { window.location.href = document.referrer ? document.referrer : '/' }) $('.download-btn').click(function (e) { var tmp_opern_id = $('.opern_name').attr('data-oid'); loadInstall() }) $('#header .h5 .login').click(function (e) { $("body").append(''); }); $('#header .h5 .defalut .d-top img.user-vip').click(function (e) { window.location.href = '/bs/user/page'; }) $('#header .h5 .defalut .d-top img.user').click(function (e) { window.location.href = '/bs/user/page'; }) $('.pop-up-close-img').click(function (e) { console.log(333); $('.pop-up').hide(); }) $('.pop-up-look-qupu').click(function (e) { addhit(2000003) loadInstall() return }) function unique(arr) { return Array.from(new Set(arr)) } function toHeaderSearch(_keyword){ var _keyword = _keyword ? _keyword : $('#keyword').val() if(_keyword){ var key = 'kw' var kws = localStorage.getItem(key) kws = kws ? kws.split(',') : [] kws.push(_keyword); kws = unique(kws); if(kws.length > 10){ kws = kws.slice(1); } localStorage.setItem(key, kws); }else{ _keyword = '' } _keyword = _keyword ? encodeURIComponent(_keyword) : '' _keyword = _keyword ? _keyword.trim().replace(/\s/g,"") : '' window.location.href = '/search/0_'+_keyword+'_1.htm'; } function initUserData(){ var _ccgq_userinfo = localStorage.getItem("_ccgq_userinfo") if(_ccgq_userinfo){ var userinfoJson = JSON.parse(_ccgq_userinfo) var time = Date.parse(new Date()) var diff = time - userinfoJson.time if(diff / 1000 <= 300){ // 5分钟 showUserBox(userinfoJson) return } } var indexV002Api = domain_str +'/home/user/indexV002' $.ajax({ type: "GET", contentType: "application/json", url: indexV002Api, dataType: 'json', data: { service_key: identity.getServiceKey(), ccgq_uuid: identity.getCcgqUuid(), service_type: identity.getServiceType(), uid: identity.getUid(), platform: 'web-ccgq', service_type: 'ccgq', userid: identity.getServiceUid() }, success: function(res) { if(res.returnCode == '0000'){ var userinfo = res.datas.userinfo showUserBox(userinfo) // 保存缓存 var time = Date.parse(new Date()) userinfo.time = time var userinfoStr = JSON.stringify(userinfo) localStorage.setItem("_ccgq_userinfo", userinfoStr); } } }); } function showUserBox(userinfo){ if(!userinfo){ return } $('.user_tool .perform').text(userinfo.perform) $('.user_tool .total_follow_num').text(userinfo.total_follow_num) $('.user_tool .total_fans_num').text(userinfo.total_fans_num) if(userinfo.is_vip == 0){ $('.vip_logo_box .tips').text('未开通,立即开通享受更多特权') $('.vip_logo_box .button p').text('立即开通') }else{ var vip_expire_time = userinfo.vip_expire_time var date = vip_expire_time ? vip_expire_time.substring(0,10) : '' var vip_expire_str = '到期时间:' + date $('.vip_logo_box .tips').text(vip_expire_str) $('.vip_logo_box .button p').text('立即续费') } } function icp(){ var html = 'Copyright ©2001- 2021, CCMusic Technology Co. Ltd. All Rights Reserved. 上海凌灼信息科技有限公司' $('footer .content-w>p:eq(1)').html(html) //var html = ' 粤ICP备2021105330号-1|网络文化经营许可证:沪网文(2020)0904-073号'; var html = ' 粤ICP备2021105330号-1|网络文化经营许可证:沪网文(2024) 0970-048号'; $('footer .content-w>p:eq(2)').html(html) if(window.location.pathname == '/'){ var html = '友情链接:虫虫吉他|考拉智能陪练'; $('footer .content-w>p:eq(0)').html(html) $('footer .pc .f-bottom .content-w>p:nth-child(2)').text('Copyright 2023 All rights reserved. 上海凌灼信息科技有限公司') }else{ $('footer .content-w>p:eq(0)').remove() $('footer .pc .f-bottom .content-w>p:nth-child(1)').text('Copyright 2023 All rights reserved. 上海凌灼信息科技有限公司') } } function toBuyVipPage(){ window.open('/bs/user/vip?type=vip'); } function isHaveCoupon(){ var isCoupon = getCookie('ccgq_new_coupon'); if((isCoupon === '' || isCoupon === '0') && identity.getUid()){ var service_uid = identity.getServiceUid(); var service_key = identity.getServiceKey(); var cdb_uid = identity.getCcgqUid(); var service_type = identity.getServiceType(); var uid = identity.getUid(); getMyNewCoupon(service_uid, service_key, cdb_uid, service_type, uid); }else{ if(!identity.getUid() || isCoupon == 1){ topadv(); } } } function yc(){ $('.top-box nav.right ul').append('
  • 原创大赛
  • '); } //yc(); setTimeout(function(){ icp() }, 200); $(function(){ $("#text").powerSlider({delayTime:4000,sliderNum:2}); if(identity.getUid()){ } //isHaveCoupon();//是否有优惠券,用来判断优惠券弹框 if(identity.getUid() && identity.getIsVip()){ $('#header .h5 .login').hide(); $('#header .h5 .user').hide(); $('#header .h5 .user-vip').show(); }else if(identity.getUid() && !identity.getIsVip()){ $('#header .h5 .login').hide(); $('#header .h5 .user-vip').hide(); $('#header .h5 .user').show(); } });