Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
5 changed files
with
152 additions
and
51 deletions
@@ -118,6 +118,26 @@ function updateConformButtonClassAndText() { | @@ -118,6 +118,26 @@ function updateConformButtonClassAndText() { | ||
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||
121 | +//显示剩余件数 | ||
122 | +function displayGoodNum(curGoodNum) { | ||
123 | + | ||
124 | + //数量大于0 | ||
125 | + if (curGoodNum > 0) { | ||
126 | + if ($soonSoldOut.length > 0) { | ||
127 | + $allChoseItems.find('.num .left-num').html('即将售罄'); | ||
128 | + } else { | ||
129 | + $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件'); | ||
130 | + } | ||
131 | + | ||
132 | + $leftNum.val(curGoodNum); | ||
133 | + | ||
134 | + //数量小于0 | ||
135 | + } else { | ||
136 | + $allChoseItems.find('.num .left-num').html(''); | ||
137 | + $leftNum.val(0); | ||
138 | + } | ||
139 | +} | ||
140 | + | ||
121 | init(); | 141 | init(); |
122 | 142 | ||
123 | $yohoPage.on('touchstart', '.chose-panel', function(e) { | 143 | $yohoPage.on('touchstart', '.chose-panel', function(e) { |
@@ -187,23 +207,11 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | @@ -187,23 +207,11 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | ||
187 | $curSizeBlock.addClass('chosed'); | 207 | $curSizeBlock.addClass('chosed'); |
188 | } | 208 | } |
189 | 209 | ||
190 | - //数量大于0 | ||
191 | - if (curGoodNum > 0) { | ||
192 | - if ($soonSoldOut.length > 0) { | ||
193 | - $allChoseItems.find('.num .left-num').html('即将售罄'); | ||
194 | - } else { | ||
195 | - $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件'); | ||
196 | - } | ||
197 | - | ||
198 | - $leftNum.val(curGoodNum); | ||
199 | - | ||
200 | - //数量小于0 | ||
201 | - } else { | ||
202 | - $allChoseItems.find('.num .left-num').html(''); | ||
203 | - $leftNum.val(0); | ||
204 | - } | ||
205 | } | 210 | } |
206 | 211 | ||
212 | + // 显示剩余数量 | ||
213 | + displayGoodNum(curGoodNum); | ||
214 | + | ||
207 | // 尺码行当前行隐藏 | 215 | // 尺码行当前行隐藏 |
208 | $sizeRowList.eq(curSizeIndex).removeClass('show').addClass('hide'); | 216 | $sizeRowList.eq(curSizeIndex).removeClass('show').addClass('hide'); |
209 | 217 | ||
@@ -271,30 +279,16 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | @@ -271,30 +279,16 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | ||
271 | // 之前选中的颜色去掉勾选样式,新颜色块勾选 | 279 | // 之前选中的颜色去掉勾选样式,新颜色块勾选 |
272 | if ($curColorBlock && $curColorBlock.length > 0) { | 280 | if ($curColorBlock && $curColorBlock.length > 0) { |
273 | $curColorBlock.removeClass('chosed'); | 281 | $curColorBlock.removeClass('chosed'); |
274 | - | ||
275 | - //curColorBlock = $colorRowList.eq(curColorIndex + 1).children().get(curSizeIndex - 1); | ||
276 | curColorBlock = $colorRowList.eq(index + 1).children().get(curSizeIndex - 1); | 282 | curColorBlock = $colorRowList.eq(index + 1).children().get(curSizeIndex - 1); |
277 | $curColorBlock = $(curColorBlock); | 283 | $curColorBlock = $(curColorBlock); |
278 | curGoodNum = $curColorBlock.data('num'); | 284 | curGoodNum = $curColorBlock.data('num'); |
279 | $curColorBlock.addClass('chosed'); | 285 | $curColorBlock.addClass('chosed'); |
280 | } | 286 | } |
281 | - | ||
282 | - //数量大于0 | ||
283 | - if (curGoodNum > 0) { | ||
284 | - if ($soonSoldOut.length > 0) { | ||
285 | - $allChoseItems.find('.num .left-num').html('即将售罄'); | ||
286 | - } else { | ||
287 | - $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件'); | ||
288 | - } | ||
289 | - $leftNum.val(curGoodNum); | ||
290 | - | ||
291 | - //数量小于0 | ||
292 | - } else { | ||
293 | - $allChoseItems.find('.num .left-num').html(''); | ||
294 | - $leftNum.val(0); | ||
295 | - } | ||
296 | } | 287 | } |
297 | 288 | ||
289 | + // 显示剩余数量 | ||
290 | + displayGoodNum(curGoodNum); | ||
291 | + | ||
298 | // 颜色当前行隐藏 | 292 | // 颜色当前行隐藏 |
299 | $colorRowList.eq(curColorIndex).removeClass('show').addClass('hide'); | 293 | $colorRowList.eq(curColorIndex).removeClass('show').addClass('hide'); |
300 | 294 |
@@ -215,6 +215,7 @@ | @@ -215,6 +215,7 @@ | ||
215 | background-size:100% 100%; | 215 | background-size:100% 100%; |
216 | position: relative; | 216 | position: relative; |
217 | top: .36rem; | 217 | top: .36rem; |
218 | + margin-right: pxToRem(12px); | ||
218 | } | 219 | } |
219 | &.highlight { | 220 | &.highlight { |
220 | background: #eee; | 221 | background: #eee; |
@@ -6,9 +6,9 @@ | @@ -6,9 +6,9 @@ | ||
6 | <div class="sale-group-big clearfix"> | 6 | <div class="sale-group-big clearfix"> |
7 | {{#brandSale}} | 7 | {{#brandSale}} |
8 | {{#big}} | 8 | {{#big}} |
9 | - <a class="item pull-left {{#if @first}}first{{/if}} {{#if @last}}last{{/if}}" href="{{link}}"> | 9 | + <a class="item pull-left" href="{{link}}"> |
10 | <div class="pic"> | 10 | <div class="pic"> |
11 | - <img class="" src="{{img}}"> | 11 | + <img src="{{img}}"> |
12 | <div class="time">{{time}}</div> | 12 | <div class="time">{{time}}</div> |
13 | </div> | 13 | </div> |
14 | <div class="detail"> | 14 | <div class="detail"> |
@@ -24,6 +24,17 @@ | @@ -24,6 +24,17 @@ | ||
24 | </div> | 24 | </div> |
25 | </a> | 25 | </a> |
26 | {{/big}} | 26 | {{/big}} |
27 | + </div> | ||
28 | + <div class="sale-group clearfix"> | ||
29 | + {{#normal}} | ||
30 | + <a class="item pull-left" href="{{link}}"> | ||
31 | + <img class="pic" src="{{img}}"> | ||
32 | + <div class="detail"> | ||
33 | + <div class="title">{{title}}</div> | ||
34 | + <div class="time">{{time}}</div> | ||
35 | + </div> | ||
36 | + </a> | ||
37 | + {{/normal}} | ||
27 | {{/brandSale}} | 38 | {{/brandSale}} |
28 | </div> | 39 | </div> |
29 | 40 |
@@ -55,20 +55,13 @@ | @@ -55,20 +55,13 @@ | ||
55 | } | 55 | } |
56 | 56 | ||
57 | .brand-sale { | 57 | .brand-sale { |
58 | - | ||
59 | .sale-group-big { | 58 | .sale-group-big { |
60 | - .item { | ||
61 | - width: 377px; | ||
62 | - margin-right: 10px; | ||
63 | - | ||
64 | - &.first, | ||
65 | - &.last { | ||
66 | - width: 376px; | ||
67 | - } | 59 | + width: 1150px + 8px; |
68 | 60 | ||
69 | - &.last { | ||
70 | - margin-right: 0; | ||
71 | - } | 61 | + .item { |
62 | + width: 378px; | ||
63 | + margin-right: 8px; | ||
64 | + margin-bottom: 10px; | ||
72 | } | 65 | } |
73 | 66 | ||
74 | .pic { | 67 | .pic { |
@@ -95,7 +88,7 @@ | @@ -95,7 +88,7 @@ | ||
95 | } | 88 | } |
96 | 89 | ||
97 | .brand { | 90 | .brand { |
98 | - margin: 24px 10px; | 91 | + margin: 24px 10px 0; |
99 | } | 92 | } |
100 | 93 | ||
101 | .text { | 94 | .text { |
@@ -112,7 +105,36 @@ | @@ -112,7 +105,36 @@ | ||
112 | font-size: 40px; | 105 | font-size: 40px; |
113 | } | 106 | } |
114 | } | 107 | } |
108 | + } | ||
109 | + | ||
110 | + .sale-group { | ||
111 | + width: 1150px + 8px; | ||
112 | + | ||
113 | + .item { | ||
114 | + width: 185px; | ||
115 | + margin-right: 8px; | ||
116 | + margin-bottom: 10px; | ||
117 | + } | ||
118 | + | ||
119 | + .pic { | ||
120 | + width: 100%; | ||
121 | + display: block; | ||
122 | + } | ||
123 | + | ||
124 | + .detail { | ||
125 | + padding: 14px 10px; | ||
126 | + background: #f5f5f5; | ||
127 | + text-align: center; | ||
128 | + line-height: 20px; | ||
129 | + } | ||
130 | + | ||
131 | + .title { | ||
132 | + font-size: 12px; | ||
133 | + } | ||
115 | 134 | ||
135 | + .time { | ||
136 | + font-size: 14px; | ||
137 | + } | ||
116 | } | 138 | } |
117 | } | 139 | } |
118 | } | 140 | } |
@@ -54,7 +54,7 @@ class Sale1Controller extends WebAction | @@ -54,7 +54,7 @@ class Sale1Controller extends WebAction | ||
54 | 'brandSale' => array( | 54 | 'brandSale' => array( |
55 | 'big' => array( | 55 | 'big' => array( |
56 | array( | 56 | array( |
57 | - 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/376/h/400', | 57 | + 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/378/h/400', |
58 | 'link' => 'http://www.yohobuy.com', | 58 | 'link' => 'http://www.yohobuy.com', |
59 | 'time' => '低于1小时', | 59 | 'time' => '低于1小时', |
60 | 'brand' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/22/09/0168ae2421d5283414ff5b873fa4a1c16a.jpg?imageView/1/w/185/h/62', | 60 | 'brand' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/22/09/0168ae2421d5283414ff5b873fa4a1c16a.jpg?imageView/1/w/185/h/62', |
@@ -62,7 +62,7 @@ class Sale1Controller extends WebAction | @@ -62,7 +62,7 @@ class Sale1Controller extends WebAction | ||
62 | 'discount' => '70%', | 62 | 'discount' => '70%', |
63 | ), | 63 | ), |
64 | array( | 64 | array( |
65 | - 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/376/h/400', | 65 | + 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/378/h/400', |
66 | 'link' => 'http://www.yohobuy.com', | 66 | 'link' => 'http://www.yohobuy.com', |
67 | 'time' => '低于1小时', | 67 | 'time' => '低于1小时', |
68 | 'brand' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/22/09/0168ae2421d5283414ff5b873fa4a1c16a.jpg?imageView/1/w/185/h/62', | 68 | 'brand' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/22/09/0168ae2421d5283414ff5b873fa4a1c16a.jpg?imageView/1/w/185/h/62', |
@@ -70,7 +70,7 @@ class Sale1Controller extends WebAction | @@ -70,7 +70,7 @@ class Sale1Controller extends WebAction | ||
70 | 'discount' => '70%', | 70 | 'discount' => '70%', |
71 | ), | 71 | ), |
72 | array( | 72 | array( |
73 | - 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/376/h/400', | 73 | + 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/378/h/400', |
74 | 'link' => 'http://www.yohobuy.com', | 74 | 'link' => 'http://www.yohobuy.com', |
75 | 'time' => '低于1小时', | 75 | 'time' => '低于1小时', |
76 | 'brand' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/22/09/0168ae2421d5283414ff5b873fa4a1c16a.jpg?imageView/1/w/185/h/62', | 76 | 'brand' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/22/09/0168ae2421d5283414ff5b873fa4a1c16a.jpg?imageView/1/w/185/h/62', |
@@ -78,7 +78,80 @@ class Sale1Controller extends WebAction | @@ -78,7 +78,80 @@ class Sale1Controller extends WebAction | ||
78 | 'discount' => '70%', | 78 | 'discount' => '70%', |
79 | ) | 79 | ) |
80 | ), | 80 | ), |
81 | - 'normal' => array() | 81 | + 'normal' => array( |
82 | + array( | ||
83 | + 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180', | ||
84 | + 'link' => 'http://www.yohobuy.com', | ||
85 | + 'time' => '低于1小时', | ||
86 | + 'title' => '2015春夏海量大促!' | ||
87 | + ), | ||
88 | + array( | ||
89 | + 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180', | ||
90 | + 'link' => 'http://www.yohobuy.com', | ||
91 | + 'time' => '低于1小时', | ||
92 | + 'title' => '2015春夏海量大促!' | ||
93 | + ), | ||
94 | + array( | ||
95 | + 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180', | ||
96 | + 'link' => 'http://www.yohobuy.com', | ||
97 | + 'time' => '低于1小时', | ||
98 | + 'title' => '2015春夏海量大促!' | ||
99 | + ), | ||
100 | + array( | ||
101 | + 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180', | ||
102 | + 'link' => 'http://www.yohobuy.com', | ||
103 | + 'time' => '低于1小时', | ||
104 | + 'title' => '2015春夏海量大促!' | ||
105 | + ), | ||
106 | + array( | ||
107 | + 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180', | ||
108 | + 'link' => 'http://www.yohobuy.com', | ||
109 | + 'time' => '低于1小时', | ||
110 | + 'title' => '2015春夏海量大促!' | ||
111 | + ), | ||
112 | + array( | ||
113 | + 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180', | ||
114 | + 'link' => 'http://www.yohobuy.com', | ||
115 | + 'time' => '低于1小时', | ||
116 | + 'title' => '2015春夏海量大促!' | ||
117 | + ), | ||
118 | + array( | ||
119 | + 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180', | ||
120 | + 'link' => 'http://www.yohobuy.com', | ||
121 | + 'time' => '低于1小时', | ||
122 | + 'title' => '2015春夏海量大促!' | ||
123 | + ), | ||
124 | + array( | ||
125 | + 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180', | ||
126 | + 'link' => 'http://www.yohobuy.com', | ||
127 | + 'time' => '低于1小时', | ||
128 | + 'title' => '2015春夏海量大促!' | ||
129 | + ), | ||
130 | + array( | ||
131 | + 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180', | ||
132 | + 'link' => 'http://www.yohobuy.com', | ||
133 | + 'time' => '低于1小时', | ||
134 | + 'title' => '2015春夏海量大促!' | ||
135 | + ), | ||
136 | + array( | ||
137 | + 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180', | ||
138 | + 'link' => 'http://www.yohobuy.com', | ||
139 | + 'time' => '低于1小时', | ||
140 | + 'title' => '2015春夏海量大促!' | ||
141 | + ), | ||
142 | + array( | ||
143 | + 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180', | ||
144 | + 'link' => 'http://www.yohobuy.com', | ||
145 | + 'time' => '低于1小时', | ||
146 | + 'title' => '2015春夏海量大促!' | ||
147 | + ), | ||
148 | + array( | ||
149 | + 'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180', | ||
150 | + 'link' => 'http://www.yohobuy.com', | ||
151 | + 'time' => '低于1小时', | ||
152 | + 'title' => '2015春夏海量大促!' | ||
153 | + ) | ||
154 | + ) | ||
82 | ) | 155 | ) |
83 | ); | 156 | ); |
84 | $this->setWebNavHeader(); | 157 | $this->setWebNavHeader(); |
-
Please register or login to post a comment