@fonixtree/magic-design 2.0.194 → 2.0.195
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/composite-comp/public/components/Location/mobile/index.js +17 -7
- package/es/composite-comp/public/components/Stores/mobile/index.js +17 -7
- package/es/decorator/compositeDecorator.js +6 -6
- package/es/mobx/Store.js +4 -1
- package/es/utils/businessUtil.js +1 -1
- package/lib/composite-comp/public/components/Location/mobile/index.js +17 -7
- package/lib/composite-comp/public/components/Stores/mobile/index.js +17 -7
- package/lib/decorator/compositeDecorator.js +6 -6
- package/lib/mobx/Store.js +4 -1
- package/lib/utils/businessUtil.js +1 -1
- package/package.json +1 -1
|
@@ -19,10 +19,10 @@ var _common = require("../../../../../common");
|
|
|
19
19
|
|
|
20
20
|
var _locale = require("../../../../../locale");
|
|
21
21
|
|
|
22
|
-
var _storeUtil = require("../../../../../utils/storeUtil");
|
|
23
|
-
|
|
24
22
|
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
25
23
|
|
|
24
|
+
var _mobx = require("../../../../../mobx");
|
|
25
|
+
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
27
|
|
|
28
28
|
var __extends = void 0 && (void 0).__extends || function () {
|
|
@@ -75,18 +75,28 @@ function (_super) {
|
|
|
75
75
|
function LocationMobile() {
|
|
76
76
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
77
77
|
|
|
78
|
-
_this.state = {
|
|
78
|
+
_this.state = {
|
|
79
|
+
locationInfo: {}
|
|
80
|
+
};
|
|
79
81
|
return _this;
|
|
80
82
|
}
|
|
81
83
|
|
|
82
|
-
LocationMobile.prototype.componentDidMount = function () {
|
|
84
|
+
LocationMobile.prototype.componentDidMount = function () {
|
|
85
|
+
var _this = this;
|
|
86
|
+
|
|
87
|
+
this.distroy = (0, _mobx.autorun)(function () {
|
|
88
|
+
_this.setState({
|
|
89
|
+
locationInfo: _mobx.store.locationInfo
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
};
|
|
83
93
|
|
|
84
94
|
LocationMobile.prototype.render = function () {
|
|
85
95
|
var _a;
|
|
86
96
|
|
|
87
97
|
var panelProps = this.props.panelProps;
|
|
88
|
-
var
|
|
89
|
-
var customerInfo =
|
|
98
|
+
var locationInfo = this.state.locationInfo;
|
|
99
|
+
var customerInfo = locationInfo.customer ? locationInfo.customer + " " + locationInfo.tel : (0, _locale.i18n)('CAN_BE_ADDED_AS_YOUR_ADDRESS');
|
|
90
100
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
91
101
|
className: (0, _classnames["default"])('m-location-mobile', (_a = {}, _a['reversed-layout'] = (0, _commonUtil.needReverse)(), _a))
|
|
92
102
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -108,7 +118,7 @@ function (_super) {
|
|
|
108
118
|
}, panelProps.content.address.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
109
119
|
className: "address one_row",
|
|
110
120
|
data: __assign(__assign({}, panelProps.content.address), {
|
|
111
|
-
text: (0, _coreUtil.isDesignMode)() ? (0, _locale.i18n)('DISPLAY_LOCATION_ADDRESS') :
|
|
121
|
+
text: (0, _coreUtil.isDesignMode)() ? (0, _locale.i18n)('DISPLAY_LOCATION_ADDRESS') : locationInfo.address
|
|
112
122
|
})
|
|
113
123
|
}), panelProps.content.customer.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
114
124
|
className: "customer one_row",
|
|
@@ -19,7 +19,7 @@ var _commonUtil = require("../../../../../utils/commonUtil");
|
|
|
19
19
|
|
|
20
20
|
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _mobx = require("../../../../../mobx");
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
25
|
|
|
@@ -239,7 +239,8 @@ function (_super) {
|
|
|
239
239
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
240
240
|
|
|
241
241
|
_this.state = {
|
|
242
|
-
list: []
|
|
242
|
+
list: [],
|
|
243
|
+
locationInfo: {}
|
|
243
244
|
};
|
|
244
245
|
_this.sourceType = '1';
|
|
245
246
|
_this.maxProdNum = 5;
|
|
@@ -247,7 +248,7 @@ function (_super) {
|
|
|
247
248
|
|
|
248
249
|
_this.getData = function () {
|
|
249
250
|
return __awaiter(_this, void 0, void 0, function () {
|
|
250
|
-
var _a, maxProdNum, sourceType, storeIds, params,
|
|
251
|
+
var _a, maxProdNum, sourceType, storeIds, params, locationInfo, res, list;
|
|
251
252
|
|
|
252
253
|
var _b;
|
|
253
254
|
|
|
@@ -271,11 +272,11 @@ function (_super) {
|
|
|
271
272
|
}
|
|
272
273
|
|
|
273
274
|
if ((0, _commonUtil.isLogin)()) {
|
|
274
|
-
|
|
275
|
+
locationInfo = this.state.locationInfo;
|
|
275
276
|
|
|
276
|
-
if (
|
|
277
|
-
params.longitude =
|
|
278
|
-
params.latitude =
|
|
277
|
+
if (locationInfo.longitude && locationInfo.latitude) {
|
|
278
|
+
params.longitude = locationInfo.longitude;
|
|
279
|
+
params.latitude = locationInfo.latitude;
|
|
279
280
|
}
|
|
280
281
|
}
|
|
281
282
|
|
|
@@ -301,7 +302,16 @@ function (_super) {
|
|
|
301
302
|
}
|
|
302
303
|
|
|
303
304
|
Mobile.prototype.componentDidMount = function () {
|
|
305
|
+
var _this = this;
|
|
306
|
+
|
|
304
307
|
this.getData();
|
|
308
|
+
this.distroy = (0, _mobx.autorun)(function () {
|
|
309
|
+
_this.setState({
|
|
310
|
+
locationInfo: _mobx.store.locationInfo
|
|
311
|
+
}, function () {
|
|
312
|
+
_this.getData();
|
|
313
|
+
});
|
|
314
|
+
});
|
|
305
315
|
};
|
|
306
316
|
|
|
307
317
|
Mobile.prototype.componentWillReceiveProps = function (nextProps) {
|
|
@@ -89,21 +89,21 @@ function compositeDecorator(WrappedComponent) {
|
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
_this.switchLanguage = function (value) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
(0, _storeUtil.setStore)(_constants.STORAGE_KEY.LOCALE, value);
|
|
92
|
+
// const lang = 'ar';
|
|
93
|
+
(0, _storeUtil.setStore)(_constants.STORAGE_KEY.LOCALE, value); // 实时更新问题待优化;
|
|
95
94
|
};
|
|
96
95
|
|
|
97
96
|
_this.getUserAddress = function (value) {
|
|
98
|
-
|
|
97
|
+
// const info = {
|
|
99
98
|
// address: '简短地址',
|
|
100
99
|
// customer: '客户名称',
|
|
101
100
|
// tel: '客户手机号',
|
|
102
101
|
// longitude: '经度',
|
|
103
102
|
// latitude: '纬度',
|
|
104
103
|
// };
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
_mobx.store.setState({
|
|
105
|
+
locationInfo: value || {}
|
|
106
|
+
});
|
|
107
107
|
}; // 复合组件点击事件
|
|
108
108
|
|
|
109
109
|
|
package/es/mobx/Store.js
CHANGED
|
@@ -12,7 +12,7 @@ var _storeUtil = require("../utils/storeUtil");
|
|
|
12
12
|
var debug = require('debug')('worker:mobx');
|
|
13
13
|
|
|
14
14
|
var CACHE_KEY = 'STORE';
|
|
15
|
-
var whiteList = ['hoveredMeta', 'clickedMeta', 'clickedGroup', 'clickedFloor', 'hoveredFloor', 'textSelection', 'MPageData'];
|
|
15
|
+
var whiteList = ['hoveredMeta', 'clickedMeta', 'clickedGroup', 'clickedFloor', 'hoveredFloor', 'textSelection', 'MPageData', 'locationInfo'];
|
|
16
16
|
|
|
17
17
|
var Store =
|
|
18
18
|
/** @class */
|
|
@@ -36,6 +36,8 @@ function () {
|
|
|
36
36
|
|
|
37
37
|
this.imgGenVisible = false; // 图片生成器是否可见
|
|
38
38
|
|
|
39
|
+
this.locationInfo = {}; // 地址组件暂存数据
|
|
40
|
+
|
|
39
41
|
(0, _mobx.makeObservable)(this, {
|
|
40
42
|
MPageData: _mobx.observable,
|
|
41
43
|
hoveredMeta: _mobx.observable,
|
|
@@ -45,6 +47,7 @@ function () {
|
|
|
45
47
|
hoveredFloor: _mobx.observable,
|
|
46
48
|
CarouselStore: _mobx.observable,
|
|
47
49
|
imgGenVisible: _mobx.observable,
|
|
50
|
+
locationInfo: _mobx.observable,
|
|
48
51
|
setState: _mobx.action.bound
|
|
49
52
|
});
|
|
50
53
|
}
|
package/es/utils/businessUtil.js
CHANGED
|
@@ -19,10 +19,10 @@ var _common = require("../../../../../common");
|
|
|
19
19
|
|
|
20
20
|
var _locale = require("../../../../../locale");
|
|
21
21
|
|
|
22
|
-
var _storeUtil = require("../../../../../utils/storeUtil");
|
|
23
|
-
|
|
24
22
|
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
25
23
|
|
|
24
|
+
var _mobx = require("../../../../../mobx");
|
|
25
|
+
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
27
|
|
|
28
28
|
var __extends = void 0 && (void 0).__extends || function () {
|
|
@@ -75,18 +75,28 @@ function (_super) {
|
|
|
75
75
|
function LocationMobile() {
|
|
76
76
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
77
77
|
|
|
78
|
-
_this.state = {
|
|
78
|
+
_this.state = {
|
|
79
|
+
locationInfo: {}
|
|
80
|
+
};
|
|
79
81
|
return _this;
|
|
80
82
|
}
|
|
81
83
|
|
|
82
|
-
LocationMobile.prototype.componentDidMount = function () {
|
|
84
|
+
LocationMobile.prototype.componentDidMount = function () {
|
|
85
|
+
var _this = this;
|
|
86
|
+
|
|
87
|
+
this.distroy = (0, _mobx.autorun)(function () {
|
|
88
|
+
_this.setState({
|
|
89
|
+
locationInfo: _mobx.store.locationInfo
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
};
|
|
83
93
|
|
|
84
94
|
LocationMobile.prototype.render = function () {
|
|
85
95
|
var _a;
|
|
86
96
|
|
|
87
97
|
var panelProps = this.props.panelProps;
|
|
88
|
-
var
|
|
89
|
-
var customerInfo =
|
|
98
|
+
var locationInfo = this.state.locationInfo;
|
|
99
|
+
var customerInfo = locationInfo.customer ? locationInfo.customer + " " + locationInfo.tel : (0, _locale.i18n)('CAN_BE_ADDED_AS_YOUR_ADDRESS');
|
|
90
100
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
91
101
|
className: (0, _classnames["default"])('m-location-mobile', (_a = {}, _a['reversed-layout'] = (0, _commonUtil.needReverse)(), _a))
|
|
92
102
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -108,7 +118,7 @@ function (_super) {
|
|
|
108
118
|
}, panelProps.content.address.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
109
119
|
className: "address one_row",
|
|
110
120
|
data: __assign(__assign({}, panelProps.content.address), {
|
|
111
|
-
text: (0, _coreUtil.isDesignMode)() ? (0, _locale.i18n)('DISPLAY_LOCATION_ADDRESS') :
|
|
121
|
+
text: (0, _coreUtil.isDesignMode)() ? (0, _locale.i18n)('DISPLAY_LOCATION_ADDRESS') : locationInfo.address
|
|
112
122
|
})
|
|
113
123
|
}), panelProps.content.customer.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
114
124
|
className: "customer one_row",
|
|
@@ -19,7 +19,7 @@ var _commonUtil = require("../../../../../utils/commonUtil");
|
|
|
19
19
|
|
|
20
20
|
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _mobx = require("../../../../../mobx");
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
25
|
|
|
@@ -239,7 +239,8 @@ function (_super) {
|
|
|
239
239
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
240
240
|
|
|
241
241
|
_this.state = {
|
|
242
|
-
list: []
|
|
242
|
+
list: [],
|
|
243
|
+
locationInfo: {}
|
|
243
244
|
};
|
|
244
245
|
_this.sourceType = '1';
|
|
245
246
|
_this.maxProdNum = 5;
|
|
@@ -247,7 +248,7 @@ function (_super) {
|
|
|
247
248
|
|
|
248
249
|
_this.getData = function () {
|
|
249
250
|
return __awaiter(_this, void 0, void 0, function () {
|
|
250
|
-
var _a, maxProdNum, sourceType, storeIds, params,
|
|
251
|
+
var _a, maxProdNum, sourceType, storeIds, params, locationInfo, res, list;
|
|
251
252
|
|
|
252
253
|
var _b;
|
|
253
254
|
|
|
@@ -271,11 +272,11 @@ function (_super) {
|
|
|
271
272
|
}
|
|
272
273
|
|
|
273
274
|
if ((0, _commonUtil.isLogin)()) {
|
|
274
|
-
|
|
275
|
+
locationInfo = this.state.locationInfo;
|
|
275
276
|
|
|
276
|
-
if (
|
|
277
|
-
params.longitude =
|
|
278
|
-
params.latitude =
|
|
277
|
+
if (locationInfo.longitude && locationInfo.latitude) {
|
|
278
|
+
params.longitude = locationInfo.longitude;
|
|
279
|
+
params.latitude = locationInfo.latitude;
|
|
279
280
|
}
|
|
280
281
|
}
|
|
281
282
|
|
|
@@ -301,7 +302,16 @@ function (_super) {
|
|
|
301
302
|
}
|
|
302
303
|
|
|
303
304
|
Mobile.prototype.componentDidMount = function () {
|
|
305
|
+
var _this = this;
|
|
306
|
+
|
|
304
307
|
this.getData();
|
|
308
|
+
this.distroy = (0, _mobx.autorun)(function () {
|
|
309
|
+
_this.setState({
|
|
310
|
+
locationInfo: _mobx.store.locationInfo
|
|
311
|
+
}, function () {
|
|
312
|
+
_this.getData();
|
|
313
|
+
});
|
|
314
|
+
});
|
|
305
315
|
};
|
|
306
316
|
|
|
307
317
|
Mobile.prototype.componentWillReceiveProps = function (nextProps) {
|
|
@@ -89,21 +89,21 @@ function compositeDecorator(WrappedComponent) {
|
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
_this.switchLanguage = function (value) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
(0, _storeUtil.setStore)(_constants.STORAGE_KEY.LOCALE, value);
|
|
92
|
+
// const lang = 'ar';
|
|
93
|
+
(0, _storeUtil.setStore)(_constants.STORAGE_KEY.LOCALE, value); // 实时更新问题待优化;
|
|
95
94
|
};
|
|
96
95
|
|
|
97
96
|
_this.getUserAddress = function (value) {
|
|
98
|
-
|
|
97
|
+
// const info = {
|
|
99
98
|
// address: '简短地址',
|
|
100
99
|
// customer: '客户名称',
|
|
101
100
|
// tel: '客户手机号',
|
|
102
101
|
// longitude: '经度',
|
|
103
102
|
// latitude: '纬度',
|
|
104
103
|
// };
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
_mobx.store.setState({
|
|
105
|
+
locationInfo: value || {}
|
|
106
|
+
});
|
|
107
107
|
}; // 复合组件点击事件
|
|
108
108
|
|
|
109
109
|
|
package/lib/mobx/Store.js
CHANGED
|
@@ -12,7 +12,7 @@ var _storeUtil = require("../utils/storeUtil");
|
|
|
12
12
|
var debug = require('debug')('worker:mobx');
|
|
13
13
|
|
|
14
14
|
var CACHE_KEY = 'STORE';
|
|
15
|
-
var whiteList = ['hoveredMeta', 'clickedMeta', 'clickedGroup', 'clickedFloor', 'hoveredFloor', 'textSelection', 'MPageData'];
|
|
15
|
+
var whiteList = ['hoveredMeta', 'clickedMeta', 'clickedGroup', 'clickedFloor', 'hoveredFloor', 'textSelection', 'MPageData', 'locationInfo'];
|
|
16
16
|
|
|
17
17
|
var Store =
|
|
18
18
|
/** @class */
|
|
@@ -36,6 +36,8 @@ function () {
|
|
|
36
36
|
|
|
37
37
|
this.imgGenVisible = false; // 图片生成器是否可见
|
|
38
38
|
|
|
39
|
+
this.locationInfo = {}; // 地址组件暂存数据
|
|
40
|
+
|
|
39
41
|
(0, _mobx.makeObservable)(this, {
|
|
40
42
|
MPageData: _mobx.observable,
|
|
41
43
|
hoveredMeta: _mobx.observable,
|
|
@@ -45,6 +47,7 @@ function () {
|
|
|
45
47
|
hoveredFloor: _mobx.observable,
|
|
46
48
|
CarouselStore: _mobx.observable,
|
|
47
49
|
imgGenVisible: _mobx.observable,
|
|
50
|
+
locationInfo: _mobx.observable,
|
|
48
51
|
setState: _mobx.action.bound
|
|
49
52
|
});
|
|
50
53
|
}
|