Showing
2 changed files
with
5 additions
and
42 deletions
@@ -29,49 +29,10 @@ require('common'); | @@ -29,49 +29,10 @@ require('common'); | ||
29 | require('plugin/wx-share')(); | 29 | require('plugin/wx-share')(); |
30 | require('./detail-dynamic'); | 30 | require('./detail-dynamic'); |
31 | require('./detail/guang-cart'); | 31 | require('./detail/guang-cart'); |
32 | +require('./detail/guang-comments'); | ||
32 | 33 | ||
33 | let CollactionBlock = require('./collocation-block'); | 34 | let CollactionBlock = require('./collocation-block'); |
34 | 35 | ||
35 | -const qs = window.queryString; | ||
36 | -const article_id = qs.id || $('.detail').data('id'); | ||
37 | -const $comments = $('#comments'); | ||
38 | -let onLoading = false; // 是否正在加载 | ||
39 | -// let beforeScroll = document.body.scrollTop; // 滚动前位置记录 | ||
40 | -let page = 0; | ||
41 | - | ||
42 | -/** | ||
43 | - * 异步加载评论 | ||
44 | - */ | ||
45 | -const getComments = () => { | ||
46 | - if (!onLoading) { | ||
47 | - onLoading = true; | ||
48 | - } else { | ||
49 | - return false; | ||
50 | - } | ||
51 | - | ||
52 | - $.ajax({ | ||
53 | - method: 'get', | ||
54 | - url: '//guang.m.yohobuy.com/guang/info/getComments', | ||
55 | - data: { | ||
56 | - article_id: article_id, | ||
57 | - page: page++ | ||
58 | - }, | ||
59 | - success: function(res) { | ||
60 | - $comments.append(res); | ||
61 | - onLoading = false; | ||
62 | - } | ||
63 | - }); | ||
64 | -}; | ||
65 | - | ||
66 | -/** | ||
67 | - * 当scroll到1/2$goodsContainer高度后继续请求下一页数据 | ||
68 | - */ | ||
69 | -// const scrollHandler = function() { | ||
70 | -// if ($(window).scrollTop() > $comments.height() * 0.6) { | ||
71 | -// getComments(); | ||
72 | -// } | ||
73 | -// }; | ||
74 | - | ||
75 | $('#wrapper').css({ | 36 | $('#wrapper').css({ |
76 | 'overflow-y': 'scroll' | 37 | 'overflow-y': 'scroll' |
77 | }); | 38 | }); |
@@ -371,6 +332,4 @@ $('.wei-share').on('touchend', function(e) { | @@ -371,6 +332,4 @@ $('.wei-share').on('touchend', function(e) { | ||
371 | } | 332 | } |
372 | 333 | ||
373 | initIscroll(); | 334 | initIscroll(); |
374 | - | ||
375 | - getComments(); | ||
376 | }()); | 335 | }()); |
-
Please register or login to post a comment