|
|
$(function() {
|
|
|
var host = 'http://'+window.location.host+'/themes/simpleboot3_mobile/public/assets';
|
|
|
var host = 'http://' + window.location.host + '/themes/simpleboot3_mobile/public/assets';
|
|
|
// 点击左上角
|
|
|
$('.nav_downN9,.nav_drop-down ul a').click(function() {
|
|
|
$('.nav_down').hide();
|
|
|
$('.navImg1 img').attr('src', host + "/images/cicon_02@2x.png")
|
|
|
});
|
|
|
//导航
|
|
|
$('.navImg1 img').click(function() {
|
|
|
if ($(this).attr('src') == host+"/images/cicon_02@2x.png") {
|
|
|
$(this).attr('src', host+'/images/xx.png');
|
|
|
$('.nav_down').slideToggle();
|
|
|
if ($(this).attr('src') == host + "/images/cicon_02@2x.png") {
|
|
|
$(this).attr('src', host + '/images/xx.png');
|
|
|
$('.nav_down').slideDown();
|
|
|
} else {
|
|
|
$(this).attr('src', host+'/images/cicon_02@2x.png');
|
|
|
$('.nav_down').slideToggle();
|
|
|
console.log(1)
|
|
|
$(this).attr('src', host + '/images/cicon_02@2x.png');
|
|
|
$('.nav_down').slideUp();
|
|
|
}
|
|
|
});
|
|
|
//二级导航
|
|
|
$('.nav_downN').each(function() {
|
|
|
$(this).click(function() {
|
|
|
if ($(this).children('.nav_downImg2').attr('src') == host+'/images/down.png') {
|
|
|
$(this).children('.nav_downImg2').attr('src', host+'/images/top.png');
|
|
|
if ($(this).children('.nav_downImg2').attr('src') == host + '/images/down.png') {
|
|
|
$(this).children('.nav_downImg2').attr('src', host + '/images/top.png');
|
|
|
$(this).next('.nav_drop-down').slideDown();
|
|
|
} else {
|
|
|
$(this).children('.nav_downImg2').attr('src', host+'/images/down.png');
|
|
|
$(this).children('.nav_downImg2').attr('src', host + '/images/down.png');
|
|
|
$(this).next('.nav_drop-down').slideUp();
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -25,34 +31,34 @@ $(function() { |
|
|
|
|
|
// 收藏
|
|
|
$('.collections').click(function() {
|
|
|
if ($(this).children('img').attr('src') == host+'/images/bicon_02.png') {
|
|
|
if ($(this).children('img').attr('src') == host + '/images/bicon_02.png') {
|
|
|
var login = operation('/portal/star/collection');
|
|
|
if(login == 0){
|
|
|
if (login == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
$(this).children('img').attr('src', host+'/images/bicon_15.png');
|
|
|
$(this).children('img').attr('src', host + '/images/bicon_15.png');
|
|
|
} else {
|
|
|
var login = operation('/portal/star/cancelCollection');
|
|
|
if(login == 0){
|
|
|
if (login == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
$(this).children('img').attr('src', host+'/images/bicon_02.png');
|
|
|
$(this).children('img').attr('src', host + '/images/bicon_02.png');
|
|
|
}
|
|
|
});
|
|
|
//点赞
|
|
|
$('.likes').click(function() {
|
|
|
if ($(this).children('img').attr('src') == host+'/images/bicon_03.png') {
|
|
|
if ($(this).children('img').attr('src') == host + '/images/bicon_03.png') {
|
|
|
var login = operation('/portal/star/like');
|
|
|
if(login == 0){
|
|
|
if (login == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
$(this).children('img').attr('src', host+'/images/bicon_16.png');
|
|
|
$(this).children('img').attr('src', host + '/images/bicon_16.png');
|
|
|
} else {
|
|
|
var login = operation('/portal/star/cancelLike');
|
|
|
if(login == 0){
|
|
|
if (login == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
$(this).children('img').attr('src', host+'/images/bicon_03.png');
|
|
|
$(this).children('img').attr('src', host + '/images/bicon_03.png');
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
@@ -95,41 +101,41 @@ $(function() { |
|
|
window.location.href = "/portal/login/register";
|
|
|
});
|
|
|
//个人中心
|
|
|
$('.login_person').click(function(){
|
|
|
$('.login_person').click(function() {
|
|
|
window.location.href = '/portal/login/info';
|
|
|
});
|
|
|
|
|
|
//修改资料页面
|
|
|
$('#editInfo').click(function(){
|
|
|
$('#editInfo').click(function() {
|
|
|
window.location.href = '/portal/login/editInfo';
|
|
|
});
|
|
|
|
|
|
//我的收藏页面
|
|
|
$('#myCollection').click(function(){
|
|
|
$('#myCollection').click(function() {
|
|
|
window.location.href = '/portal/login/myCollection';
|
|
|
});
|
|
|
|
|
|
//跳转链接
|
|
|
$('.nav_drop-down a').click(function(){
|
|
|
$('.nav_down').css('display','none');
|
|
|
$('.nav_drop-down a').click(function() {
|
|
|
$('.nav_down').css('display', 'none');
|
|
|
});
|
|
|
|
|
|
//评论
|
|
|
$('#comment').click(function(){
|
|
|
$('#comment').click(function() {
|
|
|
var content = $('#comment_content').val();
|
|
|
var article_id = getUrlParam('id');
|
|
|
var url = window.location.pathname+window.location.search;
|
|
|
var url = window.location.pathname + window.location.search;
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: "/portal/star/comment",
|
|
|
data: {
|
|
|
'content': content,
|
|
|
'article_id':article_id,
|
|
|
'url':url
|
|
|
'article_id': article_id,
|
|
|
'url': url
|
|
|
|
|
|
},
|
|
|
dataType: 'json',
|
|
|
success: function (data) {
|
|
|
success: function(data) {
|
|
|
console.log(data);
|
|
|
if (data.code == 1) {
|
|
|
mask(data.msg);
|
...
|
...
|
@@ -141,13 +147,13 @@ $(function() { |
|
|
});
|
|
|
});
|
|
|
//关于我们
|
|
|
$('#about_us').click(function(){
|
|
|
$('#about_us').click(function() {
|
|
|
window.location.href = '/portal/index/aboutUs';
|
|
|
});
|
|
|
//搜索
|
|
|
$("#keywords").keypress(function (e) {
|
|
|
$("#keywords").keypress(function(e) {
|
|
|
if (e.which == 13) {
|
|
|
$("#searchForm").submit();//处理事件
|
|
|
$("#searchForm").submit(); //处理事件
|
|
|
}
|
|
|
});
|
|
|
});
|
...
|
...
|
@@ -156,36 +162,36 @@ $(function() { |
|
|
function mask(msg) {
|
|
|
$('.mask').text(msg);
|
|
|
$('.mask').show();
|
|
|
setTimeout(function(){
|
|
|
setTimeout(function() {
|
|
|
$('.mask').hide();
|
|
|
$('.mask').text('');
|
|
|
},4000);
|
|
|
}, 4000);
|
|
|
}
|
|
|
|
|
|
//弹框
|
|
|
function video_mask(msg) {
|
|
|
$('.mask').text(msg);
|
|
|
$('.mask').show();
|
|
|
setTimeout(function(){
|
|
|
setTimeout(function() {
|
|
|
$('.mask').hide();
|
|
|
$('.mask').text('');
|
|
|
},6000);
|
|
|
}, 6000);
|
|
|
}
|
|
|
//点赞收藏
|
|
|
function operation(url){
|
|
|
function operation(url) {
|
|
|
var article_id = getUrlParam('id');
|
|
|
var is_login = 1;
|
|
|
var post_url = window.location.pathname+window.location.search;
|
|
|
var post_url = window.location.pathname + window.location.search;
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: url,
|
|
|
data: {
|
|
|
'article_id':article_id,
|
|
|
'post_url':post_url
|
|
|
'article_id': article_id,
|
|
|
'post_url': post_url
|
|
|
},
|
|
|
dataType: 'json',
|
|
|
async : false,
|
|
|
success: function (data) {
|
|
|
async: false,
|
|
|
success: function(data) {
|
|
|
if (data.code == 1) {
|
|
|
mask(data.msg);
|
|
|
} else {
|
...
|
...
|
|