Merge branch 'guange_dev' into 'develop'

微信功能修改



See merge request !103
This commit is contained in:
黄井泉 2017-01-06 09:40:18 +08:00
commit db0a27933b
6 changed files with 28 additions and 33 deletions

View File

@ -75,15 +75,9 @@ module Mobile
authenticate!
subscribe = 0 #默认未关注
#-------------------获取用户是否关注此公众号-----------------------------
openid = session[:wechat_openid]
raise "无法获取到openid,请在微信中打开本页面" unless openid
user_info = Wechat.api.user(openid)
Rails.logger.info "user_info!!!!!!!!!"
Rails.logger.info user_info
subscribe = user_info["subscribe"]
## 能进来的就是已关注
## 因为取消订阅的记录被删除了
subscribe = 1 #默认未关注
status = 0
tip = 0 #0班级1项目

View File

@ -515,8 +515,8 @@ class WechatsController < ActionController::Base
private
def get_openid_from_code(code)
if code =='only-for-test'
openid = 'o3ss_wHOOnHkz1khBJxH8RF4SfPY'
if code =='test'
openid = 'orgVLv8TlS6e7FDiI6xdTGHRaaRo'
session[:wechat_openid] = openid
return openid
end
@ -545,6 +545,8 @@ class WechatsController < ActionController::Base
return openid
end
## 能进来的就是已关注
## 因为取消订阅的记录被删除了
def user_binded?(openid)
uw = UserWechat.where(openid: openid).first
if uw && uw.bindtype == 0

View File

@ -235,6 +235,8 @@ class News < ActiveRecord::Base
vs << {course_message_type:'News',course_message_id:self.id, :user_id => m.user_id,
:course_id => self.course_id, :viewed => false}
#delayed_job卡住的原因是一次执行的条数太多导致超时。
#现在把每次只执行不超过30条就不会超了。
if vs.size >= 30
self.delay.contain_news_message(vs)
vs.clear

View File

@ -11,8 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20161230061940) do
ActiveRecord::Schema.define(:version => 20161223083022) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
t.string "act_type", :null => false
@ -2434,16 +2433,6 @@ ActiveRecord::Schema.define(:version => 20161230061940) do
t.datetime "updated_at", :null => false
end
create_table "wechat_logs", :force => true do |t|
t.string "openid", :null => false
t.text "request_raw"
t.text "response_raw"
t.text "session_raw"
t.datetime "created_at", :null => false
end
add_index "wechat_logs", ["openid"], :name => "index_wechat_logs_on_openid"
create_table "wiki_content_versions", :force => true do |t|
t.integer "wiki_content_id", :null => false
t.integer "page_id", :null => false

View File

@ -126,7 +126,7 @@
<div class="post-reply-row border-bottom-none">
<div class="post-input-container">
<div class="copy-input-container"><textarea class="copy-input"></textarea></div>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-change="onPostChange(issue.comment, '{{issue.comment}}')" ng-model="issue.comment" placeholder="输入回复内容~" /></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-change="onPostChange(issue.comment, '{{issue.comment}}')" ng-model="issue.comment" placeholder="输入回复内容,您可以@别人啦~" /></textarea>
<button ng-click="addReply(issue,0)" ng-disabled="issue.disabled" ng-hide="issue.disabled" class="post-reply-submit fr border-radius">提交</button>
<button ng-disabled="issue.disabled" ng-hide="!issue.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
<div class="cl"></div>
@ -140,11 +140,17 @@
<div class="post-container wechat-at" ng-show="showAtDialog">
<div loading-spinner></div>
<div class="class-detail-name"><span class="course-name-width hidden inline-block">选择您要@的人</span>
<button ng-click="cancelAt()" class="cancel-btn-new fr border-radius">取消</button>
<div class="wechat-at-inner">
<div loading-spinner></div>
<div class="class-detail-name"><span class="course-name-width hidden inline-block">选择您要@的人</span>
<button ng-click="cancelAt()" class="cancel-btn-new fr border-radius">取消</button>
</div>
<ul class="weixin-users-all">
<li ng-repeat="person in at_persons track by $index" ng-click="selectAtPerson($index)"><p class="fl ">{{person.name}}</p><p class="fl ">{{person.login}}</p></li>
<li ng-repeat="person in at_persons track by $index" ng-click="selectAtPerson($index)"><p class="fl ">{{person.name}}</p><p class="fl ">{{person.login}}</p></li>
<li ng-repeat="person in at_persons track by $index" ng-click="selectAtPerson($index)"><p class="fl ">{{person.name}}</p><p class="fl ">{{person.login}}</p></li>
<li ng-repeat="person in at_persons track by $index" ng-click="selectAtPerson($index)"><p class="fl ">{{person.name}}</p><p class="fl ">{{person.login}}</p></li>
<li ng-repeat="person in at_persons track by $index" ng-click="selectAtPerson($index)"><p class="fl ">{{person.name}}</p><p class="fl ">{{person.login}}</p></li>
</ul>
</div>
<ul class="weixin-users-all">
<li ng-repeat="person in at_persons track by $index" ng-click="selectAtPerson($index)"><p class="fl ">{{person.name}}</p><p class="fl ">{{person.login}}</p></li>
</ul>
</div>

View File

@ -283,7 +283,9 @@ a.underline {text-decoration:underline;}
.weixin-users-all li:hover{ background:#f4f4f4;}
/*弹出@选择对话框 guange*/
.wechat-at {position: absolute; z-index: 999; top: 0; left:0; width: 100%; height: 100%; background-color: #ffffff;}
.wechat-at {position: fixed; z-index: 999; top: 0; left:0; width: 100%; height: 100%; background-color: #ffffff;}
.wechat-at-inner{overflow-y: scroll;
-webkit-overflow-scrolling: touch;
height: 100%;}
/*@页面的取消按钮*/
.cancel-btn-new {position: absolute; font-size: 13px; height: 24px; line-height: 24px; vertical-align: middle; padding: 0 7px; color: #888; background-color: #fff; outline: none; border: none; top: 11px; right: 10px;}
.cancel-btn-new {font-size: 13px; height: 24px; line-height: 24px; padding: 0 7px; color: #888; background-color: #fff; outline: none; border: none; margin-top: 11px; margin-right: 10px;}