diff --git a/Client.html b/Client.html deleted file mode 100644 index fbb7cec52..000000000 --- a/Client.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - -Client - - - - -
-

这是一张图片

-

photo Share A

-
- -

这是一段视频

-

Text Share B

-
- -

这是一篇文章

-

Text Share C

-
- - - - \ No newline at end of file diff --git a/Gemfile.lock~ b/Gemfile.lock~ deleted file mode 100644 index 7d6563465..000000000 --- a/Gemfile.lock~ +++ /dev/null @@ -1,386 +0,0 @@ -GIT - remote: http://github.com/guange2015/wechat.git - revision: a18c3d6603cb1aa7bd1fe887b17f67426be01f35 - specs: - wechat (0.7.1) - activerecord (>= 3.2, < 5.1.x) - http (~> 1.0, >= 1.0.1) - nokogiri (>= 1.6.0) - thor - -PATH - remote: lib/gitlab-cli - specs: - gitlab (3.2.0) - httparty - terminal-table - -PATH - remote: lib/grack - specs: - grack (2.0.2) - rack (~> 1.4.5) - -PATH - remote: lib/rails_kindeditor - specs: - rails_kindeditor (0.4.5) - carrierwave - mini_magick - -GEM - remote: https://ruby.taobao.org/ - specs: - actionmailer (3.2.22.2) - actionpack (= 3.2.22.2) - mail (~> 2.5.4) - actionpack (3.2.22.2) - activemodel (= 3.2.22.2) - activesupport (= 3.2.22.2) - builder (~> 3.0.0) - erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.5) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.2.1) - activemodel (3.2.22.2) - activesupport (= 3.2.22.2) - builder (~> 3.0.0) - activerecord (3.2.22.2) - activemodel (= 3.2.22.2) - activesupport (= 3.2.22.2) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.22.2) - activemodel (= 3.2.22.2) - activesupport (= 3.2.22.2) - activesupport (3.2.22.2) - i18n (~> 0.6, >= 0.6.4) - multi_json (~> 1.0) - acts-as-taggable-on (2.4.1) - rails (>= 3, < 5) - addressable (2.4.0) - ansi (1.5.0) - arel (3.0.3) - axiom-types (0.1.1) - descendants_tracker (~> 0.0.4) - ice_nine (~> 0.11.0) - thread_safe (~> 0.3, >= 0.3.1) - better_errors (1.1.0) - coderay (>= 1.0.0) - erubis (>= 2.6.6) - binding_of_caller (0.7.2) - debug_inspector (>= 0.0.1) - builder (3.0.0) - byebug (8.2.2) - carrierwave (0.10.0) - activemodel (>= 3.2.0) - activesupport (>= 3.2.0) - json (>= 1.7) - mime-types (>= 1.16) - chinese_pinyin (1.0.0) - climate_control (0.0.3) - activesupport (>= 3.0) - cocaine (0.5.8) - climate_control (>= 0.0.3, < 1.0) - coderay (1.1.1) - coercible (1.0.0) - descendants_tracker (~> 0.0.1) - coffee-rails (3.2.2) - coffee-script (>= 2.2.0) - railties (~> 3.2.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.10.0) - daemons (1.2.3) - debug_inspector (0.0.2) - delayed_job (4.1.1) - activesupport (>= 3.0, < 5.0) - delayed_job_active_record (4.1.0) - activerecord (>= 3.0, < 5) - delayed_job (>= 3.0, < 5) - descendants_tracker (0.0.4) - thread_safe (~> 0.3, >= 0.3.1) - diff-lcs (1.2.5) - domain_name (0.5.20160216) - unf (>= 0.0.5, < 1.0.0) - elasticsearch (1.0.15) - elasticsearch-api (= 1.0.15) - elasticsearch-transport (= 1.0.15) - elasticsearch-api (1.0.15) - multi_json - elasticsearch-model (0.1.8) - activesupport (> 3) - elasticsearch (> 0.4) - hashie - elasticsearch-rails (0.1.8) - elasticsearch-transport (1.0.15) - faraday - multi_json - equalizer (0.0.11) - erubis (2.7.0) - execjs (2.6.0) - factory_girl (4.5.0) - activesupport (>= 3.0.0) - factory_girl_rails (4.6.0) - factory_girl (~> 4.5.0) - railties (>= 3.0.0) - faraday (0.9.2) - multipart-post (>= 1.2, < 3) - fastercsv (1.5.5) - grape (0.9.0) - activesupport - builder - hashie (>= 2.1.0) - multi_json (>= 1.3.2) - multi_xml (>= 0.5.2) - rack (>= 1.3.0) - rack-accept - rack-mount - virtus (>= 1.0.0) - grape-entity (0.4.8) - activesupport - multi_json (>= 1.3.2) - grape-swagger (0.10.4) - grape (>= 0.8.0) - grape-entity (< 0.5.0) - hashie (3.4.3) - hike (1.2.3) - htmlentities (4.3.4) - http (1.0.2) - addressable (~> 2.3) - http-cookie (~> 1.0) - http-form_data (~> 1.0.1) - http_parser.rb (~> 0.6.0) - http-cookie (1.0.2) - domain_name (~> 0.5) - http-form_data (1.0.1) - http_parser.rb (0.6.0) - httparty (0.13.7) - json (~> 1.8) - multi_xml (>= 0.5.2) - i18n (0.6.11) - ice_nine (0.11.2) - iconv (1.0.4) - journey (1.0.4) - jquery-rails (2.0.3) - railties (>= 3.1.0, < 5.0) - thor (~> 0.14) - json (1.8.3) - kaminari (0.16.3) - actionpack (>= 3.0.0) - activesupport (>= 3.0.0) - libv8 (3.16.14.13) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) - method_source (0.8.2) - mime-types (1.25.1) - mini_magick (4.4.0) - mini_portile2 (2.0.0) - multi_json (1.11.2) - multi_xml (0.5.5) - multipart-post (2.0.0) - mysql2 (0.3.18) - net-ldap (0.3.1) - netrc (0.11.0) - nokogiri (1.6.7.2) - mini_portile2 (~> 2.0.0.rc2) - paperclip (3.5.4) - activemodel (>= 3.0.0) - activesupport (>= 3.0.0) - cocaine (~> 0.5.3) - mime-types - polyglot (0.3.5) - pry (0.10.3) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - pry-byebug (3.3.0) - byebug (~> 8.0) - pry (~> 0.10) - pry-rails (0.3.4) - pry (>= 0.9.10) - pry-stack_explorer (0.4.9.2) - binding_of_caller (>= 0.7) - pry (>= 0.9.11) - rack (1.4.7) - rack-accept (0.4.5) - rack (>= 0.4) - rack-cache (1.6.1) - rack (>= 0.4) - rack-cors (0.4.0) - rack-mount (0.8.3) - rack (>= 1.0.0) - rack-openid (1.4.2) - rack (>= 1.1.0) - ruby-openid (>= 2.1.8) - rack-raw-upload (1.1.1) - multi_json - rack-ssl (1.3.4) - rack - rack-test (0.6.3) - rack (>= 1.0) - rails (3.2.22.2) - actionmailer (= 3.2.22.2) - actionpack (= 3.2.22.2) - activerecord (= 3.2.22.2) - activeresource (= 3.2.22.2) - activesupport (= 3.2.22.2) - bundler (~> 1.0) - railties (= 3.2.22.2) - railties (3.2.22.2) - actionpack (= 3.2.22.2) - activesupport (= 3.2.22.2) - rack-ssl (~> 1.3.2) - rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) - rake (10.5.0) - rdoc (3.12.2) - json (~> 1.4) - redis (3.2.2) - redis-actionpack (3.2.4) - actionpack (~> 3.2.0) - redis-rack (~> 1.4.4) - redis-store (~> 1.1.4) - redis-activesupport (3.2.5) - activesupport (~> 3.2.0) - redis-store (~> 1.1.0) - redis-rack (1.4.4) - rack (~> 1.4.0) - redis-store (~> 1.1.4) - redis-rails (3.2.4) - redis-actionpack (~> 3.2.4) - redis-activesupport (~> 3.2.4) - redis-store (~> 1.1.4) - redis-store (1.1.7) - redis (>= 2.2) - ref (2.0.0) - rest-client (1.8.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 3.0) - netrc (~> 0.7) - rich (1.4.6) - jquery-rails - kaminari - mime-types - paperclip - rack-raw-upload - rails (>= 3.2.0) - sass-rails - rspec-core (3.4.3) - rspec-support (~> 3.4.0) - rspec-expectations (3.4.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-mocks (3.4.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-rails (3.4.2) - actionpack (>= 3.0, < 4.3) - activesupport (>= 3.0, < 4.3) - railties (>= 3.0, < 4.3) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-support (~> 3.4.0) - rspec-support (3.4.1) - ruby-ole (1.2.12) - ruby-openid (2.1.8) - rubyzip (1.2.0) - sass (3.4.21) - sass-rails (3.2.6) - railties (~> 3.2.0) - sass (>= 3.1.10) - tilt (~> 1.3) - seems_rateable (1.0.13) - jquery-rails - rails - slop (3.6.0) - spreadsheet (1.1.1) - ruby-ole (>= 1.0) - sprockets (2.2.3) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - terminal-table (1.5.2) - therubyracer (0.12.2) - libv8 (~> 3.16.14.0) - ref - thor (0.19.1) - thread_safe (0.3.5) - tilt (1.4.1) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.46) - uglifier (2.7.2) - execjs (>= 0.3.0) - json (>= 1.8.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.2) - virtus (1.0.5) - axiom-types (~> 0.1) - coercible (~> 1.0) - descendants_tracker (~> 0.0, >= 0.0.3) - equalizer (~> 0.0, >= 0.0.9) - -PLATFORMS - ruby - -DEPENDENCIES - acts-as-taggable-on (= 2.4.1) - ansi - better_errors (~> 1.1.0) - binding_of_caller - builder (= 3.0.0) - chinese_pinyin - coderay (~> 1.1.0) - coffee-rails (~> 3.2.1) - daemons - delayed_job_active_record - elasticsearch-model - elasticsearch-rails - factory_girl_rails - fastercsv (~> 1.5.0) - gitlab! - grack! - grape (~> 0.9.0) - grape-entity - grape-swagger - htmlentities - i18n (~> 0.6.0) - iconv - jquery-rails (~> 2.0.2) - kaminari - mysql2 (= 0.3.18) - net-ldap (~> 0.3.1) - paperclip (~> 3.5.4) - pry-byebug - pry-rails - pry-stack_explorer - rack-cors - rack-openid - rails (~> 3.2) - rails_kindeditor! - redis-rails - rest-client - rich (= 1.4.6) - rspec-rails (~> 3.0) - ruby-ole - ruby-openid (~> 2.1.4) - rubyzip - sass-rails (~> 3.2.3) - seems_rateable (~> 1.0.13) - spreadsheet - therubyracer - uglifier (>= 1.0.3) - wechat! - -BUNDLED WITH - 1.10.6 diff --git a/Gemfile~ b/Gemfile~ deleted file mode 100644 index 24869e72b..000000000 --- a/Gemfile~ +++ /dev/null @@ -1,112 +0,0 @@ -source 'http://rubygems.org/' -### ִbundle config mirror.https://rubygems.org https://gems.ruby-china.org лruby-chinaԴ - -unless RUBY_PLATFORM =~ /w32/ - # unix-like only - gem 'iconv' -end - -gem 'certified' - -gem 'wechat',path: 'lib/wechat' -gem 'grack', path:'lib/grack' -gem 'gitlab', path: 'lib/gitlab-cli' -gem 'rest-client' -gem "mysql2", "= 0.3.18" -gem 'redis-rails' -gem 'rubyzip' -gem 'delayed_job_active_record'#, :group => :production -gem 'daemons' -gem 'grape', '~> 0.9.0' -gem 'grape-entity' -gem 'rack-cors', :require => 'rack/cors' -gem 'seems_rateable', '~> 1.0.13' -gem 'rails', '~> 3.2' -gem "jquery-rails", "~> 2.0.2" -gem "i18n", "~> 0.6.0" -gem 'coderay', '~> 1.1.0' -gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby] -gem "builder", "3.0.0" -gem 'acts-as-taggable-on', '2.4.1' -gem 'spreadsheet' -gem 'ruby-ole' -gem 'rails_kindeditor',path:'lib/rails_kindeditor' -#gem "rmagick", ">= 2.0.0" -gem 'binding_of_caller' -gem 'chinese_pinyin' -# gem 'sunspot_rails', '~> 1.3.3' -# gem 'sunspot_solr' -# gem 'sunspot' -# gem 'progress_bar' -gem 'ansi' - -gem 'kaminari' -gem 'elasticsearch-model' -gem 'elasticsearch-rails' - - -### profile -#gem 'oneapm_rpm' - -group :development do - gem 'grape-swagger' - gem 'better_errors', '~> 1.1.0' - # gem "query_reviewer" - # gem 'rack-mini-profiler', '~> 0.9.3' - if RUBY_PLATFORM =~ /w32/ - gem 'win32console' - end -end - -group :development, :test do - unless RUBY_PLATFORM =~ /w32/ - gem 'pry-rails' - if RUBY_VERSION >= '2.0.0' - gem 'pry-byebug' - end - gem 'pry-stack_explorer' - if RUBY_PLATFORM =~ /darwin/ - gem 'puma' - end - end - - gem 'rspec-rails', '~> 3.0' - gem 'factory_girl_rails' -end - -# Gems used only for assets and not required -# in production environments by default. -group :assets do - gem 'sass-rails', '~> 3.2.3' - gem 'coffee-rails', '~> 3.2.1' - - # See https://github.com/sstephenson/execjs#readme for more supported runtimes - gem 'therubyracer', :platforms => :ruby - - gem 'uglifier', '>= 1.0.3' -end - -# Optional gem for LDAP authentication -group :ldap do - gem "net-ldap", "~> 0.3.1" -end - - -# Optional gem for OpenID authentication -group :openid do - gem "ruby-openid", "~> 2.1.4", :require => "openid" - gem "rack-openid" -end - - -database_file = File.join(File.dirname(__FILE__), "config/database.yml") -if File.exist?(database_file) -else - warn("Please configure your config/database.yml first") -end - -# Load plugins' Gemfiles -Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file| - puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v` - instance_eval File.read(file) -end diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 170c92791..b80d32455 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -151,87 +151,111 @@ class WechatsController < ActionController::Base end - def get_open_id - begin - raise "非法操作, code不存在" unless params[:code] - openid = get_openid_from_code(params[:code]) - raise "无法获取到openid" unless openid - render :json => {status:0, openid: openid} - rescue Exception=>e - render :json => {status: -1, msg: e.message} - end - end - def bind - begin - raise "非法操作, code不存在" unless params[:code] - openid = get_openid_from_code(params[:code]) - raise "无法获取到openid" unless openid - raise "此微信号已绑定用户, 不能重复绑定" if user_binded?(openid) - user, last_login_on = User.try_to_login(params[:username], params[:password]) - raise "用户名或密码错误,请重新登录" unless user - #补全用户信息 + ### controller method + + + module Controllers + def get_open_id + begin - raise "此用户已经绑定了公众号" if user.user_wechat + code = params[:code] || session[:wechat_code] + openid = get_openid_from_code(code) - UserWechat.create!( - openid: openid, - user: user - ) - render :json => {status:0, msg: "绑定成功"} - rescue Exception=>e - render :json => {status: -1, msg: e.message} + + raise "无法获取到微信openid" unless openid + render :json => {status:0, openid: openid} + rescue Exception=>e + render :json => {status: -1, msg: e.message} + end end - end - def login - @code = params[:code] #TODO 安全性 - render 'wechats/login', layout: 'base_wechat' - end + def bind + begin - private - def get_openid_from_code(code) - url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=#{Wechat.config.appid}&secret=#{Wechat.config.secret}&code=#{code}&grant_type=authorization_code" - logger.debug url - body = URI.parse(url).read - logger.debug body - JSON.parse(body)["openid"] - end + code = params[:code] || session[:wechat_code] + openid = get_openid_from_code(code) - def user_binded?(openid) - uw = UserWechat.where(openid: openid).first - end + raise "无法获取到openid" unless openid + raise "此微信号已绑定用户, 不能重复绑定" if user_binded?(openid) - 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" + user, last_login_on = User.try_to_login(params[:username], params[:password]) + raise "用户名或密码错误,请重新登录" unless user + #补全用户信息 - 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) + raise "此用户已经绑定过公众号, 请换一个帐户试试" if user.user_wechat + UserWechat.create!( + openid: openid, + user: user + ) + render :json => {status:0, msg: "绑定成功"} + rescue Exception=>e + render :json => {status: -1, msg: e.message} + end + end - end + def login + session[:wechat_code] = params[:code] if params[:code] + render 'wechats/login', layout: 'base_wechat' + end + + private + def get_openid_from_code(code) + openid = session[:wechat_openid] - 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}"] + unless openid + if code + openid = wechat.web_access_token(code)["openid"] end + end + + if openid + session[:wechat_openid] = openid + end + + return openid + end + + def user_binded?(openid) + 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) + + + 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 + + + include Controllers + end diff --git a/app/views/wechats/create.html.erb b/app/views/wechats/create.html.erb deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/views/wechats/login.html.erb b/app/views/wechats/login.html.erb index adde6d776..c7ab519f2 100644 --- a/app/views/wechats/login.html.erb +++ b/app/views/wechats/login.html.erb @@ -12,8 +12,7 @@
- -
+
@@ -23,8 +22,6 @@
- -
确定
diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index 3391506f2..dbf5e8b27 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -5,7 +5,7 @@
-
+
@@ -39,7 +39,7 @@
-
+
@@ -66,7 +66,7 @@
-
+
@@ -109,7 +109,7 @@
-
+
@@ -139,7 +139,7 @@
-
+
@@ -181,7 +181,7 @@
-
+
@@ -208,7 +208,7 @@
-
+
diff --git a/public/assets/wechat/blog_detail.html b/public/assets/wechat/blog_detail.html index d9944fc7d..fa3a9f341 100644 --- a/public/assets/wechat/blog_detail.html +++ b/public/assets/wechat/blog_detail.html @@ -1,46 +1,48 @@ -
-
-
-
{{blog.title}}      
-
{{blog.user.realname}}发表博客
-
-
-
+
+
+
+
+
{{blog.title}}
+
{{blog.user.realname}}发表博客
+
+
+
+
+
+ {{blog.created_at}} +
-
- {{blog.created_at}} -
-
-
-
回复 ({{blog.comment_count}})
-
已赞 ({{blog.praise_count}})
-
赞 ({{blog.praise_count}})
-
-
-
-
-
-
- -
-
{{journal.lasted_comment}}
-
回复
+
+
回复 ({{blog.comment_count}})
+
已赞 ({{blog.praise_count}})
+
赞 ({{blog.praise_count}})
+
+
+
+
+
+
+ +

