Authored by yyqing

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

@@ -60,6 +60,12 @@ @@ -60,6 +60,12 @@
60 运费 60 运费
61 <span>{{freight}}</span> 61 <span>{{freight}}</span>
62 </li> 62 </li>
  63 + {{#if promo_code_amount}}
  64 + <li>
  65 + 优惠码
  66 + <span>{{promo_code_amount}}</span>
  67 + </li>
  68 + {{/if}}
63 {{#if coupon}} 69 {{#if coupon}}
64 <li> 70 <li>
65 优惠券 71 优惠券
1 -<div class="shopping-cart-good clearfix" data-id="{{id}}"> 1 +<div class="shopping-cart-good clearfix" data-id="{{id}}" data-skn="{{skn}}">
2 {{#if inValid}} 2 {{#if inValid}}
3 <span class="few-tag-expire">失效</span> 3 <span class="few-tag-expire">失效</span>
4 {{/if}} 4 {{/if}}
1 <div class="side-nav"> 1 <div class="side-nav">
  2 + {{# sideNav}}
2 <ul> 3 <ul>
3 - {{# sideNav}} 4 + {{# this}}
4 <li class="{{styleClass}}"> 5 <li class="{{styleClass}}">
5 {{# url}} 6 {{# url}}
6 <a href="{{.}}"> 7 <a href="{{.}}">
@@ -43,6 +44,7 @@ @@ -43,6 +44,7 @@
43 </ul> 44 </ul>
44 {{/ subNav}} 45 {{/ subNav}}
45 </li> 46 </li>
46 - {{/ sideNav}} 47 + {{/ this}}
47 </ul> 48 </ul>
  49 + {{/sideNav}}
48 </div> 50 </div>
@@ -208,6 +208,10 @@ class OrderModel @@ -208,6 +208,10 @@ class OrderModel
208 $result['salePrice'] = self::filterOrderPrice($orderDetail['data']['promotion_amount']); // 活动金额 208 $result['salePrice'] = self::filterOrderPrice($orderDetail['data']['promotion_amount']); // 活动金额
209 $result['freight'] = $orderDetail['data']['shipping_cost']; // 运费 209 $result['freight'] = $orderDetail['data']['shipping_cost']; // 运费
210 $result['coupon'] = self::filterOrderPrice($orderDetail['data']['coupons_amount']); // 优惠券 210 $result['coupon'] = self::filterOrderPrice($orderDetail['data']['coupons_amount']); // 优惠券
  211 + if (isset($orderDetail['data']['promo_code_amount'])) {
  212 + $result['promo_code_amount'] = self::filterOrderPrice($orderDetail['data']['promo_code_amount']); // 优惠码
  213 + }
  214 +
211 $result['yohoCoin'] = self::filterOrderPrice($orderDetail['data']['yoho_coin_num']); // YOHO币 215 $result['yohoCoin'] = self::filterOrderPrice($orderDetail['data']['yoho_coin_num']); // YOHO币
212 $result['price'] = $orderDetail['data']['amount']; // 实付金额 216 $result['price'] = $orderDetail['data']['amount']; // 实付金额
213 $result['goodsAmount'] = $orderDetail['data']['payment_amount']; // 商品总金额没有人民币符号 217 $result['goodsAmount'] = $orderDetail['data']['payment_amount']; // 商品总金额没有人民币符号
@@ -224,8 +224,7 @@ class CartModel @@ -224,8 +224,7 @@ class CartModel
224 224
225 $product = CartData::cartProductData($uid, $skn); 225 $product = CartData::cartProductData($uid, $skn);
226 if (isset($product['code']) && $product['code'] === 200) { 226 if (isset($product['code']) && $product['code'] === 200) {
227 - $result['code'] = 200;  
228 - $result['data'] = self::procGoodsDetail($product['data'], $num); 227 + $result = self::procGoodsDetail($product['data'], $num);
229 } 228 }
230 229
231 return $result; 230 return $result;
@@ -244,7 +243,7 @@ class CartModel @@ -244,7 +243,7 @@ class CartModel
244 243
245 $product = CartData::giftProductData($skn, $promotionId); 244 $product = CartData::giftProductData($skn, $promotionId);
246 if (isset($product['code']) && $product['code'] === 200) { 245 if (isset($product['code']) && $product['code'] === 200) {
247 - $result['data'] = self::procGoodsDetail($product['data']); 246 + $result = self::procGoodsDetail($product['data']);
248 } 247 }
249 248
250 return $result; 249 return $result;
@@ -39,16 +39,38 @@ class SideModel @@ -39,16 +39,38 @@ class SideModel
39 // 调用接口获取后台配置的侧边栏数据 39 // 调用接口获取后台配置的侧边栏数据
40 $side = SideData::leftNav(); 40 $side = SideData::leftNav();
41 if (!empty($side['data'])) { 41 if (!empty($side['data'])) {
  42 + $group = array();
  43 + $num = 0;
  44 + $groupKey = 0;
  45 + $count = count(($side['data']));
42 foreach ($side['data'] as $key => $value) { 46 foreach ($side['data'] as $key => $value) {
  47 + if ($value['separative_sign'] === 'Y') {
  48 + $result[$num] = $group;
  49 + $num++;
  50 + $groupKey = 0;
  51 + $group = array();
  52 + }
  53 +
43 // 逛的按照原来的做法,使用配置 54 // 逛的按照原来的做法,使用配置
44 if ($value['sort_name_en'] === 'TRENDFINDER') { 55 if ($value['sort_name_en'] === 'TRENDFINDER') {
45 continue; 56 continue;
46 } 57 }
47 - $result[$key]['textCn'] = $value['sort_name'];  
48 - $result[$key]['textEn'] = $value['sort_name_en'];  
49 - $result[$key]['styleClass'] = strtolower($value['sort_name_en']);  
50 - $result[$key]['url'] = Helpers::getFilterUrl($value['sort_url']);  
51 - $result[$key]['img'] = Helpers::getImageUrl($value['sort_ico'], 60, 60, 1); 58 + $group[$groupKey] = self::formatSideItem($value);
  59 +
  60 + // 如果存在子菜单,就输出子菜单
  61 + if (isset($value['sub']) && !empty($value['sub'])) {
  62 + $subs = array();
  63 + foreach ($value['sub'] as $oneSub) {
  64 + $subs[] = self::formatSideItem($oneSub);
  65 + }
  66 +
  67 + $group[$groupKey]['subNav'] = $subs;
  68 + }
  69 + $groupKey++;
  70 +
  71 + if ($count === $key + 1) {
  72 + $result[$num] = $group;
  73 + }
52 } 74 }
53 } 75 }
54 76
@@ -126,4 +148,24 @@ class SideModel @@ -126,4 +148,24 @@ class SideModel
126 ); 148 );
127 } 149 }
128 150
  151 +
  152 + /**
  153 + * 格式化侧边栏数据
  154 + *
  155 + * @param array $data 要格式化的侧边栏数据
  156 + * @return array
  157 + */
  158 + private static function formatSideItem($data)
  159 + {
  160 + $result = array();
  161 +
  162 + $result['textCn'] = $data['sort_name'];
  163 + $result['textEn'] = $data['sort_name_en'];
  164 + $result['styleClass'] = strtolower($data['sort_name_en']);
  165 + $result['url'] = Helpers::getFilterUrl($data['sort_url']);
  166 + $result['img'] = Helpers::getImageUrl($data['sort_ico'], 60, 60, 1);
  167 +
  168 + return $result;
  169 + }
  170 +
129 } 171 }
@@ -195,7 +195,9 @@ class IndexController extends AbstractAction @@ -195,7 +195,9 @@ class IndexController extends AbstractAction
195 $result['num'] = $num; 195 $result['num'] = $num;
196 } 196 }
197 197
198 - $this->echoJson($result); 198 + $this->_view->display('gift-info', array(
  199 + 'cartInfo' => $result
  200 + ));
199 } 201 }
200 202
201 // /* 203 // /*
@@ -223,7 +225,7 @@ class IndexController extends AbstractAction @@ -223,7 +225,7 @@ class IndexController extends AbstractAction
223 225
224 $this->_view->display('gift-info', array( 226 $this->_view->display('gift-info', array(
225 'promotionId' => $promotionId, 227 'promotionId' => $promotionId,
226 - 'cartInfo' => $result['data'] 228 + 'cartInfo' => $result
227 )); 229 ));
228 } 230 }
229 231