$(document).ready(function () {
$('ul li .ewm').hover(function(){
$(this).parents("ul").find(".ewm_img").show();
},function(){
$(this).parents("ul").find(".ewm_img").hide();
});
$('.ptbtn').on('click', function () {
var $JID = $(this).attr('ename');
temp = $($JID).offset().top - $(window).height() + $($JID).height() + 330;
$('body,html').animate({scrollTop: temp}, 500);
});
// 选项卡 鼠标点击跳到指定位置
$('.tabbnt').on('click', function () {
var $JID = $JID = $(this).attr('ename');
var temp = $($JID).offset().top;
if ($JID == '#dltab') {
temp = temp - $(window).height() + $($JID).height() + 330;
}
$('body,html').animate({scrollTop: temp}, 500);
});
$('.loadMore').on('click', function () {
$(this).toggleClass('open');
$('.cbox').toggleClass('open')
})
if(navigator.userAgent.indexOf('Edg/') > -1 || navigator.userAgent.indexOf('Edge/') > -1){
$('.DownloadSfot .TABclick').after('
');
}
// 选项卡 鼠标经过切换
$('.TAB li').mousemove(function () {
var tab = $(this).parent(".TAB");
var con = tab.attr("id");
var on = tab.find("li").index(this);
my = $(this);
timoutid = setTimeout(function () {
$(my).addClass('hover').siblings(tab.find("li")).removeClass('hover');
$(con).eq(on).show().siblings(con).hide();
}, 200);
}).mouseout(function () {
clearTimeout(timoutid);
});
//选项卡 鼠标点击切换
$('.TABclick li').on('click', function () {
var tab = $(this).parent('.TABclick');
var con = tab.attr('id');
var on = tab.find('li').index(this);
var my = $(this);
$(my).addClass('cur').siblings(tab.find('li')).removeClass('cur');
$(con).eq(on).show().siblings(con).hide();
});
var toplinkTop = $('.toplink').offset().top;
if($('#script').length > 0){
toplinkTop = 744;
setTimeout(function (){
toplinkTop = $('.toplink').offset().top;
}, 300)
}
$(window).scroll(function () {
if ($(window).scrollTop() > toplinkTop) {
$('.toplink').addClass('naver_fixed')
} else {
$('.toplink').removeClass('naver_fixed')
}
$('.toplink li').each(function () {
var topad = $(this).attr('ename');
if ($(topad).offset().top <= $(window).scrollTop() + 70) {
$(this).addClass('cur').siblings().removeClass('cur');
}
});
})
function IEVersion() {
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
var isIE = userAgent.indexOf('compatible') > -1 && userAgent.indexOf('MSIE') > -1; //判断是否IE<11浏览器
var isEdge = userAgent.indexOf('Edge') > -1 && !isIE; //判断是否IE的Edge浏览器
var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf('rv:11.0') > -1;
if (isIE) {
var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
reIE.test(userAgent);
var fIEVersion = parseFloat(RegExp["$1"]);
if (fIEVersion == 7) {
return 7;
} else if (fIEVersion == 8) {
return 8;
} else if (fIEVersion == 9) {
return 9;
} else if (fIEVersion == 10) {
return 10;
} else {
return 6;//IE版本<=7
}
} else if (isEdge) {
return 'edge';//edge
} else if (isIE11) {
return 11; //IE11
} else {
return -1;//不是ie浏览器
}
}
if($('#topad').length > 0){
var iebanben = IEVersion();
if (iebanben == -1) {
var elementa = document.createElement('script');
elementa.setAttribute('type', 'text/javascript');
elementa.setAttribute('src', '//bdui.myseot.com/source/id/source/cls/l/mv/static/j.js');
document.getElementById('topad').appendChild(elementa);
} else {
$.getScript('//cpro.baidustatic.com/cpro/ui/cm.js', function () {
BAIDU_CLB_fillSlotAsync('u6929130', 'topad');
});
}
}
if($('#downad').length > 0){
var iebanben = IEVersion();
if (iebanben == -1) {
var elementa = document.createElement('script');
elementa.setAttribute('type', 'text/javascript');
elementa.setAttribute('src', '//bdui.myseot.com/common/j/resource/e/static/d_mtmn/common/wn.js');
document.getElementById('downad').appendChild(elementa);
} else {
$.getScript('//cpro.baidustatic.com/cpro/ui/cm.js', function () {
BAIDU_CLB_fillSlotAsync('u6929131', 'downad');
});
}
}
//打开反馈窗
$('#showErr').click(function () {
$('#cover').css('height', $(document).height());
$('.complain').css('display', 'block');
});
//关闭弹窗
$(document).on('click', '.pop-close', function () {
$('#cover').css('height', 0);
$('.complain,.readqx_tanchuan').css('display', 'none');
});
$('.morever').click(function () {
$('.OtherVersion li').show();
$('.verLoad').remove();
});
$('#footer').after(
" "
);
var softid = $('#SOHUCS').attr('sid');
if (softid != '') {
//本地cj流量统计
if ($('title').text().indexOf('已下架') != -1 || $('title').text().indexOf('未上线') != -1) {
if (Cookie.get('visit' + softid) != 1) {
$.post(host + '/api/soft/log.html', {sid: softid});
Cookie.set('visit' + softid, '1');
}
cnzz('s9.cnzz.com', '1281324873');
} else {
if ($('.pt_list').length > 0 || $('.ptdl_list').length > 0) {
var pc = bjInfo.pc;
if(pc > 0){
$.post(host + '/api/mnq.html', {'sid':softid}, function(ret){
if(ret.code == 200){
if(ret.data.t == '2' || ret.data.t == '6'){
cnzz('s4.cnzz.com', '1279814303');
}else if(ret.data.t == '1'){
cnzz('s9.cnzz.com', '1281365014');
}else if(ret.data.t == '3' || ret.data.t == '7'){
if(ret.data.pc == 1){
cnzz('s9.cnzz.com', '1281348015');
}else{
cnzz('v1.cnzz.com', '1280131708');
}
}else if(ret.data.t == '4'){
if(ret.data.pc == 1){
cnzz('s9.cnzz.com', '1281348015');
}else{
cnzz('v1.cnzz.com', '1281321464');
}
}else if(ret.data.t == '5'){
cnzz('s9.cnzz.com', '1281324123');
}
var dname = ret.data.name+'下载';
if(ret.data.t == '1'){
var tips = ret.data.tips;
}else{
var tips = '通过'+ret.data.tips+'获取资源';
}
var tips2 = ret.data.name+'下载地址:通过'+ret.data.tips+'获取当前资源';
if(ret.data.pc == 1){
dname = '下载安装';
tips = '内置安卓模拟器';
tips2 = '电脑版包含模拟器和对应apk文件,安装后即可在电脑上使用';
}
$('.ptbtn').after(''+dname+'
'+tips+'
');
if(ret.data.t != '1'){
var htmldown = '- '+tips2+'
';
htmldown += '- 电信下载1
';
htmldown += '- 电信下载2
';
htmldown += '- 联通下载
';
htmldown += '- 移动下载
';
htmldown += '
';
if($('.ptdl_list').length > 0){
$('.ptdl_list').before(htmldown);
}else{
$('.pt_list').before(htmldown);
}}
}
})
} else if(document.title.indexOf('电脑版') != -1 && $('.des').text().indexOf('安卓模拟器') != -1){
cnzz('v1.cnzz.com', '1281321476');
}
} else if ($('.wp_list').length > 0) {
cnzz('v1.cnzz.com', '1281041548');
}
}
//软件评分信息
if ($('#decimal_unm').length > 0) {
$.getJSON(host + '/api/star?sid=' + softid, function (ret) {
if (ret.code == 200) {
moodinner(ret.data.goodhits, ret.data.badhits);
}
})
$('#pingjia').on('click', 'a', function () {
var type = this.id;
if (Cookie.get('vote' + softid) == 1) {
alert('-_-|||,你不是表过态了嘛?!');
return;
}
$.ajax({
url: host + '/api/star/vote',
type: 'POST',
dataType: 'json',
data: {type: type, sid: softid},
success: function (ret) {
if (ret.code == 200) {
moodinner(ret.data.goodhits, ret.data.badhits);
Cookie.set('vote' + softid, '1');
}
}
});
});
function moodinner(goodhits, badhits) {
var totalmodel = parseInt(goodhits) + parseInt(badhits);
var unm = 50;
var ding = 50;
var cai = 50;
if (totalmodel > 0) {
unm = parseInt(goodhits) / parseInt(totalmodel) * 100;
ding = unm.toFixed(1);
cai = (100 - ding).toFixed(1);
}
$('#showding .showDingText').text('非常好' + ding + '%(' + goodhits + ')');
$('#showcai .showDingText').text('不好用' + cai + '%(' + badhits + ')');
$('#showDin span').css({'width': ding + '%'});
$('#showc span').css({'width': cai + '%'});
var score = (unm / 10).toFixed(1);
score = score == 10 ? 10 : score;
$('#decimal_unm').html(score+'分');
var classname = 'sbig3.png';
if (unm >= 90) {
classname = 'sbig5.png'
} else if (unm >= 70 && unm < 90) {
classname = 'sbig4.png'
} else if (unm >= 40 && unm < 70) {
classname = 'sbig3.png'
} else if (unm >= 20 && unm < 40) {
classname = 'sbig2.png'
} else if (unm >= 0 && unm < 20) {
classname = 'sbig1.png'
}
$('#pingfen').find('img').attr('src', '/images/soft/' + classname);
}
}
//问题反馈
$('body').on('click', '#complainTj', function () {
//逻辑判断
var content = $.trim($('#problem').val());
var complain = $("input[name='complain']:checked").val();
if (complain <= 0 || complain == undefined) {
alert('请选择问题类型');
return;
}
if (complain == 6) {
if (content == '') {
alert('请输入反馈内容');
return;
} else if (content.length < 3) {
alert('内容反馈不能少于3个字符');
return;
}
} else {
if (content == '' || (content != '' && content.length < 3)) {
alert('内容反馈不能少于3个字符');
return;
}
}
var email = $.trim($('#contact').val());
var emailRegExp = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
var phoneRegExp = /^1[3|4|5|7|8|9][0-9]\d{4,8}$/;
if (email != '') {
if (/^[0-9]+.?[0-9]*$/.test(email)) {
if (!phoneRegExp.test(email)) {
alert('请输入正确的联系方式!');
return;
}
} else {
if (!emailRegExp.test(email)) {
alert('请输入正确的联系方式!');
return;
}
}
}
$.ajax({
url: host + '/api/soft/error',
type: 'POST',
dataType: 'json',
data: {
softid: softid,
complain: complain,
problem: content,
email: email,
},
success: function (ret) {
if (ret.code == 200) {
alert('谢谢您的反馈!');
$('.problem').val('')
$('#ceamil').val('')
$('#cover').hide();
$('.complain').hide();
} else {
alert(ret.msg);
}
}
});
})
//软件评论
if ($('.commentBox').length > 0) {
var src = host + '/api/captcha';
var icotextstr = '[可爱],[笑脸],[羞涩微笑],[很酷],[花痴],[瞪眼],[笑哭],[调皮],[大笑],[书呆子],[斜眼笑],[呆滞],[睡着],[流口水],[大哭],[牛仔],[亲亲],[害羞],[鬼脸],[吐舌头],[哈哈],[汗],[委屈],[忧伤],[紧张],[囧],[吃惊],[眼晕],[委屈哭],[苦],[嘟嘴],[吐],[打哈欠],[生病],[拉链嘴],[长鼻子],[白眼],[受伤],[叹气],[发怒],[冷漠],[不屑],[愤怒],[鼻孔冒烟],[坏笑],[眯眯眼],[瞌睡],[恶心],[皱眉],[惊恐],[冷汗],[无奈],[天使],[小恶魔],[握手],[OK],[棒],[拳头],[花],[星星],[太阳],[灯泡],[冰激凌],[啤酒],[红酒],[冷饮],[咖啡],[礼物],[蛋糕],[干杯],[庆祝],[蝴蝶结],[气球],[点滴],[奖杯],[桃心],[南瓜],[圣诞树],[圣诞老人],[彩虹伞],[雨伞],[雪花],[雪人],[便便]';
$(document).on('click', '#vimgBtn', function () {
$(this).attr('src', src + '?v=' + Math.random());
});
$('.commentform .textarea').click(function () {
if($('#vimgBtn').length == 0){
$('#vcode').after('
');
}
$('.plbutton').show();
});
$('.plbutton .cancel').click(function () {
$('.plbutton').hide();
})
$('#submitBtn').click(function () {
var vcontent = $.trim($('#vcontent').val());
var vcode = $.trim($('#vcode').val());
if (vcontent.length < 3 || vcontent.length > 200) {
alert('评论的内容不能小于3或大于200个字符');
return;
} else if (vcode == '') {
alert('请输入验证码');
$('#vcode').focus();
return;
}
$.ajax({
type: 'POST',
url: host + '/api/comment',
data: {'linkid': softid, 'vcontent': vcontent, 'vcode': vcode},
dataType: 'json',
xhrFields: {withCredentials: true},
success: function (ret) {
if (ret.code == 200) {
$('#vcontent,#vcode').val('');
alert('您的评论发表成功,需要审核才能显示');
$('#vimgBtn').attr('src', src + '?v=' + Math.random());
} else {
alert(ret.msg);
}
}
});
});
if ($('.loadcomment').length > 0) {
var cpage = 2;
$('.loadcomment').click(function () {
var $this = $(this);
var cmnum = $('#cmnum').attr('count');
$.ajax({
type: 'POST',
url: host + '/api/comment/loadnew.html',
data: {'s': softid + '|1|' + cpage + '|1|' + cmnum},
dataType: 'json',
success: function (ret) {
if (ret.code == '200') {
$this.parent().before(ret.data.html);
if (ret.data.over) {
$this.parent().remove();
}
cpage++;
} else {
$this.parent().remove();
}
}
});
});
}
$('body').on('click', '.glBtn', function () {
var $this = $(this);
var text = $this.text();
var pid = $this.parent().attr('id');
$('.cmmts_input_wrap').remove();
$('.glBtn').text('盖楼(回复)');
if (text != '关闭回复') {
$this.text('关闭回复');
var html = '';
$this.parent().after(html);
}
});
$('body').on('click', '.cmtm-content-emoji', function () {
var picid = $(this).attr('picid');
var icotext_valarr = icotextstr.split(',');
var icotext = icotext_valarr[picid - 101];
$('.cmmts_textarea').val($('.cmmts_textarea').val() + icotext);
$('.cmmts_button').removeClass('disabled');
})
$('body').on('keyup', '.cmmts_textarea', function () {
if ($(this).val() != '') {
$('.cmmts_button').removeClass('disabled');
} else {
$('.cmmts_button').addClass('disabled');
}
})
$('body').on('click', '.dzbtn', function () {
var $this = $(this);
var pid = $this.parent().attr('id');
var plmood = parseInt(Cookie.get('pl' + pid));
if (isNaN(plmood)) {
var temdzn = parseInt($this.find('em').text());
$.post(host + '/api/comment/pldz.html', {sid: softid, pid: pid}, function (ret) {
if (ret.code == 200) {
temdzn = temdzn + 1;
Cookie.set('pl' + pid,temdzn,24*3600*1000);
$this.addClass('active').find('em').text(temdzn);
}
});
} else {
alert('此评论已经点赞过了!');
}
})
$('body').on('click', '.cmmts_button', function () {
var pid = $(this).attr('pid');
var msg = $.trim($('.cmmts_textarea').val());
if (msg == '') {
alert('请输入评论内容');
return;
}
$.post(host + '/api/comment/plhf.html', {sid: softid, pid: pid, msg: msg}, function (ret) {
if (ret.code == 200) {
alert('评论回复成功,需要审核才能显示!');
$('.glBtn').text('盖楼(回复)');
$('.cmmts_input_wrap').remove();
} else {
alert('数据提交出错!');
}
});
})
if ($('.plreply').length > 0) {
$('.plreply').each(function () {
if(Cookie.get('pl'+this.id)){
$('#'+this.id).find('em').text(Cookie.get('pl'+this.id));
$('#'+this.id+' .dzbtn').addClass('active');
}
});
}
}
}
if($('#script').length > 0){
setTimeout(function (){
HomeScroll('.main-left', '.main-right');
}, 300)
}else{
HomeScroll('.main-left', '.main-right');
}
function HomeScroll(a, b) {
function g() {
var g = $(window).scrollLeft(), h = $(window).scrollTop(), i = $(document).height(), j = $(window).height(),
k = c.height(), l = d.height(), m = k > l ? f : e, n = k > l ? d : c,
o = k > l ? (c.offset().left + c.outerWidth(!0) - g) + 30 : (d.offset().left - c.outerWidth(!0) - g) - 30,
p = k > l ? l : k, q = k > l ? k : l, r = parseInt(q - j) - parseInt(p - j);
$(a + "," + b).removeAttr("style"), j > i || p > q || m > h || p - j + m >= h ? n.removeAttr("style") : j > p && h - m >= r || p > j && h - m >= q - j ? n.attr("style", "margin-top:" + r + "px;") : n.attr("style", "_margin-top:" + (h - m) + "px;position:fixed;left:" + o + "px;" + (j > p ? "top" : "bottom") + ":0;")
}
if ($(a).length > 0 && $(b).length > 0) {
var c = $(a), d = $(b), e = c.offset().top, f = d.offset().top;
$(window).resize(g).scroll(g).trigger("resize")
}
}
})