+                            
{{journal.lasted_comment}}
+
回复
+
+
-
-
-
-
- -
- - +
+
+ +
+ + +
+ +
- -
diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index 42facd960..d1b65e629 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -1,52 +1,55 @@ -
-
-
-
{{discussion.subject}}      
- - - - - - - -
发布者:{{discussion.user.realname}}
来   源:{{discussion.course_project_name}}  |  课程问答区
-
-
-
-
- {{discussion.created_on}} -
-
-
-
回复 ({{discussion.replies_count}})
-
已赞 ({{discussion.praise_count}})
-
赞 ({{discussion.praise_count}})
-
-
-
-
-
-
- -
-
{{journal.lasted_comment}}
-
回复
+
+
+
+
+
+
{{discussion.subject}}
+ + + + + + + +
发布者:{{discussion.user.realname}}
来   源:{{discussion.course_project_name}}  |  课程问答区
+
+
+ {{discussion.created_on}} +
-
-
-
-
- -
- - +
+
回复 ({{discussion.replies_count}})
+
已赞 ({{discussion.praise_count}})
+
赞 ({{discussion.praise_count}})
+
+
+
+
+
+
+ +

+                            
{{journal.lasted_comment}}
+
回复
+
+
+
+
+
+
+
+ +
+ + +
+ +
- -
diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index 18f62be1e..c10763bf8 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -1,5 +1,6 @@ +
@@ -30,7 +31,7 @@
-
+

                         
{{comments.created_on}}
回复
@@ -51,3 +52,4 @@
+
\ No newline at end of file diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index 5efa7c54d..2783bd317 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -1,5 +1,6 @@ +
@@ -36,7 +37,7 @@
-
+

                         
{{journal.lasted_comment}}
回复
@@ -56,4 +57,5 @@
-
\ No newline at end of file +
+
\ No newline at end of file diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index 20c35c664..035a7c98d 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -1,5 +1,6 @@ +
@@ -34,7 +35,7 @@
-
+

                         
{{journal.created_on}}
回复
@@ -55,3 +56,4 @@
+
\ No newline at end of file diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html index f9aebd632..5ccbf6248 100644 --- a/public/assets/wechat/jour_message_detail.html +++ b/public/assets/wechat/jour_message_detail.html @@ -1,44 +1,46 @@ -
-
-
-
{{message.user.realname}}给您留言了
-
{{message.created_on}}
-
-
-
+
+
+
+
+
{{message.user.realname}}给您留言了
+
{{message.created_on}}
+
+
+
+
+
-
-
-
-
回复 ({{message.reply_count}})
-
已赞 ({{message.praise_count}})
-
赞 ({{message.praise_count}})
-
-
+
+
回复 ({{message.reply_count}})
+
已赞 ({{message.praise_count}})
+
赞 ({{message.praise_count}})
+
+
-
-
-
-
- -
-
{{journal.lasted_comment}}
-
回复
+
+
+
+
+ +

