微信图片内容点击可放大

This commit is contained in:
Tim 2016-09-20 14:42:36 +08:00
parent 9c214ef57b
commit 2856cd06d5
9 changed files with 30 additions and 7 deletions

View File

@ -41,6 +41,7 @@
<script src="/javascripts/wechat/directives/at_delete_link.js"></script> <script src="/javascripts/wechat/directives/at_delete_link.js"></script>
<script src="/javascripts/wechat/directives/iphone_recognize.js"></script> <script src="/javascripts/wechat/directives/iphone_recognize.js"></script>
<script src="/javascripts/wechat/directives/multi_reply.js"></script> <script src="/javascripts/wechat/directives/multi_reply.js"></script>
<script src="/javascripts/wechat/directives/img_preview.js"></script>
<script src="/javascripts/wechat/controllers/reg.js"></script> <script src="/javascripts/wechat/controllers/reg.js"></script>
<script src="/javascripts/wechat/controllers/login.js"></script> <script src="/javascripts/wechat/controllers/login.js"></script>
<script src="/javascripts/wechat/controllers/activity.js"></script> <script src="/javascripts/wechat/controllers/activity.js"></script>

View File

@ -25,7 +25,7 @@
<div class="post-dynamic-title c-black fb">{{blog.title}}<img ng-if="blog.locked" src="/images/locked.png" style="display:inline-block;" /></div> <div class="post-dynamic-title c-black fb">{{blog.title}}<img ng-if="blog.locked" src="/images/locked.png" style="display:inline-block;" /></div>
<div class="c-grey4 f13 mt5"><span class="mr10">博客</span><span>{{blog.created_at}}</span></div> <div class="c-grey4 f13 mt5"><span class="mr10">博客</span><span>{{blog.created_at}}</span></div>
<div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="blog.content|safeHtml"></div> <div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="blog.content|safeHtml" img-preview></div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="fr f13"> <div class="fr f13">

View File

@ -25,7 +25,7 @@
<div class="ml40"> <div class="ml40">
<div class="post-dynamic-title c-black fb">{{discussion.subject}}<img ng-if="discussion.locked" src="/images/locked.png" style="display:inline-block;" /></div> <div class="post-dynamic-title c-black fb">{{discussion.subject}}<img ng-if="discussion.locked" src="/images/locked.png" style="display:inline-block;" /></div>
<div class="c-grey4 f13 mt5"><span class="mr10">{{discussion.syllabus_title}}<font class="fb" style="height:18px; line-height:18px; vertical-align:top; margin:0 3px;">·</font>{{discussion.course_project_name}} - 班级讨论区</span><span>{{discussion.created_on}}</span></div> <div class="c-grey4 f13 mt5"><span class="mr10">{{discussion.syllabus_title}}<font class="fb" style="height:18px; line-height:18px; vertical-align:top; margin:0 3px;">·</font>{{discussion.course_project_name}} - 班级讨论区</span><span>{{discussion.created_on}}</span></div>
<div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="discussion.content|safeHtml"></div> <div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="discussion.content|safeHtml" img-preview></div>
<div class="cl"></div> <div class="cl"></div>
<div class="fr f13"> <div class="fr f13">
<div ng-if="!discussion.praise_count" ng-click="addPraise(discussion);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div> <div ng-if="!discussion.praise_count" ng-click="addPraise(discussion);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>

View File

@ -24,7 +24,7 @@
<div class="ml40"> <div class="ml40">
<div class="post-dynamic-title c-black fb">{{news.title}}</div> <div class="post-dynamic-title c-black fb">{{news.title}}</div>
<div class="c-grey4 f13 mt5"><span class="mr10">{{news.syllabus_title}}<font class="fb" style="height:18px; line-height:18px; vertical-align:top; margin:0 3px;">·</font>{{news.course_name}} - 课程通知</span><span>{{news.created_on}}</span></div> <div class="c-grey4 f13 mt5"><span class="mr10">{{news.syllabus_title}}<font class="fb" style="height:18px; line-height:18px; vertical-align:top; margin:0 3px;">·</font>{{news.course_name}} - 课程通知</span><span>{{news.created_on}}</span></div>
<div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="news.description|safeHtml"></div> <div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="news.description|safeHtml" img-preview></div>
<div class="cl"></div> <div class="cl"></div>
<div class="fr f13"> <div class="fr f13">
<div ng-if="!news.praise_count" ng-click="addPraise(news);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div> <div ng-if="!news.praise_count" ng-click="addPraise(news);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>

View File

