图片调整
This commit is contained in:
parent
a72339fe2c
commit
f644aa1144
|
@ -122,15 +122,19 @@ class WechatsController < ActionController::Base
|
||||||
if uw && uw.user
|
if uw && uw.user
|
||||||
ua = UserActivity.where(user_id: uw.user.id).order("id desc").limit(5)
|
ua = UserActivity.where(user_id: uw.user.id).order("id desc").limit(5)
|
||||||
logo = "trustie_logo2.png"
|
logo = "trustie_logo2.png"
|
||||||
|
i = 0
|
||||||
news = ua.map do |ua|
|
news = ua.map do |ua|
|
||||||
|
i += 1
|
||||||
{title: "act_type: #{ua.act_type}, act_id: #{ua.act_id}",
|
{title: "act_type: #{ua.act_type}, act_id: #{ua.act_id}",
|
||||||
content: "container_id: #{ua.container_id}, container_type: #{ua.container_type}",
|
content: "container_id: #{ua.container_id}, container_type: #{ua.container_type}",
|
||||||
picurl: "http://wechat.trustie.net/images/#{logo}" }
|
picurl: "http://wechat.trustie.net/images/#{i == 1 ? logo : 'trustie_logo1.png'}" }
|
||||||
logo = "trustie_logo1.png"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
request.reply.news(news) do |article, n, index| # article is return object
|
request.reply.news(news) do |article, n, index| # article is return object
|
||||||
article.item title: "#{index} #{n[:title]}", description: n[:content], pic_url: n[:picurl], url: 'http://www.baidu.com/'
|
article.item title: "#{index} #{n[:title]}",
|
||||||
|
description: n[:content],
|
||||||
|
pic_url: n[:picurl],
|
||||||
|
url: 'http://www.baidu.com/'
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
openid = request[:FromUserName]
|
openid = request[:FromUserName]
|
||||||
|
@ -139,7 +143,10 @@ class WechatsController < ActionController::Base
|
||||||
uw = UserWechat.create!(attrs)
|
uw = UserWechat.create!(attrs)
|
||||||
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '绑定登录', content: "您还未绑定确实的用户,请先绑定." } }
|
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '绑定登录', content: "您还未绑定确实的用户,请先绑定." } }
|
||||||
request.reply.news(news) do |article, n, index| # article is return object
|
request.reply.news(news) do |article, n, index| # article is return object
|
||||||
article.item title: "#{n[:title]}", description: n[:content], pic_url: 'http://wechat.trustie.net/images/trustie_logo2.png', url: login_wechat_url(openid: uw.id)
|
article.item title: "#{n[:title]}",
|
||||||
|
description: n[:content],
|
||||||
|
pic_url: 'http://wechat.trustie.net/images/trustie_logo2.png',
|
||||||
|
url: login_wechat_url(openid: uw.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue