Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
6 changed files
with
24 additions
and
10 deletions
@@ -119,7 +119,8 @@ $likeBtn.bind('click', function() { | @@ -119,7 +119,8 @@ $likeBtn.bind('click', function() { | ||
119 | method: 'post', | 119 | method: 'post', |
120 | url: '/home/upAndDown', | 120 | url: '/home/upAndDown', |
121 | data: { | 121 | data: { |
122 | - suggest_id: id | 122 | + suggest_id: id, |
123 | + reliable: 1 | ||
123 | } | 124 | } |
124 | }).then(function(data) { | 125 | }).then(function(data) { |
125 | if (data.code === 200) { | 126 | if (data.code === 200) { |
@@ -146,7 +147,8 @@ $disLikeBtn.bind('click', function() { | @@ -146,7 +147,8 @@ $disLikeBtn.bind('click', function() { | ||
146 | method: 'post', | 147 | method: 'post', |
147 | url: '/home/upAndDown', | 148 | url: '/home/upAndDown', |
148 | data: { | 149 | data: { |
149 | - suggest_id: id | 150 | + suggest_id: id, |
151 | + reliable: 2 | ||
150 | } | 152 | } |
151 | }).then(function(data) { | 153 | }).then(function(data) { |
152 | if (data.code === 200) { | 154 | if (data.code === 200) { |
1 | {{> layout/header}} | 1 | {{> layout/header}} |
2 | <div class="discount-page yoho-page"> | 2 | <div class="discount-page yoho-page"> |
3 | {{# headerBanner}} | 3 | {{# headerBanner}} |
4 | - {{> product/banner_swipe_and_single}} | 4 | + {{> product/banner-swipe-and-single}} |
5 | {{/ headerBanner}} | 5 | {{/ headerBanner}} |
6 | <div id="hotRank"></div> | 6 | <div id="hotRank"></div> |
7 | {{#if brand}} | 7 | {{#if brand}} |
@@ -84,6 +84,18 @@ class BrandModel | @@ -84,6 +84,18 @@ class BrandModel | ||
84 | $result['bannerTop']['list'][] = $build; | 84 | $result['bannerTop']['list'][] = $build; |
85 | } | 85 | } |
86 | } | 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 | + } | ||
87 | 99 | ||
88 | /* 顶部的热门品牌列表 (备注: 当没有轮翻广告的时候,此处内部的foreach不会被执行) */ | 100 | /* 顶部的热门品牌列表 (备注: 当没有轮翻广告的时候,此处内部的foreach不会被执行) */ |
89 | if (!empty($brand['brandTop'][1]['data']['list'])) { | 101 | if (!empty($brand['brandTop'][1]['data']['list'])) { |
@@ -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['data'][0]['data']['list'][0]['src'])) { | ||
102 | - $result = Helpers::getImageUrl($banner['data'][0]['data']['list'][0]['src'], 640, 800, 2); | 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); | ||
103 | } | 103 | } |
104 | 104 | ||
105 | if (USE_CACHE) { | 105 | if (USE_CACHE) { |
@@ -302,7 +302,7 @@ class UserModel | @@ -302,7 +302,7 @@ class UserModel | ||
302 | $data = $records['data']['product_list']; | 302 | $data = $records['data']['product_list']; |
303 | foreach ($data as &$val) { | 303 | foreach ($data as &$val) { |
304 | $val['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : ''; | 304 | $val['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : ''; |
305 | - $val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 140, 140) : ''; | 305 | + $val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : ''; |
306 | $val['sales_price'] = !empty($val['sales_price']) ? $val['sales_price'] . '.00' : 0; | 306 | $val['sales_price'] = !empty($val['sales_price']) ? $val['sales_price'] . '.00' : 0; |
307 | $val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false; | 307 | $val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false; |
308 | } | 308 | } |
@@ -184,12 +184,12 @@ class NewsaleModel | @@ -184,12 +184,12 @@ class NewsaleModel | ||
184 | $newsale = NewsaleData::getNewsaleFocus($codeKey); | 184 | $newsale = NewsaleData::getNewsaleFocus($codeKey); |
185 | 185 | ||
186 | // 调用接口获取数据并封装 | 186 | // 调用接口获取数据并封装 |
187 | - if (isset($newsale['code']) && isset($newsale['data']['list'])) { | ||
188 | - if(count($newsale['data']['list']) === 1) { | 187 | + if (isset($newsale['code']) && isset($newsale['data']['list']) && !empty($newsale['data']['list'])) { |
188 | + if(count($newsale['data']['list'][0]['data']) === 1) { | ||
189 | $result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240); | 189 | $result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240); |
190 | } else { | 190 | } else { |
191 | - foreach ($newsale['data']['list'] as $one) { | ||
192 | - $result['list'][] = Helpers::formatBanner($one['data'], 640, 240); | 191 | + foreach ($newsale['data']['list'][0]['data'] as $one) { |
192 | + $result['list'][] = Helpers::formatBanner($one, 640, 240); | ||
193 | } | 193 | } |
194 | } | 194 | } |
195 | } | 195 | } |
-
Please register or login to post a comment