Authored by hf

code review by hf: merge zhaobiao order logistic

... ... @@ -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
... ...
... ... @@ -139,7 +139,7 @@ $.get('/home/locationList').then(function(html) {
addressHammer.on('tap', function(e) {
var $this = $(e.target);
if (e.target.tagName !== 'li') {
if (e.target.tagName.toLowerCase() !== 'li') {
$this = $this.parent('li');
}
newArea.push($this.children('.caption').text());
... ...
... ... @@ -261,7 +261,13 @@
height: pxToRem(200px);
line-height: pxToRem(200px);
color: #e0e0e0;
font-size: 20px;
text-align: center;
span{
display: inline-block;
font-size: 20px;
padding-right: 5px;
}
}
}
}
... ...
... ... @@ -33,11 +33,8 @@ $basicBtnC:#eb0313;
line-height: pxToRem(36px);
&.table {
width: 100%;
// .row {
// display: table-row;
.column {
box-sizing: border-box;
display: table-cell;
padding: pxToRem(20px) pxToRem(12px);
width: 50%;
border-bottom: 1px solid #fff;
... ... @@ -45,9 +42,6 @@ $basicBtnC:#eb0313;
font-size: pxToRem(24px);
background-color: $tableCellC;
float: left;
// &:nth-child(even) {
// border-right: none;
// }
}
}
}
... ... @@ -89,7 +83,6 @@ $basicBtnC:#eb0313;
left: pxToRem(108px);
top: pxToRem(40px);
height: pxToRem(35px);
// width: pxToRem(70px);
color: #fff;
font-size: pxToRem(20px);
line-height: pxToRem(35px);
... ... @@ -137,6 +130,12 @@ $basicBtnC:#eb0313;
background-color: #fff;
// overflow: hidden;
}
.banner-top-single{
height:pxToRem(600px);
width: pxToRem(448px);
margin:pxToRem(30px) pxToRem(72px);
overflow: hidden;
}
.banner-top {
// width: 100%;
min-height: 660rem / $pxConvertRem;
... ... @@ -163,14 +162,12 @@ $basicBtnC:#eb0313;
min-height: pxToRem(600px);
min-width: pxToRem(448px);
margin: pxToRem(30px) pxToRem(96px);
// position: relative;
overflow: hidden;
ul {
position: relative;
height: 100%;
li {
float: left;
// height: 100%;
}
}
}
... ...
... ... @@ -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>
... ... @@ -114,7 +113,6 @@
{{/ enterStore}}
<div id="productDesc"> </div>
<!-- {{> product/product-description}} -->
{{> product/recommend-for-you}}
{{#cartInfo}}
... ...
... ... @@ -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}}
... ...
... ... @@ -44,7 +44,7 @@
</div>
<div class="answer">
<span class="iconfont">&#xe63c;</span>
<span class="iconfont">&#xe63d;</span>
<p>{{answer}}</p>
</div>
{{/ consults}}
... ... @@ -56,7 +56,7 @@
</div>
{{else}}
<div class="consult-content-main content-main no-item">
<span class="iconfont">&#xe63c;</span>暂无咨询
<span class="iconfont">&#xe63d;</span>暂无咨询
</div>
<div class="consult-content-footer">
<a href="/product/detail/consultform">
... ...
... ... @@ -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'])) {
... ... @@ -249,7 +259,7 @@ class DetailModel
}
$result['goodsDescription'] = array(
'title' => '商品信息',
'enTitle' => 'PRODUCT INFO',
'enTitle' => 'DESCRIPTION',
'detail' => array(
'list' => array(
array('param' => '编号:' . $sizeInfo['productDescBo']['erpProductId']),
... ... @@ -367,7 +377,7 @@ class DetailModel
$result['washTips']['list'][] = $value;
}
}
// 详情配图
if (isset($sizeInfo['productIntroBo']['productIntro'])) {
$productIntro = $sizeInfo['productIntroBo']['productIntro'];
... ...