|
|
$(function(){
|
|
|
var host = 'http://'+window.location.host;
|
|
|
$(function() {
|
|
|
var host = 'http://' + window.location.host;
|
|
|
// 收藏
|
|
|
$('.collections').click(function() {
|
|
|
if ($(this).children('img').attr('src') == host+'/themes/simpleboot3/public/assets/starImg/bicon_02.png') {
|
|
|
if ($(this).children('img').attr('src') == host + '/themes/simpleboot3/public/assets/starImg/bicon_02.png') {
|
|
|
var login = operation('/portal/star/collection');
|
|
|
if(login == 0){
|
|
|
if (login == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
$(this).children('img').attr('src', host+'/themes/simpleboot3/public/assets/starImg/bicon_15.png');
|
|
|
$(this).children('img').attr('src', host + '/themes/simpleboot3/public/assets/starImg/bicon_15.png');
|
|
|
} else {
|
|
|
var login = operation('/portal/star/cancelCollection');
|
|
|
if(login == 0){
|
|
|
if (login == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
$(this).children('img').attr('src', host+'/themes/simpleboot3/public/assets/starImg/bicon_02.png');
|
|
|
$(this).children('img').attr('src', host + '/themes/simpleboot3/public/assets/starImg/bicon_02.png');
|
|
|
}
|
|
|
});
|
|
|
//点赞
|
|
|
$('.likes').click(function() {
|
|
|
if ($(this).children('img').attr('src') == host+'/themes/simpleboot3/public/assets/starImg/bicon_03.png') {
|
|
|
if ($(this).children('img').attr('src') == host + '/themes/simpleboot3/public/assets/starImg/bicon_03.png') {
|
|
|
var login = operation('/portal/star/like');
|
|
|
if(login == 0){
|
|
|
if (login == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
$(this).children('img').attr('src', host+'/themes/simpleboot3/public/assets/starImg/bicon_16.png');
|
|
|
$(this).children('img').attr('src', host + '/themes/simpleboot3/public/assets/starImg/bicon_16.png');
|
|
|
} else {
|
|
|
var login = operation('/portal/star/cancelLike');
|
|
|
if(login == 0){
|
|
|
if (login == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
$(this).children('img').attr('src', host+'/themes/simpleboot3/public/assets/starImg/bicon_03.png');
|
|
|
$(this).children('img').attr('src', host + '/themes/simpleboot3/public/assets/starImg/bicon_03.png');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 收藏更多视频
|
|
|
$('#collections').click(function() {
|
|
|
if ($(this).attr('src') == host+'/themes/simpleboot3/public/assets/starImg/bicon_02.png') {
|
|
|
var login = operation('/portal/star/collection',1);
|
|
|
if(login == 0){
|
|
|
if ($(this).attr('src') == host + '/themes/simpleboot3/public/assets/starImg/bicon_02.png') {
|
|
|
var login = operation('/portal/star/collection', 1);
|
|
|
if (login == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
$(this).attr('src', host+'/themes/simpleboot3/public/assets/starImg/bicon_15.png');
|
|
|
$(this).attr('src', host + '/themes/simpleboot3/public/assets/starImg/bicon_15.png');
|
|
|
} else {
|
|
|
var login = operation('/portal/star/cancelCollection',1);
|
|
|
if(login == 0){
|
|
|
var login = operation('/portal/star/cancelCollection', 1);
|
|
|
if (login == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
$(this).attr('src', host+'/themes/simpleboot3/public/assets/starImg/bicon_02.png');
|
|
|
$(this).attr('src', host + '/themes/simpleboot3/public/assets/starImg/bicon_02.png');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//点赞
|
|
|
$('#likes').click(function() {
|
|
|
if ($(this).attr('src') == host+'/themes/simpleboot3/public/assets/starImg/bicon_03.png') {
|
|
|
var login = operation('/portal/star/like',1);
|
|
|
if(login == 0){
|
|
|
if ($(this).attr('src') == host + '/themes/simpleboot3/public/assets/starImg/bicon_031.png') {
|
|
|
var login = operation('/portal/star/like', 1);
|
|
|
if (login == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
$(this).attr('src', host+'/themes/simpleboot3/public/assets/starImg/bicon_16.png');
|
|
|
$(this).attr('src', host + '/themes/simpleboot3/public/assets/starImg/bicon_161.png');
|
|
|
} else {
|
|
|
var login = operation('/portal/star/cancelLike',1);
|
|
|
if(login == 0){
|
|
|
var login = operation('/portal/star/cancelLike', 1);
|
|
|
if (login == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
$(this).attr('src', host+'/themes/simpleboot3/public/assets/starImg/bicon_03.png');
|
|
|
$(this).attr('src', host + '/themes/simpleboot3/public/assets/starImg/bicon_031.png');
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
@@ -90,22 +90,22 @@ $(function(){ |
|
|
//头部导航栏切换颜色
|
|
|
var str_url = window.location.pathname;
|
|
|
$('.home_nav_act,.slide_vo').children('a').removeClass('home_nav_act');
|
|
|
var star = 'star';//星球奇境
|
|
|
var region = 'region';//星域秀场
|
|
|
var enjoy = 'enjoy';//星享体验
|
|
|
var scout = 'scout';//星探推荐
|
|
|
var active = 'active';//星际活动
|
|
|
if(str_url.indexOf(star) != -1){
|
|
|
var star = 'star'; //星球奇境
|
|
|
var region = 'region'; //星域秀场
|
|
|
var enjoy = 'enjoy'; //星享体验
|
|
|
var scout = 'scout'; //星探推荐
|
|
|
var active = 'active'; //星际活动
|
|
|
if (str_url.indexOf(star) != -1) {
|
|
|
$('.slide_vo').eq(0).children('a').addClass('home_nav_act');
|
|
|
}else if(str_url.indexOf(region) != -1){
|
|
|
} else if (str_url.indexOf(region) != -1) {
|
|
|
$('.slide_vo').eq(1).children('a').addClass('home_nav_act');
|
|
|
}else if(str_url.indexOf(enjoy) != -1){
|
|
|
} else if (str_url.indexOf(enjoy) != -1) {
|
|
|
$('.slide_vo').eq(2).children('a').addClass('home_nav_act');
|
|
|
}else if(str_url.indexOf(scout) != -1){
|
|
|
} else if (str_url.indexOf(scout) != -1) {
|
|
|
$('.slide_vo').eq(3).children('a').addClass('home_nav_act');
|
|
|
}else if(str_url.indexOf(active) != -1){
|
|
|
} else if (str_url.indexOf(active) != -1) {
|
|
|
$('.slide_vo').eq(4).children('a').addClass('home_nav_act');
|
|
|
}else{
|
|
|
} else {
|
|
|
$('.home_nav_act').children('a').addClass('home_nav_act');
|
|
|
}
|
|
|
|
...
|
...
|
@@ -114,46 +114,46 @@ $(function(){ |
|
|
$('.page-item:last').children().text('>');
|
|
|
|
|
|
//注册页面
|
|
|
$('#register').click(function(){
|
|
|
$('#register').click(function() {
|
|
|
window.location.href = '/portal/login/register';
|
|
|
});
|
|
|
|
|
|
//登录页面
|
|
|
$('#login').click(function(){
|
|
|
$('#login').click(function() {
|
|
|
window.location.href = '/portal/login/login';
|
|
|
});
|
|
|
|
|
|
//个人中心
|
|
|
$('.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';
|
|
|
});
|
|
|
|
|
|
//评论
|
|
|
$('#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);
|
...
|
...
|
@@ -165,20 +165,20 @@ $(function(){ |
|
|
});
|
|
|
});
|
|
|
//关于我们
|
|
|
$('#about_us,#about_us1').click(function(){
|
|
|
$('#about_us,#about_us1').click(function() {
|
|
|
window.location.href = '/portal/index/aboutUs';
|
|
|
});
|
|
|
//搜索
|
|
|
$("#keywords").keypress(function (e) {
|
|
|
$("#keywords").keypress(function(e) {
|
|
|
if (e.which == 13) {
|
|
|
$("#searchForm").submit();//处理事件
|
|
|
$("#searchForm").submit(); //处理事件
|
|
|
}
|
|
|
});
|
|
|
|
|
|
var share_url = encodeURIComponent(location.href);
|
|
|
var share_title = encodeURIComponent(document.title);
|
|
|
//分享到微博
|
|
|
$('.weibo').click(function(){
|
|
|
$('.weibo').click(function() {
|
|
|
var param = {
|
|
|
url: share_url,
|
|
|
title: share_title,
|
...
|
...
|
@@ -193,24 +193,24 @@ $(function(){ |
|
|
});
|
|
|
|
|
|
//点赞收藏
|
|
|
function operation(url,id =''){
|
|
|
if(id == ''){
|
|
|
function operation(url, id = '') {
|
|
|
if (id == '') {
|
|
|
var article_id = getUrlParam('id');
|
|
|
}else{
|
|
|
} else {
|
|
|
var article_id = $('#li_id').val();
|
|
|
}
|
|
|
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 {
|
...
|
...
|
@@ -225,20 +225,20 @@ function operation(url,id =''){ |
|
|
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);
|
|
|
}
|
|
|
|
|
|
//获取url的参数
|
...
|
...
|
|