Authored by 郭成尧

Merge branch 'feature/usercenter' of git.yoho.cn:fe/yohobuywap-node into feature/usercenter

@@ -36,7 +36,7 @@ let favProduct = (req, res, next) => { @@ -36,7 +36,7 @@ let favProduct = (req, res, next) => {
36 36
37 favoriteModel.favProduct(uid, page, limit).then((result) => { 37 favoriteModel.favProduct(uid, page, limit).then((result) => {
38 38
39 - if (typeof(result.total) === "undefined") { 39 + if (typeof(result.total) === "undefined" && typeof(result.more) === "undefined") {
40 res.render('favorite/favorite-product', { 40 res.render('favorite/favorite-product', {
41 layout: false, 41 layout: false,
42 hasFavProduct: result.hasFavProduct 42 hasFavProduct: result.hasFavProduct
@@ -54,7 +54,7 @@ let favfavBrand = (req, res, next) => { @@ -54,7 +54,7 @@ let favfavBrand = (req, res, next) => {
54 54
55 favoriteModel.favfavBrand(uid, page, limit).then((result) => { 55 favoriteModel.favfavBrand(uid, page, limit).then((result) => {
56 56
57 - if (typeof(result.total) === "undefined") { 57 + if (typeof(result.total) === "undefined" && typeof(result.more) === "undefined") {
58 res.render('favorite/favorite-brand', { 58 res.render('favorite/favorite-brand', {
59 layout: false, 59 layout: false,
60 hasFavBrand: result.hasFavBrand 60 hasFavBrand: result.hasFavBrand
@@ -104,7 +104,7 @@ const favProduct = (uid, page, limit) => { @@ -104,7 +104,7 @@ const favProduct = (uid, page, limit) => {
104 }); 104 });
105 105
106 } else { 106 } else {
107 - resu.end = true; 107 + resu.more = true;
108 } 108 }
109 109
110 return resu; 110 return resu;
@@ -122,7 +122,7 @@ const favfavBrand = (uid, page, limit) => { @@ -122,7 +122,7 @@ const favfavBrand = (uid, page, limit) => {
122 page: page, 122 page: page,
123 limit: limit 123 limit: limit
124 }).then((result) => { 124 }).then((result) => {
125 - console.log(result) 125 +
126 let resu = { 126 let resu = {
127 hasFavBrand: [] 127 hasFavBrand: []
128 } 128 }
@@ -188,10 +188,9 @@ const favfavBrand = (uid, page, limit) => { @@ -188,10 +188,9 @@ const favfavBrand = (uid, page, limit) => {
188 }); 188 });
189 189
190 } else { 190 } else {
191 - resu.end = true; 191 + resu.more = true;
192 } 192 }
193 193
194 - console.log(resu);  
195 return resu; 194 return resu;
196 } else { 195 } else {
197 logger.error('收藏品牌 cood 不是 200'); 196 logger.error('收藏品牌 cood 不是 200');
@@ -38,4 +38,8 @@ @@ -38,4 +38,8 @@
38 </div> 38 </div>
39 {{/if}} 39 {{/if}}
40 </div> 40 </div>
41 -{{/ hasFavBrand}}  
  41 +{{/ hasFavBrand}}
  42 +
  43 +{{!-- {{#if more}}
  44 + <div class="fav-brand-load-more">没有更多了</div>
  45 +{{/if}} --}}
@@ -30,4 +30,7 @@ @@ -30,4 +30,7 @@
30 </div> 30 </div>
31 </a> 31 </a>
32 </li> 32 </li>
33 -{{/ hasFavProduct}}  
  33 +{{/ hasFavProduct}}
  34 +{{!-- {{#if more}}
  35 + <div class="fav-brand-load-more">没有更多了</div>
  36 +{{/if}} --}}
@@ -18,8 +18,8 @@ module.exports = { @@ -18,8 +18,8 @@ module.exports = {
18 // api: 'http://devapi.yoho.cn:58078/', 18 // api: 'http://devapi.yoho.cn:58078/',
19 // service: 'http://devservice.yoho.cn:58077/', 19 // service: 'http://devservice.yoho.cn:58077/',
20 20
21 - api: 'http://testapi.yoho.cn:28078/',  
22 - service: 'http://testservice.yoho.cn:28077/', 21 + api: 'http://api.yoho.cn/',
  22 + service: 'http://service.yoho.cn/',
23 singleApi: 'http://192.168.102.31:8092/' 23 singleApi: 'http://192.168.102.31:8092/'
24 }, 24 },
25 subDomains: { 25 subDomains: {
@@ -96,7 +96,8 @@ function loadData($parent, url, page) { @@ -96,7 +96,8 @@ function loadData($parent, url, page) {
96 $loadingMask.addClass('hide'); 96 $loadingMask.addClass('hide');
97 $parent.closest('.fav-type').find('.fav-null-box').removeClass('hide'); 97 $parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
98 window.rePosFooter(); 98 window.rePosFooter();
99 - } else if (data.end === true) { 99 + } else if (data.more === true) {
  100 + console.log(0)
100 101
101 //处理data等于end时如果loadingMask存在且没有hide样式的情况 102 //处理data等于end时如果loadingMask存在且没有hide样式的情况
102 if ($loadingMask && !$loadingMask.hasClass('hide')) { 103 if ($loadingMask && !$loadingMask.hasClass('hide')) {
@@ -204,6 +205,7 @@ favContentHammer.on('tap', function(e) { @@ -204,6 +205,7 @@ favContentHammer.on('tap', function(e) {
204 dialogText: '已经取消收藏' 205 dialogText: '已经取消收藏'
205 }); 206 });
206 $(e.target).closest('li').remove(); 207 $(e.target).closest('li').remove();
  208 + location.reload();
207 } else if (data.code === 400) { 209 } else if (data.code === 400) {
208 diaLog.showDialog({ 210 diaLog.showDialog({
209 autoHide: true, 211 autoHide: true,