content_uuhelper.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. <!--手机列表页-->
  2. <#if USER??> <#assign userId=USER.id><#else><#assign userId=0></#if>
  3. <!DOCTYPE html>
  4. <html>
  5. <head lang="en">
  6. <meta charset="UTF-8">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0,maximum-scale=1.0, user-scalable=no">
  8. <script type="text/javascript" src="${CTPATH}/assets/js/jquery.min.js"></script>
  9. <title></title>
  10. <style>
  11. .main{
  12. width: 100%;
  13. margin: 0 auto;
  14. }
  15. .main .container{
  16. /*width: 1190px;*/
  17. max-width: 640px;
  18. margin: 0 auto;
  19. text-align: center;
  20. padding: 0 10px;
  21. }
  22. .main .container .header p{
  23. text-align: left;
  24. font-size: 18px;
  25. color: #000;
  26. }
  27. .main .container .header div{
  28. margin: 5px 0;
  29. text-align: left;
  30. font-size: 14px;
  31. color: #8c8c8c;
  32. }
  33. .main .container .header div span:first-child{
  34. margin-right: 10px;
  35. }
  36. .main .container .section div{
  37. font-size: 14px;
  38. color: #000;
  39. text-align: left;
  40. }
  41. .main .container .section p{
  42. font-size: 14px;
  43. line-height: 20px;
  44. color: #6c6a6b;
  45. text-indent: 2em;
  46. text-align: left;
  47. }
  48. .main .container .section div.readCount{
  49. margin: 30px 0;
  50. overflow: hidden;
  51. color: #8c8c8c;
  52. }
  53. .main .container .section div.readCount div{
  54. float: left;
  55. }
  56. .main .container .section div.readCount div span{
  57. font-size: 14px;
  58. margin-right: 10px;
  59. cursor: pointer;
  60. }
  61. .main .container .section div.readCount div span em{
  62. color: #5f9ac6;
  63. margin-left: 5px;
  64. font-style: normal;
  65. }
  66. .main .container .section div.readCount div span i{
  67. display: inline-block;
  68. font-size: 14px;
  69. color: #8c8c8c;
  70. }
  71. .main .container .section div.readCount p{
  72. float: right;
  73. font-size: 14px;
  74. }
  75. .main .container .section div.readCount img{
  76. width: 18px;
  77. height: 18px;
  78. }
  79. .main .container .footer{
  80. border-top: 1px solid #d7d5d6;
  81. padding-top: 20px;
  82. }
  83. .main .container .footer .footer-header{
  84. position: relative;
  85. cursor: pointer;
  86. }
  87. .main .container .footer .footer-header div.infoMessage{
  88. position: absolute;
  89. left: 278px;
  90. top: -30px;
  91. width: 90px;
  92. height: 25px;
  93. color: #8ca8bd;
  94. font-size: 14px;
  95. background: #fff;
  96. }
  97. .main .container .footer .footer-header div.infoMessage:hover{
  98. color: #000;
  99. }
  100. .main .container .footer .footer-header div span{
  101. margin-right: 5px;
  102. }
  103. .main .container .footer .footer-header div img{
  104. width: 15px;
  105. height: 15px;
  106. }
  107. .main .container .footer .footer-section .message{
  108. margin: 30px 0;
  109. overflow: hidden ;
  110. }
  111. .main .container .footer .footer-section .message .left{
  112. float: left;
  113. }
  114. .main .container .footer .footer-section .message .right{
  115. float: right;
  116. width: 85%;
  117. padding-bottom: 20px;
  118. border-bottom: 1px solid #ddd;
  119. }
  120. .main .container .footer .footer-section .img{
  121. border: 1px solid #ddd;
  122. border-radius: 5px;
  123. width: 70px;
  124. height: 70px;
  125. }
  126. .main .container .footer .footer-section .img img{
  127. max-width: 70px;
  128. max-height: 70px;
  129. text-align: center;
  130. margin: 0 auto;
  131. }
  132. .main .container .footer .footer-section .detail{
  133. /*overflow: hidden;*/
  134. }
  135. .main .container .footer .footer-section .detail .title{
  136. overflow: hidden;
  137. margin-bottom: 10px;
  138. }
  139. .main .container .footer .footer-section .detail .title img{
  140. width: 17px;
  141. height: 17px;
  142. }
  143. .main .container .footer .footer-section .detail .title span:first-child{
  144. float: left;
  145. color: #6c6a6b;
  146. font-size: 14px;
  147. }
  148. .main .container .footer .footer-section .detail .title span:first-child em{
  149. margin-left: 10px;
  150. font-size: 14px;
  151. color: #8c8c8c;
  152. font-style: normal;
  153. }
  154. .main .container .footer .footer-section .detail .title span em{
  155. font-size: 14px;
  156. }
  157. .main .container .footer .footer-section .detail .title span:last-child{
  158. color: #8c8c8c;
  159. font-size: 14px;
  160. float: right;
  161. cursor: pointer;
  162. }
  163. .main .container .footer .footer-section .detail .title span:last-child em{
  164. margin-left: 10px;
  165. color: #5f9ac6;
  166. font-size: 14px;
  167. padding-right: 5px;
  168. font-style: normal;
  169. }
  170. .main .container .footer .footer-section .detail p{
  171. text-align: left;
  172. font-size: 14px;
  173. color: #333;
  174. }
  175. .main .container .footer .footer-section .detail .reply {
  176. margin-top: 10px;
  177. }
  178. .main .container .footer .pull{
  179. margin: 40px 0;
  180. }
  181. .main .container .footer .pull a{
  182. font-size: 14px;
  183. color: #8c8c8c;
  184. text-decoration: none;
  185. }
  186. .main .container .footer .footer-header .writeMessage{
  187. display: none;
  188. padding: 20px;
  189. }
  190. .main .container .footer .footer-header .writeMessage textarea{
  191. width: 580px;
  192. height: 100px;
  193. }
  194. .main .container .footer .footer-header .writeMessage div{
  195. text-align: right;
  196. margin-top: -60px;
  197. }
  198. .main .container .footer .footer-header .writeMessage button{
  199. display: inline-block;
  200. width: 80px;
  201. height: 25px;
  202. line-height: 25px;
  203. text-align: center;
  204. font-size: 14px;
  205. background: #b4b5b9;
  206. border-radius: 5px;
  207. color: #333;
  208. border: none;
  209. cursor: pointer;
  210. }
  211. .main .container .footer .footer-header .writeMessage button:hover{
  212. border: none;
  213. background: #5078cb;
  214. color: #fff;
  215. }
  216. </style>
  217. <!--<#macro script>-->
  218. <script>
  219. </script>
  220. <!--</#macro>-->
  221. </head>
  222. <body>
  223. <div class="main">
  224. <div class="container">
  225. <div class="header">
  226. <p>${content.title!}</p>
  227. <div><span>${(content.getMetadataByKey("push_time"))!}</span><span>${content.author!}</span></div>
  228. </div>
  229. <div class="section">
  230. ${content.text!}
  231. <div class="readCount">
  232. <div>
  233. <span>阅读 <em>${content.view_count!'0'}</em></span>
  234. <span><img src="/jpress/static/jpress/admin/image/hands.png" alt=""><em>${content.vote_up!'0'}</em></span>
  235. <!--<span><img src="/jpress/static/jpress/admin/image/support.png" alt=""/><em>1</em></span>-->
  236. </div>
  237. <p>${(content.getMetadataByKey("copy_right"))!}</p>
  238. </div>
  239. </div>
  240. <div class="footer">
  241. <#if content.isCommentEnable() && !(content.isUuUserReplied(userid) || (USER?? && content.isUserReplied(USER.id))) && (USER?? || userid??)>
  242. <form action="${CPATH}/comment/submit" method="post" id="comment">
  243. <input type="hidden" name="cid" value="${(content.id)!}" >
  244. <input type="hidden" id="parent_id" name="parent_id" >
  245. <input type="hidden" name="uuUserId" value="${userid!}" >
  246. <input type="hidden" name="uuUserName" value="${username!}" >
  247. <input type="hidden" name="uuUserAvatar" value="${iconurl!}" >
  248. <div class="footer-header">
  249. <div class="infoMessage"><span>写留言</span><img src="/jpress/static/jpress/admin/image/pen.png" alt=""/></div>
  250. <div class="writeMessage">
  251. <textarea name="text" id="" cols="30" rows="10"></textarea>
  252. <div><button type="submit">提交留言</div>
  253. </div>
  254. </div>
  255. </form>
  256. </#if>
  257. <div class="footer-section">
  258. <@jp.commentPage pageSize="1">
  259. <#if page ??>
  260. <#list page.getList() as comment>
  261. <div class="message">
  262. <div class="left">
  263. <div class="img" >
  264. <img src="/jpress/static/jpress/admin/image/dot.png" alt="用户头像">
  265. </div>
  266. </div>
  267. <div class="right">
  268. <div class="detail">
  269. <div class="title">
  270. <span>${comment.author!} <em>${(comment.created?string("yyyy-MM-dd"))!}</em></span>
  271. <span><img class="votedUas${comment.id} <#if comment.isvoted(comment.id, userId!0, userid!0)>voted</#if>" src="/jpress/static/jpress/admin/image/hands.png" alt="" onclick="vote(${comment.id})"/><em class="em${comment.id}">${(comment.vote_up)!'0'}</em></span>
  272. </div>
  273. <p>${comment.text!}</p>
  274. <#if comment.qc_content ??>
  275. <div class="title reply">
  276. <span>作者回复: <em>${(comment.qc_created?string("yyyy-MM-dd"))!}</em></span>
  277. <span><img class="votedUas${comment.qc_id} <#if comment.isvoted(comment.qc_id, userId!0, userid!0)>voted</#if>" src="/jpress/static/jpress/admin/image/hands.png" alt="" onclick="vote(${comment.qc_id})"/><em class="em${comment.qc_id}">${(comment.qc_vote_up)!'0'}</em></span>
  278. </div>
  279. <p>${comment.qc_content!}</p>
  280. </#if>
  281. </div>
  282. </div>
  283. </div>
  284. </#list>
  285. </#if>
  286. </@jp.commentPage>
  287. </div>
  288. <div class="pull">下拉加载更多</div>
  289. <!--<div class="pull"><a>没有更多数据了</a></div>-->
  290. </div>
  291. </div>
  292. </div>
  293. </body>
  294. <script>
  295. jQuery('html').css('fontSize',$(window).width()/640 * 30);
  296. // jQuery(window).load(function () {
  297. // jQuery("img").each(function () {
  298. // DrawImage(this, 100, 50);
  299. // });
  300. // });
  301. // function DrawImage(ImgD, FitWidth, FitHeight) {
  302. // var image = new Image();
  303. // image.src = ImgD.src;
  304. // if (image.width > 0 && image.height > 0) {
  305. // if (image.width / image.height >= FitWidth / FitHeight) {
  306. // if (image.width > FitWidth) {
  307. // ImgD.width = FitWidth;
  308. // ImgD.height = (image.height * FitWidth) / image.width;
  309. // } else {
  310. // ImgD.width = image.width;
  311. // ImgD.height = image.height;
  312. // }
  313. // } else {
  314. // if (image.height > FitHeight) {
  315. // ImgD.height = FitHeight;
  316. // ImgD.width = (image.width * FitHeight) / image.height;
  317. // } else {
  318. // ImgD.width = image.width;
  319. // ImgD.height = image.height;
  320. // }
  321. // }
  322. // }
  323. // }
  324. // 写留言
  325. $('.footer-header>div.infoMessage').click(function () {
  326. $(this).next('.writeMessage').toggle()
  327. })
  328. // 上拉加载更多
  329. var aa = 2,
  330. timers = null;
  331. //加载数据
  332. var LoadingDataFn = function() {
  333. $.get("${CPATH}/comment/lazyLoad?contId=${(content.id)!}&pagesize=3&pagenumber="+aa+"&userId=${userId!0}&uuUserId=${userid!0}", function(result){
  334. var dom = '';
  335. if (result.data == null){
  336. $('.pull').text("没有更多数据了");
  337. }
  338. dom += result.message;
  339. $('.footer-section').append(dom);
  340. });
  341. };
  342. //初始化
  343. var userId = null;
  344. var uuUserId = null;
  345. $(document).ready(function() {
  346. userId = "${userId!0}"
  347. uuUserId = "${userid!0}";
  348. $('.voted').attr("src","/jpress/static/jpress/admin/image/support.png");
  349. });
  350. //滚动加载方法
  351. $(window).scroll(function() {
  352. if (($(window).height() + $(window).scrollTop() + 60) >= $(document).height()) {
  353. clearTimeout(timers);
  354. timers = setTimeout(function() {
  355. aa++;
  356. LoadingDataFn();
  357. }, 300);
  358. }
  359. });
  360. //点赞
  361. var vote = function(commentid) {
  362. var imgObj = $(".votedUas"+commentid);
  363. var emObj = $(".em"+commentid);
  364. if (imgObj.hasClass("voted")) {
  365. emObj.text(""+(parseInt(emObj.text())-1));
  366. imgObj.removeClass("voted");
  367. imgObj.attr("src","/jpress/static/jpress/admin/image/hands.png");
  368. } else {
  369. emObj.text(""+(parseInt(emObj.text())+1));
  370. imgObj.addClass("voted");
  371. imgObj.attr("src","/jpress/static/jpress/admin/image/support.png")
  372. }
  373. $.get("${CPATH}/comment/vote?comment_id="+commentid+"&user_id="+userId+"&uu_user_id="+uuUserId, function(result){
  374. console.log(result.message);
  375. });
  376. }
  377. </script>
  378. </html>