+                            
{{journal.lasted_comment}}
+
回复
+
+
-
-
-
-
- -
- - +
+
+ +
+ + +
+ +
- -
diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html index 1f2f7ce72..be639c1a0 100644 --- a/public/assets/wechat/project_discussion.html +++ b/public/assets/wechat/project_discussion.html @@ -1,9 +1,10 @@ +
-
{{discussion.subject}}      
+
{{discussion.subject}}
@@ -30,7 +31,7 @@
-
+

                             
{{journal.lasted_comment}}
回复
@@ -38,7 +39,7 @@ -
+
@@ -50,4 +51,5 @@
-
\ No newline at end of file + + \ No newline at end of file diff --git a/public/images/wechat/icon.png b/public/images/wechat/icon.png new file mode 100755 index 000000000..afc7aa639 Binary files /dev/null and b/public/images/wechat/icon.png differ diff --git a/public/images/wechat/icon_list.gif b/public/images/wechat/icon_list.gif new file mode 100755 index 000000000..1d7dcb061 Binary files /dev/null and b/public/images/wechat/icon_list.gif differ diff --git a/public/images/wechat/loading.gif b/public/images/wechat/loading.gif deleted file mode 100755 index b806bf34c..000000000 Binary files a/public/images/wechat/loading.gif and /dev/null differ diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index b72d39c40..8f00a2b96 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -136,7 +136,7 @@ app.factory('common', function($http, auth, $routeParams){ url: apiUrl+ "new_comment/"+id, data: userInfo }).then(function successCallback(response) { - alert("提交成功"); + //alert("提交成功"); //数据提交完成,回复按钮启用 data.disabled = false; if(typeof cb === 'function'){ @@ -446,11 +446,16 @@ app.directive('inputAuto',function(){ scope: {}, link: function(scope, element){ var copyContainer = element.parent().children().eq(0); + var sendButton = element.parent().next(); element.on('input',function(){ + console.log(sendButton); copyContainer.html(element[0].value); var textHeight = copyContainer[0].scrollHeight; element.css('height', textHeight + 'px'); }); + sendButton.on('click',function(){ + element.css('height','28px'); + }); } } }); diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 30023f606..5f0e5343f 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -3,7 +3,7 @@ /*基本样式*/ body,table,input,textarea,select,button { font-family: "微软雅黑","宋体";} -h1,h2,h3,h4,h5,p {padding:0px; margin:0px;} +h1,h2,h3,h4,h5,p,pre {padding:0px; margin:0px;} .f12 {font-size:12px;} .f13 {font-size:13px;} .f15 {font-size:15px;} @@ -70,11 +70,11 @@ a.underline {text-decoration:underline;} .post-reply-date, .post-reply-trigger {font-size:13px;} .post-input-container {padding-right:2px;} .copy-input {width:100%; height:28px; line-height:28px; border-radius:3px; position:absolute; left:-9999em;} -.post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; border:1px solid #e6e6e6; outline:none; padding:0; margin:0; border-radius:3px; overflow-y:hidden; resize:none;} +.post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; border:1px solid #e6e6e6; outline:none; padding:0; margin:0; border-radius:3px; overflow-y:auto; resize:none;} .post-reply-submit {font-size:13px; padding:3px 8px; color:#fff; background-color:#269ac9; outline:none; border:none; display:inline-block;} -.reply-icon {background:url(/images/wechat/wechat_icon.gif) -100px 1px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} -.praise-icon {background:url(/images/wechat/wechat_icon.gif) -100px -38px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} -.praised-icon {background:url(/images/wechat/wechat_icon.gif) -100px -76px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} +.reply-icon {background:url(/images/wechat/icon_list.gif) -150px -155px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} +.praise-icon {background:url(/images/wechat/icon_list.gif) -36px -88px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} +.praised-icon {background:url(/images/wechat/icon_list.gif) -152px -86px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} /* loading 弹框*/ .loading-bg {position:fixed; width:100%; height:100%; left:0; top:0; z-index:99; background:rgba(206, 206, 206, 0.3); overflow:hidden;}
发布者: {{discussion.user.realname}}