easy3wmui 0.0.43-beta2 → 0.0.43-beta3
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/lib/Easy3wMPagination/index.js +40 -24
- package/package.json +1 -1
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
|
|
5
|
+
var _toast = require('antd-mobile/es/components/toast');
|
|
6
|
+
|
|
7
|
+
var _toast2 = _interopRequireDefault(_toast);
|
|
8
|
+
|
|
5
9
|
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
6
10
|
|
|
7
11
|
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
@@ -20,6 +24,8 @@ var _react2 = _interopRequireDefault(_react);
|
|
|
20
24
|
|
|
21
25
|
var _dva = require('dva');
|
|
22
26
|
|
|
27
|
+
var _antdMobile = require('antd-mobile');
|
|
28
|
+
|
|
23
29
|
var _antdMobileIcons = require('antd-mobile-icons');
|
|
24
30
|
|
|
25
31
|
var _Easy3wMCard = require('../Easy3wMCard');
|
|
@@ -37,33 +43,43 @@ var Easy3wMPagination = function (_PureComponent) {
|
|
|
37
43
|
var _this = (0, _possibleConstructorReturn3['default'])(this, _PureComponent.call(this, props));
|
|
38
44
|
|
|
39
45
|
_this.onChange = function (num, notFetchFlag) {
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
var globalLoading = _this.props.loading.global;
|
|
47
|
+
if (globalLoading) {
|
|
48
|
+
_toast2['default'].show({
|
|
49
|
+
icon: 'loading',
|
|
50
|
+
content: '正在后台处理,请稍后!',
|
|
51
|
+
duration: 3000
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
// func(e);
|
|
55
|
+
var _this$props = _this.props,
|
|
56
|
+
intData = _this$props.intData,
|
|
57
|
+
touchFetch = _this$props.touchFetch;
|
|
43
58
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
59
|
+
var intTotalPage = Math.ceil(intData / 10);
|
|
60
|
+
// const intTotalPage = 99999;
|
|
61
|
+
var offset = _this.state.offset;
|
|
47
62
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
if (offset < 1) {
|
|
54
|
-
offset = 1;
|
|
55
|
-
} else if (offset > intTotalPage) {
|
|
56
|
-
offset = intTotalPage;
|
|
57
|
-
}
|
|
58
|
-
_this.setState({
|
|
59
|
-
offset: offset // 当前页
|
|
60
|
-
}, function () {
|
|
61
|
-
if (notFetchFlag) {// true 不查询 false 查询
|
|
62
|
-
// 不查询
|
|
63
|
-
} else if (touchFetch && typeof touchFetch === 'function') {
|
|
64
|
-
touchFetch();
|
|
63
|
+
if (typeof num === 'string') {
|
|
64
|
+
offset += Number(num);
|
|
65
|
+
} else {
|
|
66
|
+
offset = num;
|
|
65
67
|
}
|
|
66
|
-
|
|
68
|
+
if (offset < 1) {
|
|
69
|
+
offset = 1;
|
|
70
|
+
} else if (offset > intTotalPage) {
|
|
71
|
+
offset = intTotalPage;
|
|
72
|
+
}
|
|
73
|
+
_this.setState({
|
|
74
|
+
offset: offset // 当前页
|
|
75
|
+
}, function () {
|
|
76
|
+
if (notFetchFlag) {// true 不查询 false 查询
|
|
77
|
+
// 不查询
|
|
78
|
+
} else if (touchFetch && typeof touchFetch === 'function') {
|
|
79
|
+
touchFetch();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
67
83
|
};
|
|
68
84
|
|
|
69
85
|
_this.touchCreatePageNum = function (intTotalPage, offset, index) {
|