Authored by 郭成尧

'pullmerge'

... ... @@ -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('网络断开连接了~');
... ...
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.
... ... @@ -148,7 +148,7 @@ function bindWriteLocal($brandList, list) {
}
if (localStorage) {
if (isLocalStorageSupported) {
if (isLocalStorageSupported()) {
historys = localStorage.getItem('historys-brand');
}
... ... @@ -167,8 +167,9 @@ function bindWriteLocal($brandList, list) {
}
historys += query + ranToken;
localStorage.setItem('historys-brand', historys);
if (isLocalStorageSupported()) {
localStorage.setItem('historys-brand', historys);
}
}
if (list) {
... ... @@ -432,7 +433,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();
... ...
... ... @@ -142,7 +142,7 @@ class DetailModel
else {
// tar modified 201606141155 常見問題恢復
$result['feedbacks']['consults'] = array_slice(self::getCommonConsults()['commonConsults'], 0, 2);
$result['feedbacks']['consultsNum'] = 2; // 数字无意义,兼容原来的前端模板代码使用,不能为 0
$result['feedbacks']['consultsNum'] = '0'; // 数字无意义,兼容原来的前端模板代码使用,不能为 0
$result['feedbacks']['commonConsults'] = true; // 用来标记是否是常见问题的
$result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum']));
// $result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consultform', array('product_id' => $productId));
... ...