Showing
5 changed files
with
20 additions
and
9 deletions
@@ -330,7 +330,7 @@ const getDynamicDataByIds = (ids, udid, other) => { | @@ -330,7 +330,7 @@ const getDynamicDataByIds = (ids, udid, other) => { | ||
330 | }); | 330 | }); |
331 | } | 331 | } |
332 | 332 | ||
333 | - return serviceAPI.get('guang/api/*/article/getSimpleArticleList', params, {cache: true}); | 333 | + return serviceAPI.get('guang/api/v6/article/getSimpleArticleList', params, {cache: true}); |
334 | }; | 334 | }; |
335 | 335 | ||
336 | /** | 336 | /** |
@@ -340,7 +340,7 @@ const getDynamicDataByIds = (ids, udid, other) => { | @@ -340,7 +340,7 @@ const getDynamicDataByIds = (ids, udid, other) => { | ||
340 | * @returns {Promise.<T>|*} | 340 | * @returns {Promise.<T>|*} |
341 | */ | 341 | */ |
342 | const getDynamicDataById = (id, uid, udid) => { | 342 | const getDynamicDataById = (id, uid, udid) => { |
343 | - return serviceAPI.get('/gateway/guang/api/*/article/getArticlePraiseAndFavor', { | 343 | + return serviceAPI.get('/gateway/guang/api/v6/article/getArticlePraiseAndFavor', { |
344 | id: id, | 344 | id: id, |
345 | uid: uid, | 345 | uid: uid, |
346 | udid: udid | 346 | udid: udid |
@@ -24,9 +24,11 @@ var setting = { | @@ -24,9 +24,11 @@ var setting = { | ||
24 | }; | 24 | }; |
25 | 25 | ||
26 | var $infos = $('#info-list'); | 26 | var $infos = $('#info-list'); |
27 | +var getDynamicData = require('./list-dynamic'); | ||
27 | 28 | ||
28 | require('../common'); | 29 | require('../common'); |
29 | -require('./list-dynamic'); | 30 | + |
31 | +getDynamicData.getDynamicData(); | ||
30 | 32 | ||
31 | info.initInfosEvt($infos); | 33 | info.initInfosEvt($infos); |
32 | 34 |
@@ -22,7 +22,7 @@ var $infoList = $('#info-list'), | @@ -22,7 +22,7 @@ var $infoList = $('#info-list'), | ||
22 | curType = $curNav.data('type'); | 22 | curType = $curNav.data('type'); |
23 | 23 | ||
24 | require('../common'); | 24 | require('../common'); |
25 | -require('./list-dynamic'); | 25 | +var getDynamicData = require('./list-dynamic'); |
26 | 26 | ||
27 | var state = {}; | 27 | var state = {}; |
28 | 28 | ||
@@ -50,6 +50,8 @@ info.initInfosEvt($infoList); | @@ -50,6 +50,8 @@ info.initInfosEvt($infoList); | ||
50 | end: false | 50 | end: false |
51 | }; | 51 | }; |
52 | }); | 52 | }); |
53 | + | ||
54 | + getDynamicData.getDynamicData(); | ||
53 | }()); | 55 | }()); |
54 | $nav.bind('contextmenu', function(e) { | 56 | $nav.bind('contextmenu', function(e) { |
55 | return false; | 57 | return false; |
@@ -24,6 +24,7 @@ var searching = false; | @@ -24,6 +24,7 @@ var searching = false; | ||
24 | var mySwiper = {}; | 24 | var mySwiper = {}; |
25 | 25 | ||
26 | var isLoading = false; | 26 | var isLoading = false; |
27 | +var getDynamicData = require('./list-dynamic'); | ||
27 | 28 | ||
28 | ellipsis.init(); | 29 | ellipsis.init(); |
29 | 30 | ||
@@ -251,6 +252,8 @@ function loadMore($container, opt, url) { | @@ -251,6 +252,8 @@ function loadMore($container, opt, url) { | ||
251 | $loading.removeClass('hide');// 显示空屏加载时hide的隐藏 | 252 | $loading.removeClass('hide');// 显示空屏加载时hide的隐藏 |
252 | 253 | ||
253 | window.rePosFooter();// 插入内容后重新计算底部位置 | 254 | window.rePosFooter();// 插入内容后重新计算底部位置 |
255 | + | ||
256 | + getDynamicData.getDynamicData(); | ||
254 | } | 257 | } |
255 | 258 | ||
256 | opt.page++; | 259 | opt.page++; |
@@ -21,10 +21,10 @@ function getDynamicByIds(ids) { | @@ -21,10 +21,10 @@ function getDynamicByIds(ids) { | ||
21 | 21 | ||
22 | // 标签列表 | 22 | // 标签列表 |
23 | data.query = qs.query; | 23 | data.query = qs.query; |
24 | - } else if (qs.type) { | 24 | + } else if (qs.id) { |
25 | 25 | ||
26 | // 逛首页type | 26 | // 逛首页type |
27 | - data.type = qs.type; | 27 | + data.type = qs.id; |
28 | } else if (!qs.author_id) { | 28 | } else if (!qs.author_id) { |
29 | 29 | ||
30 | // 非编辑页的情况下,为逛首页默认type=0 | 30 | // 非编辑页的情况下,为逛首页默认type=0 |
@@ -71,12 +71,12 @@ function renderData(data) { | @@ -71,12 +71,12 @@ function renderData(data) { | ||
71 | } | 71 | } |
72 | } | 72 | } |
73 | 73 | ||
74 | -(function() { | 74 | + function getDynamicData() { |
75 | 'use strict'; | 75 | 'use strict'; |
76 | 76 | ||
77 | var idArr = []; | 77 | var idArr = []; |
78 | 78 | ||
79 | - $msgs.find('.guang-info').each(function() { | 79 | + $('.info-list').not('.hide').find('.guang-info').each(function() { |
80 | var id = $(this).data('id'); | 80 | var id = $(this).data('id'); |
81 | 81 | ||
82 | if (id) { | 82 | if (id) { |
@@ -85,4 +85,8 @@ function renderData(data) { | @@ -85,4 +85,8 @@ function renderData(data) { | ||
85 | }); | 85 | }); |
86 | 86 | ||
87 | getDynamicByIds(idArr.join(',')).then(renderData); | 87 | getDynamicByIds(idArr.join(',')).then(renderData); |
88 | -}()); | 88 | +}; |
89 | + | ||
90 | +module.exports = { | ||
91 | + getDynamicData | ||
92 | +}; |
-
Please register or login to post a comment