Authored by Rock Zhang

Merge branch 'hotfix/apichange-bug' into develop

... ... @@ -21,6 +21,7 @@ class UserData
* 个人详情数据
*
* @param int $uid 用户ID
* @param int $udid 客户端唯一标识
* @return array 个人详情接口返回的数据
*/
public static function userData($uid)
... ... @@ -39,11 +40,12 @@ class UserData
* @param int $uid 用户ID
* @return array 接口返回的数据
*/
public static function infoNum($uid)
public static function infoNum($uid, $udid)
{
$param = Yohobuy::param();
$param['method'] = 'app.home.getInfoNum';
$param['uid'] = $uid;
$param['udid'] = $udid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
... ... @@ -189,7 +191,23 @@ class UserData
}
/**
* YOHO币数据
* YOHO币总数
*
* @param int $uid 用户ID
* @return array YOHO币接口返回的数据
*/
public static function yohoCoinTotal($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.yohocoin.total';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* YOHO币列表数据
*
* @param int $uid 用户ID
* @param int $page 第几页,默认1
... ...
... ... @@ -2,10 +2,9 @@
<div class="good-detail-page yoho-page">
<div class="banner-container">
<div class="tag-container">
<p class="good-tag new-tag">NEW</p>
{{# tags}}
{{# is_new}}
<!-- <p class="good-tag new-tag">NEW</p> -->
<p class="good-tag new-tag">NEW</p>
{{/ is_new}}
{{# is_advance}}
<p class="good-tag renew-tag">再到着</p>
... ...
... ... @@ -22,7 +22,10 @@
<ul class="swiper-wrapper swiper-wrapper-{{id}}">
{{# productList}}
<li class="swiper-slide">
<img class="swiper-lazy" data-src="{{imgUrl}}" alt=""/>
<a href="{{link}}">
<img class="swiper-lazy" data-src="{{imgUrl}}" alt=""/>
</a>
<div class="brand-product">
<div class="{{# discount}}price-discount{{/ discount}}">
{{# discount}}<span>{{.}}<span>{{/ discount}}
... ...
... ... @@ -277,14 +277,11 @@
</script>
{{/if}}
{{#if browseRecordPage}}
<<<<<<< HEAD
<script>
seajs.use('js/me/browse-record');
</script>
{{/if}}
{{#if logisticInfoPage}}
=======
>>>>>>> feature/hf
<script>
seajs.use('js/me/logistic');
</script>
... ...
... ... @@ -65,8 +65,9 @@ class HomeController extends AbstractAction
);
if ($this->_uid) {
$data['isLogin'] = true;
$udid = $this->getUdid();
$data += UserModel::getUserProfileData($this->_uid);
$data += UserModel::getInfoNumData($this->_uid);
$data += UserModel::getInfoNumData($this->_uid, $udid);
// 优选新品数据
$channel = Helpers::getChannelByCookie();
... ...
... ... @@ -46,14 +46,15 @@ class UserModel
* 处理个人中心页面优惠券,收藏的商品等的数目数据
*
* @param int $uid 用户ID
* @param int $udid 客户端唯一标识
* @return array|mixed 处理之后的个人中心页面优惠券,收藏的商品等的数目数据
*/
public static function getInfoNumData($uid)
public static function getInfoNumData($uid, $udid)
{
$result = array();
// 调用接口获取个人中心页面优惠券,收藏的商品等的数目数据
$infoNumData = UserData::infoNum($uid);
$infoNumData = UserData::infoNum($uid, $udid);
// 处理个人中心页面优惠券,收藏的商品等的数目数据
if (isset($infoNumData['data']) && !empty($infoNumData['data'])) {
... ... @@ -181,9 +182,9 @@ class UserModel
$product['imgUrl'] = Helpers::getImageUrl($val['image'], 447, 596);
;
$product['title'] = $val['product_name'];
$product['price'] = !empty($val['market_price']) ? '¥' . $val['market_price'] . '.00' : 0;
$product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false;
$product['savePrice'] = ($val['price_down'] > 0) ? '¥' . $val['price_down'] . '.00' : false;
$product['price'] = !empty($val['market_price']) ? '¥' . $val['market_price'] . '.00' : 0;
$product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false;
$product['savePrice'] = ($val['price_down'] > 0) ? '¥' . $val['price_down'] . '.00' : false;
$product['sellOut'] = ($val['storage'] <= 0);
$datas[] = $product;
... ... @@ -236,7 +237,8 @@ class UserModel
$product = array();
foreach ($val['new_product'] as $one) {
$product = array();
$product['imgUrl'] = Images::getImageUrl($one['default_images'], 235, 314);
$product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
$product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : '';
$product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] . '.00' : 0;
$product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] . '.00' : 0;
... ... @@ -299,9 +301,10 @@ class UserModel
} else {
$data = $records['data']['product_list'];
foreach ($data as &$val) {
$val['image'] = Helpers::getImageUrl($val['image'], 140, 140);
$val['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
$val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 140, 140) : '';
$val['sales_price'] = !empty($val['sales_price']) ? $val['sales_price'] . '.00' : 0;
$val['market_price'] = !empty($val['market_price']) ? $val['market_price'] . '.00' : 0;
$val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false;
}
!empty($data) && $result['browseRecord'] = $data;
}
... ... @@ -333,7 +336,7 @@ class UserModel
}
/**
* 处理YOHO币数据
* 处理YOHO币总数数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的YOHO币数据
... ... @@ -343,7 +346,7 @@ class UserModel
$result = array();
// 调用接口获取YOHO币
$yohoCoin = UserData::yohoCoinData($uid);
$yohoCoin = UserData::yohoCoinTotal($uid);
// 处理YOHO币数据
if (isset($yohoCoin['data']) && !empty($yohoCoin['data'])) {
... ...
... ... @@ -50,10 +50,10 @@ class DetailModel
case 'is_soon_sold_out': // 即将售磬
$result['tags']['is_soon_sold_out'] = true;
break;
case 'is_new': // 新品
case 'is_new': // 新品NEW
$result['tags']['is_new'] = true;
break;
case 'is_discount': // 在售
case 'is_discount': // SALE
$result['tags']['is_discount'] = true;
break;
case 'is_limited': // 限量
... ... @@ -68,7 +68,17 @@ class DetailModel
}
}
}
// 新品标签
if (isset($baseInfo['isNew']) && $baseInfo['isNew'] === 'Y') {
$result['tags']['is_new'] = true;
}
// NEW和SALE只显示一个
if (isset($result['tags']['is_new']) && isset($result['tags']['is_discount'])) {
unset($result['tags']['is_discount']);
}
// 商品价格
if (isset($baseInfo['productPriceBo'])) {
$result['goodsPrice'] = array();
... ... @@ -87,10 +97,10 @@ class DetailModel
}
}
// 上市期
if (isset($baseInfo['expectArrivalTime'])) {
$result['periodOfMarket'] = date('n', $baseInfo['firstShelveTime']) . '月';
}
// 上市期
if (isset($baseInfo['expectArrivalTime']) && !empty($baseInfo['expectArrivalTime'])) {
$result['periodOfMarket'] = date('n', $baseInfo['expectArrivalTime']) . '月';
}
// 促销信息
if (isset($baseInfo['promotionBoList'])) {
... ... @@ -245,7 +255,7 @@ class DetailModel
}
$result['goodsDescription'] = array(
'title' => '商品信息',
'enTitle' => 'PRODUCT INFO',
'enTitle' => 'DESCRIPTION',
'detail' => array(
'list' => array(
array('param' => '编号:' . $sizeInfo['productDescBo']['erpProductId']),
... ... @@ -363,7 +373,7 @@ class DetailModel
$result['washTips']['list'][] = $value;
}
}
// 详情配图
if (isset($sizeInfo['productIntroBo']['productIntro'])) {
$productIntro = $sizeInfo['productIntroBo']['productIntro'];
... ...