sen
2026-03-10 933046f7fd7fa9104bc33862951d570d88d7e2df
1
2
3
4
5
6
7
8
9
10
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["uni_modules/uview-ui/components/u-number-box/u-number-box"],{"1b97":function(t,n,e){"use strict";e.r(n);var i=e("5a4ea"),u=e("59f2");for(var s in u)["default"].indexOf(s)<0&&function(t){e.d(n,t,(function(){return u[t]}))}(s);e("c459");var r=e("828b"),o=Object(r["a"])(u["default"],i["b"],i["c"],!1,null,"8e67aeb6",null,!1,i["a"],void 0);n["default"]=o.exports},"30f1":function(t,n,e){},"53a0":function(t,n,e){"use strict";(function(t){var i=e("47a9");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var u=i(e("7ca3")),s=i(e("a6bc"));function r(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,i)}return e}function o(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?r(Object(e),!0).forEach((function(n){(0,u.default)(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):r(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}var a={name:"u-number-box",mixins:[t.$u.mpMixin,t.$u.mixin,s.default],data:function(){return{currentValue:"",longPressTimer:null}},watch:{watchChange:function(t){this.check()},value:function(t){t!==this.currentValue&&(this.currentValue=this.format(this.value))}},computed:{getCursorSpacing:function(){return t.$u.getPx(this.cursorSpacing)},buttonStyle:function(){var n=this;return function(e){var i={backgroundColor:n.bgColor,height:t.$u.addUnit(n.buttonSize),color:n.color};return n.isDisabled(e)&&(i.backgroundColor="#f7f8fa"),i}},inputStyle:function(){this.disabled||this.disabledInput;var n={color:this.color,backgroundColor:this.bgColor,height:t.$u.addUnit(this.buttonSize),width:t.$u.addUnit(this.inputWidth)};return n},watchChange:function(){return[this.integer,this.decimalLength,this.min,this.max]},isDisabled:function(){var t=this;return function(n){return"plus"===n?t.disabled||t.disablePlus||t.currentValue>=t.max:t.disabled||t.disableMinus||t.currentValue<=t.min}}},mounted:function(){this.init()},methods:{init:function(){this.currentValue=this.format(this.value)},format:function(t){return t=this.filter(t),t=""===t?0:+t,t=Math.max(Math.min(this.max,t),this.min),null!==this.decimalLength&&(t=t.toFixed(this.decimalLength)),t},filter:function(t){return t=String(t).replace(/[^0-9.-]/g,""),this.integer&&-1!==t.indexOf(".")&&(t=t.split(".")[0]),t},check:function(){var t=this.format(this.currentValue);t!==this.currentValue&&(this.currentValue=t)},onFocus:function(t){this.$emit("focus",o(o({},t.detail),{},{name:this.name}))},onBlur:function(t){this.format(t.detail.value);this.$emit("blur",o(o({},t.detail),{},{name:this.name}))},onInput:function(t){var n=t.detail||{},e=n.value,i=void 0===e?"":e;if(""!==i){var u=this.filter(i);if(null!==this.decimalLength&&-1!==u.indexOf(".")){var s=u.split(".");u="".concat(s[0],".").concat(s[1].slice(0,this.decimalLength))}u=this.format(u),this.emitChange(u)}},emitChange:function(t){var n=this;this.asyncChange||this.$nextTick((function(){n.$emit("input",t),n.currentValue=t,n.$forceUpdate()})),this.$emit("change",{value:t,name:this.name})},onChange:function(){var t=this.type;if(this.isDisabled(t))return this.$emit("overlimit",t);var n="minus"===t?-this.step:+this.step,e=this.format(this.add(+this.currentValue,n));this.emitChange(e),this.$emit(t)},add:function(t,n){var e=Math.pow(10,10);return Math.round((t+n)*e)/e},clickHandler:function(t){this.type=t,this.onChange()},longPressStep:function(){var t=this;this.clearTimeout(),this.longPressTimer=setTimeout((function(){t.onChange(),t.longPressStep()}),250)},onTouchStart:function(t){var n=this;this.longPress&&(this.clearTimeout(),this.type=t,this.longPressTimer=setTimeout((function(){n.onChange(),n.longPressStep()}),600))},onTouchEnd:function(){this.longPress&&this.clearTimeout()},clearTimeout:function(t){function n(){return t.apply(this,arguments)}return n.toString=function(){return t.toString()},n}((function(){clearTimeout(this.longPressTimer),this.longPressTimer=null}))}};n.default=a}).call(this,e("df3c")["default"])},"59f2":function(t,n,e){"use strict";e.r(n);var i=e("53a0"),u=e.n(i);for(var s in i)["default"].indexOf(s)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(s);n["default"]=u.a},"5a4ea":function(t,n,e){"use strict";e.d(n,"b",(function(){return u})),e.d(n,"c",(function(){return s})),e.d(n,"a",(function(){return i}));var i={uIcon:function(){return Promise.all([e.e("common/vendor"),e.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(e.bind(null,"669e"))}},u=function(){var t=this,n=t.$createElement,e=(t._self._c,t.showMinus&&t.$slots.minus||!t.showMinus?null:t.__get_style([t.buttonStyle("minus")])),i=t.showMinus&&t.$slots.minus||!t.showMinus?null:t.isDisabled("minus"),u=t.showMinus&&t.$slots.minus||!t.showMinus?null:t.isDisabled("minus"),s=t.__get_style([t.inputStyle]),r=t.showPlus&&t.$slots.plus||!t.showPlus?null:t.__get_style([t.buttonStyle("plus")]),o=t.showPlus&&t.$slots.plus||!t.showPlus?null:t.isDisabled("plus"),a=t.showPlus&&t.$slots.plus||!t.showPlus?null:t.isDisabled("plus");t.$mp.data=Object.assign({},{$root:{s0:e,m0:i,m1:u,s1:s,s2:r,m2:o,m3:a}})},s=[]},c459:function(t,n,e){"use strict";var i=e("30f1"),u=e.n(i);u.a}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'uni_modules/uview-ui/components/u-number-box/u-number-box-create-component',
    {
        'uni_modules/uview-ui/components/u-number-box/u-number-box-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('df3c')['createComponent'](__webpack_require__("1b97"))
        })
    },
    [['uni_modules/uview-ui/components/u-number-box/u-number-box-create-component']]
]);