Authored by zhangxiaoru

yohocoin

@@ -16,7 +16,7 @@ const myCurrency = (req, res, next) => { @@ -16,7 +16,7 @@ const myCurrency = (req, res, next) => {
16 let gender = req.query.gender || '1,3'; 16 let gender = req.query.gender || '1,3';
17 let lifestyleHomePage = ''; 17 let lifestyleHomePage = '';
18 18
19 - if(gender === '3,3') { 19 + if (gender === '3,3') {
20 lifestyleHomePage = true; 20 lifestyleHomePage = true;
21 } else { 21 } else {
22 lifestyleHomePage = false; 22 lifestyleHomePage = false;
@@ -25,11 +25,11 @@ const bannerData = (contentCode) => { @@ -25,11 +25,11 @@ const bannerData = (contentCode) => {
25 return serviceAPI.get('operations/api/v5/resource/get', { 25 return serviceAPI.get('operations/api/v5/resource/get', {
26 content_code: contentCode 26 content_code: contentCode
27 }).then((result) => { 27 }).then((result) => {
28 - //console.log(result) 28 + // console.log(result)
29 29
30 if (result && result.code === 200) { 30 if (result && result.code === 200) {
31 31
32 - return result.data 32 + return result.data;
33 33
34 } else { 34 } else {
35 logger.error('banner is not 200'); 35 logger.error('banner is not 200');
@@ -40,13 +40,13 @@ const bannerData = (contentCode) => { @@ -40,13 +40,13 @@ const bannerData = (contentCode) => {
40 40
41 const myCurrency = (uid, contentCode) => { 41 const myCurrency = (uid, contentCode) => {
42 return Promise.all([yohoCoin(uid), bannerData(contentCode)]) 42 return Promise.all([yohoCoin(uid), bannerData(contentCode)])
43 - .then((result) => { 43 + .then((result) => {
44 44
45 - return {  
46 - yohoCoin: result[0],  
47 - banner: result[1]  
48 - };  
49 - }); 45 + return {
  46 + yohoCoin: result[0],
  47 + banner: result[1]
  48 + };
  49 + });
50 }; 50 };
51 51
52 const currencyDetail = (uid, page, limit) => { 52 const currencyDetail = (uid, page, limit) => {
@@ -87,7 +87,7 @@ const currencyDetail = (uid, page, limit) => { @@ -87,7 +87,7 @@ const currencyDetail = (uid, page, limit) => {
87 }; 87 };
88 88
89 const mayLike = (uid, page, limit, udid, gender, recPos, channel) => { 89 const mayLike = (uid, page, limit, udid, gender, recPos, channel) => {
90 - return api.get('', { 90 + return api.get('', {
91 method: 'app.search.newLast7day', 91 method: 'app.search.newLast7day',
92 uid: uid, 92 uid: uid,
93 page: page, 93 page: page,
@@ -96,9 +96,9 @@ const mayLike = (uid, page, limit, udid, gender, recPos, channel) => { @@ -96,9 +96,9 @@ const mayLike = (uid, page, limit, udid, gender, recPos, channel) => {
96 rec_pos: recPos, 96 rec_pos: recPos,
97 yh_channel: channel 97 yh_channel: channel
98 }).then((result) => { 98 }).then((result) => {
99 - console.log(result) 99 + console.log(result);
100 }); 100 });
101 -} 101 +};
102 102
103 module.exports = { 103 module.exports = {
104 myCurrency, 104 myCurrency,
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 40
41 // // ajax url 41 // // ajax url
42 // if (kidsType) { 42 // if (kidsType) {
43 - 43 +
44 // url = '/product/recom/maylikekids'; 44 // url = '/product/recom/maylikekids';
45 // } else if (lifestyleType) { 45 // } else if (lifestyleType) {
46 46
@@ -270,7 +270,7 @@ module.exports = function(specificGender) { @@ -270,7 +270,7 @@ module.exports = function(specificGender) {
270 url, 270 url,
271 RECPOSE = '110001'; 271 RECPOSE = '110001';
272 272
273 - //The kidsType can be specified by the parameter. Add by @ZhaoBiao 273 + // The kidsType can be specified by the parameter. Add by @ZhaoBiao
274 var kidsType = specificGender === 'kids' || $('.mobile-wrap').hasClass('kids-wrap') ? true : false, 274 var kidsType = specificGender === 'kids' || $('.mobile-wrap').hasClass('kids-wrap') ? true : false,
275 lifestyleType = specificGender === 'lifestyle' || 275 lifestyleType = specificGender === 'lifestyle' ||
276 $('.mobile-wrap').hasClass('lifestyle-wrap') ? true : false, 276 $('.mobile-wrap').hasClass('lifestyle-wrap') ? true : false,
@@ -284,13 +284,13 @@ module.exports = function(specificGender) { @@ -284,13 +284,13 @@ module.exports = function(specificGender) {
284 284
285 ellipsis.init(); 285 ellipsis.init();
286 286
287 - //ajax url 287 + // ajax url
288 if (kidsType) { 288 if (kidsType) {
289 - 289 +
290 url = '/product/recom/maylikekids'; 290 url = '/product/recom/maylikekids';
291 } else if (lifestyleType) { 291 } else if (lifestyleType) {
292 292
293 - //有货币页面加载男生首页的数据 293 + // 有货币页面加载男生首页的数据
294 url = specificGender === 'lifestyle' ? '/product/recom/maylike?gender=1,3&rec_pos=100001' : '/product/recom/maylikelife'; 294 url = specificGender === 'lifestyle' ? '/product/recom/maylike?gender=1,3&rec_pos=100001' : '/product/recom/maylikelife';
295 } else if (yohoCoinType) { 295 } else if (yohoCoinType) {
296 296
@@ -299,7 +299,7 @@ module.exports = function(specificGender) { @@ -299,7 +299,7 @@ module.exports = function(specificGender) {
299 url = '/product/recom/maylike?gender=' + gender; 299 url = '/product/recom/maylike?gender=' + gender;
300 RECPOSE = 110009; 300 RECPOSE = 110009;
301 301
302 - } else if (logisticType) { //物流页面 302 + } else if (logisticType) { // 物流页面
303 gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ? 303 gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ?
304 '1,3&rec_pos=100006' : '2,3&rec_pos=100006', 304 '1,3&rec_pos=100006' : '2,3&rec_pos=100006',
305 url = '/product/recom/maylike?gender=' + gender; 305 url = '/product/recom/maylike?gender=' + gender;
@@ -311,12 +311,12 @@ module.exports = function(specificGender) { @@ -311,12 +311,12 @@ module.exports = function(specificGender) {
311 url = '/product/recom/maylike?gender=' + gender; 311 url = '/product/recom/maylike?gender=' + gender;
312 } 312 }
313 313
314 - //日韩馆-你可能喜欢的 314 + // 日韩馆-你可能喜欢的
315 if ($('.mobile-wrap').hasClass('yoho-channel-page')) { 315 if ($('.mobile-wrap').hasClass('yoho-channel-page')) {
316 url = '/product/recom/newPreference?template_id=' + $.queryString().template_id; 316 url = '/product/recom/newPreference?template_id=' + $.queryString().template_id;
317 } 317 }
318 318
319 - //首页男生和女生,推荐位ID,埋点 319 + // 首页男生和女生,推荐位ID,埋点
320 if (window.location.pathname === '/boys') { 320 if (window.location.pathname === '/boys') {
321 RECPOSE = 110001; 321 RECPOSE = 110001;
322 } else if (window.location.pathname === '/girls') { 322 } else if (window.location.pathname === '/girls') {
@@ -349,7 +349,7 @@ module.exports = function(specificGender) { @@ -349,7 +349,7 @@ module.exports = function(specificGender) {
349 349
350 $curNav = $this; 350 $curNav = $this;
351 351
352 - $(document).trigger('scroll'); //Trigger lazyLoad 352 + $(document).trigger('scroll'); // Trigger lazyLoad
353 e.srcEvent.stopPropagation(); 353 e.srcEvent.stopPropagation();
354 }); 354 });
355 } 355 }
@@ -365,7 +365,7 @@ module.exports = function(specificGender) { @@ -365,7 +365,7 @@ module.exports = function(specificGender) {
365 365
366 loading.showLoadingMask(); 366 loading.showLoadingMask();
367 367
368 - //num = $goodList.find('.good-info').length; 368 + // num = $goodList.find('.good-info').length;
369 $.ajax({ 369 $.ajax({
370 type: 'GET', 370 type: 'GET',
371 url: url, 371 url: url,
@@ -403,7 +403,7 @@ module.exports = function(specificGender) { @@ -403,7 +403,7 @@ module.exports = function(specificGender) {
403 return; 403 return;
404 } 404 }
405 405
406 - //加载到数据后,去除bottom样式,使得footer能够随着页面长度的增加改变位置 406 + // 加载到数据后,去除bottom样式,使得footer能够随着页面长度的增加改变位置
407 if (data.length > 1) { 407 if (data.length > 1) {
408 $footer ? null : $footer = $('#yoho-footer'); 408 $footer ? null : $footer = $('#yoho-footer');
409 $footer.hasClass('bottom') ? $footer.removeClass('bottom') : null; 409 $footer.hasClass('bottom') ? $footer.removeClass('bottom') : null;
@@ -431,7 +431,7 @@ module.exports = function(specificGender) { @@ -431,7 +431,7 @@ module.exports = function(specificGender) {
431 $title[0].mlellipsis(2); 431 $title[0].mlellipsis(2);
432 }); 432 });
433 433
434 - //为您优选埋点 start 434 + // 为您优选埋点 start
435 $(data).closest('.good-info').each(function() { 435 $(data).closest('.good-info').each(function() {
436 PRDID.push($(this).data('id')); 436 PRDID.push($(this).data('id'));
437 }); 437 });
@@ -442,7 +442,8 @@ module.exports = function(specificGender) { @@ -442,7 +442,8 @@ module.exports = function(specificGender) {
442 'ACTION_ID': 0, 442 'ACTION_ID': 0,
443 'page_num': RECPOSE === 110009 ? 1 : page 443 'page_num': RECPOSE === 110009 ? 1 : page
444 }); 444 });
445 - //为您优选埋点 end 445 +
  446 + // 为您优选埋点 end
446 }, 447 },
447 error: function() { 448 error: function() {
448 tip.show('网络断开连接了~'); 449 tip.show('网络断开连接了~');
@@ -467,12 +468,12 @@ module.exports = function(specificGender) { @@ -467,12 +468,12 @@ module.exports = function(specificGender) {
467 search(); 468 search();
468 } 469 }
469 470
470 - //srcoll to load more 471 + // srcoll to load more
471 $(window).scroll(function() { 472 $(window).scroll(function() {
472 window.requestAnimationFrame(scrollHandler); 473 window.requestAnimationFrame(scrollHandler);
473 }); 474 });
474 475
475 - //为您优选埋点 http://redmine.yoho.cn/issues/10116 476 + // 为您优选埋点 http://redmine.yoho.cn/issues/10116
476 $('.maybe-like .goods-list').on('click', 'a', function() { 477 $('.maybe-like .goods-list').on('click', 'a', function() {
477 var index = $(this).closest('.good-info').index() + 1, 478 var index = $(this).closest('.good-info').index() + 1,
478 pageNum = 50; 479 pageNum = 50;