Skip to content

Commit

Permalink
大衣
Browse files Browse the repository at this point in the history
  • Loading branch information
wxianfeng committed Jan 15, 2012
1 parent 7b226ae commit 4c7dd2e
Show file tree
Hide file tree
Showing 11 changed files with 205 additions and 24 deletions.
12 changes: 6 additions & 6 deletions app/assets/javascripts/.svn/entries
Expand Up @@ -431,14 +431,14 @@ deleted

step.js
file
655
656



2012-01-12T15:57:37.000000Z
351db780478a592311ba4a52a627ad29
2012-01-12T15:59:44.243967Z
655
2012-01-15T13:49:56.000000Z
a7b9a5e04e5e5fb0bd663e6b00b83bd9
2012-01-15T13:51:12.545213Z
656
wxianfeng


Expand All @@ -461,7 +461,7 @@ wxianfeng



6868
7453

up_sizes.js.coffee
file
Expand Down
24 changes: 24 additions & 0 deletions app/assets/javascripts/step.js
Expand Up @@ -277,6 +277,30 @@
$("#right_top").after(data);
}
});
},
loadOvercoat: function(){
$.ajax({
url: "/welcome/load_overcoat",
type: "GET",
success: function(data){
if ($("#overcoat_content").length != 0)
return;
$("#right_top").after(data);
}
});
},
changeOvercoatStyle: function(style){
$.ajax({
url: "/welcome/load_overcoat",
type: "GET",
data: {
'style': style
},
success: function(data){
$("#overcoat_content").remove();
$("#right_top").after(data);
}
});
}
};

Expand Down
12 changes: 6 additions & 6 deletions app/controllers/.svn/entries
Expand Up @@ -240,14 +240,14 @@ deleted

welcome_controller.rb
file
655
656



2012-01-12T15:58:11.000000Z
66fde410089f14317abe8de4a1cf93e9
2012-01-12T15:59:44.243967Z
655
2012-01-15T13:39:34.000000Z
ab6588bb2b8173819e79a26af6f8c68b
2012-01-15T13:51:12.545213Z
656
wxianfeng


Expand All @@ -270,5 +270,5 @@ wxianfeng



3604
3747

8 changes: 8 additions & 0 deletions app/controllers/.svn/text-base/welcome_controller.rb.svn-base
Expand Up @@ -151,6 +151,14 @@ class WelcomeController < ApplicationController
render :partial => "waitao"
end

def load_overcoat
if params[:style]
@user.style = params[:style]
@user.save
end
render :partial => "overcoat"
end

protected
def find_user
@user = User.find_by_visitor_id(cookies[:visitor_id])
Expand Down
8 changes: 8 additions & 0 deletions app/controllers/welcome_controller.rb
Expand Up @@ -151,6 +151,14 @@ def load_waitao
render :partial => "waitao"
end

def load_overcoat
if params[:style]
@user.style = params[:style]
@user.save
end
render :partial => "overcoat"
end

protected
def find_user
@user = User.find_by_visitor_id(cookies[:visitor_id])
Expand Down
12 changes: 6 additions & 6 deletions app/helpers/.svn/entries
Expand Up @@ -35,14 +35,14 @@ c9c43223-3a15-4248-947a-f546d6373bce

application_helper.rb
file
655
656



2012-01-12T15:51:48.000000Z
acc05953bfae22542504ecaf3a682ce8
2012-01-12T15:59:44.243967Z
655
2012-01-15T13:48:25.000000Z
20895a20c6af16305e1fee4123684621
2012-01-15T13:51:12.545213Z
656
wxianfeng


Expand All @@ -65,7 +65,7 @@ wxianfeng



14920
15478

brands_helper.rb
file
Expand Down
25 changes: 25 additions & 0 deletions app/helpers/.svn/text-base/application_helper.rb.svn-base
Expand Up @@ -602,4 +602,29 @@ module ApplicationHelper
r
end

# 大衣 衣长
def show_overcoat_length(user)
height = user.height.value
r = case height
when 160..161 then "85"
when 162..163 then "86"
when 164..165 then "87"
when 166..167 then "88"
when 168..169 then "89"
when 170..171 then "90"
when 172..173 then "91"
when 174..175 then "92"
when 176..177 then "93"
when 178..179 then "94"
when 180..181 then "95"
when 182..183 then "96"
when 184..187 then "97"
when 188..189 then "98"
when 190 then "99"
else
"85"
end
r
end

end
25 changes: 25 additions & 0 deletions app/helpers/application_helper.rb
Expand Up @@ -602,4 +602,29 @@ def show_jack_chest(user)
r
end

