|
@@ -14,4 +14,45 @@ $(function () {
|
|
$(item).append(`<div style="visibility:hidden" class="list-item"></div>`);
|
|
$(item).append(`<div style="visibility:hidden" class="list-item"></div>`);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+})
|
|
|
|
+$(function () {
|
|
|
|
+ let path = lxd.parseUrl(window.location.href).pathname;
|
|
|
|
+ let reg = /(?<=\/h_exam\/).*?(?=.html)/;
|
|
|
|
+ $.ajax({
|
|
|
|
+ url: `http://api.gaokaoapp.net/exampaper/h/${path.match(reg)}/`,
|
|
|
|
+ data: {
|
|
|
|
+ },
|
|
|
|
+ type: "get",
|
|
|
|
+ error: function (error) {
|
|
|
|
+ $(".loading").html("获取更多的评论,请下载大联考app").show();
|
|
|
|
+ },
|
|
|
|
+ success: function (res) {
|
|
|
|
+ let { comments, like_count = 1, read_count = 1 } = res.data;
|
|
|
|
+ $(".good>span").html(like_count);
|
|
|
|
+ $(".see").html(`阅读数:${read_count}`);
|
|
|
|
+ let father = document.createDocumentFragment();
|
|
|
|
+ Array.from(comments).forEach(
|
|
|
|
+ item => {
|
|
|
|
+ let str = `<div class="user" data-good="false" data-userid="1" >
|
|
|
|
+ <div class="u-img"><img src="${item.user_face}" alt="" class="img"></div>
|
|
|
|
+ <div class="u-content">
|
|
|
|
+ <div class="u-flex">
|
|
|
|
+ <div class="u-name">${item.user_name}</div>
|
|
|
|
+ <div class="u-fabulous" data-gods="1"><span>${item.like_count}</span><i data-gods="1" style="margin-left:5px" class="glyphicon glyphicon-thumbs-up"></i></div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="u-detail">
|
|
|
|
+ ${item.content}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="u-flex">
|
|
|
|
+ <div class="u-date">${item.delay_time}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>`;
|
|
|
|
+ $(father).append(str);
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ $("#detail").append(father);
|
|
|
|
+ $(".loading").html("获取更多的评论,请下载大联考app").show()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
})
|
|
})
|