@fonixtree/magic-design 1.0.60 → 1.0.62
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/es/common/CountDown/index.js +20 -11
- package/es/common/CropperModal/index.js +3 -3
- package/es/common/CropperModal/{index.module.less → index.less} +2 -0
- package/es/utils/commonUtil.js +7 -4
- package/lib/common/CountDown/index.js +20 -11
- package/lib/common/CropperModal/index.js +3 -3
- package/lib/common/CropperModal/{index.module.less → index.less} +2 -0
- package/lib/utils/commonUtil.js +7 -4
- package/package.json +1 -1
|
@@ -57,9 +57,11 @@ function (_super) {
|
|
|
57
57
|
hour: '00',
|
|
58
58
|
min: '00',
|
|
59
59
|
second: '00',
|
|
60
|
-
nowTime: _this.props.now
|
|
60
|
+
nowTime: Number(_this.props.now),
|
|
61
|
+
now: _this.props.now
|
|
61
62
|
};
|
|
62
63
|
_this.timer = null;
|
|
64
|
+
_this.preTime = '';
|
|
63
65
|
|
|
64
66
|
_this.componentWillUnmount = function () {
|
|
65
67
|
_this.clearTimer();
|
|
@@ -112,19 +114,26 @@ function (_super) {
|
|
|
112
114
|
return _this;
|
|
113
115
|
}
|
|
114
116
|
|
|
115
|
-
CountDown.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
CountDown.getDerivedStateFromProps = function (nextProps, prevState) {
|
|
118
|
+
// 检查是否需要更新sortType
|
|
119
|
+
if (nextProps.now !== prevState.now) {
|
|
120
|
+
return {
|
|
121
|
+
now: nextProps.now,
|
|
120
122
|
nowTime: nextProps.now
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return null;
|
|
127
|
+
};
|
|
123
128
|
|
|
124
|
-
|
|
129
|
+
CountDown.prototype.componentDidUpdate = function () {
|
|
130
|
+
var now = this.state.now;
|
|
125
131
|
|
|
126
|
-
|
|
127
|
-
|
|
132
|
+
if (this.preTime != now) {
|
|
133
|
+
this.preTime = now;
|
|
134
|
+
this.clearTimer();
|
|
135
|
+
this.calcLastTime();
|
|
136
|
+
this.timer = setInterval(this.calcLastTime, 1000);
|
|
128
137
|
}
|
|
129
138
|
};
|
|
130
139
|
|
|
@@ -13,7 +13,7 @@ var _reactCropper = _interopRequireDefault(require("react-cropper"));
|
|
|
13
13
|
|
|
14
14
|
require("cropperjs/dist/cropper.css");
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
require("./index.less");
|
|
17
17
|
|
|
18
18
|
var _locale = require("../../locale");
|
|
19
19
|
|
|
@@ -99,7 +99,7 @@ function (_super) {
|
|
|
99
99
|
var _this = this;
|
|
100
100
|
|
|
101
101
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
102
|
-
className:
|
|
102
|
+
className: "cropperModalWrap"
|
|
103
103
|
}, /*#__PURE__*/_react["default"].createElement(_reactCropper["default"], {
|
|
104
104
|
aspectRatio: 1,
|
|
105
105
|
className: "company-logo-cropper",
|
|
@@ -111,7 +111,7 @@ function (_super) {
|
|
|
111
111
|
viewMode: 1,
|
|
112
112
|
zoomable: false
|
|
113
113
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
114
|
-
className:
|
|
114
|
+
className: "btnWrap"
|
|
115
115
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
116
116
|
onClick: this.props.onClose
|
|
117
117
|
}, (0, _locale.i18n)('CANCEL')), /*#__PURE__*/_react["default"].createElement("span", {
|
package/es/utils/commonUtil.js
CHANGED
|
@@ -305,16 +305,19 @@ var navigateTo = function navigateTo(url, state) {
|
|
|
305
305
|
|
|
306
306
|
var _a = url.split(';'),
|
|
307
307
|
h5Url = _a[0],
|
|
308
|
-
appUrl = _a[1];
|
|
308
|
+
appUrl = _a[1];
|
|
309
|
+
|
|
310
|
+
if (appUrl && (0, _androidUtil.browserVersion)().isApp) {
|
|
311
|
+
window.location.href = appUrl;
|
|
312
|
+
} // 未配置App路径并且h5绝对路径时直接跳转,其他情况让业务层处理
|
|
309
313
|
|
|
310
314
|
|
|
311
315
|
if (!appUrl && !h5Url.startsWith('/')) {
|
|
312
316
|
window.location.href = h5Url;
|
|
313
317
|
} else if (window.magicDesign.history) {
|
|
314
|
-
// window.magicDesign.history.push(url);
|
|
315
318
|
window.magicDesign.history.push({
|
|
316
|
-
pathname:
|
|
317
|
-
state:
|
|
319
|
+
pathname: h5Url,
|
|
320
|
+
state: state
|
|
318
321
|
});
|
|
319
322
|
} else if (window.magicDesign.navigatePreUrl) {
|
|
320
323
|
// 预览模式跳转
|
|
@@ -57,9 +57,11 @@ function (_super) {
|
|
|
57
57
|
hour: '00',
|
|
58
58
|
min: '00',
|
|
59
59
|
second: '00',
|
|
60
|
-
nowTime: _this.props.now
|
|
60
|
+
nowTime: Number(_this.props.now),
|
|
61
|
+
now: _this.props.now
|
|
61
62
|
};
|
|
62
63
|
_this.timer = null;
|
|
64
|
+
_this.preTime = '';
|
|
63
65
|
|
|
64
66
|
_this.componentWillUnmount = function () {
|
|
65
67
|
_this.clearTimer();
|
|
@@ -112,19 +114,26 @@ function (_super) {
|
|
|
112
114
|
return _this;
|
|
113
115
|
}
|
|
114
116
|
|
|
115
|
-
CountDown.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
CountDown.getDerivedStateFromProps = function (nextProps, prevState) {
|
|
118
|
+
// 检查是否需要更新sortType
|
|
119
|
+
if (nextProps.now !== prevState.now) {
|
|
120
|
+
return {
|
|
121
|
+
now: nextProps.now,
|
|
120
122
|
nowTime: nextProps.now
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return null;
|
|
127
|
+
};
|
|
123
128
|
|
|
124
|
-
|
|
129
|
+
CountDown.prototype.componentDidUpdate = function () {
|
|
130
|
+
var now = this.state.now;
|
|
125
131
|
|
|
126
|
-
|
|
127
|
-
|
|
132
|
+
if (this.preTime != now) {
|
|
133
|
+
this.preTime = now;
|
|
134
|
+
this.clearTimer();
|
|
135
|
+
this.calcLastTime();
|
|
136
|
+
this.timer = setInterval(this.calcLastTime, 1000);
|
|
128
137
|
}
|
|
129
138
|
};
|
|
130
139
|
|
|
@@ -13,7 +13,7 @@ var _reactCropper = _interopRequireDefault(require("react-cropper"));
|
|
|
13
13
|
|
|
14
14
|
require("cropperjs/dist/cropper.css");
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
require("./index.less");
|
|
17
17
|
|
|
18
18
|
var _locale = require("../../locale");
|
|
19
19
|
|
|
@@ -99,7 +99,7 @@ function (_super) {
|
|
|
99
99
|
var _this = this;
|
|
100
100
|
|
|
101
101
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
102
|
-
className:
|
|
102
|
+
className: "cropperModalWrap"
|
|
103
103
|
}, /*#__PURE__*/_react["default"].createElement(_reactCropper["default"], {
|
|
104
104
|
aspectRatio: 1,
|
|
105
105
|
className: "company-logo-cropper",
|
|
@@ -111,7 +111,7 @@ function (_super) {
|
|
|
111
111
|
viewMode: 1,
|
|
112
112
|
zoomable: false
|
|
113
113
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
114
|
-
className:
|
|
114
|
+
className: "btnWrap"
|
|
115
115
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
116
116
|
onClick: this.props.onClose
|
|
117
117
|
}, (0, _locale.i18n)('CANCEL')), /*#__PURE__*/_react["default"].createElement("span", {
|
package/lib/utils/commonUtil.js
CHANGED
|
@@ -305,16 +305,19 @@ var navigateTo = function navigateTo(url, state) {
|
|
|
305
305
|
|
|
306
306
|
var _a = url.split(';'),
|
|
307
307
|
h5Url = _a[0],
|
|
308
|
-
appUrl = _a[1];
|
|
308
|
+
appUrl = _a[1];
|
|
309
|
+
|
|
310
|
+
if (appUrl && (0, _androidUtil.browserVersion)().isApp) {
|
|
311
|
+
window.location.href = appUrl;
|
|
312
|
+
} // 未配置App路径并且h5绝对路径时直接跳转,其他情况让业务层处理
|
|
309
313
|
|
|
310
314
|
|
|
311
315
|
if (!appUrl && !h5Url.startsWith('/')) {
|
|
312
316
|
window.location.href = h5Url;
|
|
313
317
|
} else if (window.magicDesign.history) {
|
|
314
|
-
// window.magicDesign.history.push(url);
|
|
315
318
|
window.magicDesign.history.push({
|
|
316
|
-
pathname:
|
|
317
|
-
state:
|
|
319
|
+
pathname: h5Url,
|
|
320
|
+
state: state
|
|
318
321
|
});
|
|
319
322
|
} else if (window.magicDesign.navigatePreUrl) {
|
|
320
323
|
// 预览模式跳转
|