@ -24,7 +24,7 @@
<div class="ml40"> <div class="ml40">
<div class="post-dynamic-title c-black fb">{{homework.name}}</div> <div class="post-dynamic-title c-black fb">{{homework.name}}</div>
<div class="c-grey4 mt5 f13"><span class="mr10">{{homework.syllabus_title}}<font class="fb" style="height:18px; line-height:18px; vertical-align:top; margin:0 3px;">·</font>{{homework.course_name}} - <span ng-if="homework.homework_type == 1">普通作业</span><span ng-if="homework.homework_type == 2">编程作业</span><span ng-if="homework.homework_type == 3">分组作业</span></span><span>{{homework.publish_time}}</span></div> <div class="c-grey4 mt5 f13"><span class="mr10">{{homework.syllabus_title}}<font class="fb" style="height:18px; line-height:18px; vertical-align:top; margin:0 3px;">·</font>{{homework.course_name}} - <span ng-if="homework.homework_type == 1">普通作业</span><span ng-if="homework.homework_type == 2">编程作业</span><span ng-if="homework.homework_type == 3">分组作业</span></span><span>{{homework.publish_time}}</span></div>
<div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="homework.description|safeHtml"></div> <div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="homework.description|safeHtml" img-preview></div>
<span class="c-grey f12 mr15">迟交扣分:{{homework.late_penalty}}分</span> <span class="c-grey f12 mr15">迟交扣分:{{homework.late_penalty}}分</span>
<span ng-if="!homework.anonymous_comment" class="c-grey f12">匿评开启时间:{{homework.evaluation_start}}</span><br /> <span ng-if="!homework.anonymous_comment" class="c-grey f12">匿评开启时间:{{homework.evaluation_start}}</span><br />
<span ng-if="!homework.anonymous_comment" class="c-grey f12 mr15">缺评扣分:{{homework.absence_penalty}}分/作品</span> <span ng-if="!homework.anonymous_comment" class="c-grey f12 mr15">缺评扣分:{{homework.absence_penalty}}分/作品</span>

View File

@ -26,7 +26,7 @@
<div class="post-dynamic-title c-black fb">{{issue.subject}}</div> <div class="post-dynamic-title c-black fb">{{issue.subject}}</div>
<div class="c-grey4 f13 mt5"><span class="mr10">{{issue.project_name}} - 项目问题</span><span>{{issue.created_on}}</span></div> <div class="c-grey4 f13 mt5"><span class="mr10">{{issue.project_name}} - 项目问题</span><span>{{issue.created_on}}</span></div>
<div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="issue.description|safeHtml"></div> <div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="issue.description|safeHtml" img-preview></div>
<span class="c-grey f12 mr15">&nbsp;&nbsp;&nbsp;态:{{issue.issue_status}}</span> <span class="c-grey f12 mr15">&nbsp;&nbsp;&nbsp;态:{{issue.issue_status}}</span>
<span class="c-grey f12">优先级:{{issue.issue_priority}}</span><br/> <span class="c-grey f12">优先级:{{issue.issue_priority}}</span><br/>
<span class="c-grey f12 mr15">指派给:{{issue.issue_assigned_to}}</span> <span class="c-grey f12 mr15">指派给:{{issue.issue_assigned_to}}</span>

View File

@ -24,7 +24,7 @@
<div class="ml40"> <div class="ml40">
<div class="c-grey4 f13 mt5"><span class="mr10">留言</span><span>{{message.created_on}}</span></div> <div class="c-grey4 f13 mt5"><span class="mr10">留言</span><span>{{message.created_on}}</span></div>
<div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="message.content|safeHtml"></div> <div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="message.content|safeHtml" img-preview></div>
<div class="cl"></div> <div class="cl"></div>
<div class="fr f13"> <div class="fr f13">
<div ng-if="!message.praise_count" ng-click="addPraise(message);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div> <div ng-if="!message.praise_count" ng-click="addPraise(message);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>

View File

@ -25,7 +25,7 @@
<div class="post-dynamic-title c-black fb">{{discussion.subject}}<img ng-if="discussion.locked" src="/images/locked.png" style="display:inline-block;" /></div> <div class="post-dynamic-title c-black fb">{{discussion.subject}}<img ng-if="discussion.locked" src="/images/locked.png" style="display:inline-block;" /></div>
<div class="c-grey4 f13 mt5"><span class="mr10">{{discussion.course_project_name}} - 项目讨论区</span><span>{{discussion.created_on}}</span></div> <div class="c-grey4 f13 mt5"><span class="mr10">{{discussion.course_project_name}} - 项目讨论区</span><span>{{discussion.created_on}}</span></div>
<div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="discussion.content|safeHtml"></div> <div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="discussion.content|safeHtml" img-preview></div>
<div class="cl"></div> <div class="cl"></div>
<div class="fr f13"> <div class="fr f13">
<div ng-if="!discussion.praise_count" ng-click="addPraise(discussion);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div> <div ng-if="!discussion.praise_count" ng-click="addPraise(discussion);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>

View File

@ -0,0 +1,22 @@
/**
* Created by ttang on 2016/9/20.
*/
app.directive('imgPreview',["$timeout",'wx',function(timer,wx){
return{
restrict: 'A',
scope: {},
link: function(scope, element){
timer(function(){
var srcList = [];
$.each($(".post-all-content img"),function(i,item){
if(item.src){
srcList.push(item.src);
$(item).click(function(e){
wx.previewImage(this.src,srcList);
});
}
});
})
}
}
}]);