@gm-mobile/react 1.1.4-alpha.1 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gm-mobile/react",
|
|
3
|
-
"version": "1.1.4
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "liyatang <liyatang@qq.com>",
|
|
6
6
|
"homepage": "https://github.com/gmfe/gm-mobile#readme",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@gm-common/number": "^2.2.9",
|
|
29
29
|
"@gm-common/tool": "^2.2.9",
|
|
30
|
-
"@gm-mobile/locales": "^1.1.4
|
|
30
|
+
"@gm-mobile/locales": "^1.1.4",
|
|
31
31
|
"classnames": "^2.2.6"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "cb93e88b78cfb93da3491f7b377ef265809b0cf5"
|
|
34
34
|
}
|
|
@@ -4,6 +4,8 @@ import PropTypes from 'prop-types'
|
|
|
4
4
|
import _ from 'lodash'
|
|
5
5
|
import Big from 'big.js'
|
|
6
6
|
|
|
7
|
+
import { t } from 'gm-i18n'
|
|
8
|
+
import Toast from '@gm-mobile/react/src/component/toast'
|
|
7
9
|
import { KeyboardWrap } from '../keyboard'
|
|
8
10
|
import SVGPlus from '../../../svg/plus.svg'
|
|
9
11
|
import SVGMinus from '../../../svg/minus.svg'
|
|
@@ -34,7 +36,10 @@ const Counter = ({
|
|
|
34
36
|
// 检验是否超出大小值限制
|
|
35
37
|
const checkValue = (value, type) => {
|
|
36
38
|
if (max && value > max) {
|
|
37
|
-
|
|
39
|
+
Toast.tip({
|
|
40
|
+
children: <div className='m-number-keyboard-msg'>{t('下单数量超出当前库存')}</div>,
|
|
41
|
+
})
|
|
42
|
+
return max
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
if (min && value < min) {
|
|
@@ -59,7 +64,12 @@ const Counter = ({
|
|
|
59
64
|
return
|
|
60
65
|
}
|
|
61
66
|
|
|
62
|
-
if (plusDisabled)
|
|
67
|
+
if (plusDisabled){
|
|
68
|
+
Toast.tip({
|
|
69
|
+
children: <div className='m-number-keyboard-msg'>{t('下单数量超出当前库存')}</div>,
|
|
70
|
+
})
|
|
71
|
+
return
|
|
72
|
+
}
|
|
63
73
|
|
|
64
74
|
// 如果存在最小值,以最小值开始相加
|
|
65
75
|
v = v + 1
|