diff --git a/static/js/cart/chose-panel.js b/static/js/cart/chose-panel.js index 5fde78d..42eabab 100644 --- a/static/js/cart/chose-panel.js +++ b/static/js/cart/chose-panel.js @@ -61,6 +61,10 @@ function checkColorSizeNum() { function show(html, cb) { if (html) { $chosePanel.html(html); + if ($('#promotionId').val() !== '') { + $yohoPage.off('touchstart', '.btn-minus'); + $yohoPage.off('touchstart', '.btn-plus'); + } init(); } $('.chose-panel').show(); @@ -288,6 +292,10 @@ $yohoPage.on('touchstart', '.btn-minus', function() { } //TODO:库存数验证 + if (num > leftNum) { + $num.val(leftNum); + return; + } $num.val(num + 1); }).on('touchstart', '#chose-btn-sure', function() { @@ -303,6 +311,10 @@ $yohoPage.on('touchstart', '.btn-minus', function() { if (!checkColorSizeNum()) { return; } + if (isNaN(num)) { + tip.show('您选择的数量不是一个数字~'); + return; + } //TODO status change if ($('#chose-btn-sure').html() === '已售罄') { diff --git a/static/sass/cart/_chose-panel.scss b/static/sass/cart/_chose-panel.scss index 825cf93..4585c0a 100644 --- a/static/sass/cart/_chose-panel.scss +++ b/static/sass/cart/_chose-panel.scss @@ -73,7 +73,10 @@ position: relative; font-size: 28rem / $pxConvertRem; padding-left: 80rem / $pxConvertRem; - + input.disabled{ + background-color:#fff; + color: #000; + } > span { position: absolute; left: 0; @@ -84,6 +87,9 @@ left: pxToRem(380px); top: 20rem / $pxConvertRem; } + span.disabled{ + color: #e6e6e6; + } } .size-list li.hide { diff --git a/template/m.yohobuy.com/partials/cart/cart-content.phtml b/template/m.yohobuy.com/partials/cart/cart-content.phtml index 1c27ad9..2e2eb87 100644 --- a/template/m.yohobuy.com/partials/cart/cart-content.phtml +++ b/template/m.yohobuy.com/partials/cart/cart-content.phtml @@ -13,9 +13,9 @@ <ul class="freebie-and-advance-buy"> {{# freebie}} <li class="freebie"> + <a href="/cart/index/gift?cartType="> <span class="iconfont"></span> 赠品 - <a href=":;"> <span class="count">{{count}}</span> <span class="iconfont icon-right-arrow"></span> </a> @@ -23,9 +23,9 @@ {{/ freebie}} {{#if advanceBuy}} <li class="advance-buy"> + <a href="/cart/index/advanceBuy?cartType="> <span class="iconfont"></span> 加价购 - <a href=":;"> <span class="count">{{advanceBuyCount}}</span> <span class="iconfont icon-right-arrow"></span> </a> @@ -66,13 +66,13 @@ {{^}} <span class="checkbox icon-checkbox iconfont"></span> {{/if}} + <a class="btn-balance"> + 结算 + </a> <p> <span id="good-total"> 总计:¥{{sumPrice}} ({{count}}件) </span> <span class="tip">(不含运费)</span> </p> - <a class="btn-balance"> - 结算 - </a> </div> diff --git a/template/m.yohobuy.com/partials/cart/chose-panel.phtml b/template/m.yohobuy.com/partials/cart/chose-panel.phtml index 3bf4b93..99420a7 100644 --- a/template/m.yohobuy.com/partials/cart/chose-panel.phtml +++ b/template/m.yohobuy.com/partials/cart/chose-panel.phtml @@ -50,11 +50,11 @@ <span>数量</span> <div class="clearfix"> <a class="btn btn-minus" href="javascript:void(0);"> - <span class="iconfont"></span> + <span class="iconfont {{#if promotionId}}disabled{{/if}}"></span> </a> - <input id="good-num" class="good-num" type="text" value="1"> + <input id="good-num" class="good-num {{#if promotionId}}disabled{{/if}}" type="text" value="1" {{#if promotionId}}disabled="true"{{/if}}> <a class="btn btn-plus" href="javascript:void(0);"> - <span class="iconfont"></span> + <span class="iconfont {{#if promotionId}}disabled{{/if}}"></span> </a> </div> <span class="left-num"></span>