最新动态各详情页面
This commit is contained in:
parent
869810b3a0
commit
596bf641ac
|
@ -44,6 +44,8 @@ module Mobile
|
|||
ac.act.description unless ac.nil? || ac.act.nil?
|
||||
elsif ac.act_type == "Message" || ac.act_type == "BlogComment"
|
||||
ac.act.content unless ac.nil? || ac.act.nil?
|
||||
elsif ac.act_type == "JournalsForMessage"
|
||||
ac.act.notes
|
||||
end
|
||||
when :latest_update
|
||||
time_from_now ac.updated_at unless ac.nil?
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-interactive">
|
||||
<div class="post-interactive-column c-grey2">回复 (<!=activities[i].reply_count!>)</div>
|
||||
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" onclick="window.open('course_notice.html?id=<!=activities[i].act_id!>');" class="c-grey">回复 (<!=activities[i].reply_count!>)</a></div>
|
||||
<div class="post-interactive-column c-grey2">赞 (<!=activities[i].activity_praise_count!>)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -77,17 +77,18 @@
|
|||
<div class="post-wrapper">
|
||||
<div class="post-main">
|
||||
<div class="post-avatar fl"><img src="images/post-avatar.jpg" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="post-title fl mb10 hidden"><a herf="javascript:void(0);" class="mr10"><!=activities[i].author.nickname!></a> <span style="vertical-align:top;">给您留言了</span><br />
|
||||
<span class="c-grey"><!=activities[i].latest_update!></span> </div>
|
||||
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=activities[i].subject!></span></div>
|
||||
<div class="post-title fl mb10 hidden"><a herf="javascript:void(0);" class="mr10"><!=activities[i].author.nickname!></a>to<a herf="javascript:void(0);" class="ml10"><!=activities[i].course_project_name!> | <!=activities[i].activity_type_name!></a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-content c-grey2 mt10">
|
||||
<p class="post-all-content"><!:=activities[i].description!></p>
|
||||
</div>
|
||||
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more undis" style="text-decoration:underline;">点击展开</a>
|
||||
<span class="c-grey f13 mt10 fl"><!=activities[i].latest_update!></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-interactive">
|
||||
<div class="post-interactive-column c-grey2">回复 (<!=activities[i].reply_count!>)</div>
|
||||
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" onclick="window.open('course_discussion.html?id=<!=activities[i].act_id!>');" class="c-grey">回复 (<!=activities[i].reply_count!>)</a></div>
|
||||
<div class="post-interactive-column c-grey2">赞 (<!=activities[i].activity_praise_count!>)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -97,7 +98,7 @@
|
|||
<div class="post-wrapper">
|
||||
<div class="post-main">
|
||||
<div class="post-avatar fl"><img src="<!=activities[i].author.img_url!>" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=activities[i].author.nickname!></span>创建了<span class="c-grey3 f15 fb"><!=activities[i].course_project_name!></span></div>
|
||||
<div class="post-title hidden mb5"><span class="c-grey3 f13 fb mr10"><!=activities[i].author.nickname!></span>创建了<span class="c-grey3 f13 fb ml10"><!=activities[i].course_project_name!></span></div>
|
||||
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=activities[i].latest_update!></a></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
@ -124,7 +125,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-interactive">
|
||||
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" onclick="window.open('issue_detail.html?id=<!=i!>');" class="c-grey"> 回复 (<!=activities[i].reply_count!>)</a></div>
|
||||
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" onclick="window.open('issue_detail.html?id=<!=activities[i].act_id!>');" class="c-grey"> 回复 (<!=activities[i].reply_count!>)</a></div>
|
||||
<div class="post-interactive-column c-grey2">赞 (<!=activities[i].activity_praise_count!>)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -147,7 +148,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-interactive">
|
||||
<div class="post-interactive-column c-grey2">回复 (<!=activities[i].reply_count!>)</div>
|
||||
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" onclick="window.open('project_discussion.html?id=<!=activities[i].act_id!>');" class="c-grey"> 回复 (<!=activities[i].reply_count!>) </a></div>
|
||||
<div class="post-interactive-column c-grey2">赞 (<!=activities[i].activity_praise_count!>)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -171,8 +172,8 @@
|
|||
<div class="post-wrapper">
|
||||
<div class="post-main">
|
||||
<div class="post-avatar fl"><img src="images/post-avatar.jpg" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="post-title fl mb10 hidden"><a herf="javascript:void(0);" class="mr10"><!=activities[i].author.nickname!></a> <span style="vertical-align:top;">给您留言了</span><br />
|
||||
<span class="c-grey"><!=activities[i].latest_update!></span> </div>
|
||||
<div class="post-title mb5 hidden"><a herf="javascript:void(0);" class="mr10"><!=activities[i].author.nickname!></a> <span style="vertical-align:top;">给您留言了</span></div>
|
||||
<div class="post-title hidden"><!=activities[i].latest_update!></div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-content c-grey2 mt10">
|
||||
<p class="post-all-content"><!:=activities[i].description!></p>
|
||||
|
@ -181,7 +182,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-interactive">
|
||||
<div class="post-interactive-column c-grey2">回复 (<!=activities[i].reply_count!>)</div>
|
||||
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" onclick="window.open('message_detail.html?id=<!=activities[i].act_id!>');" class="c-grey"> 回复 (<!=activities[i].reply_count!>)</a></div>
|
||||
<div class="post-interactive-column c-grey2">赞 (<!=activities[i].activity_praise_count!>)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -204,20 +205,20 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-interactive">
|
||||
<div class="post-interactive-column c-grey2">回复 (<!=activities[i].reply_count!>)</div>
|
||||
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" onclick="window.open('blog_detail.html?id=<!=activities[i].act_id!>');" class="c-grey"> 回复 (<!=activities[i].reply_count!>)</a></div>
|
||||
<div class="post-interactive-column c-grey2">赞 (<!=activities[i].activity_praise_count!>)</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<! } !>
|
||||
<! } !>
|
||||
<div class="more-events mt10">更多</div>
|
||||
<div class="more-events mt10" onclick="loadMore()">更多</div>
|
||||
</script>
|
||||
|
||||
<script src="/javascripts/jquery-1.3.2.js"></script>
|
||||
<script src="/javascripts/baiduTemplate.js"></script>
|
||||
<script src="/javascripts/wechat/wechat-dev.js"></script>
|
||||
<script src="/javascripts/wechat/homework-detail.js"></script>
|
||||
<script src="/javascripts/wechat/wechat_dev.js"></script>
|
||||
<script src="/javascripts/wechat/homework_detail.js"></script>
|
||||
<script src="/javascripts/wechat/auth.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,73 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>博客</title>
|
||||
<meta charset='utf-8' />
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="apple-mobile-web-app-capable" content="no">
|
||||
<meta content='True' name='HandheldFriendly' />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="blog-container"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 模板1开始,可以使用script(type设置为text/html)来存放模板片段,并且用id标示 -->
|
||||
<script id="t:blog-detail" type="text/html">
|
||||
<div id="check"></div>
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper">
|
||||
<div class="post-main">
|
||||
<div class="post-avatar fl"><img src="<!=blog.user.img_url!>" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=blog.title!></span></div>
|
||||
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=blog.user.nickname!></a>发表博客</div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-content c-grey2 mt10" style="height:auto;">
|
||||
<div class="post-all-content"><!:=blog.content!></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span class="c-grey f13 mt10 fl"><!=blog.created_at!></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-interactive border-bottom">
|
||||
<div class="post-interactive-reply c-grey2">回复 <span class="reply-num">(<!=blog.comments_count!>)</span></div>
|
||||
<div class="post-interactive-praise c-grey2"><span class="paise-text"> 赞 </span><span class="praise-num">(<!=blog.blog_praise_count!>)</span></div>
|
||||
</div>
|
||||
<! for(var j =0; j < blog.blog_comment_children.length; ++j){ !>
|
||||
<div class="post-reply-wrap border-bottom">
|
||||
<div class="post-reply-row">
|
||||
<div class="post-reply-avatar fl"><img src="<!=blog.blog_comment_children[j].user.img_url!>" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="ml55">
|
||||
<div class="post-reply-user hidden"><!=blog.blog_comment_children[j].user.realname!></div>
|
||||
<div class="post-reply-content c-grey2 mb10"><!:=blog.blog_comment_children[j].content!></div>
|
||||
<div class="post-reply-date fl"><!=blog.blog_comment_children[j].lasted_comment!></div>
|
||||
<div class="post-reply-trigger fr undis">回复</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<! } !>
|
||||
<div class="post-input-wrap">
|
||||
<div class="post-reply-row">
|
||||
<!--<div class="post-reply-avatar fl" id = "100"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
|
||||
<input type="text" class="post-reply-input" id="postInput" />
|
||||
<input type="submit" value="回复" class="post-reply-submit fr mt10" onclick="replyInsert()" />
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script src="/javascripts/jquery-1.3.2.js"></script>
|
||||
<script src="/javascripts/baiduTemplate.js"></script>
|
||||
<script src="/javascripts/wechat/blog_detail.js"></script>
|
||||
<script src="/javascripts/wechat/auth.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,73 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>课程讨论区</title>
|
||||
<meta charset='utf-8' />
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="apple-mobile-web-app-capable" content="no">
|
||||
<meta content='True' name='HandheldFriendly' />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="c-discussion-container"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 模板1开始,可以使用script(type设置为text/html)来存放模板片段,并且用id标示 -->
|
||||
<script id="t:course-discussion" type="text/html">
|
||||
<div id="check"></div>
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper">
|
||||
<div class="post-main">
|
||||
<div class="post-avatar fl"><img src="<!=discussion.user.img_url!>" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=discussion.subject!></span></div>
|
||||
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=discussion.user.nickname!></a>to<a herf="javascript:void(0);" class="ml10"><!=discussion.discussion_name!> | 课程问答区</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-content c-grey2 mt10" style="height:auto;">
|
||||
<div class="post-all-content"><!:=discussion.content!></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span class="c-grey f13 mt10 fl"><!=discussion.created_on!></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-interactive border-bottom">
|
||||
<div class="post-interactive-reply c-grey2">回复 <span class="reply-num">(<!=discussion.replies_count!>)</span></div>
|
||||
<div class="post-interactive-praise c-grey2"><span class="paise-text"> 赞 </span><span class="praise-num">()</span></div>
|
||||
</div>
|
||||
<! for(var j =0; j < discussion.message_children.length; ++j){ !>
|
||||
<div class="post-reply-wrap border-bottom">
|
||||
<div class="post-reply-row">
|
||||
<div class="post-reply-avatar fl"><img src="<!=discussion.message_children[j].user.img_url!>" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="ml55">
|
||||
<div class="post-reply-user hidden"><!=discussion.message_children[j].user.realname!></div>
|
||||
<div class="post-reply-content c-grey2 mb10"><!:=discussion.message_children[j].content!></div>
|
||||
<div class="post-reply-date fl"><!=discussion.message_children[j].lasted_comment!></div>
|
||||
<div class="post-reply-trigger fr undis">回复</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<! } !>
|
||||
<div class="post-input-wrap">
|
||||
<div class="post-reply-row">
|
||||
<!--<div class="post-reply-avatar fl" id = "100"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
|
||||
<input type="text" class="post-reply-input" id="postInput" />
|
||||
<input type="submit" value="回复" class="post-reply-submit fr mt10" onclick="replyInsert()" />
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script src="/javascripts/jquery-1.3.2.js"></script>
|
||||
<script src="/javascripts/baiduTemplate.js"></script>
|
||||
<script src="/javascripts/wechat/course_discussion.js"></script>
|
||||
<script src="/javascripts/wechat/auth.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,73 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>课程通知</title>
|
||||
<meta charset='utf-8' />
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="apple-mobile-web-app-capable" content="no">
|
||||
<meta content='True' name='HandheldFriendly' />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="c-notice-container"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 模板1开始,可以使用script(type设置为text/html)来存放模板片段,并且用id标示 -->
|
||||
<script id="t:course-notice" type="text/html">
|
||||
<div id="check"></div>
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper">
|
||||
<div class="post-main">
|
||||
<div class="post-avatar fl"><img src="<!=course.author_img_url!>" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=course.title!></span></div>
|
||||
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=course.author_name!></a>to<a herf="javascript:void(0);" class="ml10"><!=course.course_name!> | 课程作业</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-content c-grey2 mt10" style="height:auto;">
|
||||
<div class="post-all-content"><!:=course.description!></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span class="c-grey f13 mt10 fl"><!=course.created_on!></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-interactive border-bottom">
|
||||
<div class="post-interactive-reply c-grey2">回复 <span class="reply-num">(<!=course.comments_count!>)</span></div>
|
||||
<div class="post-interactive-praise c-grey2"><span class="paise-text"> 赞 </span><span class="praise-num">1</span></div>
|
||||
</div>
|
||||
<! for(var j =0; j < course.comments.length; ++j){ !>
|
||||
<div class="post-reply-wrap border-bottom">
|
||||
<div class="post-reply-row">
|
||||
<div class="post-reply-avatar fl"><img src="<!=course.comments[j].user.img_url!>" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="ml55">
|
||||
<div class="post-reply-user hidden"><!=course.comments[j].user.realname!></div>
|
||||
<div class="post-reply-content c-grey2 mb10"><!:=course.comments[j].comments!></div>
|
||||
<div class="post-reply-date fl"><!=course.comments[j].created_on!></div>
|
||||
<div class="post-reply-trigger fr undis">回复</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<! } !>
|
||||
<div class="post-input-wrap">
|
||||
<div class="post-reply-row">
|
||||
<!--<div class="post-reply-avatar fl" id = "100"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
|
||||
<input type="text" class="post-reply-input" id="postInput" />
|
||||
<input type="submit" value="回复" class="post-reply-submit fr mt10" onclick="replyInsert()" />
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script src="/javascripts/jquery-1.3.2.js"></script>
|
||||
<script src="/javascripts/baiduTemplate.js"></script>
|
||||
<script src="/javascripts/wechat/course_notice.js"></script>
|
||||
<script src="/javascripts/wechat/auth.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -57,7 +57,7 @@
|
|||
<div class="post-input-wrap">
|
||||
<div class="post-reply-row">
|
||||
<!--<div class="post-reply-avatar fl" id = "100"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
|
||||
<div class="mr55"><input type="text" class="post-reply-input" id="postInput" /></div>
|
||||
<input type="text" class="post-reply-input" id="postInput" />
|
||||
<input type="submit" value="回复" class="post-reply-submit fr mt10" onclick="replyInsert()" />
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
@ -68,7 +68,7 @@
|
|||
|
||||
<script src="/javascripts/jquery-1.3.2.js"></script>
|
||||
<script src="/javascripts/baiduTemplate.js"></script>
|
||||
<script src="/javascripts/wechat/homework-detail.js"></script>
|
||||
<script src="/javascripts/wechat/homework_detail.js"></script>
|
||||
<script src="/javascripts/wechat/auth.js"></script>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>缺陷详情</title>
|
||||
<title>问题跟踪</title>
|
||||
<meta charset='utf-8' />
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="" />
|
||||
|
@ -13,13 +13,13 @@
|
|||
|
||||
</head>
|
||||
<body>
|
||||
<div id="container"></div>
|
||||
<div id="issue-container"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 模板1开始,可以使用script(type设置为text/html)来存放模板片段,并且用id标示 -->
|
||||
<script id="t:result-list" type="text/html">
|
||||
<script id="t:issue-detail" type="text/html">
|
||||
<!var searchPart = window.location.search;!>
|
||||
<!if (searchPart == ""){!>
|
||||
<!}else{!>
|
||||
|
@ -29,40 +29,36 @@
|
|||
<div class="post-container">
|
||||
<div class="post-wrapper">
|
||||
<div class="post-main">
|
||||
<div class="post-avatar fl"><img src="<!=activities[i].author.img_url!>" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=activities[i].subject!></span></div>
|
||||
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=activities[i].author.nickname!></a>to<!=activities[i].course_project_name!> | <!=activities[i].activity_type_name!></div>
|
||||
<div class="post-avatar fl"><img src="<!=issues[i].author.img_url!>" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=issues[i].subject!></span></div>
|
||||
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=issues[i].author.nickname!></a>to<!=issues[i].course_project_name!> | <!=issues[i].activity_type_name!></div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-content" style="height:auto;">
|
||||
<div class="post-all-content c-grey2 mt10"><!:=activities[i].description!><br />
|
||||
<span class="mr15">状态:<!:=activities[i].issue_detail.issue_status!></span> <span class="mr15">优先级:<!:=activities[i].issue_detail.issue_priority!></span> <br /> <span class="mr15">指派给:<!:=activities[i].issue_detail.issue_assigned_to!></span> <span class="mr15">完成度:<!:=activities[i].issue_detail.done_ratio!></span></div>
|
||||
<div class="post-all-content c-grey2 mt10"><!:=issues[i].description!><br />
|
||||
<span class="mr15">状态:<!:=issues[i].issue_status!></span> <span class="mr15">优先级:<!:=issues[i].issue_priority!></span> <br /> <span class="mr15">指派给:<!:=issues[i].issue_assigned_to!></span> <span class="mr15">完成度:<!:=issues[i].done_ratio!></span></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span class="c-grey f13 mt10 fl"><!=activities[i].latest_update!></span>
|
||||
<span class="c-grey f13 mt10 fl"><!=issues[i].created_on!></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-interactive border-bottom">
|
||||
<div class="post-interactive-column c-grey2">回复 (<!=activities[i].reply_count!>)</div>
|
||||
<div class="post-interactive-column c-grey2">赞 (<!=activities[i].activity_praise_count!>)</div>
|
||||
<div class="post-interactive-column c-grey2">回复 (<!=issues[i].journals_count!>)</div>
|
||||
<div class="post-interactive-column c-grey2">赞 ()</div>
|
||||
</div>
|
||||
<! for(var j =0; j < issue.issue_journals.length; ++j){ !>
|
||||
<div class="post-reply-wrap border-bottom">
|
||||
<div class="post-reply-row">
|
||||
<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>
|
||||
<div class="post-reply-avatar fl"><img src="<!=issue.issue_journals[j].user.img_url!>" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="ml55">
|
||||
<div class="post-reply-user hidden">Mrs. Ashford</div>
|
||||
<div class="post-reply-content c-grey2 mb10">Afternoon colleges,<br />
|
||||
<br />
|
||||
Thank you so much for the support and resources!<br />
|
||||
<br />
|
||||
regards,<br />
|
||||
<br />
|
||||
Jackson</div>
|
||||
<div class="post-reply-date fl">1分钟前</div>
|
||||
<div class="post-reply-user hidden"><!=issue.issue_journals[j].user.realname!></div>
|
||||
<div class="post-reply-content c-grey2 mb10"><!:=issue.issue_journals[j].content!></div>
|
||||
<div class="post-reply-date fl"><!=issue.issue_journals[j].lasted_comment!></div>
|
||||
<div class="post-reply-trigger fr undis">回复</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<! } !>
|
||||
<div class="post-input-wrap">
|
||||
<div class="post-reply-row">
|
||||
<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>
|
||||
|
@ -79,7 +75,7 @@
|
|||
|
||||
<script src="/javascripts/jquery-1.3.2.js"></script>
|
||||
<script src="/javascripts/baiduTemplate.js"></script>
|
||||
<script src="/javascripts/wechat/wechat-dev.js"></script>
|
||||
<script src="/javascripts/wechat/issue_detail.js"></script>
|
||||
<script src="/javascripts/wechat/auth.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,71 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>留言</title>
|
||||
<meta charset='utf-8' />
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="apple-mobile-web-app-capable" content="no">
|
||||
<meta content='True' name='HandheldFriendly' />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="message-container"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 模板1开始,可以使用script(type设置为text/html)来存放模板片段,并且用id标示 -->
|
||||
<script id="t:message-detail" type="text/html">
|
||||
<div id="check"></div>
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper">
|
||||
<div class="post-main">
|
||||
<div class="post-avatar fl"><img src="<!=message.user.img_url!>" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="post-title mb5 hidden"><a herf="javascript:void(0);" class="mr10"><!=message.user.nickname!></a><span style="vertical-align:top;">给您留言了</span><br /></div>
|
||||
<div class="post-title hidden"><!=message.created_on!></div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-content c-grey2 mt10" style="height:auto;">
|
||||
<div class="post-all-content"><!:=message.notes!></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-interactive border-bottom">
|
||||
<div class="post-interactive-reply c-grey2">回复 <span class="reply-num">(<!=message.reply_count!>)</span></div>
|
||||
<div class="post-interactive-praise c-grey2"><span class="paise-text"> 赞 </span><span class="praise-num">()</span></div>
|
||||
</div>
|
||||
<! for(var j =0; j < message.child_reply.length; ++j){ !>
|
||||
<div class="post-reply-wrap border-bottom">
|
||||
<div class="post-reply-row">
|
||||
<div class="post-reply-avatar fl"><img src="<!=message.child_reply[j].user.img_url!>" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="ml55">
|
||||
<div class="post-reply-user hidden"><!=message.child_reply[j].user.realname!></div>
|
||||
<div class="post-reply-content c-grey2 mb10"><!:=message.child_reply[j].content!></div>
|
||||
<div class="post-reply-date fl"><!=message.child_reply[j].lasted_comment!></div>
|
||||
<div class="post-reply-trigger fr undis">回复</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<! } !>
|
||||
<div class="post-input-wrap">
|
||||
<div class="post-reply-row">
|
||||
<!--<div class="post-reply-avatar fl" id = "100"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
|
||||
<input type="text" class="post-reply-input" id="postInput" />
|
||||
<input type="submit" value="回复" class="post-reply-submit fr mt10" onclick="replyInsert()" />
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script src="/javascripts/jquery-1.3.2.js"></script>
|
||||
<script src="/javascripts/baiduTemplate.js"></script>
|
||||
<script src="/javascripts/wechat/message_detail.js"></script>
|
||||
<script src="/javascripts/wechat/auth.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,73 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>课程讨论区</title>
|
||||
<meta charset='utf-8' />
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="apple-mobile-web-app-capable" content="no">
|
||||
<meta content='True' name='HandheldFriendly' />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="p-discussion-container"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 模板1开始,可以使用script(type设置为text/html)来存放模板片段,并且用id标示 -->
|
||||
<script id="t:prject-discussion" type="text/html">
|
||||
<div id="check"></div>
|
||||
<div class="post-container">
|
||||
<div class="post-wrapper">
|
||||
<div class="post-main">
|
||||
<div class="post-avatar fl"><img src="<!=homework.author.img_url!>" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=homework.name!></span></div>
|
||||
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=homework.author.nickname!></a>to<a herf="javascript:void(0);" class="ml10"><!=homework.course_name!> | 课程作业</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="post-content c-grey2 mt10" style="height:auto;">
|
||||
<div class="post-all-content"><!:=homework.description!></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span class="c-grey f13 mt10 fl"><!=homework.publish_time!></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="post-interactive border-bottom">
|
||||
<div class="post-interactive-reply c-grey2">回复 <span class="reply-num">(<!=homework.whomework_journal_count!>)</span></div>
|
||||
<div class="post-interactive-praise c-grey2"><span class="paise-text"> 赞 </span><span class="praise-num">(<!=homework.whomework_praise_count!>)</span></div>
|
||||
</div>
|
||||
<! for(var j =0; j < homework.journals_for_messages.length; ++j){ !>
|
||||
<div class="post-reply-wrap border-bottom">
|
||||
<div class="post-reply-row">
|
||||
<div class="post-reply-avatar fl"><img src="<!=homework.journals_for_messages[j].user.img_url!>" width="45" height="45" class="border-radius" /></div>
|
||||
<div class="ml55">
|
||||
<div class="post-reply-user hidden"><!=homework.journals_for_messages[j].user.realname!></div>
|
||||
<div class="post-reply-content c-grey2 mb10"><!:=homework.journals_for_messages[j].notes!></div>
|
||||
<div class="post-reply-date fl"><!=homework.journals_for_messages[j].lasted_comment!></div>
|
||||
<div class="post-reply-trigger fr undis">回复</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<! } !>
|
||||
<div class="post-input-wrap">
|
||||
<div class="post-reply-row">
|
||||
<!--<div class="post-reply-avatar fl" id = "100"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
|
||||
<input type="text" class="post-reply-input" id="postInput" />
|
||||
<input type="submit" value="回复" class="post-reply-submit fr mt10" onclick="replyInsert()" />
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script src="/javascripts/jquery-1.3.2.js"></script>
|
||||
<script src="/javascripts/baiduTemplate.js"></script>
|
||||
<script src="/javascripts/wechat/homework-detail.js"></script>
|
||||
<script src="/javascripts/wechat/auth.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,95 @@
|
|||
/**
|
||||
* Created by root on 4/1/16.
|
||||
*/
|
||||
$(document).ready(function(){
|
||||
|
||||
var bt=baidu.template;
|
||||
bt.LEFT_DELIMITER='<!';
|
||||
bt.RIGHT_DELIMITER='!>';
|
||||
|
||||
|
||||
var apiUrl = '/api/v1/';
|
||||
|
||||
var setTemplate = function(data){
|
||||
console.log(data);
|
||||
var html=bt('t:blog-detail',{blog: data});
|
||||
$('#blog-container').prepend(html);
|
||||
$('.post-reply-submit').click(function(){
|
||||
replyInsert();
|
||||
});
|
||||
$('post-interactive-praise').click(function(){
|
||||
praiseClick();
|
||||
});
|
||||
};
|
||||
|
||||
var loadDataFromServer = function(id){
|
||||
//getOpenId(function(openid){
|
||||
$.ajax({
|
||||
url: apiUrl + 'blog_comments/' + id,
|
||||
dataType: 'json',
|
||||
success: function(data){
|
||||
setTemplate(data.data);
|
||||
},
|
||||
error: function(xhr,status,err){
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
//})
|
||||
|
||||
|
||||
};
|
||||
|
||||
var homeworkUrl = window.location.search;
|
||||
var homeworkID = homeworkUrl.split("=")[1];
|
||||
|
||||
loadDataFromServer(homeworkID);
|
||||
|
||||
//点击回复按钮,插入回复内容
|
||||
var replyInsert = function(){
|
||||
var replyContent = $("#postInput").val();
|
||||
if (!replyContent){
|
||||
alert("请输入回复");
|
||||
}else{
|
||||
|
||||
//将用户输入内容插入最后一条回复
|
||||
$(".post-reply-wrap:last").after('<div class="post-reply-wrap border-bottom"><div class="post-reply-row"><div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="45" height="45" /></div><div class="ml55"><div class="post-reply-user hidden">Mrs. Ashford</div><div class="post-reply-content c-grey2 mb10"></div><div class="post-reply-date fl"></div><div class="post-reply-trigger fr undis">回复</div></div><div class="cl"></div></div> </div>');
|
||||
$(".post-reply-content:last").append(replyContent);
|
||||
$(".post-reply-date:last").append(Date());
|
||||
var postInput = $("#postInput").val();
|
||||
$("#postInput").val("");
|
||||
//回复数目+1
|
||||
var replyNum = $(".post-interactive-reply").text().match(/\d+/g);
|
||||
replyNum++;
|
||||
$(".reply-num").text("(" + replyNum + ")");
|
||||
|
||||
//获取并传送回复用户数据
|
||||
var userInfo = {
|
||||
"replyType" : "homework_assignment",
|
||||
"replyContent" : postInput
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST", //提交方式
|
||||
dataType: "json", //类型
|
||||
url: "前台地址/后台方法", //提交的页面,方法名
|
||||
data: userInfo, //参数,如果没有,可以为null
|
||||
success: function (data) { //如果执行成功,那么执行此方法
|
||||
alert(data.d); //用data.d来获取后台传过来的json语句,或者是单纯的语句
|
||||
},
|
||||
error: function (err) { //如果执行不成功,那么执行此方法
|
||||
alert("err:" + err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//点赞效果
|
||||
var praiseClick = function(){
|
||||
var praiseNum = $(".post-interactive-praise").text().match(/\d+/g);
|
||||
praiseNum++;
|
||||
$(".praise-num").text("(" + praiseNum + ")");
|
||||
}
|
||||
|
||||
|
||||
});
|
|
@ -0,0 +1,95 @@
|
|||
/**
|
||||
* Created by root on 4/1/16.
|
||||
*/
|
||||
$(document).ready(function(){
|
||||
|
||||
var bt=baidu.template;
|
||||
bt.LEFT_DELIMITER='<!';
|
||||
bt.RIGHT_DELIMITER='!>';
|
||||
|
||||
|
||||
var apiUrl = '/api/v1/';
|
||||
|
||||
var setTemplate = function(data){
|
||||
console.log(data);
|
||||
var html=bt('t:course-discussion',{discussion: data});
|
||||
$('#c-discussion-container').prepend(html);
|
||||
$('.post-reply-submit').click(function(){
|
||||
replyInsert();
|
||||
});
|
||||
$('post-interactive-praise').click(function(){
|
||||
praiseClick();
|
||||
});
|
||||
};
|
||||
|
||||
var loadDataFromServer = function(id){
|
||||
//getOpenId(function(openid){
|
||||
$.ajax({
|
||||
url: apiUrl + 'messages/' + id,
|
||||
dataType: 'json',
|
||||
success: function(data){
|
||||
setTemplate(data.data);
|
||||
},
|
||||
error: function(xhr,status,err){
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
//})
|
||||
|
||||
|
||||
};
|
||||
|
||||
var homeworkUrl = window.location.search;
|
||||
var homeworkID = homeworkUrl.split("=")[1];
|
||||
|
||||
loadDataFromServer(homeworkID);
|
||||
|
||||
//点击回复按钮,插入回复内容
|
||||
var replyInsert = function(){
|
||||
var replyContent = $("#postInput").val();
|
||||
if (!replyContent){
|
||||
alert("请输入回复");
|
||||
}else{
|
||||
|
||||
//将用户输入内容插入最后一条回复
|
||||
$(".post-reply-wrap:last").after('<div class="post-reply-wrap border-bottom"><div class="post-reply-row"><div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="45" height="45" /></div><div class="ml55"><div class="post-reply-user hidden">Mrs. Ashford</div><div class="post-reply-content c-grey2 mb10"></div><div class="post-reply-date fl"></div><div class="post-reply-trigger fr undis">回复</div></div><div class="cl"></div></div> </div>');
|
||||
$(".post-reply-content:last").append(replyContent);
|
||||
$(".post-reply-date:last").append(Date());
|
||||
var postInput = $("#postInput").val();
|
||||
$("#postInput").val("");
|
||||
//回复数目+1
|
||||
var replyNum = $(".post-interactive-reply").text().match(/\d+/g);
|
||||
replyNum++;
|
||||
$(".reply-num").text("(" + replyNum + ")");
|
||||
|
||||
//获取并传送回复用户数据
|
||||
var userInfo = {
|
||||
"Type" : "Message",
|
||||
"Content" : postInput
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST", //提交方式
|
||||
dataType: "json", //类型
|
||||
url: "前台地址/后台方法", //提交的页面,方法名
|
||||
data: userInfo, //参数,如果没有,可以为null
|
||||
success: function (data) { //如果执行成功,那么执行此方法
|
||||
alert(data.d); //用data.d来获取后台传过来的json语句,或者是单纯的语句
|
||||
},
|
||||
error: function (err) { //如果执行不成功,那么执行此方法
|
||||
alert("err:" + err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//点赞效果
|
||||
var praiseClick = function(){
|
||||
var praiseNum = $(".post-interactive-praise").text().match(/\d+/g);
|
||||
praiseNum++;
|
||||
$(".praise-num").text("(" + praiseNum + ")");
|
||||
}
|
||||
|
||||
|
||||
});
|
|
@ -0,0 +1,95 @@
|
|||
/**
|
||||
* Created by root on 4/1/16.
|
||||
*/
|
||||
$(document).ready(function(){
|
||||
|
||||
var bt=baidu.template;
|
||||
bt.LEFT_DELIMITER='<!';
|
||||
bt.RIGHT_DELIMITER='!>';
|
||||
|
||||
|
||||
var apiUrl = '/api/v1/';
|
||||
|
||||
var setTemplate = function(data){
|
||||
console.log(data);
|
||||
var html=bt('t:course-notice',{course: data});
|
||||
$('#c-notice-container').prepend(html);
|
||||
$('.post-reply-submit').click(function(){
|
||||
replyInsert();
|
||||
});
|
||||
$('post-interactive-praise').click(function(){
|
||||
praiseClick();
|
||||
});
|
||||
};
|
||||
|
||||
var loadDataFromServer = function(id){
|
||||
//getOpenId(function(openid){
|
||||
$.ajax({
|
||||
url: apiUrl + 'newss/' + id,
|
||||
dataType: 'json',
|
||||
success: function(data){
|
||||
setTemplate(data.data);
|
||||
},
|
||||
error: function(xhr,status,err){
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
//})
|
||||
|
||||
|
||||
};
|
||||
|
||||
var homeworkUrl = window.location.search;
|
||||
var homeworkID = homeworkUrl.split("=")[1];
|
||||
|
||||
loadDataFromServer(homeworkID);
|
||||
|
||||
//点击回复按钮,插入回复内容
|
||||
var replyInsert = function(){
|
||||
var replyContent = $("#postInput").val();
|
||||
if (!replyContent){
|
||||
alert("请输入回复");
|
||||
}else{
|
||||
|
||||
//将用户输入内容插入最后一条回复
|
||||
$(".post-reply-wrap:last").after('<div class="post-reply-wrap border-bottom"><div class="post-reply-row"><div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="45" height="45" /></div><div class="ml55"><div class="post-reply-user hidden">Mrs. Ashford</div><div class="post-reply-content c-grey2 mb10"></div><div class="post-reply-date fl"></div><div class="post-reply-trigger fr undis">回复</div></div><div class="cl"></div></div> </div>');
|
||||
$(".post-reply-content:last").append(replyContent);
|
||||
$(".post-reply-date:last").append(Date());
|
||||
var postInput = $("#postInput").val();
|
||||
$("#postInput").val("");
|
||||
//回复数目+1
|
||||
var replyNum = $(".post-interactive-reply").text().match(/\d+/g);
|
||||
replyNum++;
|
||||
$(".reply-num").text("(" + replyNum + ")");
|
||||
|
||||
//获取并传送回复用户数据
|
||||
var userInfo = {
|
||||
"replyType" : "homework_assignment",
|
||||
"replyContent" : postInput
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST", //提交方式
|
||||
dataType: "json", //类型
|
||||
url: "前台地址/后台方法", //提交的页面,方法名
|
||||
data: userInfo, //参数,如果没有,可以为null
|
||||
success: function (data) { //如果执行成功,那么执行此方法
|
||||
alert(data.d); //用data.d来获取后台传过来的json语句,或者是单纯的语句
|
||||
},
|
||||
error: function (err) { //如果执行不成功,那么执行此方法
|
||||
alert("err:" + err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//点赞效果
|
||||
var praiseClick = function(){
|
||||
var praiseNum = $(".post-interactive-praise").text().match(/\d+/g);
|
||||
praiseNum++;
|
||||
$(".praise-num").text("(" + praiseNum + ")");
|
||||
}
|
||||
|
||||
|
||||
});
|
|
@ -0,0 +1,98 @@
|
|||
/**
|
||||
* Created by root on 4/1/16.
|
||||
*/
|
||||
/**
|
||||
* Created by root on 3/31/16.
|
||||
*/
|
||||
$(document).ready(function(){
|
||||
|
||||
var bt=baidu.template;
|
||||
bt.LEFT_DELIMITER='<!';
|
||||
bt.RIGHT_DELIMITER='!>';
|
||||
|
||||
|
||||
var apiUrl = '/api/v1/';
|
||||
|
||||
var setTemplate = function(data){
|
||||
console.log(data);
|
||||
var html=bt('t:issue-detail',{issues: data});
|
||||
$('#issue-container').prepend(html);
|
||||
$('.post-reply-submit').click(function(){
|
||||
replyInsert();
|
||||
});
|
||||
$('post-interactive-praise').click(function(){
|
||||
praiseClick();
|
||||
});
|
||||
};
|
||||
|
||||
var loadDataFromServer = function(id){
|
||||
//getOpenId(function(openid){
|
||||
$.ajax({
|
||||
url: apiUrl + 'issues/' + id,
|
||||
dataType: 'json',
|
||||
success: function(data){
|
||||
setTemplate(data.data);
|
||||
},
|
||||
error: function(xhr,status,err){
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
//})
|
||||
|
||||
|
||||
};
|
||||
|
||||
var homeworkUrl = window.location.search;
|
||||
var homeworkID = homeworkUrl.split("=")[1];
|
||||
|
||||
loadDataFromServer(homeworkID);
|
||||
|
||||
//点击回复按钮,插入回复内容
|
||||
var replyInsert = function(){
|
||||
var replyContent = $("#postInput").val();
|
||||
if (!replyContent){
|
||||
alert("请输入回复");
|
||||
}else{
|
||||
|
||||
//将用户输入内容插入最后一条回复
|
||||
$(".post-reply-wrap:last").after('<div class="post-reply-wrap border-bottom"><div class="post-reply-row"><div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="45" height="45" /></div><div class="ml55"><div class="post-reply-user hidden">Mrs. Ashford</div><div class="post-reply-content c-grey2 mb10"></div><div class="post-reply-date fl"></div><div class="post-reply-trigger fr undis">回复</div></div><div class="cl"></div></div> </div>');
|
||||
$(".post-reply-content:last").append(replyContent);
|
||||
$(".post-reply-date:last").append(Date());
|
||||
var postInput = $("#postInput").val();
|
||||
$("#postInput").val("");
|
||||
//回复数目+1
|
||||
var replyNum = $(".post-interactive-reply").text().match(/\d+/g);
|
||||
replyNum++;
|
||||
$(".reply-num").text("(" + replyNum + ")");
|
||||
|
||||
//获取并传送回复用户数据
|
||||
var userInfo = {
|
||||
"replyType" : "homework_assignment",
|
||||
"replyContent" : postInput
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST", //提交方式
|
||||
dataType: "json", //类型
|
||||
url: "前台地址/后台方法", //提交的页面,方法名
|
||||
data: userInfo, //参数,如果没有,可以为null
|
||||
success: function (data) { //如果执行成功,那么执行此方法
|
||||
alert(data.d); //用data.d来获取后台传过来的json语句,或者是单纯的语句
|
||||
},
|
||||
error: function (err) { //如果执行不成功,那么执行此方法
|
||||
alert("err:" + err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//点赞效果
|
||||
var praiseClick = function(){
|
||||
var praiseNum = $(".post-interactive-praise").text().match(/\d+/g);
|
||||
praiseNum++;
|
||||
$(".praise-num").text("(" + praiseNum + ")");
|
||||
}
|
||||
|
||||
|
||||
});
|
|
@ -0,0 +1,95 @@
|
|||
/**
|
||||
* Created by root on 4/1/16.
|
||||
*/
|
||||
$(document).ready(function(){
|
||||
|
||||
var bt=baidu.template;
|
||||
bt.LEFT_DELIMITER='<!';
|
||||
bt.RIGHT_DELIMITER='!>';
|
||||
|
||||
|
||||
var apiUrl = '/api/v1/';
|
||||
|
||||
var setTemplate = function(data){
|
||||
console.log(data);
|
||||
var html=bt('t:message-detail',{message: data});
|
||||
$('#message-container').prepend(html);
|
||||
$('.post-reply-submit').click(function(){
|
||||
replyInsert();
|
||||
});
|
||||
$('post-interactive-praise').click(function(){
|
||||
praiseClick();
|
||||
});
|
||||
};
|
||||
|
||||
var loadDataFromServer = function(id){
|
||||
//getOpenId(function(openid){
|
||||
$.ajax({
|
||||
url: apiUrl + 'journal_for_messages/' + id,
|
||||
dataType: 'json',
|
||||
success: function(data){
|
||||
setTemplate(data.data);
|
||||
},
|
||||
error: function(xhr,status,err){
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
//})
|
||||
|
||||
|
||||
};
|
||||
|
||||
var homeworkUrl = window.location.search;
|
||||
var homeworkID = homeworkUrl.split("=")[1];
|
||||
|
||||
loadDataFromServer(homeworkID);
|
||||
|
||||
//点击回复按钮,插入回复内容
|
||||
var replyInsert = function(){
|
||||
var replyContent = $("#postInput").val();
|
||||
if (!replyContent){
|
||||
alert("请输入回复");
|
||||
}else{
|
||||
|
||||
//将用户输入内容插入最后一条回复
|
||||
$(".post-reply-wrap:last").after('<div class="post-reply-wrap border-bottom"><div class="post-reply-row"><div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="45" height="45" /></div><div class="ml55"><div class="post-reply-user hidden">Mrs. Ashford</div><div class="post-reply-content c-grey2 mb10"></div><div class="post-reply-date fl"></div><div class="post-reply-trigger fr undis">回复</div></div><div class="cl"></div></div> </div>');
|
||||
$(".post-reply-content:last").append(replyContent);
|
||||
$(".post-reply-date:last").append(Date());
|
||||
var postInput = $("#postInput").val();
|
||||
$("#postInput").val("");
|
||||
//回复数目+1
|
||||
var replyNum = $(".post-interactive-reply").text().match(/\d+/g);
|
||||
replyNum++;
|
||||
$(".reply-num").text("(" + replyNum + ")");
|
||||
|
||||
//获取并传送回复用户数据
|
||||
var userInfo = {
|
||||
"replyType" : "homework_assignment",
|
||||
"replyContent" : postInput
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST", //提交方式
|
||||
dataType: "json", //类型
|
||||
url: "前台地址/后台方法", //提交的页面,方法名
|
||||
data: userInfo, //参数,如果没有,可以为null
|
||||
success: function (data) { //如果执行成功,那么执行此方法
|
||||
alert(data.d); //用data.d来获取后台传过来的json语句,或者是单纯的语句
|
||||
},
|
||||
error: function (err) { //如果执行不成功,那么执行此方法
|
||||
alert("err:" + err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//点赞效果
|
||||
var praiseClick = function(){
|
||||
var praiseNum = $(".post-interactive-praise").text().match(/\d+/g);
|
||||
praiseNum++;
|
||||
$(".praise-num").text("(" + praiseNum + ")");
|
||||
}
|
||||
|
||||
|
||||
});
|
|
@ -0,0 +1,3 @@
|
|||
/**
|
||||
* Created by root on 4/1/16.
|
||||
*/
|
Loading…
Reference in New Issue