Authored by 梁志锋

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

@@ -13,7 +13,6 @@ var $addressForm = $('.edit-address'), @@ -13,7 +13,6 @@ var $addressForm = $('.edit-address'),
13 $submit = $('.submit'), 13 $submit = $('.submit'),
14 $editAddressPage = $('.my-edit-address-page'), 14 $editAddressPage = $('.my-edit-address-page'),
15 $addressListPage = $('.my-address-list-page'), 15 $addressListPage = $('.my-address-list-page'),
16 - $footer = $('#yoho-footer'),  
17 $backBtn = $('.nav-back'), 16 $backBtn = $('.nav-back'),
18 $navTitle = $('.nav-title'), 17 $navTitle = $('.nav-title'),
19 $input = $('input, textarea'), 18 $input = $('input, textarea'),
@@ -111,12 +110,6 @@ $submit.on('touchend', function() { @@ -111,12 +110,6 @@ $submit.on('touchend', function() {
111 $(this).removeClass('highlight'); 110 $(this).removeClass('highlight');
112 }); 111 });
113 112
114 -$input.on('focus', function() {  
115 - $footer.hide();  
116 -}).on('blur', function() {  
117 - $footer.show();  
118 -});  
119 -  
120 // 省市区列表异步加载 113 // 省市区列表异步加载
121 $.get('/home/locationList').then(function(html) { 114 $.get('/home/locationList').then(function(html) {
122 $addressListPage.html(html); 115 $addressListPage.html(html);
@@ -124,9 +117,7 @@ $.get('/home/locationList').then(function(html) { @@ -124,9 +117,7 @@ $.get('/home/locationList').then(function(html) {
124 // 省市区 117 // 省市区
125 $area.on('touchend', function() { 118 $area.on('touchend', function() {
126 $editAddressPage.hide(); 119 $editAddressPage.hide();
127 - $addressListPage.show(1, function() {  
128 - $footer.hide();  
129 - }); 120 + $addressListPage.show();
130 currentPage = 'list'; 121 currentPage = 'list';
131 $navTitle.html('地区选择'); 122 $navTitle.html('地区选择');
132 }); 123 });
@@ -165,7 +156,6 @@ $.get('/home/locationList').then(function(html) { @@ -165,7 +156,6 @@ $.get('/home/locationList').then(function(html) {
165 $editAddressPage.show(); 156 $editAddressPage.show();
166 currentPage = 'edit'; 157 currentPage = 'edit';
167 $navTitle.html(navTitle); 158 $navTitle.html(navTitle);
168 - $footer.show();  
169 159
170 // 恢复默认的三级选择 160 // 恢复默认的三级选择
171 $addressListPage.hide(); 161 $addressListPage.hide();
@@ -25,7 +25,6 @@ var end = false, @@ -25,7 +25,6 @@ var end = false,
25 var winH = $(window).height(); 25 var winH = $(window).height();
26 26
27 load.init(); 27 load.init();
28 -  
29 function moreRecord(cb) { 28 function moreRecord(cb) {
30 var count = $page.children('.browse-record-good').length; 29 var count = $page.children('.browse-record-good').length;
31 30
@@ -61,7 +60,7 @@ function moreRecord(cb) { @@ -61,7 +60,7 @@ function moreRecord(cb) {
61 60
62 lazyLoad($page.find('.browse-record-good:gt(' + (count - 1) + ') .lazy')); 61 lazyLoad($page.find('.browse-record-good:gt(' + (count - 1) + ') .lazy'));
63 } 62 }
64 - 63 + window.rePosFooter();
65 page++; 64 page++;
66 65
67 if (cb) { 66 if (cb) {
@@ -99,6 +98,7 @@ $page.on('touchstart', '.del-icon', function() { @@ -99,6 +98,7 @@ $page.on('touchstart', '.del-icon', function() {
99 rightBtnText: '确定' 98 rightBtnText: '确定'
100 } 99 }
101 }, function() { 100 }, function() {
  101 +
102 $.ajax({ 102 $.ajax({
103 type: 'GET', 103 type: 'GET',
104 url: '/home/delRecord', 104 url: '/home/delRecord',
@@ -107,7 +107,12 @@ $page.on('touchstart', '.del-icon', function() { @@ -107,7 +107,12 @@ $page.on('touchstart', '.del-icon', function() {
107 }, 107 },
108 success: function(data) { 108 success: function(data) {
109 if (data.code === 200) { 109 if (data.code === 200) {
110 - window.history.go(0); 110 + dialog.showDialog({
  111 + dialogText: '删除浏览记录成功',
  112 + autoHide: true,
  113 + fast: true
  114 + });
  115 + setTimeout(function(){window.history.go(0);},1000);
111 } 116 }
112 }, 117 },
113 complete: function() { 118 complete: function() {
@@ -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) {
@@ -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('click', function() { 41 +$('.goodsDiscount .dropdown').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();
@@ -46,5 +46,7 @@ $('.goodsDiscount .dropdown').on('click', function() { @@ -46,5 +46,7 @@ $('.goodsDiscount .dropdown').on('click', function() {
46 $discountArrow.removeClass('icon-up').addClass('icon-down').html(''); 46 $discountArrow.removeClass('icon-up').addClass('icon-down').html('');
47 $discountFolder.slideUp(); 47 $discountFolder.slideUp();
48 } 48 }
  49 +
  50 + return false;
49 }); 51 });
50 require('./like'); 52 require('./like');
@@ -3,100 +3,101 @@ @@ -3,100 +3,101 @@
3 * @author: Lynnic 3 * @author: Lynnic
4 * @date: 2015/11/25 4 * @date: 2015/11/25
5 */ 5 */
6 -var $ = require('jquery'),  
7 - loading = require('../../plugin/loading'),  
8 - tip = require('../../plugin/tip');  
9 -  
10 -var loadMoreUrl = $('#loadMoreUrl').val(),  
11 - $commentsDiv = $('#goods-comments'),  
12 - $consultsDiv = $('#goods-consults'),  
13 - winH = $(window).height(),  
14 - searching = false,  
15 - end = false;  
16 -  
17 -var jsonObj;  
18 -  
19 -//插入评论列表底部  
20 -function insertCommentsDiv(json) {  
21 - var html = '';  
22 - var i;  
23 -  
24 -  
25 - for (i = 0; i < json.length; i++) {  
26 - html += '<div class="comment-item">';  
27 - html += '<span class="user-name">' + json[i].userName + '</span>';  
28 - html += '<span class="goods-spec">' + json[i].desc + '</span>';  
29 - html += '<span class="goods-spec">' + json[i].content + '</span>';  
30 - html += '<span class="goods-spec">' + json[i].time + '</span>';  
31 - }  
32 - $commentsDiv.append(html);  
33 -}  
34 -  
35 -//插入咨询列表底部  
36 -function insertConsultsDiv(json) {  
37 - var html = '';  
38 - var i;  
39 -  
40 -  
41 - for (i = 0; i < json.length; i++) {  
42 - html += '<div class="consult-item"> ';  
43 - html += '<div class="question"> ';  
44 - html += '<span class="iconfont">&#xe639;</span> ';  
45 - html += '<p> ';  
46 - html += json[i].question + '<br> ';  
47 - html += '<span class="time">' + json[i].time + '</span> ';  
48 - html += '</p> ';  
49 - html += '</div> ';  
50 -  
51 - html += '<div class="answer"> ';  
52 - html += '<span class="iconfont">&#xe63c;</span> ';  
53 - html += '<p>' + json[i].answer + '</p> ';  
54 - html += '</div> ';  
55 - html += '</div> ';  
56 - }  
57 - $consultsDiv.append(html);  
58 -}  
59 -  
60 -function search() {  
61 - if (searching || end) {  
62 - return;  
63 - }  
64 - searching = true;  
65 -  
66 - loading.showLoadingMask();  
67 -  
68 - $.ajax({  
69 - type: 'GET',  
70 - url: loadMoreUrl,  
71 - success: function(data) {  
72 - if (data.length > 0) {  
73 - jsonObj = JSON.parse(data);  
74 - if ($commentsDiv.length > 0) {  
75 - insertCommentsDiv(jsonObj);  
76 - } else if ($consultsDiv.length > 0) {  
77 - insertConsultsDiv(jsonObj);  
78 - }  
79 - }  
80 - searching = false;  
81 - end = true;  
82 - loading.hideLoadingMask();  
83 - },  
84 - error: function() {  
85 - tip.show('网络断开连接了~');  
86 - searching = false;  
87 - loading.hideLoadingMask();  
88 - }  
89 - });  
90 -}  
91 -  
92 -  
93 -function scrollHandler() {  
94 - if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) {  
95 - search();  
96 - }  
97 -}  
98 -  
99 -//srcoll to load more  
100 -$(window).scroll(function() {  
101 - window.requestAnimationFrame(scrollHandler);  
102 -});  
  6 +
  7 +// var $ = require('jquery'),
  8 +// loading = require('../../plugin/loading'),
  9 +// tip = require('../../plugin/tip');
  10 +
  11 +// var loadMoreUrl = $('#loadMoreUrl').val(),
  12 +// $commentsDiv = $('#goods-comments'),
  13 +// $consultsDiv = $('#goods-consults'),
  14 +// winH = $(window).height(),
  15 +// searching = false,
  16 +// end = false;
  17 +
  18 +// var jsonObj;
  19 +
  20 +// //插入评论列表底部
  21 +// function insertCommentsDiv(json) {
  22 +// var html = '';
  23 +// var i;
  24 +
  25 +
  26 +// for (i = 0; i < json.length; i++) {
  27 +// html += '<div class="comment-item">';
  28 +// html += '<span class="user-name">' + json[i].userName + '</span>';
  29 +// html += '<span class="goods-spec">' + json[i].desc + '</span>';
  30 +// html += '<span class="goods-spec">' + json[i].content + '</span>';
  31 +// html += '<span class="goods-spec">' + json[i].time + '</span>';
  32 +// }
  33 +// $commentsDiv.append(html);
  34 +// }
  35 +
  36 +// //插入咨询列表底部
  37 +// function insertConsultsDiv(json) {
  38 +// var html = '';
  39 +// var i;
  40 +
  41 +
  42 +// for (i = 0; i < json.length; i++) {
  43 +// html += '<div class="consult-item"> ';
  44 +// html += '<div class="question"> ';
  45 +// html += '<span class="iconfont">&#xe639;</span> ';
  46 +// html += '<p> ';
  47 +// html += json[i].question + '<br> ';
  48 +// html += '<span class="time">' + json[i].time + '</span> ';
  49 +// html += '</p> ';
  50 +// html += '</div> ';
  51 +
  52 +// html += '<div class="answer"> ';
  53 +// html += '<span class="iconfont">&#xe63c;</span> ';
  54 +// html += '<p>' + json[i].answer + '</p> ';
  55 +// html += '</div> ';
  56 +// html += '</div> ';
  57 +// }
  58 +// $consultsDiv.append(html);
  59 +// }
  60 +
  61 +// function search() {
  62 +// if (searching || end) {
  63 +// return;
  64 +// }
  65 +// searching = true;
  66 +
  67 +// loading.showLoadingMask();
  68 +
  69 +// $.ajax({
  70 +// type: 'GET',
  71 +// url: loadMoreUrl,
  72 +// success: function(data) {
  73 +// if (data.length > 0) {
  74 +// jsonObj = JSON.parse(data);
  75 +// if ($commentsDiv.length > 0) {
  76 +// insertCommentsDiv(jsonObj);
  77 +// } else if ($consultsDiv.length > 0) {
  78 +// insertConsultsDiv(jsonObj);
  79 +// }
  80 +// }
  81 +// searching = false;
  82 +// end = true;
  83 +// loading.hideLoadingMask();
  84 +// },
  85 +// error: function() {
  86 +// tip.show('网络断开连接了~');
  87 +// searching = false;
  88 +// loading.hideLoadingMask();
  89 +// }
  90 +// });
  91 +// }
  92 +
  93 +
  94 +// function scrollHandler() {
  95 +// if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) {
  96 +// search();
  97 +// }
  98 +// }
  99 +
  100 +// //srcoll to load more
  101 +// $(window).scroll(function() {
  102 +// window.requestAnimationFrame(scrollHandler);
  103 +// });
@@ -97,8 +97,7 @@ a { @@ -97,8 +97,7 @@ a {
97 left: 50%; 97 left: 50%;
98 margin-left: -35%; 98 margin-left: -35%;
99 margin-top: -45px; 99 margin-top: -45px;
100 - background-color: #000;  
101 - opacity: 0.7; 100 + background-color: rgba(0,0,0,.7);
102 color: #fff; 101 color: #fff;
103 font-size: 18px; 102 font-size: 18px;
104 border: none; 103 border: none;
@@ -44,6 +44,7 @@ @@ -44,6 +44,7 @@
44 padding: 0 pxToRem(28px); 44 padding: 0 pxToRem(28px);
45 height: pxToRem(120px); 45 height: pxToRem(120px);
46 background-color: #ffffff; 46 background-color: #ffffff;
  47 + border-bottom: 1px solid $borderC;
47 i, 48 i,
48 span, 49 span,
49 a { 50 a {
@@ -64,6 +65,8 @@ @@ -64,6 +65,8 @@
64 margin-top: pxToRem(30px); 65 margin-top: pxToRem(30px);
65 padding: pxToRem(20px) pxToRem(28px); 66 padding: pxToRem(20px) pxToRem(28px);
66 background-color: #fff; 67 background-color: #fff;
  68 + border-bottom: 1px solid $borderC;
  69 + border-top: 1px solid $borderC;
67 .question { 70 .question {
68 font-size: pxToRem(24px); 71 font-size: pxToRem(24px);
69 color: $mainFontC; 72 color: $mainFontC;
@@ -169,7 +169,7 @@ $basicBtnC:#eb0313; @@ -169,7 +169,7 @@ $basicBtnC:#eb0313;
169 overflow: hidden; 169 overflow: hidden;
170 ul { 170 ul {
171 position: relative; 171 position: relative;
172 - height: 100%; 172 + height: auto;
173 li { 173 li {
174 float: left; 174 float: left;
175 } 175 }
@@ -11,6 +11,6 @@ @@ -11,6 +11,6 @@
11 <div class="null"> 11 <div class="null">
12 <i></i> 12 <i></i>
13 <p>您还没有优惠券!</p> 13 <p>您还没有优惠券!</p>
14 - <a href="{{topURL}}">随便逛逛</a> 14 + <a href="/product/new">随便逛逛</a>
15 </div> 15 </div>
16 {{/ noRecord}} 16 {{/ noRecord}}
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <div class="goto-consult"> 3 <div class="goto-consult">
4 <i class="iconfont consult-logo">&#xe639;</i> 4 <i class="iconfont consult-logo">&#xe639;</i>
5 <span>我要咨询</span> 5 <span>我要咨询</span>
6 - <a href="{{consultUrl}}" class="iconfont enter-consult-page">&#xe604;</a> 6 + <a href="/product/detail/consultform" class="iconfont enter-consult-page">&#xe604;</a>
7 </div> 7 </div>
8 {{# consults}} 8 {{# consults}}
9 <div class="goods-consults" id="goods-consults"> 9 <div class="goods-consults" id="goods-consults">
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}}
@@ -26,9 +26,9 @@ @@ -26,9 +26,9 @@
26 <span class="iconfont">&#xe63c;</span>暂无评论 26 <span class="iconfont">&#xe63c;</span>暂无评论
27 </div> 27 </div>
28 {{/if}} 28 {{/if}}
29 - <div class="comment-content-footer"> 29 + <!-- <div class="comment-content-footer">
30 <a href="{{link}}">查看更多 <span class="iconfont">&#xe604;</span></a> 30 <a href="{{link}}">查看更多 <span class="iconfont">&#xe604;</span></a>
31 - </div> 31 + </div> -->
32 </div> 32 </div>
33 33
34 <div class="consult-content content hide "> 34 <div class="consult-content content hide ">
@@ -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="{{link}}"> 53 + <a href="/product/detail/consults">
54 查看更多 54 查看更多
55 <span class="iconfont">&#xe604;</span></a> 55 <span class="iconfont">&#xe604;</span></a>
56 </div> 56 </div>
@@ -22,7 +22,7 @@ class HomeController extends AbstractAction @@ -22,7 +22,7 @@ class HomeController extends AbstractAction
22 22
23 /** 23 /**
24 * 通过当前用户审判是否跳到登录 24 * 通过当前用户审判是否跳到登录
25 - * 25 + *
26 * @param int $useSession (true:从服务端session中检查, false:从客户端cookie中检查) 26 * @param int $useSession (true:从服务端session中检查, false:从客户端cookie中检查)
27 * @return void 27 * @return void
28 */ 28 */
@@ -181,7 +181,8 @@ class HomeController extends AbstractAction @@ -181,7 +181,8 @@ class HomeController extends AbstractAction
181 $this->setNavHeader('浏览记录', true, SITE_MAIN); 181 $this->setNavHeader('浏览记录', true, SITE_MAIN);
182 182
183 $this->_view->display('browse-record', array( 183 $this->_view->display('browse-record', array(
184 - 'browseRecordPage' => true 184 + 'browseRecordPage' => true,
  185 + 'pageFooter' => true
185 )); 186 ));
186 } 187 }
187 188
@@ -351,7 +352,6 @@ class HomeController extends AbstractAction @@ -351,7 +352,6 @@ class HomeController extends AbstractAction
351 $id = $this->get('id', null); 352 $id = $this->get('id', null);
352 $data = array( 353 $data = array(
353 'addressActionPage' => true, 354 'addressActionPage' => true,
354 - 'pageFooter' => true,  
355 'addressList' => UserModel::getAddressListData($uid) 355 'addressList' => UserModel::getAddressListData($uid)
356 ); 356 );
357 357
@@ -627,7 +627,7 @@ class HomeController extends AbstractAction @@ -627,7 +627,7 @@ class HomeController extends AbstractAction
627 627
628 /* 628 /*
629 * 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders) 629 * 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
630 - * 630 + *
631 */ 631 */
632 632
633 public function orderAction() 633 public function orderAction()
@@ -763,7 +763,7 @@ class HomeController extends AbstractAction @@ -763,7 +763,7 @@ class HomeController extends AbstractAction
763 /* 763 /*
764 * 我的订单-付款跳转页 764 * 我的订单-付款跳转页
765 */ 765 */
766 - public function payAction() 766 + public function payAction()
767 { 767 {
768 $this->_view->display('pay', array( 768 $this->_view->display('pay', array(
769 'payAppInfo' => array( 769 'payAppInfo' => array(
@@ -774,7 +774,7 @@ class HomeController extends AbstractAction @@ -774,7 +774,7 @@ class HomeController extends AbstractAction
774 'hint' => '需下载微信客户端', 774 'hint' => '需下载微信客户端',
775 'subHint' => '推荐使用', 775 'subHint' => '推荐使用',
776 ), 776 ),
777 - 777 +
778 ), 778 ),
779 )); 779 ));
780 } 780 }
@@ -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 }