Merge branch 'develop' into 'develop'
Develop 购物车数量选择修改 See merge request !49
Showing
4 changed files
with
27 additions
and
9 deletions
@@ -61,6 +61,10 @@ function checkColorSizeNum() { | @@ -61,6 +61,10 @@ function checkColorSizeNum() { | ||
61 | function show(html, cb) { | 61 | function show(html, cb) { |
62 | if (html) { | 62 | if (html) { |
63 | $chosePanel.html(html); | 63 | $chosePanel.html(html); |
64 | + if ($('#promotionId').val() !== '') { | ||
65 | + $yohoPage.off('touchstart', '.btn-minus'); | ||
66 | + $yohoPage.off('touchstart', '.btn-plus'); | ||
67 | + } | ||
64 | init(); | 68 | init(); |
65 | } | 69 | } |
66 | $('.chose-panel').show(); | 70 | $('.chose-panel').show(); |
@@ -288,6 +292,10 @@ $yohoPage.on('touchstart', '.btn-minus', function() { | @@ -288,6 +292,10 @@ $yohoPage.on('touchstart', '.btn-minus', function() { | ||
288 | } | 292 | } |
289 | 293 | ||
290 | //TODO:库存数验证 | 294 | //TODO:库存数验证 |
295 | + if (num > leftNum) { | ||
296 | + $num.val(leftNum); | ||
297 | + return; | ||
298 | + } | ||
291 | $num.val(num + 1); | 299 | $num.val(num + 1); |
292 | }).on('touchstart', '#chose-btn-sure', function() { | 300 | }).on('touchstart', '#chose-btn-sure', function() { |
293 | 301 | ||
@@ -303,6 +311,10 @@ $yohoPage.on('touchstart', '.btn-minus', function() { | @@ -303,6 +311,10 @@ $yohoPage.on('touchstart', '.btn-minus', function() { | ||
303 | if (!checkColorSizeNum()) { | 311 | if (!checkColorSizeNum()) { |
304 | return; | 312 | return; |
305 | } | 313 | } |
314 | + if (isNaN(num)) { | ||
315 | + tip.show('您选择的数量不是一个数字~'); | ||
316 | + return; | ||
317 | + } | ||
306 | 318 | ||
307 | //TODO status change | 319 | //TODO status change |
308 | if ($('#chose-btn-sure').html() === '已售罄') { | 320 | if ($('#chose-btn-sure').html() === '已售罄') { |
@@ -73,7 +73,10 @@ | @@ -73,7 +73,10 @@ | ||
73 | position: relative; | 73 | position: relative; |
74 | font-size: 28rem / $pxConvertRem; | 74 | font-size: 28rem / $pxConvertRem; |
75 | padding-left: 80rem / $pxConvertRem; | 75 | padding-left: 80rem / $pxConvertRem; |
76 | - | 76 | + input.disabled{ |
77 | + background-color:#fff; | ||
78 | + color: #000; | ||
79 | + } | ||
77 | > span { | 80 | > span { |
78 | position: absolute; | 81 | position: absolute; |
79 | left: 0; | 82 | left: 0; |
@@ -84,6 +87,9 @@ | @@ -84,6 +87,9 @@ | ||
84 | left: pxToRem(380px); | 87 | left: pxToRem(380px); |
85 | top: 20rem / $pxConvertRem; | 88 | top: 20rem / $pxConvertRem; |
86 | } | 89 | } |
90 | + span.disabled{ | ||
91 | + color: #e6e6e6; | ||
92 | + } | ||
87 | } | 93 | } |
88 | 94 | ||
89 | .size-list li.hide { | 95 | .size-list li.hide { |
@@ -13,9 +13,9 @@ | @@ -13,9 +13,9 @@ | ||
13 | <ul class="freebie-and-advance-buy"> | 13 | <ul class="freebie-and-advance-buy"> |
14 | {{# freebie}} | 14 | {{# freebie}} |
15 | <li class="freebie"> | 15 | <li class="freebie"> |
16 | + <a href="/cart/index/gift?cartType="> | ||
16 | <span class="iconfont"></span> | 17 | <span class="iconfont"></span> |
17 | 赠品 | 18 | 赠品 |
18 | - <a href=":;"> | ||
19 | <span class="count">{{count}}</span> | 19 | <span class="count">{{count}}</span> |
20 | <span class="iconfont icon-right-arrow"></span> | 20 | <span class="iconfont icon-right-arrow"></span> |
21 | </a> | 21 | </a> |
@@ -23,9 +23,9 @@ | @@ -23,9 +23,9 @@ | ||
23 | {{/ freebie}} | 23 | {{/ freebie}} |
24 | {{#if advanceBuy}} | 24 | {{#if advanceBuy}} |
25 | <li class="advance-buy"> | 25 | <li class="advance-buy"> |
26 | + <a href="/cart/index/advanceBuy?cartType="> | ||
26 | <span class="iconfont"></span> | 27 | <span class="iconfont"></span> |
27 | 加价购 | 28 | 加价购 |
28 | - <a href=":;"> | ||
29 | <span class="count">{{advanceBuyCount}}</span> | 29 | <span class="count">{{advanceBuyCount}}</span> |
30 | <span class="iconfont icon-right-arrow"></span> | 30 | <span class="iconfont icon-right-arrow"></span> |
31 | </a> | 31 | </a> |
@@ -66,13 +66,13 @@ | @@ -66,13 +66,13 @@ | ||
66 | {{^}} | 66 | {{^}} |
67 | <span class="checkbox icon-checkbox iconfont"></span> | 67 | <span class="checkbox icon-checkbox iconfont"></span> |
68 | {{/if}} | 68 | {{/if}} |
69 | + <a class="btn-balance"> | ||
70 | + 结算 | ||
71 | + </a> | ||
69 | <p> | 72 | <p> |
70 | <span id="good-total"> | 73 | <span id="good-total"> |
71 | 总计:¥{{sumPrice}} ({{count}}件) | 74 | 总计:¥{{sumPrice}} ({{count}}件) |
72 | </span> | 75 | </span> |
73 | <span class="tip">(不含运费)</span> | 76 | <span class="tip">(不含运费)</span> |
74 | </p> | 77 | </p> |
75 | - <a class="btn-balance"> | ||
76 | - 结算 | ||
77 | - </a> | ||
78 | </div> | 78 | </div> |
@@ -50,11 +50,11 @@ | @@ -50,11 +50,11 @@ | ||
50 | <span>数量</span> | 50 | <span>数量</span> |
51 | <div class="clearfix"> | 51 | <div class="clearfix"> |
52 | <a class="btn btn-minus" href="javascript:void(0);"> | 52 | <a class="btn btn-minus" href="javascript:void(0);"> |
53 | - <span class="iconfont"></span> | 53 | + <span class="iconfont {{#if promotionId}}disabled{{/if}}"></span> |
54 | </a> | 54 | </a> |
55 | - <input id="good-num" class="good-num" type="text" value="1"> | 55 | + <input id="good-num" class="good-num {{#if promotionId}}disabled{{/if}}" type="text" value="1" {{#if promotionId}}disabled="true"{{/if}}> |
56 | <a class="btn btn-plus" href="javascript:void(0);"> | 56 | <a class="btn btn-plus" href="javascript:void(0);"> |
57 | - <span class="iconfont"></span> | 57 | + <span class="iconfont {{#if promotionId}}disabled{{/if}}"></span> |
58 | </a> | 58 | </a> |
59 | </div> | 59 | </div> |
60 | <span class="left-num"></span> | 60 | <span class="left-num"></span> |
-
Please register or login to post a comment