Index: ssts-web/src/main/webapp/dx-disinfectsystem/css/common/dingxiang-common.css =================================================================== diff -u -r24526 -r24551 --- ssts-web/src/main/webapp/dx-disinfectsystem/css/common/dingxiang-common.css (.../dingxiang-common.css) (revision 24526) +++ ssts-web/src/main/webapp/dx-disinfectsystem/css/common/dingxiang-common.css (.../dingxiang-common.css) (revision 24551) @@ -145,4 +145,13 @@ display:block; } +/* 数字增减框-customer begin */ +.gw_num{border: 1px solid #dbdbdb;width: 110px;line-height: 26px;overflow: hidden;} + .gw_num em{display: block;height: 26px;width: 31px;float: left;color: #7A7979;border-right: 1px solid #dbdbdb;text-align: center;cursor: pointer;font-style:normal;} + .gw_num .num{display: block;float: left;text-align: center;width: 42px;font-style: normal;font-size: 14px;line-height: 24px;border: 0;} + .gw_num em.add{float: right;border-right: 0;border-left: 1px solid #dbdbdb;} +/* 数字增减框-customer end */ + + + Index: ssts-web/src/main/webapp/dx-disinfectsystem/plugins/customer/spinner/spinner.js =================================================================== diff -u --- ssts-web/src/main/webapp/dx-disinfectsystem/plugins/customer/spinner/spinner.js (revision 0) +++ ssts-web/src/main/webapp/dx-disinfectsystem/plugins/customer/spinner/spinner.js (revision 24551) @@ -0,0 +1,48 @@ +;(function($){ + function init(option){ + this.option = option; + setDom(this); + setEvent(this); + } + + function setDom(el){ + var html = '
' + +' -' + +' ' + +' +' + +'
'; + + $(el).append(html); + } + + function setEvent(el){ + + var inp = $(el).find(".num"); + + $(el).find(".minus").on("click",function(){ + if($(inp).val() != "" && parseInt($(inp).val(), 10) > 0){ + $(inp).val(parseInt($(inp).val(), 10) - 1); + } + }); + + $(el).find(".add").on("click",function(){ + if($(inp).val() == "" ){ + $(inp).val(0); + } + $(inp).val(parseInt($(inp).val(), 10) + 1); + }); + + $(inp).on('keydown',function(e){ + var k = e.keyCode; + if ((k <= 57 && k >= 48) || (k <= 105 && k >= 96) || (k== 8)){ + return true; + } else { + return false; + } + }); + + } + + $.fn.extend({spinner:init}); + +})(jQuery)