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.
473 lines
13 KiB
473 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();
|
|
if(ispay==1){
|
|
var money = $("input[name='pay-money']").val();
|
|
var taocan = $("input[name='taocan']").val();
|
|
createWxQR(money, taocan);
|
|
$('#vip-alert').show();
|
|
$('#yhhb').hide();
|
|
}else{
|
|
$('.addvip').show();
|
|
}
|
|
return false;
|
|
}
|
|
if(status==4){
|
|
$('#mengcheng').show();
|
|
$('.upvip').show();
|
|
$('.upvip').find('.more-vip').attr('href','/index/pay/payupdate');
|
|
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:1494456634解决!');
|
|
return false;
|
|
}
|
|
|
|
if(status==100){
|
|
$('#mengcheng').show();
|
|
$('.upvip').show();
|
|
$('.upvip').find('.more-vip').attr('href','/index/pay/payupdate');
|
|
return false;
|
|
$('.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/");
|
|
// login();
|
|
});
|
|
|
|
//意见反馈
|
|
$('.advice').click(function(){
|
|
if(!isLogin){
|
|
login();
|
|
return false;
|
|
}
|
|
$('#mengcheng').show();
|
|
$('.user-advice').show();
|
|
});
|
|
|
|
//搜索相关
|
|
function search(o){
|
|
if ($(this).hasClass('search-cate')) {
|
|
var q = $('#keyword').val(),t = $(this).attr('key-type');
|
|
} else {
|
|
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 o = true === o ? 1 : 0;
|
|
|
|
if(q == ''){
|
|
if(t==1) window.location.href='http://www.tukuppt.com/ppt/';
|
|
if(t==2) window.location.href='http://www.tukuppt.com/word/';
|
|
if(t==3) window.location.href='http://www.tukuppt.com/excel/';
|
|
if(t==4) window.location.href='http://www.tukuppt.com/tubiao/';
|
|
if(t==5) window.location.href='http://www.tukuppt.com/peitu/';
|
|
if(t==6) window.location.href='http://www.tukuppt.com/beijing/';
|
|
if(t==7) window.location.href='http://www.tukuppt.com/video/';
|
|
return false;
|
|
}
|
|
|
|
$.getJSON("/e/extend/api/index.php", {m:'search',c:'check',q:q,t:t,o:o}, function(r) {
|
|
if(r.code == 1){
|
|
alert(r.msg);
|
|
return false;
|
|
}
|
|
window.location.href=r.redirect_url;
|
|
});
|
|
}
|
|
if ($('.search-cate').length){
|
|
$('.search-cate').on('click', function(){
|
|
search.call($(this));
|
|
});
|
|
}
|
|
$('.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, true);
|
|
});
|
|
$('#dropdown-box-float').on('mousedown', '.tips-item', function(){
|
|
var k = $('#keyword-float');
|
|
k.val($(this).find('.tips-keyword').text());
|
|
search.call(k, true);
|
|
});
|
|
|
|
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("/e/extend/api/index.php", {m:'search',c:'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')});
|
|
|
|
|
|
|
|
//收藏通用
|
|
$('.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==3){
|
|
if(issc==1){
|
|
that.attr('issc',0);
|
|
that.removeClass('c-chose');
|
|
}else{
|
|
that.attr('issc',1);
|
|
that.addClass('c-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){},
|
|
error: function(){
|
|
alert('提交成功')
|
|
}
|
|
})
|
|
|
|
$('.user-advice').hide();
|
|
$('#mengcheng').hide();
|
|
|
|
});
|
|
|
|
//验证码下载功能
|
|
|
|
|
|
//下载功能
|
|
$(document).on('click', '.d-down,#tjyzm', function() {
|
|
if (isLogin == false) {
|
|
login();
|
|
return false;
|
|
}
|
|
|
|
var pid = $(this).attr('pid');
|
|
|
|
if (pid == '') return false;
|
|
|
|
//验证码
|
|
$('#tjyzm').attr('pid',pid);
|
|
$('.code').hide();
|
|
$('#mengcheng').hide();
|
|
|
|
var code = $('.c-code').val();
|
|
$('.c-code').val('');
|
|
|
|
var url = "/index/down";
|
|
$.ajax({
|
|
type: "GET",
|
|
url: url,
|
|
data:{pid:pid,code:code},
|
|
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);
|
|
});
|
|
|
|
});
|
|
|
|
$(window).load(function(){
|
|
|
|
//pvload();
|
|
|
|
|
|
|
|
});
|