Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
19 changed files
with
87 additions
and
105 deletions
@@ -22,8 +22,14 @@ class CacheConfig | @@ -22,8 +22,14 @@ class CacheConfig | ||
22 | const KEY_ACTION_BOYS_BOTTOM_BANNER = 'key_action_boys_bottom_banner'; // 男生首页底部banner | 22 | const KEY_ACTION_BOYS_BOTTOM_BANNER = 'key_action_boys_bottom_banner'; // 男生首页底部banner |
23 | const KEY_ACTION_GRILS_BOTTOM_BANNER = 'key_action_girls_bottom_banner';// 女生首页底部banner | 23 | const KEY_ACTION_GRILS_BOTTOM_BANNER = 'key_action_girls_bottom_banner';// 女生首页底部banner |
24 | 24 | ||
25 | - const KEY_ACTION_PRODUCT_NEWSALE_INDEX = 'key_action_product_newsale_index'; // 新品到着 | ||
26 | - const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT = 'key_action_product_newsale_discount'; // 热卖排行 | 25 | + const KEY_ACTION_PRODUCT_NEWSALE_INDEX_BOYS = 'key_action_product_newsale_index_boys'; // 男生新品到着 |
26 | + const KEY_ACTION_PRODUCT_NEWSALE_INDEX_GIRLS = 'key_action_product_newsale_index_girls'; // 女生新品到着 | ||
27 | + const KEY_ACTION_PRODUCT_NEWSALE_INDEX_KIDS = 'key_action_product_newsale_index_kids'; // 潮童新品到着 | ||
28 | + const KEY_ACTION_PRODUCT_NEWSALE_INDEX_LIFESTYLE = 'key_action_product_newsale_index_lifestyle'; // 创意生活新品到着 | ||
29 | + const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_BOYS = 'key_action_product_newsale_discount_boys'; // 男生热卖排行 | ||
30 | + const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_GIRLS = 'key_action_product_newsale_discount_girls'; // 女生热卖排行 | ||
31 | + const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_KIDS = 'key_action_product_newsale_discount_kids'; // 潮童热卖排行 | ||
32 | + const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_LIFESTYLE = 'key_action_product_newsale_discount_lifestyle'; // 创意生活热卖排行 | ||
27 | 33 | ||
28 | const KEY_ACTION_PRODUCT_INDEX = 'key_action_product_index'; // 品类商品列表 | 34 | const KEY_ACTION_PRODUCT_INDEX = 'key_action_product_index'; // 品类商品列表 |
29 | const KEY_ACTION_PRODUCT_BRAND = 'key_action_product_brand'; // 品类商品列表 | 35 | const KEY_ACTION_PRODUCT_BRAND = 'key_action_product_brand'; // 品类商品列表 |
@@ -99,6 +99,7 @@ class NewsaleData | @@ -99,6 +99,7 @@ class NewsaleData | ||
99 | $param['method'] = 'app.search.newProduct'; | 99 | $param['method'] = 'app.search.newProduct'; |
100 | } else { | 100 | } else { |
101 | $param['method'] = 'app.search.sales'; | 101 | $param['method'] = 'app.search.sales'; |
102 | + $param['p_d'] = '0.1,0.9'; | ||
102 | } | 103 | } |
103 | $param['page'] = $page; | 104 | $param['page'] = $page; |
104 | $param['limit'] = $limit; | 105 | $param['limit'] = $limit; |
@@ -269,7 +269,9 @@ class FloorProcess | @@ -269,7 +269,9 @@ class FloorProcess | ||
269 | 269 | ||
270 | foreach ($data as $key => &$value) { | 270 | foreach ($data as $key => &$value) { |
271 | if ($key == 'title') { | 271 | if ($key == 'title') { |
272 | - $value['more_url'] = Helpers::url('', array('id' => 4, 'gender' => self::$channel[$type]), 'guang'); | 272 | + $urlParam = array('id' => 4); |
273 | + isset(self::$channel[$type]) && $urlParam['gender'] = self::$channel[$type]; | ||
274 | + $value['more_url'] = Helpers::url('', $urlParam, 'guang'); | ||
273 | } | 275 | } |
274 | if ($key == 'list') { | 276 | if ($key == 'list') { |
275 | foreach ($value as &$one) { | 277 | foreach ($value as &$one) { |
@@ -138,7 +138,7 @@ $('.maybe-like p').on('touchstart', function(e) { | @@ -138,7 +138,7 @@ $('.maybe-like p').on('touchstart', function(e) { | ||
138 | }); | 138 | }); |
139 | 139 | ||
140 | function scrollHandler() { | 140 | function scrollHandler() { |
141 | - if ($(window).scrollTop() + winH >= $(document).height() - 50) { | 141 | + if ($(window).scrollTop() + winH >= $(document).height() - 200) { |
142 | search(); | 142 | search(); |
143 | } | 143 | } |
144 | } | 144 | } |
@@ -86,12 +86,20 @@ $loginBtn.on('touchstart', function() { | @@ -86,12 +86,20 @@ $loginBtn.on('touchstart', function() { | ||
86 | password: pwd | 86 | password: pwd |
87 | }, | 87 | }, |
88 | success: function(data) { | 88 | success: function(data) { |
89 | + var res; | ||
90 | + | ||
89 | if (data.code === 200) { | 91 | if (data.code === 200) { |
92 | + res = data.data; | ||
93 | + | ||
90 | showErrTip('登录成功'); | 94 | showErrTip('登录成功'); |
91 | 95 | ||
96 | + $.ajax({ | ||
97 | + url: res.session | ||
98 | + }); | ||
99 | + | ||
92 | //1s后跳转页面 | 100 | //1s后跳转页面 |
93 | setTimeout(function() { | 101 | setTimeout(function() { |
94 | - location.href = data.data; | 102 | + location.href = res.href; |
95 | }, 1000); | 103 | }, 1000); |
96 | } else { | 104 | } else { |
97 | showErrTip(data.message); | 105 | showErrTip(data.message); |
@@ -38,7 +38,7 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) { | @@ -38,7 +38,7 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) { | ||
38 | } | 38 | } |
39 | 39 | ||
40 | //goods-discount下拉按钮点击事件 | 40 | //goods-discount下拉按钮点击事件 |
41 | -$('.goodsDiscount .dropdown').on('touchend', function(e) { | 41 | +$('.goodsDiscount').on('touchend', function(e) { |
42 | if ($discountFolder.is(':hidden')) { | 42 | if ($discountFolder.is(':hidden')) { |
43 | $discountArrow.removeClass('icon-down').addClass('icon-up').html(''); | 43 | $discountArrow.removeClass('icon-down').addClass('icon-up').html(''); |
44 | $discountFolder.slideDown(); | 44 | $discountFolder.slideDown(); |
@@ -425,6 +425,13 @@ if ($brandHeader.length > 0) { | @@ -425,6 +425,13 @@ if ($brandHeader.length > 0) { | ||
425 | success: function(data) { | 425 | success: function(data) { |
426 | if (data.code === 200) { | 426 | if (data.code === 200) { |
427 | $this.toggleClass('coled'); | 427 | $this.toggleClass('coled'); |
428 | + | ||
429 | + //提示 | ||
430 | + if (opt === 'ok') { | ||
431 | + tip.show('添加收藏成功'); | ||
432 | + } else { | ||
433 | + tip.show('取消收藏成功'); | ||
434 | + } | ||
428 | } else if (data.code === 400) { | 435 | } else if (data.code === 400) { |
429 | location.href = data.data;//未登录跳转登录页 | 436 | location.href = data.data;//未登录跳转登录页 |
430 | } else { | 437 | } else { |
@@ -204,6 +204,7 @@ | @@ -204,6 +204,7 @@ | ||
204 | position: absolute; | 204 | position: absolute; |
205 | top: 20rem / $pxConvertRem; | 205 | top: 20rem / $pxConvertRem; |
206 | right: 30rem / $pxConvertRem; | 206 | right: 30rem / $pxConvertRem; |
207 | + text-align: right; | ||
207 | } | 208 | } |
208 | 209 | ||
209 | .price { | 210 | .price { |
@@ -216,4 +217,8 @@ | @@ -216,4 +217,8 @@ | ||
216 | text-align: right; | 217 | text-align: right; |
217 | line-height: 45rem / $pxConvertRem; | 218 | line-height: 45rem / $pxConvertRem; |
218 | } | 219 | } |
220 | + | ||
221 | + .appear-date { | ||
222 | + color: #f00; | ||
223 | + } | ||
219 | } | 224 | } |
@@ -135,10 +135,13 @@ $basicBtnC:#eb0313; | @@ -135,10 +135,13 @@ $basicBtnC:#eb0313; | ||
135 | // overflow: hidden; | 135 | // overflow: hidden; |
136 | } | 136 | } |
137 | .banner-top-single{ | 137 | .banner-top-single{ |
138 | - | ||
139 | - width: pxToRem(448px); | ||
140 | - margin:pxToRem(30px) pxToRem(72px); | 138 | + margin:0 auto; |
141 | overflow: hidden; | 139 | overflow: hidden; |
140 | + img{ | ||
141 | + width: pxToRem(448px); | ||
142 | + margin-top:pxToRem(30px); | ||
143 | + margin-bottom:pxToRem(30px); | ||
144 | + } | ||
142 | } | 145 | } |
143 | .banner-top { | 146 | .banner-top { |
144 | // width: 100%; | 147 | // width: 100%; |
@@ -9,25 +9,17 @@ | @@ -9,25 +9,17 @@ | ||
9 | </div> | 9 | </div> |
10 | </div> | 10 | </div> |
11 | 11 | ||
12 | + {{# topData}} | ||
13 | + {{! 头部banner}} | ||
12 | {{# bannerTop}} | 14 | {{# bannerTop}} |
13 | {{> home/banner_top}} | 15 | {{> home/banner_top}} |
14 | {{/ bannerTop}} | 16 | {{/ bannerTop}} |
15 | 17 | ||
16 | - {{# hotBrand}} | ||
17 | - <div class="hot-brand"> | ||
18 | - <ul class="hot-brand-list clearfix"> | ||
19 | - {{# list}} | ||
20 | - <li> | ||
21 | - <a href="{{url}}"> | ||
22 | - <div class="img-box"> | ||
23 | - <img class="lazy" data-original="{{img}}" alt=""> | ||
24 | - </div> | ||
25 | - </a> | ||
26 | - </li> | ||
27 | - {{/ list}} | ||
28 | - </ul> | ||
29 | - </div> | ||
30 | - {{/ hotBrand}} | 18 | + {{! 热门品牌可滑动}} |
19 | + {{# hotBrandsScroll}} | ||
20 | + {{> home/hot_brands_swipe}} | ||
21 | + {{/ hotBrandsScroll}} | ||
22 | + {{/ topData}} | ||
31 | 23 | ||
32 | {{# brandList}} | 24 | {{# brandList}} |
33 | <div class="brand-list bar-{{@index}}"> | 25 | <div class="brand-list bar-{{@index}}"> |
1 | -<div class="order-good" data-id={{id}}> | 1 | +<div class="order-good" data-id="{{id}}"> |
2 | <div class="thumb-wrap"> | 2 | <div class="thumb-wrap"> |
3 | - <img class="thumb lazy" data-original={{thumb}}> | 3 | + <img class="thumb lazy" data-original="{{thumb}}"> |
4 | <p class="tag{{#if gift}} gift-tag{{/if}}{{#if advanceBuy}} advance-buy-tag{{/if}}"></p> | 4 | <p class="tag{{#if gift}} gift-tag{{/if}}{{#if advanceBuy}} advance-buy-tag{{/if}}"></p> |
5 | </div> | 5 | </div> |
6 | <div class="deps"> | 6 | <div class="deps"> |
@@ -25,6 +25,9 @@ | @@ -25,6 +25,9 @@ | ||
25 | <span class="count"> | 25 | <span class="count"> |
26 | ×{{count}} | 26 | ×{{count}} |
27 | </span> | 27 | </span> |
28 | + {{#if appearDate}} | ||
29 | + <span class="appear-date">上市期:{{appearDate}}</span> | ||
30 | + {{/if}} | ||
28 | </p> | 31 | </p> |
29 | </div> | 32 | </div> |
30 | </div> | 33 | </div> |
@@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
50 | {{/ consults}} | 50 | {{/ consults}} |
51 | </div> | 51 | </div> |
52 | <div class="consult-content-footer"> | 52 | <div class="consult-content-footer"> |
53 | - <a href="/product/detail/consults"> | 53 | + <a href="{{link}}"> |
54 | 查看更多 | 54 | 查看更多 |
55 | <span class="iconfont"></span></a> | 55 | <span class="iconfont"></span></a> |
56 | </div> | 56 | </div> |
@@ -468,6 +468,12 @@ class HomeController extends AbstractAction | @@ -468,6 +468,12 @@ class HomeController extends AbstractAction | ||
468 | if ($cateId > 0) { | 468 | if ($cateId > 0) { |
469 | $service = Home\OnlineModel::getOnlineServiceDetail($cateId); | 469 | $service = Home\OnlineModel::getOnlineServiceDetail($cateId); |
470 | } | 470 | } |
471 | + | ||
472 | + $service = array( | ||
473 | + 'header' => array('title' => '在线客服'), | ||
474 | + 'service' => $service | ||
475 | + ); | ||
476 | + | ||
471 | $this->setTitle('在线客服'); | 477 | $this->setTitle('在线客服'); |
472 | $this->setNavHeader($cateName, true, ''); | 478 | $this->setNavHeader($cateName, true, ''); |
473 | $this->_view->display('online-service-detail', $service); | 479 | $this->_view->display('online-service-detail', $service); |
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | namespace Category; | 3 | namespace Category; |
4 | 4 | ||
5 | use LibModels\Wap\Category\BrandData; | 5 | use LibModels\Wap\Category\BrandData; |
6 | +use Plugin\DataProcess\FloorProcess; | ||
6 | use Plugin\Helpers; | 7 | use Plugin\Helpers; |
7 | 8 | ||
8 | /** | 9 | /** |
@@ -60,55 +61,8 @@ class BrandModel | @@ -60,55 +61,8 @@ class BrandModel | ||
60 | // 搜索链接地址 | 61 | // 搜索链接地址 |
61 | $result['searchUrl'] = Helpers::url('/brands/search', null); | 62 | $result['searchUrl'] = Helpers::url('/brands/search', null); |
62 | 63 | ||
63 | - /* 顶部的轮翻广告或热门品牌列表(当没有轮翻广告的情况下会是这个样子的! 此处是根据接口改造成的逻辑) */ | ||
64 | - if (!empty($brand['brandTop'][0]['data']['list'])) { | ||
65 | - $build = array(); | ||
66 | - foreach ($brand['brandTop'][0]['data']['list'] as $value) { | ||
67 | - if (isset($value['url'])) { | ||
68 | - $build['url'] = Helpers::getFilterUrl($value['url']); | ||
69 | - } | ||
70 | - $build['img'] = Helpers::getImageUrl($value['src'], 144, 144); | ||
71 | - $build['name'] = $value['name']; | ||
72 | - $result['hotBrand']['list'][] = $build; | ||
73 | - } | ||
74 | - } | ||
75 | - // 顶部的轮翻广告列表 | ||
76 | - elseif (!empty($brand['brandTop'][0]['data'])) { | ||
77 | - $build = array(); | ||
78 | - foreach ($brand['brandTop'][0]['data'] as $value) { | ||
79 | - if (isset($value['url'])) { | ||
80 | - $build['url'] = Helpers::getFilterUrl($value['url']); | ||
81 | - } | ||
82 | - $build['img'] = Helpers::getImageUrl($value['src'], 640, 310); | ||
83 | - $build['title'] = $value['title']; | ||
84 | - $result['bannerTop']['list'][] = $build; | ||
85 | - } | ||
86 | - } | ||
87 | - // 顶部的轮翻广告列表 | ||
88 | - elseif (!empty($brand['brandTop']['list'][0]['data'])) { | ||
89 | - $build = array(); | ||
90 | - foreach ($brand['brandTop']['list'][0]['data'] as $value) { | ||
91 | - if (isset($value['url'])) { | ||
92 | - $build['url'] = Helpers::getFilterUrl($value['url']); | ||
93 | - } | ||
94 | - $build['img'] = Helpers::getImageUrl($value['src'], 640, 310); | ||
95 | - $build['title'] = $value['title']; | ||
96 | - $result['bannerTop']['list'][] = $build; | ||
97 | - } | ||
98 | - } | ||
99 | - | ||
100 | - /* 顶部的热门品牌列表 (备注: 当没有轮翻广告的时候,此处内部的foreach不会被执行) */ | ||
101 | - if (!empty($brand['brandTop'][1]['data']['list'])) { | ||
102 | - $build = array(); | ||
103 | - foreach ($brand['brandTop'][1]['data']['list'] as $value) { | ||
104 | - if (isset($value['url'])) { | ||
105 | - $build['url'] = Helpers::getFilterUrl($value['url']); | ||
106 | - } | ||
107 | - $build['img'] = Helpers::getImageUrl($value['src'], 144, 144); | ||
108 | - $build['name'] = $value['name']; | ||
109 | - $result['hotBrand']['list'][] = $build; | ||
110 | - } | ||
111 | - } | 64 | + // 资源位处理 |
65 | + $result['topData'] = FloorProcess::getContent(array('list' => $brand['brandTop']), $channel); | ||
112 | 66 | ||
113 | /* 按字母'A-Z'分组的品牌列表 */ | 67 | /* 按字母'A-Z'分组的品牌列表 */ |
114 | if (!empty($brand['brandList']['brands'])) { | 68 | if (!empty($brand['brandList']['brands'])) { |
@@ -70,21 +70,17 @@ class OnlineModel | @@ -70,21 +70,17 @@ class OnlineModel | ||
70 | return $result; | 70 | return $result; |
71 | } | 71 | } |
72 | $res = OnlineData::getOnlineServiceDetail($cateId, $clinetType); | 72 | $res = OnlineData::getOnlineServiceDetail($cateId, $clinetType); |
73 | + if (isset($res['code']) && $res['code'] === 200) { | ||
73 | $questionInfo = $res['data']; | 74 | $questionInfo = $res['data']; |
74 | - if ($questionInfo) { | ||
75 | $list = array(); | 75 | $list = array(); |
76 | - if ($questionInfo) { | ||
77 | foreach ($questionInfo as $qk => $qv) { | 76 | foreach ($questionInfo as $qk => $qv) { |
78 | $list[$qk]['q'] = $qv['title']; | 77 | $list[$qk]['q'] = $qv['title']; |
79 | $list[$qk]['a'] = $qv['content']; | 78 | $list[$qk]['a'] = $qv['content']; |
80 | } | 79 | } |
80 | + | ||
81 | + !empty($list) && $result['list'] = $list; | ||
81 | } | 82 | } |
82 | - //处理返回信息 | ||
83 | - $result = array( | ||
84 | - 'header' => array('title' => '在线客服'), | ||
85 | - 'list' => $list | ||
86 | - ); | ||
87 | - } | 83 | + |
88 | return $result; | 84 | return $result; |
89 | } | 85 | } |
90 | 86 |
@@ -27,7 +27,7 @@ class HomeModel | @@ -27,7 +27,7 @@ class HomeModel | ||
27 | /* 女生楼层资源的位置码 */ | 27 | /* 女生楼层资源的位置码 */ |
28 | const CODE_FLOOR_GIRLS = '189b6686065dbd6755dd6906cf03c002'; | 28 | const CODE_FLOOR_GIRLS = '189b6686065dbd6755dd6906cf03c002'; |
29 | /* 潮童楼层资源的位置码 */ | 29 | /* 潮童楼层资源的位置码 */ |
30 | - const CODE_FLOOR_KIDS = 'b8c1bff53d4ea60f978926d538620636'; // '66cad79d93e055ad6fc5c8744086066d'; | 30 | + const CODE_FLOOR_KIDS = '66cad79d93e055ad6fc5c8744086066d'; // '66cad79d93e055ad6fc5c8744086066d'; |
31 | /* 创意生活楼层资源的位置码 */ | 31 | /* 创意生活楼层资源的位置码 */ |
32 | const CODE_FLOOR_LIFESTYLE = '61cd852c6afcf60660196154f66a3a62'; | 32 | const CODE_FLOOR_LIFESTYLE = '61cd852c6afcf60660196154f66a3a62'; |
33 | 33 | ||
@@ -98,8 +98,8 @@ class HomeModel | @@ -98,8 +98,8 @@ class HomeModel | ||
98 | 98 | ||
99 | // 调用接口获取数据 | 99 | // 调用接口获取数据 |
100 | $banner = IndexData::getBannerStart(self::CODE_BG); | 100 | $banner = IndexData::getBannerStart(self::CODE_BG); |
101 | - if (isset($banner['code']) && $banner['code'] == 200 && $banner['data']['total'] > 0) { | ||
102 | - $result = Helpers::getImageUrl($banner['data']['list'][0]['data']['list'][0]['src'], 640, 800, 2); | 101 | + if (isset($banner['code']) && $banner['code'] == 200 && !empty($banner['data'])) { |
102 | + $result = Helpers::getImageUrl($banner['data'][0]['data']['list'][0]['src'], 640, 800, 2); | ||
103 | } | 103 | } |
104 | 104 | ||
105 | if (USE_CACHE) { | 105 | if (USE_CACHE) { |
@@ -142,10 +142,10 @@ class HomeModel | @@ -142,10 +142,10 @@ class HomeModel | ||
142 | 142 | ||
143 | // 调用接口获取数据 | 143 | // 调用接口获取数据 |
144 | $banner = IndexData::getBannerStart($resource); | 144 | $banner = IndexData::getBannerStart($resource); |
145 | - if (isset($banner['code']) && $banner['code'] == 200 && $banner['data']['total'] > 0) { | 145 | + if (isset($banner['code']) && $banner['code'] == 200 && !empty($banner['data'])) { |
146 | $result = array(); | 146 | $result = array(); |
147 | // 处理数据 | 147 | // 处理数据 |
148 | - foreach ($banner['data']['list'] as $val) { | 148 | + foreach ($banner['data'] as $val) { |
149 | foreach ($val['data'] as $single) { | 149 | foreach ($val['data'] as $single) { |
150 | $result['url'] = ($channel === 2) ? Helpers::url('/boys') : Helpers::url('/girls'); | 150 | $result['url'] = ($channel === 2) ? Helpers::url('/boys') : Helpers::url('/girls'); |
151 | $result['img'] = Helpers::getImageUrl($single['src'], 640, 200); | 151 | $result['img'] = Helpers::getImageUrl($single['src'], 640, 200); |
@@ -178,7 +178,7 @@ class UserModel | @@ -178,7 +178,7 @@ class UserModel | ||
178 | foreach ($favProduct['data']['product_list'] as $val) { | 178 | foreach ($favProduct['data']['product_list'] as $val) { |
179 | $product = array(); | 179 | $product = array(); |
180 | $product['fav_id'] = $val['product_id']; | 180 | $product['fav_id'] = $val['product_id']; |
181 | - $product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : ''; | 181 | + $product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_id'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : ''; |
182 | $product['imgUrl'] = Helpers::getImageUrl($val['image'], 447, 596); | 182 | $product['imgUrl'] = Helpers::getImageUrl($val['image'], 447, 596); |
183 | ; | 183 | ; |
184 | $product['title'] = $val['product_name']; | 184 | $product['title'] = $val['product_name']; |
@@ -231,13 +231,13 @@ class UserModel | @@ -231,13 +231,13 @@ class UserModel | ||
231 | $brand['brandName'] = $val['brand_name']; | 231 | $brand['brandName'] = $val['brand_name']; |
232 | $brand['update'] = $val['new_product_num']; | 232 | $brand['update'] = $val['new_product_num']; |
233 | $brand['discount'] = $val['product_discount_num']; | 233 | $brand['discount'] = $val['product_discount_num']; |
234 | - $brand['link'] = Helpers::url('', array('query' => $val['brand_name']), 'search'); | 234 | + $brand['link'] = Helpers::url('', array(), $val['brand_domain']); |
235 | 235 | ||
236 | // 处理品牌产品 | 236 | // 处理品牌产品 |
237 | $product = array(); | 237 | $product = array(); |
238 | foreach ($val['new_product'] as $one) { | 238 | foreach ($val['new_product'] as $one) { |
239 | $product = array(); | 239 | $product = array(); |
240 | - $product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : ''; | 240 | + $product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_id'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : ''; |
241 | $product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : ''; | 241 | $product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : ''; |
242 | $product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] : 0; | 242 | $product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] : 0; |
243 | $product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] : 0; | 243 | $product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] : 0; |
@@ -381,7 +381,6 @@ class DetailModel | @@ -381,7 +381,6 @@ class DetailModel | ||
381 | 'desc' => strtr($productIntro, array( | 381 | 'desc' => strtr($productIntro, array( |
382 | '\r\n\t' => '', | 382 | '\r\n\t' => '', |
383 | '</p>' => '', | 383 | '</p>' => '', |
384 | - '<br />' => "\r\n", | ||
385 | '<img src=' => "<img class=\"lazy\" src=\"data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==\" data-original=", | 384 | '<img src=' => "<img class=\"lazy\" src=\"data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==\" data-original=", |
386 | )), | 385 | )), |
387 | ); | 386 | ); |
@@ -46,16 +46,16 @@ class NewsaleModel | @@ -46,16 +46,16 @@ class NewsaleModel | ||
46 | /* 根据频道调用接口 */ | 46 | /* 根据频道调用接口 */ |
47 | switch (intval($channel)) { | 47 | switch (intval($channel)) { |
48 | case 1: // 男生 | 48 | case 1: // 男生 |
49 | - $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX, self::CODE_TOP_NEW_BOYS); | 49 | + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_BOYS, self::CODE_TOP_NEW_BOYS); |
50 | break; | 50 | break; |
51 | case 2: // 女生 | 51 | case 2: // 女生 |
52 | - $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX, self::CODE_TOP_NEW_GIRLS); | 52 | + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_GIRLS, self::CODE_TOP_NEW_GIRLS); |
53 | break; | 53 | break; |
54 | case 3: // 潮童 | 54 | case 3: // 潮童 |
55 | - $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX, self::CODE_TOP_NEW_KIDS); | 55 | + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_KIDS, self::CODE_TOP_NEW_KIDS); |
56 | break; | 56 | break; |
57 | case 4: // 创意生活 | 57 | case 4: // 创意生活 |
58 | - $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX, self::CODE_TOP_NEW_LIFESTYLE); | 58 | + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_LIFESTYLE, self::CODE_TOP_NEW_LIFESTYLE); |
59 | break; | 59 | break; |
60 | } | 60 | } |
61 | 61 | ||
@@ -74,16 +74,16 @@ class NewsaleModel | @@ -74,16 +74,16 @@ class NewsaleModel | ||
74 | /* 根据频道调用接口 */ | 74 | /* 根据频道调用接口 */ |
75 | switch (intval($channel)) { | 75 | switch (intval($channel)) { |
76 | case 1: // 男生 | 76 | case 1: // 男生 |
77 | - $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT, self::CODE_TOP_SALE_BOYS); | 77 | + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_BOYS, self::CODE_TOP_SALE_BOYS); |
78 | break; | 78 | break; |
79 | case 2: // 女生 | 79 | case 2: // 女生 |
80 | - $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT, self::CODE_TOP_SALE_GIRLS); | 80 | + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_GIRLS, self::CODE_TOP_SALE_GIRLS); |
81 | break; | 81 | break; |
82 | case 3: // 潮童 | 82 | case 3: // 潮童 |
83 | - $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT, self::CODE_TOP_SALE_KIDS); | 83 | + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_KIDS, self::CODE_TOP_SALE_KIDS); |
84 | break; | 84 | break; |
85 | case 4: // 创意生活 | 85 | case 4: // 创意生活 |
86 | - $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT, self::CODE_TOP_SALE_LIFESTYLE); | 86 | + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_LIFESTYLE, self::CODE_TOP_SALE_LIFESTYLE); |
87 | break; | 87 | break; |
88 | } | 88 | } |
89 | 89 | ||
@@ -183,11 +183,11 @@ class NewsaleModel | @@ -183,11 +183,11 @@ class NewsaleModel | ||
183 | $newsale = NewsaleData::getNewsaleFocus($codeKey); | 183 | $newsale = NewsaleData::getNewsaleFocus($codeKey); |
184 | 184 | ||
185 | // 调用接口获取数据并封装 | 185 | // 调用接口获取数据并封装 |
186 | - if (isset($newsale['code']) && !empty($newsale['data']['list'])) { | ||
187 | - if(count($newsale['data']['list'][0]['data']) === 1) { | ||
188 | - $result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240); | 186 | + if (isset($newsale['code']) && !empty($newsale['data'])) { |
187 | + if(count($newsale['data'][0]['data']) === 1) { | ||
188 | + $result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240); | ||
189 | } else { | 189 | } else { |
190 | - foreach ($newsale['data']['list'][0]['data'] as $one) { | 190 | + foreach ($newsale['data'][0]['data'] as $one) { |
191 | $result['list'][] = Helpers::formatBanner($one, 640, 240); | 191 | $result['list'][] = Helpers::formatBanner($one, 640, 240); |
192 | } | 192 | } |
193 | } | 193 | } |
-
Please register or login to post a comment