From 0cafebb3a24ad9007f59996e982d40f12902842e Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 27 May 2016 17:14:37 +0800 Subject: [PATCH 01/30] =?UTF-8?q?=E6=96=B0=E9=97=BB=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E7=82=B9=E8=B5=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_news.html.erb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/views/users/_project_news.html.erb b/app/views/users/_project_news.html.erb index 55e2182b5..b354bc668 100644 --- a/app/views/users/_project_news.html.erb +++ b/app/views/users/_project_news.html.erb @@ -66,11 +66,7 @@
回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<%#= format_date(activity.updated_on) %>
@@ -108,11 +104,7 @@ <% end %> <%= format_time(comment.created_on) %> - <% if comment.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
From 19de82359a7db0686cbea05a16a0418860885a3b Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 31 May 2016 10:53:11 +0800 Subject: [PATCH 02/30] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/blog_detail.html | 1 + public/assets/wechat/course_discussion.html | 1 + public/assets/wechat/course_notice.html | 1 + public/assets/wechat/homework_detail.html | 1 + public/assets/wechat/issue_detail.html | 1 + public/assets/wechat/jour_message_detail.html | 1 + public/assets/wechat/project_discussion.html | 1 + 7 files changed, 7 insertions(+) diff --git a/public/assets/wechat/blog_detail.html b/public/assets/wechat/blog_detail.html index fa3a9f341..bd398c988 100644 --- a/public/assets/wechat/blog_detail.html +++ b/public/assets/wechat/blog_detail.html @@ -1,5 +1,6 @@ +
diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index d1b65e629..46ef95cfa 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -1,5 +1,6 @@ +
diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index c10763bf8..a4bca9809 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -1,5 +1,6 @@ +
diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index 2783bd317..0671da049 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -1,5 +1,6 @@ +
diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index 035a7c98d..0be7ba5ac 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -1,5 +1,6 @@ +
diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html index 5ccbf6248..9b1494abe 100644 --- a/public/assets/wechat/jour_message_detail.html +++ b/public/assets/wechat/jour_message_detail.html @@ -1,4 +1,5 @@ +
diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html index be639c1a0..69625c0c5 100644 --- a/public/assets/wechat/project_discussion.html +++ b/public/assets/wechat/project_discussion.html @@ -1,5 +1,6 @@ +
From f166a951f3665c7edbdaed54927f341f258a1ba8 Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 31 May 2016 13:49:39 +0800 Subject: [PATCH 03/30] =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=96=87=E5=AD=97=E6=A0=BC=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/blog_detail.html | 4 +--- public/assets/wechat/course_discussion.html | 4 +--- public/assets/wechat/course_notice.html | 4 +--- public/assets/wechat/homework_detail.html | 12 +++++------- public/assets/wechat/issue_detail.html | 12 +++++------- public/assets/wechat/jour_message_detail.html | 4 +--- public/assets/wechat/project_discussion.html | 4 +--- 7 files changed, 15 insertions(+), 29 deletions(-) diff --git a/public/assets/wechat/blog_detail.html b/public/assets/wechat/blog_detail.html index bd398c988..4e0fb3577 100644 --- a/public/assets/wechat/blog_detail.html +++ b/public/assets/wechat/blog_detail.html @@ -8,9 +8,7 @@
{{blog.title}}
{{blog.user.realname}}发表博客
-
-
-
+
{{blog.created_at}}
diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index 46ef95cfa..0d7beb9e6 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -15,9 +15,7 @@ 来   源: {{discussion.course_project_name}}  |  课程问答区 -
-
-
+
{{discussion.created_on}}
diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index a4bca9809..22906af39 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -14,9 +14,7 @@ 来   源: {{news.course_name}}  |  课程通知 -
-
-
+
{{news.created_on}}
diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index 0671da049..b822f9866 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -16,13 +16,11 @@ 来   源: {{homework.course_name}}  |  课程作业 -
-
- 迟交扣分:{{homework.late_penalty}}分
- 缺评扣分:{{homework.absence_penalty}}分/作品
- 匿评开启时间:{{homework.evaluation_start}}
- 匿评关闭时间:{{homework.evaluation_end}} -
+
+ 迟交扣分:{{homework.late_penalty}}分
+ 缺评扣分:{{homework.absence_penalty}}分/作品
+ 匿评开启时间:{{homework.evaluation_start}}
+ 匿评关闭时间:{{homework.evaluation_end}}
{{homework.publish_time}}
diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index 0be7ba5ac..28b02c5aa 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -14,13 +14,11 @@ 来   源: {{issue.project_name}}  |  项目问题 -
-
- 状   态:{{issue.issue_status}}
- 优先级:{{issue.issue_priority}}
- 指派给:{{issue.issue_assigned_to}}
- 完成度:{{issue.done_ratio}}%
-
+
+ 状   态:{{issue.issue_status}}
+ 优先级:{{issue.issue_priority}}
+ 指派给:{{issue.issue_assigned_to}}
+ 完成度:{{issue.done_ratio}}%
{{issue.created_on}}
diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html index 9b1494abe..a4ad7a0dd 100644 --- a/public/assets/wechat/jour_message_detail.html +++ b/public/assets/wechat/jour_message_detail.html @@ -7,9 +7,7 @@
{{message.user.realname}}给您留言了
{{message.created_on}}
-
-
-
+
diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html index 69625c0c5..4b86eaf28 100644 --- a/public/assets/wechat/project_discussion.html +++ b/public/assets/wechat/project_discussion.html @@ -14,9 +14,7 @@ 来   源: {{discussion.course_project_name}}  |  项目讨论区 -
-
-
+
{{discussion.created_on}}
From 91be3b9f85c8c2df8ee68b8f11dddff4dc32c02a Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 31 May 2016 14:37:45 +0800 Subject: [PATCH 04/30] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=97=B6=E6=8C=89=E9=92=AE=E5=8F=98=E7=81=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/blog_detail.html | 3 ++- public/assets/wechat/course_discussion.html | 3 ++- public/assets/wechat/course_notice.html | 3 ++- public/assets/wechat/homework_detail.html | 3 ++- public/assets/wechat/issue_detail.html | 5 +++-- public/assets/wechat/jour_message_detail.html | 3 ++- public/assets/wechat/project_discussion.html | 3 ++- public/javascripts/wechat/app.js | 6 +++--- public/stylesheets/weui/weixin.css | 2 ++ 9 files changed, 20 insertions(+), 11 deletions(-) diff --git a/public/assets/wechat/blog_detail.html b/public/assets/wechat/blog_detail.html index 4e0fb3577..b820ed591 100644 --- a/public/assets/wechat/blog_detail.html +++ b/public/assets/wechat/blog_detail.html @@ -39,7 +39,8 @@
- + +
diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index 0d7beb9e6..f02c01ff6 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -46,7 +46,8 @@
- + +
diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index 22906af39..0a85ed089 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -45,7 +45,8 @@
- + +
diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index b822f9866..e416b7313 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -51,7 +51,8 @@
- + +
diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index 28b02c5aa..7b5db0afa 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -49,8 +49,9 @@
- -
+ + +
diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html index a4ad7a0dd..fada796f8 100644 --- a/public/assets/wechat/jour_message_detail.html +++ b/public/assets/wechat/jour_message_detail.html @@ -37,7 +37,8 @@
- + +
diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html index 4b86eaf28..bd863f5ed 100644 --- a/public/assets/wechat/project_discussion.html +++ b/public/assets/wechat/project_discussion.html @@ -45,7 +45,8 @@
- + +
diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 8f00a2b96..267fefb43 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -1,10 +1,10 @@ var app = angular.module('wechat', ['ngRoute','ngCookies']); var apiUrl = '/api/v1/'; -var debug = false; //调试标志,如果在本地请置为true +var debug = true; //调试标志,如果在本地请置为true if(debug===true){ - //apiUrl = 'http://localhost:3000/api/v1/'; - apiUrl = 'https://www.trustie.net/api/v1/'; + apiUrl = 'http://localhost:3000/api/v1/'; + //apiUrl = 'https://www.trustie.net/api/v1/'; } app.factory('auth', function($http,$routeParams, $cookies, $q){ diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index ba3eac3df..b09c54109 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -84,3 +84,5 @@ a.underline {text-decoration:underline;} /*帖子锁定样式*/ .locked_btn_cir {background: url("/images/locked.png") 0 0 no-repeat; cursor: default;} + +.bg-grey {background-color:#c1c1c1;} From 80452ceef92553d98fbaf6cc288e7fb29a2ec701 Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 31 May 2016 14:38:55 +0800 Subject: [PATCH 05/30] =?UTF-8?q?app.js=E6=96=87=E4=BB=B6=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 267fefb43..8f00a2b96 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -1,10 +1,10 @@ var app = angular.module('wechat', ['ngRoute','ngCookies']); var apiUrl = '/api/v1/'; -var debug = true; //调试标志,如果在本地请置为true +var debug = false; //调试标志,如果在本地请置为true if(debug===true){ - apiUrl = 'http://localhost:3000/api/v1/'; - //apiUrl = 'https://www.trustie.net/api/v1/'; + //apiUrl = 'http://localhost:3000/api/v1/'; + apiUrl = 'https://www.trustie.net/api/v1/'; } app.factory('auth', function($http,$routeParams, $cookies, $q){ From e121d7d9270cdffefab90a1b154e0da97e280cfe Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 31 May 2016 14:55:25 +0800 Subject: [PATCH 06/30] =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=BE=B9=E6=A1=86=E5=8C=BA=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 6 +++--- public/stylesheets/weui/weixin.css | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 8f00a2b96..267fefb43 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -1,10 +1,10 @@ var app = angular.module('wechat', ['ngRoute','ngCookies']); var apiUrl = '/api/v1/'; -var debug = false; //调试标志,如果在本地请置为true +var debug = true; //调试标志,如果在本地请置为true if(debug===true){ - //apiUrl = 'http://localhost:3000/api/v1/'; - apiUrl = 'https://www.trustie.net/api/v1/'; + apiUrl = 'http://localhost:3000/api/v1/'; + //apiUrl = 'https://www.trustie.net/api/v1/'; } app.factory('auth', function($http,$routeParams, $cookies, $q){ diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index b09c54109..4a88f9705 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -4,6 +4,16 @@ /*基本样式*/ body,table,input,textarea,select,button { font-family: "微软雅黑","宋体";} h1,h2,h3,h4,h5,p,pre {padding:0px; margin:0px;} +blockquote { + border:1px solid #d4d4d4; + padding: 0.6em; + margin-left: 1.4em; + margin-right: 0.4em; + border-radius: 4px; + font-family: "Microsoft YaHei"; + background-size: 100% 100%; + margin-top:5px; +} .f12 {font-size:12px;} .f13 {font-size:13px;} .f15 {font-size:15px;} From 7e93518d4149548b49663dbc6e23bb96f4948c14 Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 31 May 2016 14:56:24 +0800 Subject: [PATCH 07/30] =?UTF-8?q?app.js=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 267fefb43..8f00a2b96 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -1,10 +1,10 @@ var app = angular.module('wechat', ['ngRoute','ngCookies']); var apiUrl = '/api/v1/'; -var debug = true; //调试标志,如果在本地请置为true +var debug = false; //调试标志,如果在本地请置为true if(debug===true){ - apiUrl = 'http://localhost:3000/api/v1/'; - //apiUrl = 'https://www.trustie.net/api/v1/'; + //apiUrl = 'http://localhost:3000/api/v1/'; + apiUrl = 'https://www.trustie.net/api/v1/'; } app.factory('auth', function($http,$routeParams, $cookies, $q){ From 7f811d7551b2be4660021e9fbcd40f7a4ea6edc0 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:20:15 +0800 Subject: [PATCH 08/30] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 43 +++++++-------------------- config/menu.yml | 2 +- config/routes.rb | 1 + 3 files changed, 12 insertions(+), 34 deletions(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 4bf95fdbd..d4758283a 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -154,12 +154,7 @@ class WechatsController < ActionController::Base end end - - - ### controller method - - module Controllers def get_open_id begin @@ -228,37 +223,19 @@ class WechatsController < ActionController::Base uw = UserWechat.where(openid: openid).first end - def user_activity(user) - @user = user - shield_project_ids = ShieldActivity.where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id) - shield_course_ids = ShieldActivity.where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id) - @page = params[:page] ? params[:page].to_i + 1 : 0 - user_project_ids = (@user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" - user_course_ids = (@user.courses.visible.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.courses.visible.map{|course| course.id}-shield_course_ids).join(",") + ")" - course_types = "('Message','News','HomeworkCommon','Poll','Course')" - project_types = "('Message','Issue','Project')" - principal_types = "JournalsForMessage" - - blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")" - @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" + - "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+ - "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " + - "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10) - + def user_activities + session[:wechat_code] = params[:code] if params[:code] + code = params[:code] || session[:wechat_code] + openid = get_openid_from_code(code) + @wechat_user = user_binded?(openid) + unless @wechat_user + redirect_to :login + return + end + render File.join(Rails.root, "public/wechat/app.html"), layout: nil end - def process_activity(user_activity) - act= user_activity.act - case user_activity.container_type.to_s - when 'Course' - when 'Project' - case user_activity.act_type.to_s - when 'Issue' - [act.project.name.to_s+" | 项目问题", act.subject.to_s, url_to_avatar(act.author),"http://wechat.trustie.net/app.html#/issue/#{act.id}"] - end - end - end end diff --git a/config/menu.yml b/config/menu.yml index de1952503..ab6ae89ac 100644 --- a/config/menu.yml +++ b/config/menu.yml @@ -2,7 +2,7 @@ button: - type: "view" name: "最新动态" - url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.course.trustie.net/assets/wechat/app.html#/activities?response_type=code&scope=snsapi_base&state=123#wechat_redirect" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" - type: "click" name: "意见反馈" diff --git a/config/routes.rb b/config/routes.rb index 2863d49a4..9abaef0ae 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1237,6 +1237,7 @@ RedmineApp::Application.routes.draw do resource :wechat, only:[:show, :create] do collection do get :login + get :user_activities post :bind post :get_open_id end From 7b5a7a93f535555d72b83a475a7228f62a182cee Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:40:54 +0800 Subject: [PATCH 09/30] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 24 +++++++++++++----------- config/menu.yml | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index d4758283a..1e87c7b96 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -202,6 +202,19 @@ class WechatsController < ActionController::Base render 'wechats/login', layout: 'base_wechat' end + def user_activities + session[:wechat_code] = params[:code] if params[:code] + code = params[:code] || session[:wechat_code] + openid = get_openid_from_code(code) + @wechat_user = user_binded?(openid) + unless @wechat_user + redirect_to :login + return + end + + render File.join(Rails.root, "public/wechat/app.html"), layout: nil + end + private def get_openid_from_code(code) openid = session[:wechat_openid] @@ -223,18 +236,7 @@ class WechatsController < ActionController::Base uw = UserWechat.where(openid: openid).first end - def user_activities - session[:wechat_code] = params[:code] if params[:code] - code = params[:code] || session[:wechat_code] - openid = get_openid_from_code(code) - @wechat_user = user_binded?(openid) - unless @wechat_user - redirect_to :login - return - end - render File.join(Rails.root, "public/wechat/app.html"), layout: nil - end end diff --git a/config/menu.yml b/config/menu.yml index ab6ae89ac..3671ebb1b 100644 --- a/config/menu.yml +++ b/config/menu.yml @@ -2,7 +2,7 @@ button: - type: "view" name: "最新动态" - url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=http://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" - type: "click" name: "意见反馈" From e73c94680660701db79ea2059d290432b40bf957 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:43:27 +0800 Subject: [PATCH 10/30] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 1e87c7b96..b0901efd4 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -208,7 +208,7 @@ class WechatsController < ActionController::Base openid = get_openid_from_code(code) @wechat_user = user_binded?(openid) unless @wechat_user - redirect_to :login + redirect_to login_wechat_path return end From 49a1a9de325b679579d9d01f3c12af6d27e37d63 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:46:30 +0800 Subject: [PATCH 11/30] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index b0901efd4..1074ebc3f 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -212,7 +212,7 @@ class WechatsController < ActionController::Base return end - render File.join(Rails.root, "public/wechat/app.html"), layout: nil + render template: File.join(Rails.root, "public/wechat/app.html"), layout: nil end private From 1c5a31e8f1a1970619f3b2974f7d74543514363d Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:49:57 +0800 Subject: [PATCH 12/30] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 1074ebc3f..d5dfb88f7 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -212,7 +212,7 @@ class WechatsController < ActionController::Base return end - render template: File.join(Rails.root, "public/wechat/app.html"), layout: nil + render file: File.join(Rails.root, "public/wechat/app.html") end private From ac5d91a428981e7bd2ad5381bf8336585726993e Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:51:38 +0800 Subject: [PATCH 13/30] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index d5dfb88f7..9c6ab33f6 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -212,7 +212,7 @@ class WechatsController < ActionController::Base return end - render file: File.join(Rails.root, "public/wechat/app.html") + render template: File.join(Rails.root, "public/assets/wechat/app.html"), layout: nil end private From e01da32c75a64f58a5b921366a7ae53d76e55a6a Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:54:45 +0800 Subject: [PATCH 14/30] tempate=>file --- app/controllers/wechats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 9c6ab33f6..e47c99cbd 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -212,7 +212,7 @@ class WechatsController < ActionController::Base return end - render template: File.join(Rails.root, "public/assets/wechat/app.html"), layout: nil + render file: File.join(Rails.root, "public/assets/wechat/app.html"), layout: nil end private From 4815dc3c7b3c6dc3e5ce2f804f8a4d5c7e163bae Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 19:59:34 +0800 Subject: [PATCH 15/30] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 8f00a2b96..f0881486e 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -482,7 +482,7 @@ app.directive('loadingSpinner', function ($http) { app.config(['$routeProvider',"$httpProvider",function ($routeProvider, $httpProvider) { $routeProvider .when('/activities', { - templateUrl: 'activities.html', + templateUrl: '/public/assets/wechat/activities.html', controller: 'ActivityController' }) .when('/issues/:id', { From 13d11e223934bac22a7b38975dc8a91f3d276a13 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 20:01:41 +0800 Subject: [PATCH 16/30] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E7=BB=91=E5=AE=9A=E5=88=99?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index f0881486e..d18719cfe 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -480,37 +480,39 @@ app.directive('loadingSpinner', function ($http) { }); app.config(['$routeProvider',"$httpProvider",function ($routeProvider, $httpProvider) { + var rootPath = '/assets/wechat/' + $routeProvider .when('/activities', { - templateUrl: '/public/assets/wechat/activities.html', + templateUrl: rootPath + 'activities.html', controller: 'ActivityController' }) .when('/issues/:id', { - templateUrl: 'issue_detail.html', + templateUrl: rootPath + 'issue_detail.html', controller: 'IssueController' }) .when('/project_discussion/:id', { - templateUrl: 'project_discussion.html', + templateUrl: rootPath + 'project_discussion.html', controller: 'DiscussionController' }) .when('/homework/:id', { - templateUrl: 'homework_detail.html', + templateUrl: rootPath + 'homework_detail.html', controller: 'HomeworkController' }) .when('/course_notice/:id', { - templateUrl: 'course_notice.html', + templateUrl: rootPath + 'course_notice.html', controller: 'CourseNoticeController' }) .when('/course_discussion/:id', { - templateUrl: 'course_discussion.html', + templateUrl: rootPath + 'course_discussion.html', controller: 'DiscussionController' }) .when('/journal_for_message/:id', { - templateUrl: 'jour_message_detail.html', + templateUrl: rootPath + 'jour_message_detail.html', controller: 'JournalsController' }) .when('/blog_comment/:id', { - templateUrl: 'blog_detail.html', + templateUrl: rootPath + 'blog_detail.html', controller: 'BlogController' }) .otherwise({ From 814fde878e5743013963e9111eb232cf85ea9000 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 20:19:45 +0800 Subject: [PATCH 17/30] =?UTF-8?q?=E4=BB=8E=E5=90=8E=E5=8F=B0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96openid=E5=8D=B3=E5=8F=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 2 +- app/views/wechats/user_activities.html.erb | 30 ++++++++++++++++++++++ config/menu.yml | 2 +- public/javascripts/wechat/app.js | 4 +++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 app/views/wechats/user_activities.html.erb diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index e47c99cbd..ea230abe5 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -212,7 +212,7 @@ class WechatsController < ActionController::Base return end - render file: File.join(Rails.root, "public/assets/wechat/app.html"), layout: nil + render 'wechats/user_activities', layout: nil end private diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb new file mode 100644 index 000000000..b45587ae0 --- /dev/null +++ b/app/views/wechats/user_activities.html.erb @@ -0,0 +1,30 @@ + + + + 最新动态 + + + + + + + + + + + +
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/config/menu.yml b/config/menu.yml index 3671ebb1b..83b892037 100644 --- a/config/menu.yml +++ b/config/menu.yml @@ -2,7 +2,7 @@ button: - type: "view" name: "最新动态" - url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=http://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf694495398c7d470&redirect_uri=http://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" - type: "click" name: "意见反馈" diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index d18719cfe..59605271c 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -10,6 +10,10 @@ if(debug===true){ app.factory('auth', function($http,$routeParams, $cookies, $q){ var _openid = ''; + if(typeof g_openid !== 'undefined'){ + _openid = g_openid; + } + if(debug===true){ _openid = "1"; } From 48b36e5d169e1ca519df54bccc7482c47a8a7351 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 20:46:46 +0800 Subject: [PATCH 18/30] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/activities.html | 2 +- public/javascripts/wechat/app.js | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index 30b4dafaa..ab0e85faf 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -118,7 +118,7 @@
-
+
diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 59605271c..4c17027e0 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -7,6 +7,7 @@ if(debug===true){ apiUrl = 'https://www.trustie.net/api/v1/'; } + app.factory('auth', function($http,$routeParams, $cookies, $q){ var _openid = ''; @@ -66,7 +67,7 @@ app.factory('rms', function(){ return {save: save, get: get}; }); -app.controller('ActivityController',function($scope, $http, auth, rms, common){ +app.controller('ActivityController',function($anchorScroll, $location,$scope, $http, auth, rms, common){ $scope.replaceUrl = function(url){ return url; }; @@ -76,6 +77,12 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){ $scope.page = 0; var loadActData = function(page){ + if (page <= 0 && $scope.activities.length >0){ + var yOffset = rms.get("yoffset"); + $location.hash(yOffset); + return; + } + $scope.page = page; $http({ method: 'POST', @@ -109,6 +116,12 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){ $scope.loadActData = loadActData; + //跳到详情页 + $scope.goDetail = function(type, id){ + rms.save("yoffset", id); + $location.path('/'+type+'/'+id); + } + $scope.addPraise = function(act){ common.addCommonPraise(act); }; @@ -117,6 +130,8 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){ common.decreaseCommonPraise(act); }; + + }); app.factory('common', function($http, auth, $routeParams){ From 32ffd2a5b5372aab6c8d8802b63e0f1763de5ae7 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 20:55:46 +0800 Subject: [PATCH 19/30] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/entities/activity.rb | 1 + public/assets/wechat/activities.html | 2 +- public/javascripts/wechat/app.js | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/api/mobile/entities/activity.rb b/app/api/mobile/entities/activity.rb index a90ff323d..9e2a39a5a 100644 --- a/app/api/mobile/entities/activity.rb +++ b/app/api/mobile/entities/activity.rb @@ -98,6 +98,7 @@ module Mobile end expose :act_type #缺陷/作业/讨论区/留言等类型 expose :act_id + expose :id expose :container_type #课程/项目/博客/个人 expose :author, using: Mobile::Entities::User do |a, opt| #用户信息 if a.is_a? ::UserActivity diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index ab0e85faf..85cfad7e4 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -118,7 +118,7 @@
-
+
diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 4c17027e0..51c91d152 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -117,9 +117,9 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h $scope.loadActData = loadActData; //跳到详情页 - $scope.goDetail = function(type, id){ - rms.save("yoffset", id); - $location.path('/'+type+'/'+id); + $scope.goDetail = function(type, act_id,id){ + rms.save("yoffset", 'act_'+id); + $location.path('/'+type+'/'+act_id); } $scope.addPraise = function(act){ From c9eddad45d8b3036e9dec1be6ec0ffa222132f9c Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 21:09:47 +0800 Subject: [PATCH 20/30] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/activities.html | 4 ++-- public/javascripts/wechat/app.js | 36 ++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index 85cfad7e4..c610a9839 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -249,8 +249,8 @@
-
-
更多
+
+
更多
diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 51c91d152..a129a795c 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -73,11 +73,35 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h }; console.log("ActivityController load"); - $scope.activities = rms.get("activities") || []; + $scope.page = 0; + $scope.activities = rms.get("activities") || []; + + var savePageConfig = function(){ + rms.save('current_page', $scope.current_page); + rms.save('has_more', $scope.has_more); + rms.save('activities', $scope.activities); + } + + var loadPageConfig = function(){ + var current_page = rms.get('current_page'); + var has_more = rms.get('has_more'); + var activities = rms.get('activities'); + + if(typeof current_page !== 'undefined'){ + $scope.page = current_page; + } + if(typeof has_more !== 'undefined'){ + $scope.has_more = has_more; + } + if(typeof activities !== 'undefined'){ + $scope.activities = activities; + } + } var loadActData = function(page){ - if (page <= 0 && $scope.activities.length >0){ + if (page <= 0 && $scope.activities.length >0){ //应该是返回过来的 + loadPageConfig(); var yOffset = rms.get("yoffset"); $location.hash(yOffset); return; @@ -97,10 +121,12 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h } else { $scope.activities = response.data.data; } - $scope.current_page = response.data.page; - $scope.all_count = response.data.all_count; - $scope.count = response.data.count; + $scope.has_more = (response.data.count + response.data.page * 10) < response.data.all_count; + console.log(response.data); + + rms.save('current_page', $scope.page); + rms.save('has_more', $scope.has_more); rms.save('activities', $scope.activities); }, function errorCallback(response) { }); From c26d544772370e6b18b8e29830b99909d73764a3 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 21:15:31 +0800 Subject: [PATCH 21/30] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index a129a795c..82c41a53c 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -103,7 +103,7 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h if (page <= 0 && $scope.activities.length >0){ //应该是返回过来的 loadPageConfig(); var yOffset = rms.get("yoffset"); - $location.hash(yOffset); + $location.yOffset = yOffset; return; } @@ -144,7 +144,9 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h //跳到详情页 $scope.goDetail = function(type, act_id,id){ - rms.save("yoffset", 'act_'+id); + console.log($anchorScroll.yOffset); + rms.save("yoffset", $anchorScroll.yOffset); + $location.path('/'+type+'/'+act_id); } From 553a02c89dbbba10ce7cb69cb5c9a269eb5961cc Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 21:22:44 +0800 Subject: [PATCH 22/30] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 82c41a53c..5232b91c4 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -103,7 +103,7 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h if (page <= 0 && $scope.activities.length >0){ //应该是返回过来的 loadPageConfig(); var yOffset = rms.get("yoffset"); - $location.yOffset = yOffset; + $location.hash(yOffset); return; } @@ -144,8 +144,8 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h //跳到详情页 $scope.goDetail = function(type, act_id,id){ - console.log($anchorScroll.yOffset); - rms.save("yoffset", $anchorScroll.yOffset); + console.log($anchorScroll()); + rms.save("yoffset", $anchorScroll()); $location.path('/'+type+'/'+act_id); } From 03357388bdda524c1951eb661af3c0586191e74c Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 21:26:31 +0800 Subject: [PATCH 23/30] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 5232b91c4..e0e436fda 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -103,7 +103,7 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h if (page <= 0 && $scope.activities.length >0){ //应该是返回过来的 loadPageConfig(); var yOffset = rms.get("yoffset"); - $location.hash(yOffset); + $location.yOffset = yOffset; return; } @@ -144,9 +144,7 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h //跳到详情页 $scope.goDetail = function(type, act_id,id){ - console.log($anchorScroll()); - rms.save("yoffset", $anchorScroll()); - + rms.save("yoffset",'act_'+id); $location.path('/'+type+'/'+act_id); } From ceffa6c2c82c74e60982838041ffb5863abdb8ca Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 21:27:00 +0800 Subject: [PATCH 24/30] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index e0e436fda..8cc3d053a 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -103,7 +103,7 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h if (page <= 0 && $scope.activities.length >0){ //应该是返回过来的 loadPageConfig(); var yOffset = rms.get("yoffset"); - $location.yOffset = yOffset; + $location.hash(yOffset); return; } From 51d3fc3aad760b2113b78f7d1b0aa9aad1311bd8 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 31 May 2016 21:31:36 +0800 Subject: [PATCH 25/30] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 8cc3d053a..641e95bed 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -94,9 +94,7 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h if(typeof has_more !== 'undefined'){ $scope.has_more = has_more; } - if(typeof activities !== 'undefined'){ - $scope.activities = activities; - } + } var loadActData = function(page){ From cba5b246bcbe9ed691611877076f8d18efdd556f Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 1 Jun 2016 14:14:24 +0800 Subject: [PATCH 26/30] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E7=9A=84=E8=BF=94=E5=9B=9E=E4=B8=8D=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/activities.html | 52 ++++++++++++++-------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index c610a9839..d7f48c4b2 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -8,7 +8,7 @@
-
+