Authored by 刘传洋

Merge branch 'release/5.4.1' of http://git.yoho.cn/fe/YOHOBUYPC into release/5.4.1

... ... @@ -79,8 +79,7 @@ class AbstractAction extends Controller_Abstract
//客服配置
protected function getCustomerServiceSwitch() {
return $this->_useSession && $this->getCacheBy('zookeeper:/pc/clientService/new') === 'true' ? '/service/client' :
'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409';
return $this->_useSession && $this->getCacheBy('zookeeper:/pc/clientService/new') === 'true' ? 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409' : '/service/client';
}
/**
* 封装一下获取get参数
... ...
... ... @@ -95,8 +95,7 @@ class WebAction extends Controller_Abstract
//客服配置
protected function getCustomerServiceSwitch() {
return $this->_useSession && $this->getCacheBy('zookeeper:/pc/clientService/new') === 'true' ? '/service/client' :
'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409';
return $this->_useSession && $this->getCacheBy('zookeeper:/pc/clientService/new') === 'true' ? 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409' : '/service/client';
}
/**
... ...
... ... @@ -855,6 +855,20 @@ handlebars.registerHelper('notzero', function(v1, options) {
}
});
handlebars.registerHelper('gt', function(v1, v2, options) {
var ret = v1 > v2;
if (options.fn) {
if (ret) {
return options.fn(this);
} else {
return options.inverse(this);
}
} else {
return ret;
}
});
/**
* 获取头部banner的回调函数
* @param {[type]} data [description]
... ... @@ -1613,6 +1627,28 @@ function actionUpdateCartNum() {
cartNum: '.ic-infomation'
});
}
function refreshCartNum() {
var $miniCart = $('#miniCartBox');
var $totalInfo = $miniCart.find('[data-role=totalinfo]');
var total = 0;
$miniCart.find('.goods-list .goods-item.hide').each(function() {
var $t = $(this);
var val = $t.data('num') || 0;
total += Number(val);
});
if (total > 0) {
$totalInfo.show();
$totalInfo.find('[data-role=last-num]').text(total);
} else {
$totalInfo.hide();
}
}
/**
* 加载购物车数据
* @return {[type]} [description]
... ... @@ -1622,13 +1658,17 @@ function loadCartData() {
shoppingData,
strK;
$.getData('//www.yohobuy.com/common/shoppingCart', '', function(jsonData) {
$.getJSON('//www.yohobuy.com/cart/cart/minicart?callback=?', {}, function(jsonData) {
if (cartTpl === '') {
cartTpl = handlebars.compile($('#mini-cart-tpl').html());
}
$('#miniCartBox').children('.gobuy-wrapper').html(cartTpl({
carData: jsonData
carData: jsonData.data
}));
refreshCartNum();
if (parseInt($('.ic-infomation').html()) === 0) {
$('#miniCartBox .gobuy-wrapper').html('<div class="gobuy-empty">' +
'<h3 class="information">您的购物车暂无商品</h3></div>');
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -45,7 +45,7 @@ class UserModel
}
public static function getCustomerServiceSwitch() {
return USE_CACHE && Cache::getBy('zookeeper:/pc/clientService/new') === 'true' ? '/service/client' : 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409';
return USE_CACHE && Cache::getBy('zookeeper:/pc/clientService/new') === 'true' ? 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409' : '/service/client';
}
/**
* 个人中心-左侧导航
... ...