Authored by 郭成尧

'gulpge'

... ... @@ -1361,6 +1361,23 @@ if ($loadMoreInfo.length > 0) {
$noMore = $loadMoreInfo.children('.no-more');
}
// 获取url中的参数
function getUrlParam(name) {
// 构造一个含有目标参数的正则表达式对象
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
// 匹配目标参数
var r = window.location.search.substr(1).match(reg);
// 返回参数值
if (r != null) {
return r[2];
}
return null;
}
//初始化swiper
function initSwiper(typeId) {
if (typeof typeId === undefined) {
... ... @@ -1411,7 +1428,8 @@ function initInfosEvt($container) {
var $this = $(e.target),
opt = 'ok',
$btn,
$info;
$info,
yhChannel;
//e.preventDefault();
... ... @@ -1464,12 +1482,18 @@ function initInfosEvt($container) {
}
$info = $this.closest('.guang-info');
if (getUrlParam('yh_channel')) {
yhChannel = getUrlParam('yh_channel');
}
$.ajax({
type: 'POST',
url: '/guang/opt/collectArticle',
data: {
id: $info.data('id'),
opt: opt
opt: opt,
yh_channel: yhChannel
},
success: function(data) {
if (data.code && data.code === 200) {
... ... @@ -1477,6 +1501,17 @@ function initInfosEvt($container) {
//切换收藏状态
$btn.toggleClass('collected');
}
if (data.code && data.code === 400 && data.data.jumpUrl) {
if (yhChannel) {
if ($('#intimacy-link').length <= 0) {
$('body').append('<a href=\'' + data.data.jumpUrl + '\' style="display:none;" id="intimacy-link">' +
'<span class="intimacy-link"></span></a>');
}
$('.intimacy-link').click();
}
}
},
error: function() {
tip.show('网络断开连接了~');
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.