# 大衣 衣长
def show_overcoat_length(user)
height = user.height.value
r = case height
when 160..161 then "85"
when 162..163 then "86"
when 164..165 then "87"
when 166..167 then "88"
when 168..169 then "89"
when 170..171 then "90"
when 172..173 then "91"
when 174..175 then "92"
when 176..177 then "93"
when 178..179 then "94"
when 180..181 then "95"
when 182..183 then "96"
when 184..187 then "97"
when 188..189 then "98"
when 190 then "99"
else
"85"
end
r
end

end
46 changes: 40 additions & 6 deletions app/views/welcome/.svn/entries
Expand Up @@ -169,6 +169,40 @@ wxianfeng

1924

_overcoat.html.erb
file
656



2012-01-15T13:44:18.000000Z
6de8ddb7ec494f11df905036decac186
2012-01-15T13:51:12.545213Z
656
wxianfeng





















2219

_polo.html.erb
file
653
Expand Down Expand Up @@ -535,14 +569,14 @@ wxianfeng

step6.html.erb
file
655
656



2012-01-12T15:56:11.000000Z
f2e11b94680becab9b31b429b0542f89
2012-01-12T15:59:44.243967Z
655
2012-01-15T13:36:56.000000Z
279646d370c06328dba909e2bbcd29e8
2012-01-15T13:51:12.545213Z
656
wxianfeng


Expand All @@ -565,7 +599,7 @@ wxianfeng



2415
2529

step7.html.erb
file
Expand Down
56 changes: 56 additions & 0 deletions app/views/welcome/_overcoat.html.erb
@@ -0,0 +1,56 @@
<div id="overcoat_content">
<div id="xinghao">
<div class="styBox_right_top" id="xifu">大衣</div>
<div class="styBox_right_mid">
<div class="xinghao_title">
<ul>
<li>
<span><input id="sx_biaozhuan" onclick="Chima.Step.changeOvercoatStyle('<%= User::Style::LOOSE %>');" type="radio" name="shenxing" <%= 'checked' if @user.style == User::Style::LOOSE %>/></span>
<span>宽松</span>
</li>
<li>
<span><input id="sx_shoushen" type="radio" onclick="Chima.Step.changeOvercoatStyle('<%= User::Style::NORMAL %>');" name="shenxing" <%= 'checked' if @user.style == User::Style::NORMAL %>/></span>
<span>标准</span>
</li>
<li>
<span><input id="sx_kuansong" type="radio" onclick="Chima.Step.changeOvercoatStyle('<%= User::Style::FIT %>');" name="shenxing" <%= 'checked' if @user.style == User::Style::FIT %>/></span>
<span>合体</span>
</li>
<li>
<span><input id="sx_kuansong" type="radio" onclick="Chima.Step.changeOvercoatStyle('<%= User::Style::TIGHT %>');" name="shenxing" <%= 'checked' if @user.style == User::Style::TIGHT %>/></span>
<span>紧身</span>
</li>
</ul>
</div>
<div id="xh_table">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="width01">胸围</td>
<td><%= show_coat_chest(@user) + 2 %></td>
</tr>
<tr>
<td class="width01">腰围</td>
<td><%= show_coat_middle_chest(@user) + 2 %></td>
</tr>
<tr>
<td class="width01">下摆</td>
<td><%= show_coat_chest(@user) + 2 %></td>
</tr>
<tr>
<td class="width01">衣长</td>
<td><%= show_overcoat_length(@user) %></td>
</tr>
<tr>
<td class="width01">肩宽</td>
<td><%= @user.shoulder %></td>
</tr>
<tr>
<td class="width01">袖长</td>
<td><%= @user.sleeve %></td>
</tr>
</table>
</div>
</div>
<div class="styBox_right_btm"></div>
</div>
</div>
1 change: 1 addition & 0 deletions app/views/welcome/step6.html.erb
Expand Up @@ -19,6 +19,7 @@
<li><a href="javascript:void(0)" onclick="Chima.Step.loadCoat();">羽绒服<font>></font></a></li>
<li><a href="javascript:void(0)" onclick="Chima.Step.loadJack();">夹克<font>></font></a></li>
<li><a href="javascript:void(0)" onclick="Chima.Step.loadWaitao();">外套<font>></font></a></li>
<li><a href="javascript:void(0)" onclick="Chima.Step.loadOvercoat();">大衣<font>></font></a></li>
</ul>
<span class="styBox_leftCell">男士下衣</span>
<ul id="leftCell_ul_2" class="leftCell_ul">
Expand Down

0 comments on commit 4c7dd2e

Please sign in to comment.