From 99f39696d0ada73f3c13997dcd471441b67f46b6 Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Thu, 7 Apr 2016 13:57:38 +0800
Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=B1=95=E5=BC=80=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/assets/wechat/activities.html | 5 ++--
public/javascripts/wechat/app.js | 36 ++++++++++++++++++++++++++--
2 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html
index ae8fe8136..2db18be26 100644
--- a/public/assets/wechat/activities.html
+++ b/public/assets/wechat/activities.html
@@ -16,8 +16,7 @@
迟交扣分:{{act.homework_common_detail.late_penalty}}分 匿评开启时间:{{act.homework_common_detail.evaluation_start}}
缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品 匿评关闭时间:{{act.homework_common_detail.evaluation_end}}
- 点击展开
- 点击展开
+ 点击展开
{{act.latest_update}}
@@ -110,7 +109,7 @@
状态:{{act.issue_detail.issue_status}} 优先级:{{act.issue_detail.issue_priority}}
指派给:{{act.issue_detail.issue_assigned_to}} 完成度:{{act.issue_detail.done_ratio}}%
- 点击展开
+ 点击展开
{{act.latest_update}}
diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js
index f288a4b65..dc926574d 100644
--- a/public/javascripts/wechat/app.js
+++ b/public/javascripts/wechat/app.js
@@ -3,14 +3,14 @@ var apiUrl = 'http://wechat.trustie.net/api/v1/';
var debug = true; //调试标志,如果在本地请置为true
if(debug===true){
- apiUrl = 'http://localhost:3000/api/v1/';
+ //apiUrl = 'http://localhost:3000/api/v1/';
}
app.factory('auth', function($http,$routeParams, $cookies, $q){
var _openid = '';
if(debug===true){
- _openid = "1";
+ _openid = "oCnvgvz8R7QheXE-R9Kkr39j8Ndg";
}
var getOpenId = function() {
@@ -397,6 +397,38 @@ app.filter('safeHtml', function ($sce) {
}
});
+app.directive('textAutoHeight', function($timeout){
+ return {
+ restrict: 'A',
+ scope: {},
+ link: function(scope, element, attr){
+ scope.text = '点击展开';
+ $timeout(function(){
+ var e = element.parent().children().eq(4);
+ var height = e[0].scrollHeight;
+ var offsetHeight = e[0].offsetHeight;
+ console.log(height);
+ console.log(offsetHeight);
+ console.log(attr);
+ if(height>90){
+ element.css('display', 'block');
+ element.on('click', function(){
+ if(element.text() == "点击展开"){
+ e.css("height", height+'px');
+ element.text("点击隐藏");
+ } else {
+ e.css("height", '90px');
+ element.text("点击展开");
+ }
+
+ });
+ }
+ }, false);
+
+ }
+ }
+});
+
app.config(['$routeProvider',function ($routeProvider) {
$routeProvider
.when('/activities', {