Authored by Rock Zhang

Merge branch 'beta' into develop

... ... @@ -18,23 +18,23 @@ class Yohobuy
{
/* 正式环境 */
// const API_URL = 'http://api2.open.yohobuy.com/';
// const API_URL2 = 'http://api.open.yohobuy.com/';
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
/**const API_URL = 'http://api2.open.yohobuy.com/';
const API_URL2 = 'http://api.open.yohobuy.com/';
const SERVICE_URL = 'http://service.api.yohobuy.com/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';**/
// const API_URL = 'http://apih5.yoho.cn/';
// const API_URL2 = 'http://apih5.yoho.cn/';
// const SERVICE_URL = 'http://serviceh5.yoho.cn/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_OLD = 'http://api2.open.yohobuy.com/';
const API_URL = 'http://apih5.yoho.cn/';
const API_URL2 = 'http://apih5.yoho.cn/';
const SERVICE_URL = 'http://serviceh5.yoho.cn/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_OLD = 'http://api2.open.yohobuy.com/';
// /* 测试环境 */
// const API_URL = 'http://192.168.102.205:8080/gateway/'; // 先临时使用网关
const API_URL = 'http://testapi.yoho.cn:28078/';
/* const API_URL = 'http://testapi.yoho.cn:28078/';
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_OLD = 'http://test2.open.yohobuy.com/';
const API_OLD = 'http://test2.open.yohobuy.com/';*/
/* 预览环境 */
// const API_URL = 'http://preapi.yoho.cn/';
... ...
... ... @@ -39,7 +39,10 @@ class DetailData
} elseif ($productSkn !== null) {
$param['product_skn'] = $productSkn;
}
$param['uid'] = $uid;
if (!empty($uid)) {
$param['uid'] = $uid;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
... ...
... ... @@ -221,8 +221,8 @@ class Helpers
$flag = false; // 判别默认的商品是否将默认的图片URL赋值到skn
$firstGood = array(); // 第一个skc产品
// 如果设置了默认图片,就取默认的图片
foreach ($productData['goods_list'] as $k => $oneGoods) {
if ($k === 0) {
foreach ($productData['goods_list'] as $oneGoods) {
if (empty($firstGood)) {
$firstGood = $oneGoods;
}
... ... @@ -298,9 +298,9 @@ class Helpers
$cover2 = isset($images['cover_2']) ? $images['cover_2'] : '';
$gender = self::getGenderByCookie();
if ($gender === '2,3') {
return !empty($cover2) ? $cover2 : !empty($cover1) ? $cover1 : $imgUrl;
return !empty($cover2) ? $cover2 : (!empty($cover1) ? $cover1 : $imgUrl);
} else {
return !empty($cover1) ? $cover1 : !empty($cover2) ? $cover2 : $imgUrl;
return !empty($cover1) ? $cover1 : (!empty($cover2) ? $cover2 : $imgUrl);
}
}
... ...
... ... @@ -595,7 +595,7 @@ if ($('.brand-search-page').length) {
if ($keyword.val().length) {
$icon.css('color', '#000');
$(this).closest('.search-box').css('width', '11.25rem');
$searchAction.show();
$searchAction.show().find('.clear-text').show();
} else {
$icon.css('color', '#b2b2b2');
$(this).closest('.search-box').css('width', '12.5rem');
... ... @@ -607,7 +607,7 @@ if ($('.brand-search-page').length) {
// 2016.1.13 产品(高扬)要求进入页面默认显示取消按钮
$icon.css('color', '#000');
$keyword.closest('.search-box').css('width', '11.25rem');
$searchAction.show();
$searchAction.show().find('.clear-text').hide();
clearTextHammer = new Hammer($('.clear-text')[0]);
clearTextHammer.on('tap', function(e) {
... ... @@ -5412,9 +5412,6 @@ var $chosePanel = $('#chose-panel'),
$sizeRowList,
$curColorBlock,
$colorRowList,
$curSizeRow,
$curColorRow,
rowIndex,
cbFn,
$allChoseItems,
queryString,
... ... @@ -5432,9 +5429,6 @@ function init() {
$sizeRowList = $('.size-list ul');
$colorRowList = $('.color-list ul');
$leftNum = $('#left-num');
$curSizeRow = $sizeRowList.eq(0);
$curColorRow = $colorRowList.eq(0);
rowIndex = 0;
curColorIndex = 0;
curSizeIndex = 0;
}
... ... @@ -5502,6 +5496,60 @@ function updateConformButtonClassAndText() {
}
}
//显示剩余件数
function displayGoodNum(curGoodNum) {
//数量大于0
if (curGoodNum > 0) {
if ($soonSoldOut.length > 0) {
$allChoseItems.find('.num .left-num').html('即将售罄');
} else {
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
}
$leftNum.val(curGoodNum);
//数量小于0
} else {
$allChoseItems.find('.num .left-num').html('');
$leftNum.val(0);
}
}
//老的选中尺码去掉勾选,新的选中尺码加上勾选
function changeSizeChosed(newSizeIndex) {
var sizes,
queryString,
i;
if (curColorIndex && $curSizeBlock && $curSizeBlock.length > 0) {
$curSizeBlock.removeClass('chosed');
sizes = $sizeRowList.eq(newSizeIndex).children();
for (i = 0; i < sizes.length; i++) {
if ($(sizes[i]).data('name') === $curSizeBlock.data('name')) {
$curSizeBlock = $(sizes[i]);
queryString = '#' + $curSizeBlock.data('name');
curColorIndex = $(queryString).data('index');
}
}
$curSizeBlock.addClass('chosed');
return $curSizeBlock.data('num');
}
return 0;
}
//老的选中颜色去掉勾选,新的选中颜色加上勾选
function changeColorChosed(newColorIndex) {
if (curSizeIndex && $curColorBlock && $curColorBlock.length > 0) {
$curColorBlock.removeClass('chosed');
$curColorBlock = $($colorRowList.eq(newColorIndex).children().get(curSizeIndex - 1));
$curColorBlock.addClass('chosed');
return $curColorBlock.data('num');
}
return 0;
}
init();
$yohoPage.on('touchstart', '.chose-panel', function(e) {
... ... @@ -5517,13 +5565,9 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) {
$yohoPage.on('touchstart', '.color-list .block', function() {
var $this = $(this),
index,
curSizeBlock,
index = $this.index(),
curGoodNum;
$this.siblings('.chosed').removeClass('chosed');
index = $this.index();
// 当前颜色已经是选中状态,再点击时
if ($this.hasClass('chosed')) {
... ... @@ -5533,66 +5577,31 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
hasChooseColor = false;
//当前尺码行隐藏
$sizeRowList.eq(curSizeIndex).removeClass('show').addClass('hide');
$sizeRowList.eq(curSizeIndex).addClass('hide');
//目标尺码行显示
$sizeRowList.eq(0).removeClass('hide').addClass('show');
$sizeRowList.eq(0).removeClass('hide');
curSizeIndex = 0;
//如果尺码已经是选择状态
if (curColorIndex) {
// 之前选中的尺码去掉勾选样式,新尺码块勾选
if ($curSizeBlock && $curSizeBlock.length > 0) {
$curSizeBlock.removeClass('chosed');
curSizeBlock = $sizeRowList.eq(0).children().get(curColorIndex - 1);
$curSizeBlock = $(curSizeBlock);
curGoodNum = $curSizeBlock.data('num');
$curSizeBlock.addClass('chosed');
}
}
//老的选中尺码去掉勾选,新的选中尺码加上勾选
changeSizeChosed(0);
// 当前颜色不是选中状态,选中时
} else {
hasChooseColor = true;
//如果尺码已经是选择状态
if (curColorIndex) {
// 之前选中的尺码去掉勾选样式,新尺码块勾选
if ($curSizeBlock && $curSizeBlock.length > 0) {
$curSizeBlock.removeClass('chosed');
//curSizeBlock = $sizeRowList.eq(curSizeIndex + 1).children().get(curColorIndex - 1);
curSizeBlock = $sizeRowList.eq(index + 1).children().get(curColorIndex - 1);
$curSizeBlock = $(curSizeBlock);
curGoodNum = $curSizeBlock.data('num');
$curSizeBlock.addClass('chosed');
}
//数量大于0
if (curGoodNum > 0) {
if ($soonSoldOut.length > 0) {
$allChoseItems.find('.num .left-num').html('即将售罄');
} else {
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
}
// 尺码行当前行隐藏
$sizeRowList.eq(curSizeIndex).addClass('hide');
$leftNum.val(curGoodNum);
//老的选中尺码去掉勾选,新的选中尺码加上勾选
curGoodNum = changeSizeChosed(index + 1);
//数量小于0
} else {
$allChoseItems.find('.num .left-num').html('');
$leftNum.val(0);
}
}
// 尺码行当前行隐藏
$sizeRowList.eq(curSizeIndex).removeClass('show').addClass('hide');
// 显示剩余数量
displayGoodNum(curGoodNum);
//尺码对应行显示
$sizeRowList.eq(index + 1).removeClass('hide').addClass('show');
$sizeRowList.eq(index + 1).removeClass('hide');
curSizeIndex = index + 1;
$curColorBlock = $this;
... ... @@ -5601,7 +5610,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
$imgsThumb.addClass('hide').eq(index).removeClass('hide');
}
// 当前颜色块 切换勾选样式
// 颜色块切换勾选样式
$this.siblings('.chosed').removeClass('chosed');
$this.toggleClass('chosed');
$('#good-num').val(1);
... ... @@ -5610,12 +5620,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
}).on('touchstart', '.size-list .block', function() {
var $this = $(this),
index,
curColorBlock,
curGoodNum;
$this.siblings('.chosed').removeClass('chosed');
index = $this.index();
// 当前尺码已经是选中状态,再点击时
if ($this.hasClass('chosed')) {
... ... @@ -5625,70 +5631,40 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
hasChooseSize = false;
//当前颜色行隐藏
$colorRowList.eq(curColorIndex).removeClass('show').addClass('hide');
$colorRowList.eq(curColorIndex).addClass('hide');
//目标颜色行显示
$colorRowList.eq(0).removeClass('hide').addClass('show');
$colorRowList.eq(0).removeClass('hide');
curColorIndex = 0;
//如果颜色已经是选择状态
if (curSizeIndex) {
// 之前选中的颜色去掉勾选样式,新颜色块勾选
if ($curColorBlock && $curColorBlock.length > 0) {
$curColorBlock.removeClass('chosed');
curColorBlock = $colorRowList.eq(0).children().get(curSizeIndex - 1);
$curColorBlock = $(curColorBlock);
curGoodNum = $curColorBlock.data('num');
$curColorBlock.addClass('chosed');
}
}
//老的选中颜色去掉勾选,新的选中颜色加上勾选
changeColorChosed(0);
// 当前尺码不是选中状态,选中时
} else {
hasChooseSize = true;
//如果颜色已经是选择状态
if (curSizeIndex) {
index = $('#' + $this.data('name')).data('index') - 1;
// 之前选中的颜色去掉勾选样式,新颜色块勾选
if ($curColorBlock && $curColorBlock.length > 0) {
$curColorBlock.removeClass('chosed');
// 颜色当前行隐藏
$colorRowList.eq(curColorIndex).addClass('hide');
//curColorBlock = $colorRowList.eq(curColorIndex + 1).children().get(curSizeIndex - 1);
curColorBlock = $colorRowList.eq(index + 1).children().get(curSizeIndex - 1);
$curColorBlock = $(curColorBlock);
curGoodNum = $curColorBlock.data('num');
$curColorBlock.addClass('chosed');
}
//老的选中颜色去掉勾选,新的选中颜色加上勾选
curGoodNum = changeColorChosed(index + 1);
//数量大于0
if (curGoodNum > 0) {
if ($soonSoldOut.length > 0) {
$allChoseItems.find('.num .left-num').html('即将售罄');
} else {
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
}
$leftNum.val(curGoodNum);
//数量小于0
} else {
$allChoseItems.find('.num .left-num').html('');
$leftNum.val(0);
}
}
// 颜色当前行隐藏
$colorRowList.eq(curColorIndex).removeClass('show').addClass('hide');
// 显示剩余数量
displayGoodNum(curGoodNum);
//颜色对应行显示
$colorRowList.eq(index + 1).removeClass('hide').addClass('show');
$colorRowList.eq(index + 1).removeClass('hide');
curColorIndex = index + 1;
$curSizeBlock = $this;
}
// 颜色块切换勾选样式
$this.siblings('.chosed').removeClass('chosed');
$this.toggleClass('chosed');
$('#good-num').val(1);
... ... @@ -5815,8 +5791,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
});
exports.init = init;
exports.show = show;
exports.show = show;
});
define("js/product/detail/desc", ["jquery","lazyload","swiper","index"], function(require, exports, module){
/**
... ...
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.
[memcached]
master.hosts=10.170.182.9:12111,10.172.169.31:12111,10.173.8.214:12111
slave.hosts=10.170.182.9:12112,10.172.169.31:12112,10.173.8.214:12112
session.hosts=10.170.182.9:12111,10.172.169.31:12111,10.173.8.214:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
[memcached]
master.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
slave.hosts=192.168.166.16:12112,192.168.166.17:12112,192.168.166.18:12112
session.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
... ... @@ -466,7 +466,7 @@ class HomeController extends AbstractAction
$serviceUrl = 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409&info=';
if ($uid) {
$time = time() . '000';
$info = 'userId=' . $uid . '&name=' . $this->_uname . '&memo=&hashCode=' . md5(rawurlencode($uid . $this->_uname . $time . '1231')) . '&timestamp=' . $time;
$info = 'userId=' . $uid . '&name=' . $this->_uname . '&memo=&hashCode=' . md5( strtoupper( rawurlencode($uid . $this->_uname . $time . '1231') ) ) . '&timestamp=' . $time;
$serviceUrl .= rawurlencode($info);
}
... ...
... ... @@ -175,6 +175,11 @@ class DetailModel
$colorStorageNum = 0;
$totalStorageNum = 0; // 总库存数
foreach ($baseInfo['goodsList'] as $value) {
// 如果status为0,即skc下架时就跳过该商品
if ($value['status'] === 0) {
continue;
}
$colorStorageNum = 0;
// 商品分组
... ...
[memcached]
master.hosts=10.170.182.9:12111,10.172.169.31:12111,10.173.8.214:12111
slave.hosts=10.170.182.9:12112,10.172.169.31:12112,10.173.8.214:12112
session.hosts=10.170.182.9:12111,10.172.169.31:12111,10.173.8.214:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...
[memcached]
master.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
slave.hosts=192.168.166.16:12112,192.168.166.17:12112,192.168.166.18:12112
session.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111
[redis]
servers.hosts=127.0.0.1:6379
\ No newline at end of file
... ...