From bd1aae07fd7ca1c0a418a38a1030909f7d0f134a Mon Sep 17 00:00:00 2001 From: txz Date: Mon, 4 Jul 2016 14:43:51 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- public/assets/wechat/activities.html | 263 +++++++++++++++------------ public/stylesheets/weui/weixin.css | 2 +- 3 files changed, 149 insertions(+), 118 deletions(-) diff --git a/Gemfile b/Gemfile index eef93c371..fe7d46d01 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ unless RUBY_PLATFORM =~ /w32/ if RUBY_PLATFORM =~ /darwin/ gem "rmagick", "= 2.15.4" ## osx must be this version else - gem "rmagick", "= 2.13.1" ## centos yum install ImageMagick-devel + #gem "rmagick", "= 2.13.1" ## centos yum install ImageMagick-devel end gem 'certified' end diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index ef3346e20..b34098a8e 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -6,43 +6,46 @@
我的动态
+
+ 所有动态 + 课程动态 + 项目动态 +
+
-
-
- - +
+
+ +
{{act.latest_update}}
- -
+ +
迟交扣分:{{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}} - 回复 - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
-
+ +
+
+
{{act.praise_count}}
+
{{act.praise_count}}
+ +
@@ -52,28 +55,32 @@
-
-
- - +
+
+ +
{{act.latest_update}}
- -
+ +
-
-
- {{act.activity_type_name}} - {{act.latest_update}} - 回复 - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
-
+ +
+
+
{{act.praise_count}}
+
{{act.praise_count}}
+ +
@@ -83,28 +90,33 @@
-
-
- - +
+
+ +
{{act.latest_update}}
- -
+ +
-
- {{act.activity_type_name}} - {{act.latest_update}} - 回复 - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
-
+ +
+
+
{{act.praise_count}}
+
{{act.praise_count}}
+ +
@@ -115,7 +127,7 @@
-
+
@@ -130,30 +142,34 @@
-
-
- - +
+
+ +
{{act.latest_update}}
- -
+ +
状态:{{act.issue_detail.issue_status}} 优先级:{{act.issue_detail.issue_priority}}
指派给:{{act.issue_detail.issue_assigned_to}} 完成度:{{act.issue_detail.done_ratio}}%
-
-
- {{act.activity_type_name}} - {{act.latest_update}} - 回复 - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
-
+ +
+
+
{{act.praise_count}}
+
{{act.praise_count}}
+
+ +
@@ -164,28 +180,32 @@
-
-
- - +
+
+ +
{{act.latest_update}}
- -
+ +
-
-
- {{act.activity_type_name}} - {{act.latest_update}} - 回复 - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
-
+ +
+
+
{{act.praise_count}}
+
{{act.praise_count}}
+
+ +
@@ -195,7 +215,7 @@
-
+
@@ -210,27 +230,32 @@
-
-
- - -
+
+
+ +
{{act.latest_update}}
-
+
-
- {{act.latest_update}} - 回复 - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
-
+ +
+
+
{{act.praise_count}}
+
{{act.praise_count}}
+ +
@@ -241,27 +266,33 @@
-
-
- - +
+
+ +
{{act.latest_update}}
- -
+ +
-
- {{act.latest_update}} - 回复 - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
-
+ +
+
+
{{act.praise_count}}
+
{{act.praise_count}}
+
+ +
diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 5b1c1df95..7c219c571 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -109,7 +109,7 @@ a.underline {text-decoration:underline;} .post-interactive-reply, .post-interactive-praise {width:50%; text-align:center; float:left; font-size:13px;} .more-wrap {width:100%;} -.more-events {width:98%; font-size:13px; text-align:center; margin:0 auto; padding: 5px 0; border:1px solid #e6e6e6; border-radius:3px; background-color:#f8f9fb; } +.more-events {width:100%; font-size:13px; text-align:center; margin:0 auto; padding: 5px 0; border-top:1px solid #e6e6e6; border-bottom:1px solid #e6e6e6; border-radius:3px; background-color:#f8f9fb; } .border-bottom {border-bottom:1px solid #e6e6e6;} .post-reply-wrap {width:100%;} .post-input-wrap {width:100%; position:fixed; bottom:0;} From 45b824938e203c6dbf7e565f279ebf2240a34aa2 Mon Sep 17 00:00:00 2001 From: txz Date: Mon, 4 Jul 2016 16:41:41 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E4=B8=8E=E8=AF=BE=E7=A8=8B=E9=80=9A=E7=9F=A5=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/activities.html | 21 ++++-- public/assets/wechat/course_discussion.html | 72 +++++++++++---------- public/assets/wechat/course_notice.html | 70 +++++++++++--------- public/stylesheets/weui/weixin.css | 1 + 4 files changed, 92 insertions(+), 72 deletions(-) diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index b34098a8e..a51a0f5f0 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -23,7 +23,8 @@
{{act.latest_update}}
@@ -60,7 +61,8 @@
{{act.latest_update}}
@@ -95,7 +97,8 @@
{{act.latest_update}}
@@ -147,7 +150,8 @@
{{act.latest_update}}
@@ -185,7 +189,8 @@
{{act.latest_update}}
@@ -235,7 +240,8 @@
{{act.latest_update}}
@@ -271,7 +277,8 @@
{{act.latest_update}}
diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index cc188f978..142a474fd 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -4,51 +4,57 @@
-
+
-
{{discussion.subject}}
- - - - - - - -
发布者:{{discussion.user.realname}}
来   源:{{discussion.course_project_name}}  |  课程问答区
-
+
+
- {{discussion.created_on}} +
{{discussion.subject}}
+
{{discussion.course_project_name}}-课程问答区{{discussion.created_on}}
+
+
+
+
+
{{discussion.praise_count}}
+
{{discussion.praise_count}}
+
+
-
-
-
回复 ({{discussion.replies_count}})
-
已赞 ({{discussion.praise_count}})
-
赞 ({{discussion.praise_count}})
-
-
-
-
- -
-
{{journal.lasted_comment}}
-
回复
+
+
+
+
+ +
{{journal.lasted_comment}}
+
+
+
-
-
-
+ +
-
- + + + +
- - -
diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index e3346ea93..780aa43a8 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -3,51 +3,57 @@
-
+
-
{{news.title}}
- - - - - - - -
发布者:{{news.author.realname}}
来   源:{{news.course_name}}  |  课程通知
+
+ +
+
{{news.title}}
+
{{news.course_name}}-课程通知{{news.created_on}}
- {{news.created_on}} +
+
+
{{news.praise_count}}
+
{{news.praise_count}}
+
+
-
-
回复 ({{news.comments_count}})
-
已赞 ({{news.praise_count}})
-
赞 ({{news.praise_count}})
-
-
-
-
-
- -
-
{{comments.created_on}}
-
回复
+
+
+
+
+ +
{{comments.created_on}}
+
+
+
-
-
-
+ +
-
- + + + +
- - -
diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 7c219c571..1b2e295f5 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -112,6 +112,7 @@ a.underline {text-decoration:underline;} .more-events {width:100%; font-size:13px; text-align:center; margin:0 auto; padding: 5px 0; border-top:1px solid #e6e6e6; border-bottom:1px solid #e6e6e6; border-radius:3px; background-color:#f8f9fb; } .border-bottom {border-bottom:1px solid #e6e6e6;} .post-reply-wrap {width:100%;} +.post-reply-wrap:first-child {border-top:1px solid #ccc;} .post-input-wrap {width:100%; position:fixed; bottom:0;} .post-input-wrap2 {width:100%;} .post-reply-row {padding:10px 15px; color:#9a9a9a; background-color:#fff;} From 9d0b5789d9493bfccc02049955358b066f7b5c8d Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Mon, 4 Jul 2016 16:50:49 +0800 Subject: [PATCH 3/3] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E6=88=91=E7=9A=84?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=8D=9A=E5=AE=A2=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA=E4=B8=8D=E4=BA=86=E7=9A=84BUG=20=20?= =?UTF-8?q?2.=E8=B5=84=E6=BA=90=E7=95=8C=E9=9D=A2=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E6=98=AF=E6=9A=82=E6=97=A0XX=E5=85=88=E9=9A=90=E8=97=8F=20=203?= =?UTF-8?q?.=20=E5=8F=91=E9=80=81=E8=B5=84=E6=BA=90=E4=B8=8D=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E7=8F=AD=E7=BA=A7=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/blog_comments.rb | 2 +- public/assets/wechat/class.html | 6 +++--- public/assets/wechat/myresource.html | 9 ++++++--- public/javascripts/wechat/controllers/class.js | 6 ++++++ public/javascripts/wechat/controllers/myresource.js | 12 ++++++------ 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/app/api/mobile/apis/blog_comments.rb b/app/api/mobile/apis/blog_comments.rb index 5a064245a..bb5758e71 100644 --- a/app/api/mobile/apis/blog_comments.rb +++ b/app/api/mobile/apis/blog_comments.rb @@ -7,7 +7,7 @@ module Mobile desc "get special topic" get ':id' do - user = UserWechat.find_by_openid(params[:openid]).user + user = current_user blog = BlogComment.find params[:id] present :data, blog, with: Mobile::Entities::BlogComment,user: user present :status, 0 diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html index 70dd64fad..fa52c9ea4 100644 --- a/public/assets/wechat/class.html +++ b/public/assets/wechat/class.html @@ -21,7 +21,7 @@
{{r.filename}}发送
-

暂无课件,
+

暂无课件,
请登录Trustie网站,在PC浏览器中上传课件。

@@ -38,14 +38,14 @@
{{r.homework_name}}
-

暂无作业,
+

暂无作业,
请登录Trustie网站,在PC浏览器中上传作业。

{{r.exercise_name}}
-

暂无小测验,
+

暂无小测验,
请登录Trustie网站,在PC浏览器中上传小测验。

diff --git a/public/assets/wechat/myresource.html b/public/assets/wechat/myresource.html index dc4d6ea78..1317ac11a 100644 --- a/public/assets/wechat/myresource.html +++ b/public/assets/wechat/myresource.html @@ -1,4 +1,5 @@
+
我的资源
{{menu}} @@ -8,19 +9,21 @@
+
{{r.filename}}发送
-

暂无课件,
+

暂无课件,
请登录Trustie网站,在PC浏览器中上传课件。

{{r.homework_name}}
-

暂无作业,
+

暂无作业,
请登录Trustie网站,在PC浏览器中创建作业。

{{r.exercise_name}}
-

暂无测验,
+

暂无测验,
请登录Trustie网站,在PC浏览器中创建测验。

+
diff --git a/public/javascripts/wechat/controllers/class.js b/public/javascripts/wechat/controllers/class.js index 1cd69bb43..d5de23859 100644 --- a/public/javascripts/wechat/controllers/class.js +++ b/public/javascripts/wechat/controllers/class.js @@ -31,6 +31,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location {token: auth.token(), name: ''} ).then(function(response){ vm.resources = response.data.data; + vm.resources_tag = true; }); } } @@ -40,6 +41,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location $http.get(config.apiUrl + "courses/homeworks/"+courseid+"?token="+auth.token()).then(function(response){ vm.homeworks = response.data.data; console.log(response.data); + vm.homeworks_tag = true; }); } } @@ -49,6 +51,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location $http.get(config.apiUrl + "courses/"+courseid+"/exercises?token="+auth.token()).then(function(response){ vm.exercises = response.data.data; console.log(response.data); + vm.exercises_tag = true; }); } } @@ -64,6 +67,9 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location vm.showResources = false; vm.showHomework = false; vm.showTestcase = false; + vm.resources_tag = false; + vm.homeworks_tag = false; + vm.exercises_tag = false; if(vm.isTeacher){ if(index == 1){ //课件 diff --git a/public/javascripts/wechat/controllers/myresource.js b/public/javascripts/wechat/controllers/myresource.js index 084205fbe..462a35842 100644 --- a/public/javascripts/wechat/controllers/myresource.js +++ b/public/javascripts/wechat/controllers/myresource.js @@ -2,23 +2,23 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l var vm = $scope; vm.menus = ['课件', '作业', '测验']; - vm.resources = []; - vm.homeworks = []; - vm.exercise = []; + vm.resources = null; + vm.homeworks = null; + vm.exercise = null; vm.tab = function(index){ vm.currentTab = index; - if(index==1){ + if(index==1 && (!vm.resources || vm.resources.length <= 0 )){ $http.get(config.apiUrl + "resources?token="+auth.token()).then(function(response){ console.log(response.data); vm.resources = response.data.data; }); - } else if(index==2){ + } else if(index==2 && (!vm.homeworks || vm.homeworks.length <= 0) ){ $http.get(config.apiUrl + "resources/homeworks?token="+auth.token()).then(function(response){ console.log(response.data); vm.homeworks = response.data.data; }); - } else if(index==3){ + } else if(index==3 && (!vm.exercise || vm.exercise.length <= 0) ){ $http.get(config.apiUrl + "resources/exercies?token="+auth.token()).then(function(response){ console.log(response.data); vm.exercise = response.data.data;