Authored by 梁志锋

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

@@ -83,12 +83,20 @@ $loginBtn.on('touchstart', function() { @@ -83,12 +83,20 @@ $loginBtn.on('touchstart', function() {
83 password: pwd 83 password: pwd
84 }, 84 },
85 success: function(data) { 85 success: function(data) {
  86 + var res;
  87 +
86 if (data.code === 200) { 88 if (data.code === 200) {
  89 + res = data.data;
87 showErrTip('登录成功'); 90 showErrTip('登录成功');
88 91
  92 + $.ajax({
  93 + url: res.session,
  94 + dataType: 'jsonp'
  95 + });
  96 +
89 //1000ms后跳转页面 97 //1000ms后跳转页面
90 setTimeout(function() { 98 setTimeout(function() {
91 - location.href = data.data; 99 + location.href = res.href;
92 }, 1000); 100 }, 1000);
93 } else { 101 } else {
94 showErrTip(data.message); 102 showErrTip(data.message);
@@ -94,7 +94,8 @@ $loginBtn.on('touchstart', function() { @@ -94,7 +94,8 @@ $loginBtn.on('touchstart', function() {
94 showErrTip('登录成功'); 94 showErrTip('登录成功');
95 95
96 $.ajax({ 96 $.ajax({
97 - url: res.session 97 + url: res.session,
  98 + dataType: 'jsonp'
98 }); 99 });
99 100
100 //1s后跳转页面 101 //1s后跳转页面
@@ -46,12 +46,20 @@ $btnSure.on('touchstart', function() { @@ -46,12 +46,20 @@ $btnSure.on('touchstart', function() {
46 token: $('#token').val() 46 token: $('#token').val()
47 }, 47 },
48 success: function(data) { 48 success: function(data) {
  49 + var res;
  50 +
49 if (data.code === 200) { 51 if (data.code === 200) {
  52 + res = data.data;
50 showErrTip('注册成功'); 53 showErrTip('注册成功');
51 54
  55 + $.ajax({
  56 + url: res.session,
  57 + dataType: 'jsonp'
  58 + });
  59 +
52 //1000ms后跳转页面 60 //1000ms后跳转页面
53 setTimeout(function() { 61 setTimeout(function() {
54 - location.href = data.data; 62 + location.href = res.href;
55 }, 1000); 63 }, 1000);
56 } else { 64 } else {
57 showErrTip(data.message); 65 showErrTip(data.message);
@@ -12,8 +12,46 @@ var page = 1, @@ -12,8 +12,46 @@ var page = 1,
12 notab = 0, 12 notab = 0,
13 sort = '', 13 sort = '',
14 id = '', 14 id = '',
  15 + hotrankNav,
15 noResult = '<p class="no-result">未找到相关搜索结果</p>'; 16 noResult = '<p class="no-result">未找到相关搜索结果</p>';
16 17
  18 +// var renderRank = {
  19 +// errMsg: '<p class="no-result">未找到相关搜索结果</p>',
  20 +// navSelector: '.goods-nav',
  21 +// rankSelector: '#hotRank',
  22 +// navHTML: null,
  23 +// data: null,
  24 +// inited: 0,
  25 +// setData: function(data) {
  26 +// this.data = data;
  27 +// },
  28 +// showDataEmptyMsg: function() {
  29 +// $(this.rankSelector).append(this.errMsg);
  30 +// },
  31 +// isDataEmpty: function() {
  32 +// if (this.data.indexOf('>') === -1) {
  33 +// return true;
  34 +// } else {
  35 +// return false;
  36 +// }
  37 +// },
  38 +// appendData: function() {
  39 +// if (!this.inited) {
  40 +// this.inited = 1;
  41 +// }
  42 +// $(this.rankSelector).append(this.data);
  43 +// },
  44 +// render: function(data) {
  45 +// this.setData(data);
  46 +// if (!this.isDataEmpty()) {
  47 +// this.appendData();
  48 +// } else {
  49 +// this.showDataEmptyMsg();
  50 +// }
  51 +// }
  52 +
  53 +// };
  54 +
17 function hotrank(page, sort, tabId, notab) { 55 function hotrank(page, sort, tabId, notab) {
18 loading.showLoadingMask(); 56 loading.showLoadingMask();
19 $.ajax({ 57 $.ajax({
@@ -26,15 +64,47 @@ function hotrank(page, sort, tabId, notab) { @@ -26,15 +64,47 @@ function hotrank(page, sort, tabId, notab) {
26 notab: notab 64 notab: notab
27 }, 65 },
28 success: function(data) { 66 success: function(data) {
29 - console.log(data);  
30 - if (page === 1) {  
31 - $('.rank-main').remove();  
32 - }  
33 - if (data === ' ' && $('.rank-main ul li').length < 1) {  
34 - $('#hotRank').html(noResult); 67 +
  68 + // if (page === 1) {
  69 + // $('.no-result').remove();
  70 + // $('.rank-main').remove();
  71 + // }
  72 +
  73 + // if (notab === 1) {
  74 + // if (data === ' ' && $('.rank-main').length < 1) {
  75 + // var hotrankNav = $('.goods-nav').prop("outerHTML");
  76 +
  77 + // $('#hotRank').html(hotrankNav + noResult);
  78 + // } else {
  79 + // $('#hotRank').append(data);
  80 + // }
  81 + // } else {
  82 + // if (data === ' ') {
  83 + // $('#hotRank').html(noResult);
  84 + // } else {
  85 + // $('#hotRank').append(data);
  86 + // }
  87 + // }
  88 + if (data === ' ') {
  89 + if ($('.rank-main').length < 1 && $('.goods-nav').length < 1) {
  90 + $('#hotRank').html(noResult);
  91 + } else {
  92 + if (page === 1) {
  93 + hotrankNav = $('.goods-nav').prop('outerHTML');
  94 +
  95 + $('#hotRank').html(hotrankNav + noResult);
  96 + }
  97 + }
35 } else { 98 } else {
  99 + $('.no-result').remove();
  100 + $('.rank-main').remove();
36 $('#hotRank').append(data); 101 $('#hotRank').append(data);
37 } 102 }
  103 +
  104 + // renderRank.render(data);
  105 +
  106 +
  107 +
38 lazyLoad($('img.lazy')); 108 lazyLoad($('img.lazy'));
39 $('.rank-main ul li:gt(2)').find('.item-content i').removeClass('top'); 109 $('.rank-main ul li:gt(2)').find('.item-content i').removeClass('top');
40 winH = $(window).height(); 110 winH = $(window).height();
@@ -83,7 +153,11 @@ hotnav.on('tap', function(e) { @@ -83,7 +153,11 @@ hotnav.on('tap', function(e) {
83 id = target.getAttribute('data-id') ? target.getAttribute('data-id') : ''; 153 id = target.getAttribute('data-id') ? target.getAttribute('data-id') : '';
84 sort = target.getAttribute('data-sort') ? target.getAttribute('data-sort') : ''; 154 sort = target.getAttribute('data-sort') ? target.getAttribute('data-sort') : '';
85 page = 1; 155 page = 1;
  156 +
  157 + // notab = renderRank.inited;
86 notab = 1; 158 notab = 1;
  159 +
  160 +
87 hotrank(page, sort, id, notab); 161 hotrank(page, sort, id, notab);
88 } 162 }
89 }); 163 });
@@ -31,6 +31,8 @@ $basicBtnC:#eb0313; @@ -31,6 +31,8 @@ $basicBtnC:#eb0313;
31 margin-bottom: pxToRem(20px); 31 margin-bottom: pxToRem(20px);
32 font-size: pxToRem(24px); 32 font-size: pxToRem(24px);
33 line-height: pxToRem(36px); 33 line-height: pxToRem(36px);
  34 + display: flex;
  35 + flex-wrap: wrap;
34 &.table { 36 &.table {
35 width: 100%; 37 width: 100%;
36 .column { 38 .column {
@@ -42,6 +44,8 @@ $basicBtnC:#eb0313; @@ -42,6 +44,8 @@ $basicBtnC:#eb0313;
42 font-size: pxToRem(24px); 44 font-size: pxToRem(24px);
43 background-color: $tableCellC; 45 background-color: $tableCellC;
44 float: left; 46 float: left;
  47 + display: flex;
  48 + align-items: center;
45 } 49 }
46 } 50 }
47 } 51 }
@@ -602,9 +602,8 @@ class HomeController extends AbstractAction @@ -602,9 +602,8 @@ class HomeController extends AbstractAction
602 //显示网站导航头部信息 602 //显示网站导航头部信息
603 $this->setNavHeader('会员等级'); 603 $this->setNavHeader('会员等级');
604 604
605 - $gender = Helpers::getGenderByCookie();  
606 $channel = Helpers::getChannelByCookie(); 605 $channel = Helpers::getChannelByCookie();
607 - $data = GradeModel::getGrade($gender, $channel, $this->_uid); 606 + $data = GradeModel::getGrade($channel, $this->_uid);
608 $data['pageFooter'] = true; 607 $data['pageFooter'] = true;
609 608
610 $this->_view->display('vip-grade', $data); 609 $this->_view->display('vip-grade', $data);
@@ -237,7 +237,7 @@ class UserModel @@ -237,7 +237,7 @@ class UserModel
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_id'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : ''; 240 + $product['link'] = isset($val['goodsList'][0]) ? Helpers::url('/product/pro_' . $val['product_id'] . '_' . $val['goodsList'][0]['id'] . '/' . $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;
@@ -23,16 +23,16 @@ class NewsaleModel @@ -23,16 +23,16 @@ class NewsaleModel
23 /* 男生频道取新品到着及折扣专区数据的位置码 */ 23 /* 男生频道取新品到着及折扣专区数据的位置码 */
24 24
25 const CODE_TOP_NEW_BOYS = '3cf2c1be5217fbab6009ce83959e1e12'; 25 const CODE_TOP_NEW_BOYS = '3cf2c1be5217fbab6009ce83959e1e12';
26 - const CODE_TOP_SALE_BOYS = '153180b9a88c0b565848850c523bb637'; 26 + const CODE_TOP_SALE_BOYS = 'e9c9be32d72e2906d404a72ee24cb523';
27 /* 女生频道取新品到着及折扣专区数据的位置码 */ 27 /* 女生频道取新品到着及折扣专区数据的位置码 */
28 const CODE_TOP_NEW_GIRLS = '1cf7f9f10e2a2670e73d05c568793ad9'; 28 const CODE_TOP_NEW_GIRLS = '1cf7f9f10e2a2670e73d05c568793ad9';
29 - const CODE_TOP_SALE_GIRLS = '0b2d133419a0f7c381306fd3522365e1'; 29 + const CODE_TOP_SALE_GIRLS = '785c0e6aab746949073c4ffb9d5106ac';
30 /* 潮童频道取新品到着及折扣专区数据的位置码 */ 30 /* 潮童频道取新品到着及折扣专区数据的位置码 */
31 const CODE_TOP_NEW_KIDS = '57457adececa6c748b29c90cad0ae940'; 31 const CODE_TOP_NEW_KIDS = '57457adececa6c748b29c90cad0ae940';
32 - const CODE_TOP_SALE_KIDS = 'de23648d28ee1e8a3f087a9dbac506f8'; 32 + const CODE_TOP_SALE_KIDS = 'ad1bb67a6007819c86f737d74172fd2e';
33 /* 创意生活频道取新品到着及折扣专区数据的位置码 */ 33 /* 创意生活频道取新品到着及折扣专区数据的位置码 */
34 const CODE_TOP_NEW_LIFESTYLE = '04953a61cbf1db426a681e55d496d2fe'; 34 const CODE_TOP_NEW_LIFESTYLE = '04953a61cbf1db426a681e55d496d2fe';
35 - const CODE_TOP_SALE_LIFESTYLE = '01269e498ff5b07756e0733ec0e88c75'; 35 + const CODE_TOP_SALE_LIFESTYLE = '8132c7db3adbeb7b0d0002de9691c753';
36 36
37 /** 37 /**
38 * 获取新品到着的焦点图资源数据 38 * 获取新品到着的焦点图资源数据