Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trim the weui stylesheet size from 17KB to 2KB #4

Merged
merged 4 commits into from
Apr 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ GEM
airbrussh (1.1.2)
sshkit (>= 1.6.1, != 1.7.0)
arel (7.1.4)
autoprefixer-rails (6.7.7.1)
autoprefixer-rails (6.7.7.2)
execjs
bcrypt (3.1.11)
better_errors (2.1.1)
Expand Down Expand Up @@ -85,7 +85,7 @@ GEM
railties (>= 4.1.0, < 5.1)
responders
warden (~> 1.2.3)
domain_name (0.5.20170223)
domain_name (0.5.20170404)
unf (>= 0.0.5, < 1.0.0)
erubis (2.7.0)
execjs (2.7.0)
Expand Down Expand Up @@ -129,7 +129,7 @@ GEM
minitest (5.10.1)
monetize (1.6.0)
money (~> 6.8)
money (6.8.2)
money (6.8.3)
i18n (>= 0.6.4, < 0.9)
sixarm_ruby_unaccent (>= 1.1.1, < 2)
money-rails (1.8.0)
Expand Down Expand Up @@ -230,11 +230,11 @@ GEM
tilt (2.0.7)
tzinfo (1.2.3)
thread_safe (~> 0.1)
uglifier (3.1.12)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)
unf_ext (0.0.7.3)
warden (1.2.7)
rack (>= 1.0)
websocket-driver (0.6.5)
Expand All @@ -245,10 +245,10 @@ GEM
http (>= 1.0.4, < 3)
nokogiri (>= 1.6.0)
thor
weui-rails (1.1.1)
weui-rails (1.1.1.1)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
wx_pay (0.14.2)
wx_pay (0.15.0)
activesupport (>= 3.2)
rest-client (>= 1.7)

Expand Down
9 changes: 8 additions & 1 deletion app/assets/stylesheets/weui-rails.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
$weuiGridIconSize: 128px;
$weuiGridColumnCount: 2;

@import "weui";
@import "base/reset";

// cell
@import "widget/weui-cell/weui-cell_global";
@import "widget/weui-cell/weui-form";

// grid
@import "widget/weui-grid/weui-grid";

.page {
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/wewebs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def pay
body: order.teddy_sku,
out_trade_no: "teddies_shop_order_id_#{order.id}",
total_fee: order.amount_fens,
spbill_create_ip: Socket.ip_address_list.detect(&:ipv4_private?).ip_address,
spbill_create_ip: request.ip,
notify_url: Figaro.env.wechat_pay_notify_url,
trade_type: 'JSAPI',
openid: openid
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/wechat.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<%= csrf_meta_tags %>
<title><%= @title.presence || "Teddies Shop" %></title>
<%= stylesheet_link_tag 'weui-rails', media: 'all' %>
<script src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
Expand Down