Authored by biao

Merge branch 'feature/wap325' of http://git.dev.yoho.cn/web/yohobuy into feature/wap325

... ... @@ -18,7 +18,7 @@ class SideData
{
const URI_LEFTNAV_ENTRANCE = 'operations/api/v5/entrance/getEntrance';
const URI_LEFTNAV_CATEGORY = 'operations/api/v5/category/getCategory';
const URI_LEFTNAV_CATEGORY = 'operations/api/v6/category/getCategory';
/**
* 左侧边栏的分类和图标数据
... ...
... ... @@ -60,6 +60,12 @@
运费
<span>{{freight}}</span>
</li>
{{#if promo_code_amount}}
<li>
优惠码
<span>{{promo_code_amount}}</span>
</li>
{{/if}}
{{#if coupon}}
<li>
优惠券
... ...
<div class="side-nav">
{{# sideNav}}
<ul>
{{# sideNav}}
{{# this}}
<li class="{{styleClass}}">
{{# url}}
<a href="{{.}}">
... ... @@ -43,6 +44,7 @@
</ul>
{{/ subNav}}
</li>
{{/ sideNav}}
{{/ this}}
</ul>
{{/sideNav}}
</div>
\ No newline at end of file
... ...
... ... @@ -208,6 +208,10 @@ class OrderModel
$result['salePrice'] = self::filterOrderPrice($orderDetail['data']['promotion_amount']); // 活动金额
$result['freight'] = $orderDetail['data']['shipping_cost']; // 运费
$result['coupon'] = self::filterOrderPrice($orderDetail['data']['coupons_amount']); // 优惠券
if (isset($orderDetail['data']['promo_code_amount'])) {
$result['promo_code_amount'] = self::filterOrderPrice($orderDetail['data']['promo_code_amount']); // 优惠码
}
$result['yohoCoin'] = self::filterOrderPrice($orderDetail['data']['yoho_coin_num']); // YOHO币
$result['price'] = $orderDetail['data']['amount']; // 实付金额
$result['goodsAmount'] = $orderDetail['data']['payment_amount']; // 商品总金额没有人民币符号
... ...
... ... @@ -39,16 +39,38 @@ class SideModel
// 调用接口获取后台配置的侧边栏数据
$side = SideData::leftNav();
if (!empty($side['data'])) {
$group = array();
$num = 0;
$groupKey = 0;
$count = count(($side['data']));
foreach ($side['data'] as $key => $value) {
if ($value['separative_sign'] === 'Y') {
$result[$num] = $group;
$num++;
$groupKey = 0;
$group = array();
}
// 逛的按照原来的做法,使用配置
if ($value['sort_name_en'] === 'TRENDFINDER') {
continue;
}
$result[$key]['textCn'] = $value['sort_name'];
$result[$key]['textEn'] = $value['sort_name_en'];
$result[$key]['styleClass'] = strtolower($value['sort_name_en']);
$result[$key]['url'] = Helpers::getFilterUrl($value['sort_url']);
$result[$key]['img'] = Helpers::getImageUrl($value['sort_ico'], 60, 60, 1);
$group[$groupKey] = self::formatSideItem($value);
// 如果存在子菜单,就输出子菜单
if (isset($value['sub']) && !empty($value['sub'])) {
$subs = array();
foreach ($value['sub'] as $oneSub) {
$subs[] = self::formatSideItem($oneSub);
}
$group[$groupKey]['subNav'] = $subs;
}
$groupKey++;
if ($count === $key + 1) {
$result[$num] = $group;
}
}
}
... ... @@ -126,4 +148,24 @@ class SideModel
);
}
/**
* 格式化侧边栏数据
*
* @param array $data 要格式化的侧边栏数据
* @return array
*/
private static function formatSideItem($data)
{
$result = array();
$result['textCn'] = $data['sort_name'];
$result['textEn'] = $data['sort_name_en'];
$result['styleClass'] = strtolower($data['sort_name_en']);
$result['url'] = Helpers::getFilterUrl($data['sort_url']);
$result['img'] = Helpers::getImageUrl($data['sort_ico'], 60, 60, 1);
return $result;
}
}
... ...