熊猫办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

467 lines
13 KiB

//qq微信登录
function openLogin(type){
if( $("input[name='yonghuxieyi']").is(':checked') == false ){
alert('未勾选用户协议哦!');
return false;
}
var iWidth = 800;
var iHeight = 600;
var iTop = (window.screen.availHeight - 30 - iHeight) / 2;
var iLeft = (window.screen.availWidth - 10 - iWidth) / 2;
window.open("/e/memberconnect/?apptype=" + type,"","width="+iWidth+", height="+iHeight+", top="+iTop+", left="+iLeft);
}
//登录注册
function login(){
// $('#mengcheng').show();
// $('#login').show();
window.open("/e/member/register/index.php?tobind=0&groupid=1");
}
//弹窗
function tan(status){
if(status==3){
$('#mengcheng').show();
$('.addvip').show();
return false;
}
if(status==4){
$('#mengcheng').show();
$('.upvip').show();
return false;
}
if(status==5){
$('.code').show();
$('#mengcheng').show();
return false;
}
if(status==7){
$('.code').show();
$('.get-again').html('验证码有误,请重新输入').css('color','red');
$('#mengcheng').show();
return false;
}
if(status==6){
alert('系统繁忙,请过5分钟后再试!');
return false;
}
if(status==10){
alert('系统检测到下载异常,请联系客服QQ:2148212解决!');
return false;
}
if(status==100){
$('.upredpacket').show();
$('#mengcheng').show();
return false;
}
}
function pvload()
{
var enddie=new Date();
var endTime=enddie.getTime();
var loadtime =(endTime-startTime)/1000;
if(exetime>0 && code>0){
var url = '/api/Stats/time';
$.ajax({
type: "GET",
url: url,
data:{'code':code,'exetime':exetime,'loadtime':loadtime,'uid':uid,'click':click_num},
jsonp: "callback",
dataType: "jsonp",
success: function(data){}
});
}
}
$(function(){
$(".lazy").lazyload({
effect: "fadeIn",
threshold :350
});
$(".lazy-nodelay").lazyload();
$('.be-vip').click(function(){
$('.addvip').hide();
$('#mengcheng').hide();
});
//验证码相关
$('.code .get-again').click(function(){
var timestamp = new Date().getTime();
$("#yanzhengma").attr('src',$('#yanzhengma').attr('src') + '?' +timestamp );
});
$('.y-close').click(function(){
$('.yhj').hide();
$(this).parent().hide();
var url = '/api/activity/close';
$.getJSON(url,function(data){});
});
$('#yanzhengma').click(function(){
var timestamp = new Date().getTime();
$(this).attr('src',$(this).attr('src') + '?' +timestamp );
});
//弹窗注册相关
$('.close').click(function(){
$(this).parent().hide();
$('#mengcheng').hide();
});
$('.regist,.regist-lg').click(function(){
var name = $(this).attr('name');
$('.loginname').html(name);
window.open("/e/member/login/");
});
//意见反馈
$('.advice').click(function(){
if(!isLogin){
login();
return false;
}
$('#mengcheng').show();
$('.user-advice').show();
});
//搜索相关
function search(){
var input = 'search' == $(this).attr('name') ? $(this) : $(this).prev().find(':input[name="search"]');
var q = $.trim(input.val()),t = $('.search-btn').attr('key-type');
var cid = $('.search-btn').attr('cid');
if(q == ''){
window.location.href='/'
return false;
}
window.location.href='/e/action/ListInfo.php?ph=1&classid='+cid+'&title='+q;
}
$('.search-btn').on('click', search);
$('#dropdown-box').on('mousedown', '.tips-item', function(){
var k = $('#keyword');
k.val($(this).find('.tips-keyword').text());
search.call(k);
});
$('#dropdown-box-float').on('mousedown', '.tips-item', function(){
var k = $('#keyword-float');
k.val($(this).find('.tips-keyword').text());
search.call(k);
});
function renderTips(d){
c = d.list.length;
if (c == 0) {
this.html('').hide();
return false;
}
var h = '<ul class="sotips tips-count" data-length="'+c+'" data-index="'+(c+1)+'">';
$.each(d.list, function(i, j){
h += '<li class="tips-item">';
if (d.rank) {
n = i + 1;
h += '<span class="bc';
if (i < 3) {
h += n;
}
h += '">' + n + '</span>';
} else {
h += '<i class="tip-indent"></i>';
}
h += '<a class="tips-keyword" herf="javascript:;">' + j + '</a></li>';
});
h += '</ul>';
this.html(h).show();
}
$.fn.sotips = function(opts){
var opts = $.extend({}, {
box: $('#dropdown-box'),
isStore: true,
salt: 'v1.3'
}, opts),checkTips = function(){
var q = $.trim(this.val()),t;
t = this.attr('key-type');
f = q+'#'+t+opts.salt;
var d = store.get(f),n = new Date().getTime() / 1000;
if (!opts.isStore || "undefined" == typeof(d) || d.expire < n) {
$.getJSON("/api/search_tips", {q:q,t:t}, function(r) {
if(r.code == 1){
opts.box.html('').hide();
} else {
renderTips.call(opts.box, r.data);
}
store.set(f, r.data);
});
} else if (d.list != '') {
renderTips.call(opts.box, d);
}
}
this.on('focus', function(){
checkTips.call($(this));
});
this.on('blur', function(){
opts.box.hide();
});
this.on('keydown', function(e){
if (13 == e.which) {
search.call(this);
return false;
}
});
this.on('keyup', function(e){
var k = e.which;
if (38 == k || 40 == k){
var c = opts.box.find('.tips-count'),l,i,o;
l = parseInt(c.attr('data-length'));
i = parseInt(c.attr('data-index'));
if (38 == k) {
i = i == 0 ? l - 1 : i - 1;
} else {
i = i >= l ? 0 : i + 1;
}
c.attr('data-index', i);
o = opts.box.find('.tips-item').eq(i);
o.addClass('hover').siblings().removeClass('hover');
$(this).val(o.find('.tips-keyword').text());
} else {
checkTips.call($(this));
}
});
};
$('#keyword').sotips();
$('#keyword-float').sotips({box: $('#dropdown-box-float')});
//点赞通用
$('.dianzan').click(function(){
if(!isLogin){
login();
return false;
}
var cid = $(this).attr('cid');
var pid = $(this).attr('pid');
var num = parseInt($('.dzs').html());
var numj = num+1;
var numjian = num-1;
if(numjian<=0){
numjian = 0;
}
if($(this).hasClass('yjdz')){
$(this).removeClass('yjdz');
$('.dzs').html(numjian);
$('.jiayi').html('- 1');
var num = -1;
}else{
$(this).addClass('yjdz');
$('.dzs').html(numj);
$('.jiayi').html('+1');
var num = 1;
}
$(".jiayi").animate({'opacity':'1'},500);
$(".jiayi").animate({'opacity':'0'},500);
var url = '/e/public/digg/';
$.ajax({
type: "GET",
url: url,
data:{'zan':num,'id':pid,'classid':cid},
jsonp: "callback",
dataType: "jsonp",
success: function(data){},
})
})
//收藏通用
$('.d-coll,.b-collect').click(function(){
var cid = $(this).attr('cid');
var id = $(this).attr('id');
var issc = $(this).attr('issc');
var that = $(this);
var isfrom = $(this).attr('isfrom');
if(!isLogin) {
login();
return false;
}
if(issc == 0){
var url = '/e/member/doaction.php?enews=AddFava';
}else{
var url = '/e/member/doaction.php?enews=DelFava';
}
//详情页
if(isfrom==1){
if(issc==1){
that.find('span').html('收藏');
that.attr('issc',0);
that.find('i').removeClass('chose');
}else{
that.find('span').html('已收藏');
that.attr('issc',1);
that.find('i').addClass('chose');
}
}else if(isfrom==2){
if(issc==1){
that.attr('issc',0);
that.removeClass('chose');
}else{
that.attr('issc',1);
that.addClass('chose');
}
}else{
if(issc==1){
that.html('收藏');
that.attr('issc',0);
that.removeClass('chose');
}else{
that.html('已收藏');
that.attr('issc',1);
that.addClass('chose');
}
}
var isuser = $(this).attr('user');
if(isuser==1){
that.parent().remove();
}
$.ajax({
type: 'get',
url: url,
data: {'classid':cid,'id':id,'cid':0},
success: function(res){
}
});
});
//意见反馈
$('.user-advice .submit').click(function(){
var content = $('.user-advice .u-advice').val();
var contact = $('.user-advice .connect').val();
if(content == ''){
alert('请输入您宝贵的意见!');
return false;
}
if(contact == ''){
alert('请输入您的联系方式!');
return false;
}
var url = '/api/advice';
$.ajax({
type: "GET",
url: url,
data:{'content':content,'contact':contact,'uid':uid},
jsonp: "callback",
dataType: "jsonp",
success: function(data){}
})
$('.user-advice').hide();
$('#mengcheng').hide();
});
//验证码下载功能
//下载功能
$(document).on('click', '.d-down,#tjyzm', function() {
if (isLogin == false) {
login();
return false;
}
var cid = $(this).attr('cid');
var did = $(this).attr('did');
if (cid == '') return false;
//验证码
$('#tjyzm').attr('did',did);
$('#tjyzm').attr('cid',cid);
$('.code').hide();
$('#mengcheng').hide();
var code = $('.c-code').val();
$('.c-code').val('');
var url = "/e/DownSys/DownSoft/";
$.ajax({
type: "GET",
url: url,
data:{pid:did,code:code,classid:cid,pathid:0},
jsonp: "callback",
dataType: "jsonp",
success: function(data){
if(data.status==1){
window.location.href = data.downurl;
}else{
var timestamp = new Date().getTime();
$("#yanzhengma").attr('src',$('#yanzhengma').attr('src') + '?' +timestamp );
tan(data.whyinfo);
}
}
})
});
$(document).on('click', '.box-down', function() {
if (isLogin == false) {
login();
return false;
}
var pid = $(this).attr('pid');
window.location.href = '/muban/'+pid+'.html';
});
$('.head-list').on('mouseover', function(){
$('.down-list').show();
});
$('.head-list').on('mouseout', function(){
$('.down-list').hide();
});
$('.more-type').on('mouseover',function(){
$('.h-types').show();
});
$('.more-type').on('mouseout',function(){
$('.h-types').hide();
});
$('.h-types').on('mouseover',function(){
$('.h-types').show();
});
$('.h-types').on('mouseout',function(){
$('.h-types').hide();
});
$(".return-top").click(function() {
$("html,body").animate({scrollTop:0}, 500);
});
});