Authored by biao

fix pay center bug. code review by guanning

@@ -182,17 +182,19 @@ class NewsaleData @@ -182,17 +182,19 @@ class NewsaleData
182 * 获取热销排行榜商品数据 182 * 获取热销排行榜商品数据
183 * 183 *
184 * @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部 184 * @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
  185 + * $param integer $channel 1表示男,2表示女,3表示潮童,4表示创意生活
185 * @param string|null $sort 品类ID查询参数 186 * @param string|null $sort 品类ID查询参数
186 * @param integer|null $tab_id Tab的ID 187 * @param integer|null $tab_id Tab的ID
187 * @param integer $limit 查询返回的最大限制数, 默认为50 188 * @param integer $limit 查询返回的最大限制数, 默认为50
188 * @param integer $page 分页第几页, 默认第1页 189 * @param integer $page 分页第几页, 默认第1页
189 * @return array 新品到着商品数据 190 * @return array 新品到着商品数据
190 */ 191 */
191 - public static function getTopProducts($gender, $sort = null, $tab_id = null, $limit = 50, $page = 1) 192 + public static function getTopProducts($gender, $channel, $sort = null, $tab_id = null, $limit = 50, $page = 1)
192 { 193 {
193 $param = Yohobuy::param(); 194 $param = Yohobuy::param();
194 $param['method'] = 'app.search.top'; 195 $param['method'] = 'app.search.top';
195 $param['gender'] = $gender; 196 $param['gender'] = $gender;
  197 + $param['yh_channel'] = $gender;
196 !empty($sort) && $param['sort'] = $sort; 198 !empty($sort) && $param['sort'] = $sort;
197 !empty($tab_id) && $param['tab_id'] = $tab_id; 199 !empty($tab_id) && $param['tab_id'] = $tab_id;
198 $param['page'] = $page; 200 $param['page'] = $page;
@@ -103,7 +103,7 @@ function hideWeChatPay() { @@ -103,7 +103,7 @@ function hideWeChatPay() {
103 var $payApps = $('.app'); 103 var $payApps = $('.app');
104 104
105 $payApps.each(function(idx, app) { 105 $payApps.each(function(idx, app) {
106 - if ($(app).attr('id') === 'weixin') { 106 + if ($(app).parent().attr('id') === 'weixin') {
107 $(app).parent().css('display', 'none'); 107 $(app).parent().css('display', 'none');
108 return false; 108 return false;
109 } 109 }
@@ -64,11 +64,21 @@ lazyLoad(); @@ -64,11 +64,21 @@ lazyLoad();
64 headerNavHammer = new Hammer(document.getElementById('yoho-header')); 64 headerNavHammer = new Hammer(document.getElementById('yoho-header'));
65 65
66 headerNavHammer.on('tap', function(e) { 66 headerNavHammer.on('tap', function(e) {
67 - var suggestText = $('#suggest-textarea').val(); 67 + var suggestText = $('#suggest-textarea').val(),
  68 + textReg = /\S+/;
68 69
69 70
70 if ($(e.target).hasClass('nav-btn')) { 71 if ($(e.target).hasClass('nav-btn')) {
71 72
  73 + if (!textReg.test(suggestText)) {
  74 + diaLog.showDialog({
  75 + autoHide: true,
  76 + dialogText: '意见不能为空'
  77 + });
  78 +
  79 + return;
  80 + }
  81 +
72 $.ajax({ 82 $.ajax({
73 method: 'post', 83 method: 'post',
74 url: '/home/savesuggest', 84 url: '/home/savesuggest',
@@ -85,10 +95,18 @@ headerNavHammer.on('tap', function(e) { @@ -85,10 +95,18 @@ headerNavHammer.on('tap', function(e) {
85 setTimeout(function() { 95 setTimeout(function() {
86 location.pathname = 'home/suggest'; 96 location.pathname = 'home/suggest';
87 }, 2000); 97 }, 2000);
  98 + } else {
  99 + diaLog.showDialog({
  100 + autoHide: true,
  101 + dialogText: '提交失败~'
  102 + });
88 } 103 }
89 }).fail(function() { 104 }).fail(function() {
90 105
91 - //TODO 106 + diaLog.showDialog({
  107 + autoHide: true,
  108 + dialogText: '网络错误~'
  109 + });
92 }); 110 });
93 } 111 }
94 }); 112 });
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 > div { 36 > div {
37 width: 60rem / $pxConvertRem; 37 width: 60rem / $pxConvertRem;
38 height: 60rem / $pxConvertRem; 38 height: 60rem / $pxConvertRem;
39 - background-image: url(http://localhost:8000/img/layout/pay-icon.png); 39 + background-image: image-url("/img/layout/pay-icon.png");
40 background-size: 90%; 40 background-size: 90%;
41 background-position-y: 8rem / $pxConvertRem; 41 background-position-y: 8rem / $pxConvertRem;
42 background-position-x: center; 42 background-position-x: center;
1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="brand-page yoho-page"> 2 <div class="brand-page yoho-page">
  3 + {{# channel}}
  4 +
3 <div class="newbrand-search"> 5 <div class="newbrand-search">
4 <div class="search-box clearfix"> 6 <div class="search-box clearfix">
5 <a href="{{searchUrl}}" > 7 <a href="{{searchUrl}}" >
@@ -40,4 +42,6 @@ @@ -40,4 +42,6 @@
40 {{/ list}} 42 {{/ list}}
41 </div> 43 </div>
42 {{/ brandList}} 44 {{/ brandList}}
  45 +
  46 + {{/channel}}
43 {{> layout/footer}} 47 {{> layout/footer}}
1 <div class="hot-brands"> 1 <div class="hot-brands">
  2 + {{^ brandPage}}
2 {{> home/floor_header}} 3 {{> home/floor_header}}
  4 + {{/ brandPage}}
3 <div class="brands-swiper"> 5 <div class="brands-swiper">
4 <ul class="brands-list swiper-wrapper clearfix"> 6 <ul class="brands-list swiper-wrapper clearfix">
5 {{# list}} 7 {{# list}}
@@ -230,6 +230,7 @@ class NewsaleModel @@ -230,6 +230,7 @@ class NewsaleModel
230 * 筛选出来的热销排行榜商品数据处理 230 * 筛选出来的热销排行榜商品数据处理
231 * 231 *
232 * @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部 232 * @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
  233 + * $param integer $channel 1表示男,2表示女,3表示潮童,4表示创意生活
233 * @param string|null $sort 品类ID查询参数 234 * @param string|null $sort 品类ID查询参数
234 * @param integer|null $tab_id Tab的ID 235 * @param integer|null $tab_id Tab的ID
235 * @param boolean $notab 时候返回顶部tab的数据,默认返回 236 * @param boolean $notab 时候返回顶部tab的数据,默认返回
@@ -237,11 +238,11 @@ class NewsaleModel @@ -237,11 +238,11 @@ class NewsaleModel
237 * @param integer $page 分页第几页 238 * @param integer $page 分页第几页
238 * @return array 处理之后的数据 239 * @return array 处理之后的数据
239 */ 240 */
240 - public static function selectTopData($gender, $sort, $tab_id, $notab, $limit, $page) 241 + public static function selectTopData($gender, $channel, $sort, $tab_id, $notab, $limit, $page)
241 { 242 {
242 $result = array(); 243 $result = array();
243 244
244 - $data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page); 245 + $data = NewsaleData::getTopProducts($gender, $channel, $sort, $tab_id, $limit, $page);
245 246
246 if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) { 247 if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) {
247 $result = NewSaleProcess::topData($data['data'], $notab, $limit, $page); 248 $result = NewSaleProcess::topData($data['data'], $notab, $limit, $page);
@@ -41,7 +41,10 @@ class BrandController extends AbstractAction @@ -41,7 +41,10 @@ class BrandController extends AbstractAction
41 } 41 }
42 42
43 // 渲染模板 43 // 渲染模板
44 - $this->_view->display('index', Category\BrandModel::getBrandByChannel($channel)); 44 + $this->_view->display('index', array(
  45 + 'brandPage' => true,
  46 + 'channel' => Category\BrandModel::getBrandByChannel($channel)
  47 + ));
45 } 48 }
46 49
47 /** 50 /**
@@ -110,7 +110,8 @@ class NewsaleController extends AbstractAction @@ -110,7 +110,8 @@ class NewsaleController extends AbstractAction
110 110
111 // 获取性别 111 // 获取性别
112 $gender = Helpers::getGenderByCookie(); 112 $gender = Helpers::getGenderByCookie();
113 - $result = \Product\NewsaleModel::selectTopData($gender, $sort, $tab_id, $notab, $limit, $page); 113 + $channel = Helpers::getChannelByCookie();
  114 + $result = \Product\NewsaleModel::selectTopData($gender, $channel, $sort, $tab_id, $notab, $limit, $page);
114 } 115 }
115 if (empty($result)) { 116 if (empty($result)) {
116 echo ' '; 117 echo ' ';