...
|
...
|
@@ -663,7 +663,7 @@ function bindWriteLocal($brandList, list) { |
|
|
}
|
|
|
|
|
|
if (localStorage) {
|
|
|
if (isLocalStorageSupported) {
|
|
|
if (isLocalStorageSupported()) {
|
|
|
historys = localStorage.getItem('historys-brand');
|
|
|
}
|
|
|
|
...
|
...
|
@@ -682,8 +682,9 @@ function bindWriteLocal($brandList, list) { |
|
|
}
|
|
|
|
|
|
historys += query + ranToken;
|
|
|
|
|
|
localStorage.setItem('historys-brand', historys);
|
|
|
if (isLocalStorageSupported()) {
|
|
|
localStorage.setItem('historys-brand', historys);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (list) {
|
...
|
...
|
@@ -947,7 +948,9 @@ if ($('.brand-search-page').length > 0) { |
|
|
|
|
|
chHammer = new Hammer($clearHistory[0]);
|
|
|
chHammer.on('tap', function() {
|
|
|
localStorage.removeItem('historys-brand');
|
|
|
if (isLocalStorageSupported()) {
|
|
|
localStorage.removeItem('historys-brand');
|
|
|
}
|
|
|
|
|
|
$history.html('');
|
|
|
$historySearch.hide();
|
...
|
...
|
@@ -1358,23 +1361,6 @@ 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) {
|
...
|
...
|
@@ -1425,8 +1411,7 @@ function initInfosEvt($container) { |
|
|
var $this = $(e.target),
|
|
|
opt = 'ok',
|
|
|
$btn,
|
|
|
$info,
|
|
|
yhChannel;
|
|
|
$info;
|
|
|
|
|
|
//e.preventDefault();
|
|
|
|
...
|
...
|
@@ -1479,18 +1464,12 @@ 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,
|
|
|
yh_channel: yhChannel
|
|
|
opt: opt
|
|
|
},
|
|
|
success: function(data) {
|
|
|
if (data.code && data.code === 200) {
|
...
|
...
|
@@ -1498,17 +1477,6 @@ 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('网络断开连接了~');
|
...
|
...
|
|