Permalink
Browse files

毛衫,针织衫,卫衣

  • Loading branch information...
1 parent 4c7dd2e commit fa0eaef14356e1de0033ecbe7fa1adf18d78caf7 @wxianfeng committed Jan 15, 2012
@@ -431,14 +431,14 @@ deleted
step.js
file
-656
+657
-2012-01-15T13:49:56.000000Z
-a7b9a5e04e5e5fb0bd663e6b00b83bd9
-2012-01-15T13:51:12.545213Z
-656
+2012-01-15T14:30:27.000000Z
+c9f8bbb8fe039d4d5e08bf479d518cbc
+2012-01-15T14:31:34.796907Z
+657
wxianfeng
@@ -461,7 +461,7 @@ wxianfeng
-7453
+8032
up_sizes.js.coffee
file
@@ -301,6 +301,30 @@
$("#right_top").after(data);
}
});
+ },
+ loadSweater: function(){
+ $.ajax({
+ url: "/welcome/load_sweater",
+ type: "GET",
+ success: function(data){
+ if ($("#sweater_content").length != 0)
+ return;
+ $("#right_top").after(data);
+ }
+ });
+ },
+ changeSweaterStyle: function(style){
+ $.ajax({
+ url: "/welcome/load_sweater",
+ type: "GET",
+ data: {
+ 'style': style
+ },
+ success: function(data){
+ $("#sweater_content").remove();
+ $("#right_top").after(data);
+ }
+ });
}
};
@@ -240,14 +240,14 @@ deleted
welcome_controller.rb
file
-656
+657
-2012-01-15T13:39:34.000000Z
-ab6588bb2b8173819e79a26af6f8c68b
-2012-01-15T13:51:12.545213Z
-656
+2012-01-15T14:18:57.000000Z
+f7827d3a96ffa2cff813e852304facb8
+2012-01-15T14:31:34.796907Z
+657
wxianfeng
@@ -270,5 +270,5 @@ wxianfeng
-3747
+3888
@@ -159,6 +159,14 @@ class WelcomeController < ApplicationController
render :partial => "overcoat"
end
+ def load_sweater
+ if params[:style]
+ @user.style = params[:style]
+ @user.save
+ end
+ render :partial => "sweater"
+ end
+
protected
def find_user
@user = User.find_by_visitor_id(cookies[:visitor_id])
@@ -159,6 +159,14 @@ def load_overcoat
render :partial => "overcoat"
end
+ def load_sweater
+ if params[:style]
+ @user.style = params[:style]
+ @user.save
+ end
+ render :partial => "sweater"
+ end
+
protected
def find_user
@user = User.find_by_visitor_id(cookies[:visitor_id])
@@ -35,14 +35,14 @@ c9c43223-3a15-4248-947a-f546d6373bce
application_helper.rb
file
-656
+657
-2012-01-15T13:48:25.000000Z
-20895a20c6af16305e1fee4123684621
-2012-01-15T13:51:12.545213Z
-656
+2012-01-15T14:29:11.000000Z
+b8434ada0daf760328895fb18d01ee28
+2012-01-15T14:31:34.796907Z
+657
wxianfeng
@@ -65,7 +65,7 @@ wxianfeng
-15478
+16409
brands_helper.rb
file
@@ -627,4 +627,43 @@ module ApplicationHelper
r
end
+ # 毛衫 胸围
+ def show_sweater_chest(user)
+ r = if user.style == User::Style::LOOSE
+ user.chest + 9
+ elsif user.style == User::Style::NORMAL
+ user.chest + 7
+ elsif user.style == User::Style::FIT
+ user.chest + 5
+ elsif user.style == User::Style::TIGHT
+ user.chest + 3
+ end
+ r
+ end
+
+ # 毛衫 衣长
+ def show_sweater_length(user)
+ height = user.height.value
+ r = case height
+ when 160..161 then "58-64"
+ when 162..163 then "58-64"
+ when 164..165 then "59-65"
+ when 166..167 then "59-65"
+ when 168..169 then "60-66"
+ when 170..171 then "60-66"
+ when 172..173 then "61-67"
+ when 174..175 then "61-67"
+ when 176..177 then "62-68"
+ when 178..179 then "62-68"
+ when 180..181 then "63-69"
+ when 182..183 then "63-69"
+ when 184..187 then "64-70"
+ when 188..189 then "64-70"
+ when 190 then "65-71"
+ else
+ "58-64"
+ end
+ r
+ end
+
end
@@ -627,4 +627,43 @@ def show_overcoat_length(user)
r
end
+ # 毛衫 胸围
+ def show_sweater_chest(user)
+ r = if user.style == User::Style::LOOSE
+ user.chest + 9
+ elsif user.style == User::Style::NORMAL
+ user.chest + 7
+ elsif user.style == User::Style::FIT
+ user.chest + 5
+ elsif user.style == User::Style::TIGHT
+ user.chest + 3
+ end
+ r
+ end
+
+ # 毛衫 衣长
+ def show_sweater_length(user)
+ height = user.height.value
+ r = case height
+ when 160..161 then "58-64"
+ when 162..163 then "58-64"
+ when 164..165 then "59-65"
+ when 166..167 then "59-65"
+ when 168..169 then "60-66"
+ when 170..171 then "60-66"
+ when 172..173 then "61-67"
+ when 174..175 then "61-67"
+ when 176..177 then "62-68"
+ when 178..179 then "62-68"
+ when 180..181 then "63-69"
+ when 182..183 then "63-69"
+ when 184..187 then "64-70"
+ when 188..189 then "64-70"
+ when 190 then "65-71"
+ else
+ "58-64"
+ end
+ r
+ end
+
end
@@ -237,6 +237,40 @@ wxianfeng
1929
+_sweater.html.erb
+file
+657
+
+
+
+2012-01-15T14:29:35.000000Z
+504b72a4d64822fe4bf2fd3b5839b5ce
+2012-01-15T14:31:34.796907Z
+657
+wxianfeng
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2103
+
_tshirt.html.erb
file
652
@@ -569,14 +603,14 @@ wxianfeng
step6.html.erb
file
-656
+657
-2012-01-15T13:36:56.000000Z
-279646d370c06328dba909e2bbcd29e8
-2012-01-15T13:51:12.545213Z
-656
+2012-01-15T14:06:55.000000Z
+710f48c972b6a4e38cc9a23f38f8fefa
+2012-01-15T14:31:34.796907Z
+657
wxianfeng
@@ -599,7 +633,7 @@ wxianfeng
-2529
+2659
step7.html.erb
file
@@ -0,0 +1,52 @@
+<div id="sweater_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.changeSweaterStyle('<%= 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.changeSweaterStyle('<%= 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.changeSweaterStyle('<%= 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.changeSweaterStyle('<%= 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_sweater_chest(@user) %></td>
+ </tr>
+ <tr>
+ <td class="width01">下摆</td>
+ <td><%= show_sweater_chest(@user) - 4 %></td>
+ </tr>
+ <tr>
+ <td class="width01">衣长</td>
+ <td><%= show_sweater_length(@user) %></td>
+ </tr>
+ <tr>
+ <td class="width01">肩宽</td>
+ <td><%= @user.shoulder - 3 %></td>
+ </tr>
+ <tr>
+ <td class="width01">袖长</td>
+ <td><%= @user.sleeve + 3 %></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="styBox_right_btm"></div>
+ </div>
+</div>
@@ -20,6 +20,7 @@
<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>
+ <li><a href="javascript:void(0)" onclick="Chima.Step.loadSweater();">毛衫,针织衫,卫衣<font>></font></a></li>
</ul>
<span class="styBox_leftCell">男士下衣</span>
<ul id="leftCell_ul_2" class="leftCell_ul">

0 comments on commit fa0eaef

Please sign in to comment.