@fonixtree/magic-design 2.0.192 → 2.0.194
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/SelectStoreModal/SortableImageList/index.js +5 -5
- package/es/common/SelectStoreModal/index.js +100 -359
- package/es/common/SelectStoreModal/index.less +1 -1
- package/es/common/StoreSource/index.js +256 -0
- package/es/common/StoreSource/index.less +14 -0
- package/es/common/index.js +8 -0
- package/es/composite-comp/public/components/Location/mobile/index.js +8 -8
- package/es/composite-comp/public/components/Stores/defaultJSON.js +2 -1
- package/es/composite-comp/public/components/Stores/mobile/StoreItem/img/defaultHImg.png +0 -0
- package/es/composite-comp/public/components/Stores/mobile/StoreItem/index.js +9 -7
- package/es/composite-comp/public/components/Stores/mobile/StoreItem/index.less +4 -1
- package/es/composite-comp/public/components/Stores/mobile/index.js +8 -5
- package/es/composite-comp/public/config-panels/StoresConfig/ConfigContent/index.js +15 -2
- package/es/composite-comp/public/config-panels/StoresConfig/ConfigContent/index.less +14 -0
- package/es/locale/ar/ar.json +9 -1
- package/es/locale/en/en.json +9 -1
- package/es/locale/es/es.json +9 -1
- package/es/locale/mn/mn.json +9 -1
- package/es/utils/commonUtil.js +11 -1
- package/lib/common/SelectStoreModal/SortableImageList/index.js +5 -5
- package/lib/common/SelectStoreModal/index.js +100 -359
- package/lib/common/SelectStoreModal/index.less +1 -1
- package/lib/common/StoreSource/index.js +256 -0
- package/lib/common/StoreSource/index.less +14 -0
- package/lib/common/index.js +8 -0
- package/lib/composite-comp/public/components/Location/mobile/index.js +8 -8
- package/lib/composite-comp/public/components/Stores/defaultJSON.js +2 -1
- package/lib/composite-comp/public/components/Stores/mobile/StoreItem/img/defaultHImg.png +0 -0
- package/lib/composite-comp/public/components/Stores/mobile/StoreItem/index.js +9 -7
- package/lib/composite-comp/public/components/Stores/mobile/StoreItem/index.less +4 -1
- package/lib/composite-comp/public/components/Stores/mobile/index.js +8 -5
- package/lib/composite-comp/public/config-panels/StoresConfig/ConfigContent/index.js +15 -2
- package/lib/composite-comp/public/config-panels/StoresConfig/ConfigContent/index.less +14 -0
- package/lib/locale/ar/ar.json +9 -1
- package/lib/locale/en/en.json +9 -1
- package/lib/locale/es/es.json +9 -1
- package/lib/locale/mn/mn.json +9 -1
- package/lib/utils/commonUtil.js +11 -1
- package/package.json +1 -1
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = StoreSource;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _locale = require("../../locale");
|
|
13
|
+
|
|
14
|
+
var _commonUtil = require("../../utils/commonUtil");
|
|
15
|
+
|
|
16
|
+
var _Button = _interopRequireDefault(require("../Button"));
|
|
17
|
+
|
|
18
|
+
require("./index.less");
|
|
19
|
+
|
|
20
|
+
var _SelectStoreModal = _interopRequireDefault(require("../SelectStoreModal"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
28
|
+
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) {
|
|
30
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
31
|
+
resolve(value);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
36
|
+
function fulfilled(value) {
|
|
37
|
+
try {
|
|
38
|
+
step(generator.next(value));
|
|
39
|
+
} catch (e) {
|
|
40
|
+
reject(e);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function rejected(value) {
|
|
45
|
+
try {
|
|
46
|
+
step(generator["throw"](value));
|
|
47
|
+
} catch (e) {
|
|
48
|
+
reject(e);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function step(result) {
|
|
53
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
61
|
+
var _ = {
|
|
62
|
+
label: 0,
|
|
63
|
+
sent: function sent() {
|
|
64
|
+
if (t[0] & 1) throw t[1];
|
|
65
|
+
return t[1];
|
|
66
|
+
},
|
|
67
|
+
trys: [],
|
|
68
|
+
ops: []
|
|
69
|
+
},
|
|
70
|
+
f,
|
|
71
|
+
y,
|
|
72
|
+
t,
|
|
73
|
+
g;
|
|
74
|
+
return g = {
|
|
75
|
+
next: verb(0),
|
|
76
|
+
"throw": verb(1),
|
|
77
|
+
"return": verb(2)
|
|
78
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
79
|
+
return this;
|
|
80
|
+
}), g;
|
|
81
|
+
|
|
82
|
+
function verb(n) {
|
|
83
|
+
return function (v) {
|
|
84
|
+
return step([n, v]);
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function step(op) {
|
|
89
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
90
|
+
|
|
91
|
+
while (_) {
|
|
92
|
+
try {
|
|
93
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
94
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
95
|
+
|
|
96
|
+
switch (op[0]) {
|
|
97
|
+
case 0:
|
|
98
|
+
case 1:
|
|
99
|
+
t = op;
|
|
100
|
+
break;
|
|
101
|
+
|
|
102
|
+
case 4:
|
|
103
|
+
_.label++;
|
|
104
|
+
return {
|
|
105
|
+
value: op[1],
|
|
106
|
+
done: false
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
case 5:
|
|
110
|
+
_.label++;
|
|
111
|
+
y = op[1];
|
|
112
|
+
op = [0];
|
|
113
|
+
continue;
|
|
114
|
+
|
|
115
|
+
case 7:
|
|
116
|
+
op = _.ops.pop();
|
|
117
|
+
|
|
118
|
+
_.trys.pop();
|
|
119
|
+
|
|
120
|
+
continue;
|
|
121
|
+
|
|
122
|
+
default:
|
|
123
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
124
|
+
_ = 0;
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
129
|
+
_.label = op[1];
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
134
|
+
_.label = t[1];
|
|
135
|
+
t = op;
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (t && _.label < t[2]) {
|
|
140
|
+
_.label = t[2];
|
|
141
|
+
|
|
142
|
+
_.ops.push(op);
|
|
143
|
+
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (t[2]) _.ops.pop();
|
|
148
|
+
|
|
149
|
+
_.trys.pop();
|
|
150
|
+
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
op = body.call(thisArg, _);
|
|
155
|
+
} catch (e) {
|
|
156
|
+
op = [6, e];
|
|
157
|
+
y = 0;
|
|
158
|
+
} finally {
|
|
159
|
+
f = t = 0;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (op[0] & 5) throw op[1];
|
|
164
|
+
return {
|
|
165
|
+
value: op[0] ? op[1] : void 0,
|
|
166
|
+
done: true
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
function StoreSource(_a) {
|
|
172
|
+
var _this = this;
|
|
173
|
+
|
|
174
|
+
var value = _a.value,
|
|
175
|
+
onChange = _a.onChange;
|
|
176
|
+
|
|
177
|
+
var _b = (0, _react.useState)([]),
|
|
178
|
+
selectedStores = _b[0],
|
|
179
|
+
setSelectedStores = _b[1];
|
|
180
|
+
|
|
181
|
+
var _c = (0, _react.useState)(false),
|
|
182
|
+
visible = _c[0],
|
|
183
|
+
setVisbile = _c[1];
|
|
184
|
+
|
|
185
|
+
var onSelectProduct = function onSelectProduct() {
|
|
186
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
187
|
+
var res;
|
|
188
|
+
return __generator(this, function (_a) {
|
|
189
|
+
switch (_a.label) {
|
|
190
|
+
case 0:
|
|
191
|
+
if (!(value && value.length > 0)) return [3
|
|
192
|
+
/*break*/
|
|
193
|
+
, 2];
|
|
194
|
+
return [4
|
|
195
|
+
/*yield*/
|
|
196
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/list", {
|
|
197
|
+
storeIds: value,
|
|
198
|
+
extOrderType: 1,
|
|
199
|
+
state: 'A'
|
|
200
|
+
}, 'GET')];
|
|
201
|
+
|
|
202
|
+
case 1:
|
|
203
|
+
res = _a.sent();
|
|
204
|
+
setSelectedStores(res || []);
|
|
205
|
+
return [3
|
|
206
|
+
/*break*/
|
|
207
|
+
, 3];
|
|
208
|
+
|
|
209
|
+
case 2:
|
|
210
|
+
setSelectedStores([]);
|
|
211
|
+
_a.label = 3;
|
|
212
|
+
|
|
213
|
+
case 3:
|
|
214
|
+
setVisbile(true);
|
|
215
|
+
return [2
|
|
216
|
+
/*return*/
|
|
217
|
+
];
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
var handleModalSave = function handleModalSave(list) {
|
|
224
|
+
var ids = list.map(function (prod) {
|
|
225
|
+
return prod.storeId;
|
|
226
|
+
}).join(',');
|
|
227
|
+
onChange(ids);
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
var getLength = function getLength() {
|
|
231
|
+
if (!value) {
|
|
232
|
+
return 0;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return value.split(',').length;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
239
|
+
className: "storeSourceWrap"
|
|
240
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
241
|
+
onClick: onSelectProduct,
|
|
242
|
+
type: "primary"
|
|
243
|
+
}, (0, _locale.i18n)('SELECT_STORE')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
244
|
+
className: "total"
|
|
245
|
+
}, (0, _locale.i18n)('TOTAL_STORES', {
|
|
246
|
+
count: getLength()
|
|
247
|
+
})), visible && /*#__PURE__*/_react["default"].createElement(_SelectStoreModal["default"], {
|
|
248
|
+
closeModal: function closeModal() {
|
|
249
|
+
return setVisbile(false);
|
|
250
|
+
},
|
|
251
|
+
defaultList: selectedStores,
|
|
252
|
+
handleModalSave: handleModalSave,
|
|
253
|
+
maxSelect: 100,
|
|
254
|
+
visible: visible
|
|
255
|
+
}));
|
|
256
|
+
}
|
package/lib/common/index.js
CHANGED
|
@@ -135,6 +135,12 @@ Object.defineProperty(exports, "Slider", {
|
|
|
135
135
|
return _Slider["default"];
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
|
+
Object.defineProperty(exports, "StoreSource", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function get() {
|
|
141
|
+
return _StoreSource["default"];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
138
144
|
Object.defineProperty(exports, "SwiperBan", {
|
|
139
145
|
enumerable: true,
|
|
140
146
|
get: function get() {
|
|
@@ -204,6 +210,8 @@ var _ButtonIconLayout = _interopRequireDefault(require("./ButtonIconLayout"));
|
|
|
204
210
|
|
|
205
211
|
var _ProductSource = _interopRequireDefault(require("./ProductSource"));
|
|
206
212
|
|
|
213
|
+
var _StoreSource = _interopRequireDefault(require("./StoreSource"));
|
|
214
|
+
|
|
207
215
|
var _ImgArea = _interopRequireDefault(require("./ImgArea"));
|
|
208
216
|
|
|
209
217
|
var _SystemNotification = _interopRequireDefault(require("./SystemNotification"));
|
|
@@ -67,21 +67,21 @@ var __assign = void 0 && (void 0).__assign || function () {
|
|
|
67
67
|
return __assign.apply(this, arguments);
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
var
|
|
70
|
+
var LocationMobile =
|
|
71
71
|
/** @class */
|
|
72
72
|
function (_super) {
|
|
73
|
-
__extends(
|
|
73
|
+
__extends(LocationMobile, _super);
|
|
74
74
|
|
|
75
|
-
function
|
|
75
|
+
function LocationMobile() {
|
|
76
76
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
77
77
|
|
|
78
78
|
_this.state = {};
|
|
79
79
|
return _this;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
LocationMobile.prototype.componentDidMount = function () {};
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
LocationMobile.prototype.render = function () {
|
|
85
85
|
var _a;
|
|
86
86
|
|
|
87
87
|
var panelProps = this.props.panelProps;
|
|
@@ -123,11 +123,11 @@ function (_super) {
|
|
|
123
123
|
}))));
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
LocationMobile.defaultProps = {
|
|
127
127
|
panelProps: {}
|
|
128
128
|
};
|
|
129
|
-
return
|
|
129
|
+
return LocationMobile;
|
|
130
130
|
}(_react["default"].Component);
|
|
131
131
|
|
|
132
|
-
var _default =
|
|
132
|
+
var _default = LocationMobile;
|
|
133
133
|
exports["default"] = _default;
|
|
Binary file
|
|
@@ -11,6 +11,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
11
11
|
|
|
12
12
|
var _defaultImg = _interopRequireDefault(require("./img/defaultImg.png"));
|
|
13
13
|
|
|
14
|
+
var _defaultHImg = _interopRequireDefault(require("./img/defaultHImg.png"));
|
|
15
|
+
|
|
14
16
|
var _commonUtil = require("../../../../../../utils/commonUtil");
|
|
15
17
|
|
|
16
18
|
var _currencyUtil = require("../../../../../../utils/currencyUtil");
|
|
@@ -123,7 +125,7 @@ function (_super) {
|
|
|
123
125
|
}, /*#__PURE__*/_react["default"].createElement(_common.NewImg, {
|
|
124
126
|
className: "product-img",
|
|
125
127
|
lazy: true,
|
|
126
|
-
src: data.storePosterUrl ||
|
|
128
|
+
src: data.storePosterUrl || _defaultHImg["default"]
|
|
127
129
|
}), freeDeliveryLabel.open && data.freeShipping === 'Y' && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
128
130
|
className: "flag",
|
|
129
131
|
data: freeDeliveryLabel
|
|
@@ -139,7 +141,7 @@ function (_super) {
|
|
|
139
141
|
readonly: true
|
|
140
142
|
}), data.newFlag === 'Y' && /*#__PURE__*/_react["default"].createElement("span", {
|
|
141
143
|
className: "new"
|
|
142
|
-
},
|
|
144
|
+
}, (0, _locale.i18n)('NEW'))), minOrder.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
143
145
|
className: "minOrder no-reversed",
|
|
144
146
|
data: __assign(__assign({}, minOrder), {
|
|
145
147
|
text: (0, _commonUtil.reverseStrArr)([(0, _locale.i18n)('MIN_ORDER'), ':', (data.minOrderAmount || 0) + " IQD"])
|
|
@@ -164,13 +166,13 @@ function (_super) {
|
|
|
164
166
|
}), deliveryTime.open && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
165
167
|
className: "time",
|
|
166
168
|
data: __assign(__assign({}, deliveryTime), {
|
|
167
|
-
text: data.deliveryTime ||
|
|
169
|
+
text: (data.deliveryTime || 17) + " " + (0, _locale.i18n)('MINS')
|
|
168
170
|
}),
|
|
169
171
|
readonly: true
|
|
170
172
|
}), distance.open && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
171
173
|
className: "distance",
|
|
172
174
|
data: __assign(__assign({}, distance), {
|
|
173
|
-
text: data.distance ||
|
|
175
|
+
text: (data.distance || 0) + " " + (0, _locale.i18n)('KM')
|
|
174
176
|
}),
|
|
175
177
|
readonly: true
|
|
176
178
|
})))) : /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
@@ -199,7 +201,7 @@ function (_super) {
|
|
|
199
201
|
readonly: true
|
|
200
202
|
}), data.newFlag === 'Y' && /*#__PURE__*/_react["default"].createElement("span", {
|
|
201
203
|
className: "new"
|
|
202
|
-
},
|
|
204
|
+
}, (0, _locale.i18n)('NEW'))), storeDesc.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
203
205
|
className: "desc",
|
|
204
206
|
data: __assign(__assign({}, storeDesc), {
|
|
205
207
|
text: data.comments
|
|
@@ -234,7 +236,7 @@ function (_super) {
|
|
|
234
236
|
}), deliveryTime.open && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
235
237
|
className: "time",
|
|
236
238
|
data: __assign(__assign({}, deliveryTime), {
|
|
237
|
-
text: data.deliveryTime ||
|
|
239
|
+
text: (data.deliveryTime || 17) + " " + (0, _locale.i18n)('MINS')
|
|
238
240
|
}),
|
|
239
241
|
readonly: true
|
|
240
242
|
}), deliveryTime.open && distance.open && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -242,7 +244,7 @@ function (_super) {
|
|
|
242
244
|
}), distance.open && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
243
245
|
className: "distance",
|
|
244
246
|
data: __assign(__assign({}, distance), {
|
|
245
|
-
text: data.distance ||
|
|
247
|
+
text: (data.distance || 0) + " " + (0, _locale.i18n)('KM')
|
|
246
248
|
}),
|
|
247
249
|
readonly: true
|
|
248
250
|
})))));
|
|
@@ -56,6 +56,9 @@
|
|
|
56
56
|
.m-store-item-wrap .content-wrap .sold {
|
|
57
57
|
width: fit-content !important;
|
|
58
58
|
}
|
|
59
|
+
.m-store-item-wrap .content-wrap .score {
|
|
60
|
+
margin-left: -0.2rem;
|
|
61
|
+
}
|
|
59
62
|
.m-store-item-wrap .content-wrap .row {
|
|
60
63
|
display: flex;
|
|
61
64
|
align-items: center;
|
|
@@ -72,7 +75,7 @@
|
|
|
72
75
|
width: 0.02rem;
|
|
73
76
|
height: 0.24rem;
|
|
74
77
|
background-color: #D9D9D9;
|
|
75
|
-
margin: 0 0.
|
|
78
|
+
margin: 0 0.02rem 0 0.14rem;
|
|
76
79
|
}
|
|
77
80
|
.m-store-item-wrap.horizontal {
|
|
78
81
|
flex-direction: column;
|
|
@@ -243,21 +243,21 @@ function (_super) {
|
|
|
243
243
|
};
|
|
244
244
|
_this.sourceType = '1';
|
|
245
245
|
_this.maxProdNum = 5;
|
|
246
|
+
_this.storeIds = '';
|
|
246
247
|
|
|
247
248
|
_this.getData = function () {
|
|
248
249
|
return __awaiter(_this, void 0, void 0, function () {
|
|
249
|
-
var _a, maxProdNum, sourceType, params, info, res, list;
|
|
250
|
+
var _a, maxProdNum, sourceType, storeIds, params, info, res, list;
|
|
250
251
|
|
|
251
252
|
var _b;
|
|
252
253
|
|
|
253
254
|
return __generator(this, function (_c) {
|
|
254
255
|
switch (_c.label) {
|
|
255
256
|
case 0:
|
|
256
|
-
_a = this.props.panelProps.content, maxProdNum = _a.maxProdNum, sourceType = _a.sourceType;
|
|
257
|
+
_a = this.props.panelProps.content, maxProdNum = _a.maxProdNum, sourceType = _a.sourceType, storeIds = _a.storeIds;
|
|
257
258
|
params = {
|
|
258
259
|
pageIndex: 1,
|
|
259
|
-
pageSize: maxProdNum
|
|
260
|
-
pageTotal: true
|
|
260
|
+
pageSize: maxProdNum
|
|
261
261
|
};
|
|
262
262
|
|
|
263
263
|
if (sourceType === '2') {
|
|
@@ -266,6 +266,8 @@ function (_super) {
|
|
|
266
266
|
params.newFlag = 'Y';
|
|
267
267
|
} else if (sourceType === '4') {
|
|
268
268
|
params.sortType = '1';
|
|
269
|
+
} else if (sourceType === '5') {
|
|
270
|
+
params.storeIdList = (storeIds === null || storeIds === void 0 ? void 0 : storeIds.split(',')) || [];
|
|
269
271
|
}
|
|
270
272
|
|
|
271
273
|
if ((0, _commonUtil.isLogin)()) {
|
|
@@ -303,10 +305,11 @@ function (_super) {
|
|
|
303
305
|
};
|
|
304
306
|
|
|
305
307
|
Mobile.prototype.componentWillReceiveProps = function (nextProps) {
|
|
306
|
-
if (nextProps.panelProps.content.sourceType !== this.sourceType || nextProps.panelProps.content.maxProdNum !== this.maxProdNum) {
|
|
308
|
+
if (nextProps.panelProps.content.sourceType !== this.sourceType || nextProps.panelProps.content.maxProdNum !== this.maxProdNum || nextProps.panelProps.content.storeIds !== this.storeIds) {
|
|
307
309
|
this.getData();
|
|
308
310
|
this.sourceType = nextProps.panelProps.content.sourceType;
|
|
309
311
|
this.maxProdNum = nextProps.panelProps.content.maxProdNum;
|
|
312
|
+
this.storeIds = nextProps.panelProps.content.storeIds;
|
|
310
313
|
}
|
|
311
314
|
};
|
|
312
315
|
|
|
@@ -19,6 +19,8 @@ var _common = require("../../../../../common");
|
|
|
19
19
|
|
|
20
20
|
var _locale = require("../../../../../locale");
|
|
21
21
|
|
|
22
|
+
require("./index.less");
|
|
23
|
+
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
25
|
|
|
24
26
|
var __extends = void 0 && (void 0).__extends || function () {
|
|
@@ -133,7 +135,9 @@ function (_super) {
|
|
|
133
135
|
metaOption: panelProps.distance
|
|
134
136
|
}],
|
|
135
137
|
type: "switch"
|
|
136
|
-
}), /*#__PURE__*/_react["default"].createElement(
|
|
138
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
139
|
+
className: "sourceOfProduct"
|
|
140
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
137
141
|
title: (0, _locale.i18n)('SOURCE_OF_ACTIVITY'),
|
|
138
142
|
topSplit: true
|
|
139
143
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
|
|
@@ -153,7 +157,16 @@ function (_super) {
|
|
|
153
157
|
value: "4"
|
|
154
158
|
}, (0, _locale.i18n)('HIGH_SALES_STORES')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
155
159
|
value: "5"
|
|
156
|
-
}, (0, _locale.i18n)('SELECT_STORES')))), /*#__PURE__*/_react["default"].createElement(
|
|
160
|
+
}, (0, _locale.i18n)('SELECT_STORES')))), panelProps.sourceType === '5' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
161
|
+
className: "greyBg"
|
|
162
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.StoreSource, {
|
|
163
|
+
onChange: function onChange(ids) {
|
|
164
|
+
panelProps.storeIds = ids;
|
|
165
|
+
|
|
166
|
+
_this.reRender();
|
|
167
|
+
},
|
|
168
|
+
value: panelProps.storeIds
|
|
169
|
+
}))), /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
157
170
|
title: (0, _locale.i18n)('PRODUCT_QUANTITY'),
|
|
158
171
|
topSplit: true
|
|
159
172
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Radio.Group, {
|
package/lib/locale/ar/ar.json
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
+
"KM": "km",
|
|
3
|
+
"MINS": "mins",
|
|
4
|
+
"NEW": "New",
|
|
5
|
+
"ALL": "All",
|
|
6
|
+
"CLOSE": "Close",
|
|
7
|
+
"OPEN": "Open",
|
|
8
|
+
"SELECT_STORE": "Select Store",
|
|
9
|
+
"STORE_LOGO": "Store Logo",
|
|
2
10
|
"STORE_STATE": "Store State",
|
|
3
11
|
"BUSINESS_TYPE": "Business Type",
|
|
4
12
|
"STORE_SELECT": "Store Select",
|
|
@@ -47,7 +55,6 @@
|
|
|
47
55
|
"CAMPAIGN_NAME": "Campaign Name",
|
|
48
56
|
"PROCESSING": "Processing",
|
|
49
57
|
"HAS_NOT_STARTED": "Has not started",
|
|
50
|
-
"ALL": "ALL",
|
|
51
58
|
"PERIOD_OF_VAILDITY": "Period of Vaildity",
|
|
52
59
|
"COUPON_VALUE": "Coupon Value",
|
|
53
60
|
"COUPON_NAME": "Coupon Name",
|
|
@@ -351,6 +358,7 @@
|
|
|
351
358
|
"ADD_IMAGE": "Add Image",
|
|
352
359
|
"ADD_BANNER": "Add Banner",
|
|
353
360
|
"TOTAL_PRODUCTS": "Total {count} products",
|
|
361
|
+
"TOTAL_STORES": "Total {count} stores",
|
|
354
362
|
"SELECTED": "Selected",
|
|
355
363
|
"GROUP_BUY": "Group Buy",
|
|
356
364
|
"RESET": "Reset",
|
package/lib/locale/en/en.json
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
+
"KM": "km",
|
|
3
|
+
"MINS": "mins",
|
|
4
|
+
"NEW": "New",
|
|
5
|
+
"ALL": "All",
|
|
6
|
+
"CLOSE": "Close",
|
|
7
|
+
"OPEN": "Open",
|
|
8
|
+
"SELECT_STORE": "Select Store",
|
|
9
|
+
"STORE_LOGO": "Store Logo",
|
|
2
10
|
"STORE_STATE": "Store State",
|
|
3
11
|
"BUSINESS_TYPE": "Business Type",
|
|
4
12
|
"STORE_SELECT": "Store Select",
|
|
@@ -47,7 +55,6 @@
|
|
|
47
55
|
"CAMPAIGN_NAME": "Campaign Name",
|
|
48
56
|
"PROCESSING": "Processing",
|
|
49
57
|
"HAS_NOT_STARTED": "Has not started",
|
|
50
|
-
"ALL": "ALL",
|
|
51
58
|
"PERIOD_OF_VAILDITY": "Period of Vaildity",
|
|
52
59
|
"COUPON_VALUE": "Coupon Value",
|
|
53
60
|
"COUPON_NAME": "Coupon Name",
|
|
@@ -351,6 +358,7 @@
|
|
|
351
358
|
"ADD_IMAGE": "Add Image",
|
|
352
359
|
"ADD_BANNER": "Add Banner",
|
|
353
360
|
"TOTAL_PRODUCTS": "Total {count} products",
|
|
361
|
+
"TOTAL_STORES": "Total {count} stores",
|
|
354
362
|
"SELECTED": "Selected",
|
|
355
363
|
"GROUP_BUY": "Group Buy",
|
|
356
364
|
"RESET": "Reset",
|
package/lib/locale/es/es.json
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
+
"KM": "km",
|
|
3
|
+
"MINS": "mins",
|
|
4
|
+
"NEW": "New",
|
|
5
|
+
"ALL": "TODO",
|
|
6
|
+
"CLOSE": "Close",
|
|
7
|
+
"OPEN": "Open",
|
|
8
|
+
"SELECT_STORE": "Select Store",
|
|
9
|
+
"STORE_LOGO": "Store Logo",
|
|
2
10
|
"STORE_STATE": "Store State",
|
|
3
11
|
"BUSINESS_TYPE": "Business Type",
|
|
4
12
|
"STORE_SELECT": "Store Select",
|
|
@@ -47,7 +55,6 @@
|
|
|
47
55
|
"CAMPAIGN_NAME": "Campaign Name",
|
|
48
56
|
"PROCESSING": "Processing",
|
|
49
57
|
"HAS_NOT_STARTED": "Has not started",
|
|
50
|
-
"ALL": "TODO",
|
|
51
58
|
"PERIOD_OF_VAILDITY": "Period of Vaildity",
|
|
52
59
|
"COUPON_VALUE": "Coupon Value",
|
|
53
60
|
"COUPON_NAME": "Coupon Name",
|
|
@@ -351,6 +358,7 @@
|
|
|
351
358
|
"ADD_IMAGE": "Añadir Imagen",
|
|
352
359
|
"ADD_BANNER": "Agregar Banner",
|
|
353
360
|
"TOTAL_PRODUCTS": "Total {count} productos",
|
|
361
|
+
"TOTAL_STORES": "Total {count} stores",
|
|
354
362
|
"SELECTED": "Seleccionado",
|
|
355
363
|
"GROUP_BUY": "Compra en grupo",
|
|
356
364
|
"RESET": "Restablecer",
|
package/lib/locale/mn/mn.json
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
+
"KM": "km",
|
|
3
|
+
"MINS": "mins",
|
|
4
|
+
"NEW": "New",
|
|
5
|
+
"ALL": "БҮГД",
|
|
6
|
+
"CLOSE": "Close",
|
|
7
|
+
"OPEN": "Open",
|
|
8
|
+
"SELECT_STORE": "Select Store",
|
|
9
|
+
"STORE_LOGO": "Store Logo",
|
|
2
10
|
"STORE_STATE": "Store State",
|
|
3
11
|
"BUSINESS_TYPE": "Business Type",
|
|
4
12
|
"STORE_SELECT": "Store Select",
|
|
@@ -47,7 +55,6 @@
|
|
|
47
55
|
"CAMPAIGN_NAME": "Аяны нэр",
|
|
48
56
|
"PROCESSING": "Боловсруулж байна",
|
|
49
57
|
"HAS_NOT_STARTED": "Эхлээгүй байна",
|
|
50
|
-
"ALL": "БҮГД",
|
|
51
58
|
"PERIOD_OF_VAILDITY": "Хүчинтэй байх хугацаа",
|
|
52
59
|
"COUPON_VALUE": "Купоны үнэ цэнэ",
|
|
53
60
|
"COUPON_NAME": "Купоны нэр",
|
|
@@ -351,6 +358,7 @@
|
|
|
351
358
|
"ADD_IMAGE": "Зураг нэмэх",
|
|
352
359
|
"ADD_BANNER": "Баннер нэмэх",
|
|
353
360
|
"TOTAL_PRODUCTS": "Нийт {count} бүтээгдэхүүн",
|
|
361
|
+
"TOTAL_STORES": "Total {count} stores",
|
|
354
362
|
"SELECTED": "Сонгосон",
|
|
355
363
|
"GROUP_BUY": "Бүлгийн худалдан авалт",
|
|
356
364
|
"RESET": "Дахин тохируулах",
|
package/lib/utils/commonUtil.js
CHANGED
|
@@ -245,12 +245,22 @@ function commonFetch(url, data, method) {
|
|
|
245
245
|
var _a, _b;
|
|
246
246
|
|
|
247
247
|
var credentials = localStorage.getItem('credentials');
|
|
248
|
+
var csrf = localStorage.getItem('X-CSRF-TOKEN');
|
|
248
249
|
var headers = {
|
|
250
|
+
Accept: 'application/json',
|
|
249
251
|
'Content-Type': 'application/json; charset=UTF-8',
|
|
250
252
|
credentials: credentials,
|
|
251
|
-
accessToken: credentials
|
|
253
|
+
accessToken: credentials,
|
|
254
|
+
'X-CSRF-TOKEN': csrf
|
|
252
255
|
};
|
|
253
256
|
|
|
257
|
+
if (url.endsWith('portal/login')) {
|
|
258
|
+
headers = __assign(__assign({}, headers), {
|
|
259
|
+
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
|
|
260
|
+
'X-Requested-With': 'XMLHttpRequest'
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
|
|
254
264
|
if (_method === 'GET') {
|
|
255
265
|
if ((_a = window.magicDesign) === null || _a === void 0 ? void 0 : _a.fetch) {
|
|
256
266
|
window.magicDesign.fetch(url, {
|