@fonixtree/magic-design 2.0.205 → 2.0.207
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/assets/images/layout-icon/campaignLayout1.png +0 -0
- package/es/assets/images/layout-icon/imageGalleryLayout3.png +0 -0
- package/es/assets/images/layout-icon/imageGalleryLayout4.png +0 -0
- package/es/common/Collapse/index.js +3 -1
- package/es/common/Field/index.js +5 -4
- package/es/common/Field/index.less +4 -0
- package/es/composite-comp/bol/components/ImageGallery/mobile/index.js +33 -2
- package/es/composite-comp/bol/components/ImageGallery/mobile/index.less +15 -0
- package/es/composite-comp/bol/components/Video/defaultJSON.js +1 -0
- package/es/composite-comp/bol/components/Video/mobile/Layout1/index.js +2 -1
- package/es/composite-comp/bol/components/Video/mobile/Layout1/index.less +1 -0
- package/es/composite-comp/bol/components/Video/mobile/Layout2/index.js +2 -1
- package/es/composite-comp/bol/components/Video/mobile/Layout2/index.less +1 -0
- package/es/composite-comp/bol/components/Video/mobile/Layout3/index.js +2 -1
- package/es/composite-comp/bol/components/Video/mobile/Layout3/index.less +1 -0
- package/es/composite-comp/bol/components/Video/pc/Layout1/index.js +2 -1
- package/es/composite-comp/bol/components/Video/pc/Layout1/index.less +1 -0
- package/es/composite-comp/bol/components/Video/pc/Layout2/index.js +8 -2
- package/es/composite-comp/bol/components/Video/pc/Layout2/index.less +2 -0
- package/es/composite-comp/bol/components/Video/pc/Layout3/index.js +4 -1
- package/es/composite-comp/bol/components/Video/pc/Layout3/index.less +1 -0
- package/es/composite-comp/bol/components/Video/pc/Layout4/index.js +2 -1
- package/es/composite-comp/bol/components/Video/pc/Layout4/index.less +1 -0
- package/es/composite-comp/bol/components/Video/pc/Layout5/index.js +2 -1
- package/es/composite-comp/bol/components/Video/pc/Layout5/index.less +1 -0
- package/es/composite-comp/bol/config-panels/ImageGalleryConfig/ImageGalleryConfigImageGroup/index.js +1 -0
- package/es/composite-comp/bol/config-panels/ImageGalleryConfig/index.js +1 -1
- package/es/composite-comp/bol/config-panels/VideoConfig/index.js +12 -0
- package/es/composite-comp/common/components/ProductItem/index.js +1 -1
- package/es/composite-comp/dito/components/Campaign/defaultJSON.js +112 -0
- package/es/composite-comp/dito/components/Campaign/index.js +88 -0
- package/es/composite-comp/dito/components/Campaign/mobile/components/Bargain/index.js +320 -0
- package/es/composite-comp/dito/components/Campaign/mobile/components/Bargain/index.less +20 -0
- package/es/composite-comp/dito/components/Campaign/mobile/components/CountDown/index.js +180 -0
- package/es/composite-comp/dito/components/Campaign/mobile/components/CountDown/index.less +26 -0
- package/es/composite-comp/dito/components/Campaign/mobile/components/FlashSale/index.js +434 -0
- package/es/composite-comp/dito/components/Campaign/mobile/components/FlashSale/index.less +20 -0
- package/es/composite-comp/dito/components/Campaign/mobile/components/GroupBuy/index.js +317 -0
- package/es/composite-comp/dito/components/Campaign/mobile/components/GroupBuy/index.less +20 -0
- package/es/composite-comp/dito/components/Campaign/mobile/components/ProductItem/index.js +115 -0
- package/es/composite-comp/dito/components/Campaign/mobile/components/ProductItem/index.less +14 -0
- package/es/composite-comp/dito/components/Campaign/mobile/imgs/defImg.png +0 -0
- package/es/composite-comp/dito/components/Campaign/mobile/index.js +125 -0
- package/es/composite-comp/dito/components/Campaign/mobile/index.less +57 -0
- package/es/composite-comp/dito/components/GroupedCarousel/pc/index.js +8 -2
- package/es/composite-comp/dito/components/SearchDITO/pc/components/Header/index.js +2 -2
- package/es/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.js +16 -16
- package/es/composite-comp/dito/components/SlideImage/pc/index.js +1 -1
- package/es/composite-comp/dito/config-panels/CampaignConfig/ConfigContent/index.js +143 -0
- package/es/composite-comp/dito/config-panels/CampaignConfig/ConfigTitle/index.js +93 -0
- package/es/composite-comp/dito/config-panels/CampaignConfig/index.js +69 -0
- package/es/composite-comp/dito/second-config-panels/CampaignSecondConfig/index.js +109 -0
- package/es/constants/component-types.js +9 -3
- package/es/constants/index.js +4 -0
- package/es/constants/layout.js +32 -2
- package/es/core/Designer/ConfigPanel/index.js +6 -2
- package/es/core/Designer/PageCompList/index.js +1 -1
- package/es/core/Designer/index.js +7 -11
- package/es/meta-comp/config-panels/ImageConfig/index.js +0 -2
- package/es/meta-comp/config-panels/TextConfig/index.js +17 -7
- package/es/meta-comp/config-panels/TextConfig/index.less +7 -0
- package/es/utils/commonUtil.js +59 -89
- package/lib/assets/images/layout-icon/campaignLayout1.png +0 -0
- package/lib/assets/images/layout-icon/imageGalleryLayout3.png +0 -0
- package/lib/assets/images/layout-icon/imageGalleryLayout4.png +0 -0
- package/lib/common/Collapse/index.js +3 -1
- package/lib/common/Field/index.js +5 -4
- package/lib/common/Field/index.less +4 -0
- package/lib/composite-comp/bol/components/ImageGallery/mobile/index.js +33 -2
- package/lib/composite-comp/bol/components/ImageGallery/mobile/index.less +15 -0
- package/lib/composite-comp/bol/components/Video/defaultJSON.js +1 -0
- package/lib/composite-comp/bol/components/Video/mobile/Layout1/index.js +2 -1
- package/lib/composite-comp/bol/components/Video/mobile/Layout1/index.less +1 -0
- package/lib/composite-comp/bol/components/Video/mobile/Layout2/index.js +2 -1
- package/lib/composite-comp/bol/components/Video/mobile/Layout2/index.less +1 -0
- package/lib/composite-comp/bol/components/Video/mobile/Layout3/index.js +2 -1
- package/lib/composite-comp/bol/components/Video/mobile/Layout3/index.less +1 -0
- package/lib/composite-comp/bol/components/Video/pc/Layout1/index.js +2 -1
- package/lib/composite-comp/bol/components/Video/pc/Layout1/index.less +1 -0
- package/lib/composite-comp/bol/components/Video/pc/Layout2/index.js +8 -2
- package/lib/composite-comp/bol/components/Video/pc/Layout2/index.less +2 -0
- package/lib/composite-comp/bol/components/Video/pc/Layout3/index.js +4 -1
- package/lib/composite-comp/bol/components/Video/pc/Layout3/index.less +1 -0
- package/lib/composite-comp/bol/components/Video/pc/Layout4/index.js +2 -1
- package/lib/composite-comp/bol/components/Video/pc/Layout4/index.less +1 -0
- package/lib/composite-comp/bol/components/Video/pc/Layout5/index.js +2 -1
- package/lib/composite-comp/bol/components/Video/pc/Layout5/index.less +1 -0
- package/lib/composite-comp/bol/config-panels/ImageGalleryConfig/ImageGalleryConfigImageGroup/index.js +1 -0
- package/lib/composite-comp/bol/config-panels/ImageGalleryConfig/index.js +1 -1
- package/lib/composite-comp/bol/config-panels/VideoConfig/index.js +12 -0
- package/lib/composite-comp/common/components/ProductItem/index.js +1 -1
- package/lib/composite-comp/dito/components/Campaign/defaultJSON.js +112 -0
- package/lib/composite-comp/dito/components/Campaign/index.js +88 -0
- package/lib/composite-comp/dito/components/Campaign/mobile/components/Bargain/index.js +320 -0
- package/lib/composite-comp/dito/components/Campaign/mobile/components/Bargain/index.less +20 -0
- package/lib/composite-comp/dito/components/Campaign/mobile/components/CountDown/index.js +180 -0
- package/lib/composite-comp/dito/components/Campaign/mobile/components/CountDown/index.less +26 -0
- package/lib/composite-comp/dito/components/Campaign/mobile/components/FlashSale/index.js +434 -0
- package/lib/composite-comp/dito/components/Campaign/mobile/components/FlashSale/index.less +20 -0
- package/lib/composite-comp/dito/components/Campaign/mobile/components/GroupBuy/index.js +317 -0
- package/lib/composite-comp/dito/components/Campaign/mobile/components/GroupBuy/index.less +20 -0
- package/lib/composite-comp/dito/components/Campaign/mobile/components/ProductItem/index.js +115 -0
- package/lib/composite-comp/dito/components/Campaign/mobile/components/ProductItem/index.less +14 -0
- package/lib/composite-comp/dito/components/Campaign/mobile/imgs/defImg.png +0 -0
- package/lib/composite-comp/dito/components/Campaign/mobile/index.js +125 -0
- package/lib/composite-comp/dito/components/Campaign/mobile/index.less +57 -0
- package/lib/composite-comp/dito/components/GroupedCarousel/pc/index.js +8 -2
- package/lib/composite-comp/dito/components/SearchDITO/pc/components/Header/index.js +2 -2
- package/lib/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.js +16 -16
- package/lib/composite-comp/dito/components/SlideImage/pc/index.js +1 -1
- package/lib/composite-comp/dito/config-panels/CampaignConfig/ConfigContent/index.js +143 -0
- package/lib/composite-comp/dito/config-panels/CampaignConfig/ConfigTitle/index.js +93 -0
- package/lib/composite-comp/dito/config-panels/CampaignConfig/index.js +69 -0
- package/lib/composite-comp/dito/second-config-panels/CampaignSecondConfig/index.js +109 -0
- package/lib/constants/component-types.js +9 -3
- package/lib/constants/index.js +4 -0
- package/lib/constants/layout.js +32 -2
- package/lib/core/Designer/ConfigPanel/index.js +6 -2
- package/lib/core/Designer/PageCompList/index.js +1 -1
- package/lib/core/Designer/index.js +7 -11
- package/lib/meta-comp/config-panels/ImageConfig/index.js +0 -2
- package/lib/meta-comp/config-panels/TextConfig/index.js +17 -7
- package/lib/meta-comp/config-panels/TextConfig/index.less +7 -0
- package/lib/utils/commonUtil.js +59 -89
- package/package.json +1 -1
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _ProductItem = _interopRequireDefault(require("../ProductItem"));
|
|
11
|
+
|
|
12
|
+
var _coreUtil = require("../../../../../../../utils/coreUtil");
|
|
13
|
+
|
|
14
|
+
var _components = require("../../../../../../../meta-comp/components");
|
|
15
|
+
|
|
16
|
+
var _commonUtil = require("../../../../../../../utils/commonUtil");
|
|
17
|
+
|
|
18
|
+
var _Iconfont = _interopRequireDefault(require("../../../../../../../common/Iconfont"));
|
|
19
|
+
|
|
20
|
+
var _storeUtil = require("../../../../../../../utils/storeUtil");
|
|
21
|
+
|
|
22
|
+
var _defImg = _interopRequireDefault(require("../../imgs/defImg.png"));
|
|
23
|
+
|
|
24
|
+
require("./index.less");
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
+
|
|
28
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
29
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
30
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
31
|
+
__proto__: []
|
|
32
|
+
} instanceof Array && function (d, b) {
|
|
33
|
+
d.__proto__ = b;
|
|
34
|
+
} || function (d, b) {
|
|
35
|
+
for (var p in b) {
|
|
36
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return _extendStatics(d, b);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return function (d, b) {
|
|
44
|
+
_extendStatics(d, b);
|
|
45
|
+
|
|
46
|
+
function __() {
|
|
47
|
+
this.constructor = d;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
51
|
+
};
|
|
52
|
+
}();
|
|
53
|
+
|
|
54
|
+
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
55
|
+
function adopt(value) {
|
|
56
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
57
|
+
resolve(value);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
62
|
+
function fulfilled(value) {
|
|
63
|
+
try {
|
|
64
|
+
step(generator.next(value));
|
|
65
|
+
} catch (e) {
|
|
66
|
+
reject(e);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function rejected(value) {
|
|
71
|
+
try {
|
|
72
|
+
step(generator["throw"](value));
|
|
73
|
+
} catch (e) {
|
|
74
|
+
reject(e);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function step(result) {
|
|
79
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
87
|
+
var _ = {
|
|
88
|
+
label: 0,
|
|
89
|
+
sent: function sent() {
|
|
90
|
+
if (t[0] & 1) throw t[1];
|
|
91
|
+
return t[1];
|
|
92
|
+
},
|
|
93
|
+
trys: [],
|
|
94
|
+
ops: []
|
|
95
|
+
},
|
|
96
|
+
f,
|
|
97
|
+
y,
|
|
98
|
+
t,
|
|
99
|
+
g;
|
|
100
|
+
return g = {
|
|
101
|
+
next: verb(0),
|
|
102
|
+
"throw": verb(1),
|
|
103
|
+
"return": verb(2)
|
|
104
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
105
|
+
return this;
|
|
106
|
+
}), g;
|
|
107
|
+
|
|
108
|
+
function verb(n) {
|
|
109
|
+
return function (v) {
|
|
110
|
+
return step([n, v]);
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function step(op) {
|
|
115
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
116
|
+
|
|
117
|
+
while (_) {
|
|
118
|
+
try {
|
|
119
|
+
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;
|
|
120
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
121
|
+
|
|
122
|
+
switch (op[0]) {
|
|
123
|
+
case 0:
|
|
124
|
+
case 1:
|
|
125
|
+
t = op;
|
|
126
|
+
break;
|
|
127
|
+
|
|
128
|
+
case 4:
|
|
129
|
+
_.label++;
|
|
130
|
+
return {
|
|
131
|
+
value: op[1],
|
|
132
|
+
done: false
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
case 5:
|
|
136
|
+
_.label++;
|
|
137
|
+
y = op[1];
|
|
138
|
+
op = [0];
|
|
139
|
+
continue;
|
|
140
|
+
|
|
141
|
+
case 7:
|
|
142
|
+
op = _.ops.pop();
|
|
143
|
+
|
|
144
|
+
_.trys.pop();
|
|
145
|
+
|
|
146
|
+
continue;
|
|
147
|
+
|
|
148
|
+
default:
|
|
149
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
150
|
+
_ = 0;
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
155
|
+
_.label = op[1];
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
160
|
+
_.label = t[1];
|
|
161
|
+
t = op;
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (t && _.label < t[2]) {
|
|
166
|
+
_.label = t[2];
|
|
167
|
+
|
|
168
|
+
_.ops.push(op);
|
|
169
|
+
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (t[2]) _.ops.pop();
|
|
174
|
+
|
|
175
|
+
_.trys.pop();
|
|
176
|
+
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
op = body.call(thisArg, _);
|
|
181
|
+
} catch (e) {
|
|
182
|
+
op = [6, e];
|
|
183
|
+
y = 0;
|
|
184
|
+
} finally {
|
|
185
|
+
f = t = 0;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (op[0] & 5) throw op[1];
|
|
190
|
+
return {
|
|
191
|
+
value: op[0] ? op[1] : void 0,
|
|
192
|
+
done: true
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
var defaultData = [{
|
|
198
|
+
imgUrlContent: {
|
|
199
|
+
url: _defImg["default"]
|
|
200
|
+
},
|
|
201
|
+
offerName: 'Product Name',
|
|
202
|
+
salesPrice: 18000000,
|
|
203
|
+
specialPrice: 18000000,
|
|
204
|
+
marketPrice: 19000000,
|
|
205
|
+
discountPercent: 10,
|
|
206
|
+
salePercent: 500,
|
|
207
|
+
sppType: '2'
|
|
208
|
+
}, {
|
|
209
|
+
imgUrlContent: {
|
|
210
|
+
url: _defImg["default"]
|
|
211
|
+
},
|
|
212
|
+
offerName: 'Product Name',
|
|
213
|
+
salesPrice: 18000000,
|
|
214
|
+
specialPrice: 18000000,
|
|
215
|
+
marketPrice: 19000000,
|
|
216
|
+
discountPercent: 10,
|
|
217
|
+
salePercent: 500,
|
|
218
|
+
sppType: '2'
|
|
219
|
+
}];
|
|
220
|
+
|
|
221
|
+
var Bargain =
|
|
222
|
+
/** @class */
|
|
223
|
+
function (_super) {
|
|
224
|
+
__extends(Bargain, _super);
|
|
225
|
+
|
|
226
|
+
function Bargain() {
|
|
227
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
228
|
+
|
|
229
|
+
_this.state = {
|
|
230
|
+
list: (0, _coreUtil.isDesignMode)() ? [] : (0, _commonUtil.ensure)(function () {
|
|
231
|
+
return (0, _storeUtil.getMagicStore)("bargain_" + (window.magicDesign.pageId || '') + "_" + _this.props.panelProps.id);
|
|
232
|
+
}, [])
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
_this.getList = function () {
|
|
236
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
237
|
+
var res, pageId, list;
|
|
238
|
+
|
|
239
|
+
var _a;
|
|
240
|
+
|
|
241
|
+
return __generator(this, function (_b) {
|
|
242
|
+
switch (_b.label) {
|
|
243
|
+
case 0:
|
|
244
|
+
return [4
|
|
245
|
+
/*yield*/
|
|
246
|
+
, (0, _commonUtil.commonFetch)('/designer/v1/h5/bargain/offer/page', {
|
|
247
|
+
sortType: this.sortType,
|
|
248
|
+
pageIndex: 1,
|
|
249
|
+
pageSize: 30
|
|
250
|
+
})];
|
|
251
|
+
|
|
252
|
+
case 1:
|
|
253
|
+
res = _b.sent();
|
|
254
|
+
pageId = window.magicDesign.pageId || '';
|
|
255
|
+
list = (((_a = res === null || res === void 0 ? void 0 : res.pageInfo) === null || _a === void 0 ? void 0 : _a.list) || []).slice(0, 2);
|
|
256
|
+
|
|
257
|
+
if (!(0, _coreUtil.isDesignMode)()) {
|
|
258
|
+
if (list.length === 0) this.props.onEmpty();
|
|
259
|
+
(0, _storeUtil.setMagicStore)("bargain_" + pageId + "_" + this.props.panelProps.id, list);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
this.setState({
|
|
263
|
+
list: list
|
|
264
|
+
});
|
|
265
|
+
return [2
|
|
266
|
+
/*return*/
|
|
267
|
+
];
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
return _this;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
Bargain.prototype.componentDidMount = function () {
|
|
277
|
+
this.getList();
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
Bargain.prototype.render = function () {
|
|
281
|
+
var panelProps = this.props.panelProps;
|
|
282
|
+
var list = this.state.list;
|
|
283
|
+
|
|
284
|
+
var _list = list.length === 0 && (0, _coreUtil.isDesignMode)() ? defaultData : list;
|
|
285
|
+
|
|
286
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, _list.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
287
|
+
className: "m-campaign-bargain-mobile"
|
|
288
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
289
|
+
className: "bargain-title"
|
|
290
|
+
}, panelProps.groupName.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
291
|
+
className: "text",
|
|
292
|
+
data: panelProps.groupName
|
|
293
|
+
}), /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
294
|
+
color: "#0038A8",
|
|
295
|
+
onClick: function onClick() {
|
|
296
|
+
return (0, _coreUtil.clickUrl)('/bargain');
|
|
297
|
+
},
|
|
298
|
+
size: 16,
|
|
299
|
+
type: "icon-outlined-right"
|
|
300
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
301
|
+
className: "bargain-list"
|
|
302
|
+
}, _list.map(function (item) {
|
|
303
|
+
return /*#__PURE__*/_react["default"].createElement(_ProductItem["default"], {
|
|
304
|
+
key: item.id,
|
|
305
|
+
data: item,
|
|
306
|
+
onItemClick: function onItemClick() {
|
|
307
|
+
(0, _coreUtil.clickUrl)("proDetail - " + item.offerId + " -" + (item.sppProductId || '') + " ");
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}))));
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
Bargain.defaultProps = {
|
|
314
|
+
panelProps: {}
|
|
315
|
+
};
|
|
316
|
+
return Bargain;
|
|
317
|
+
}(_react["default"].Component);
|
|
318
|
+
|
|
319
|
+
var _default = Bargain;
|
|
320
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.m-campaign-bargain-mobile {
|
|
2
|
+
padding: 0.12rem 0.2rem 0.24rem 0.2rem;
|
|
3
|
+
height: 100%;
|
|
4
|
+
}
|
|
5
|
+
.m-campaign-bargain-mobile .bargain-title {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
}
|
|
10
|
+
.m-campaign-bargain-mobile .bargain-title .text {
|
|
11
|
+
width: fit-content !important;
|
|
12
|
+
}
|
|
13
|
+
.m-campaign-bargain-mobile .bargain-list {
|
|
14
|
+
margin-top: 0.12rem;
|
|
15
|
+
height: calc(100% - 0.52rem);
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
gap: 0.24rem;
|
|
20
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
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"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _commonUtil = require("../../../../../../../utils/commonUtil");
|
|
13
|
+
|
|
14
|
+
require("./index.less");
|
|
15
|
+
|
|
16
|
+
var _Iconfont = _interopRequireDefault(require("../../../../../../../common/Iconfont"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
25
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
26
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
27
|
+
__proto__: []
|
|
28
|
+
} instanceof Array && function (d, b) {
|
|
29
|
+
d.__proto__ = b;
|
|
30
|
+
} || function (d, b) {
|
|
31
|
+
for (var p in b) {
|
|
32
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return _extendStatics(d, b);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return function (d, b) {
|
|
40
|
+
_extendStatics(d, b);
|
|
41
|
+
|
|
42
|
+
function __() {
|
|
43
|
+
this.constructor = d;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
47
|
+
};
|
|
48
|
+
}();
|
|
49
|
+
|
|
50
|
+
var debug = require('debug')('worker:count-down');
|
|
51
|
+
|
|
52
|
+
var CountDown =
|
|
53
|
+
/** @class */
|
|
54
|
+
function (_super) {
|
|
55
|
+
__extends(CountDown, _super);
|
|
56
|
+
|
|
57
|
+
function CountDown() {
|
|
58
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
59
|
+
|
|
60
|
+
_this.state = {
|
|
61
|
+
hour: '00',
|
|
62
|
+
min: '00',
|
|
63
|
+
second: '00',
|
|
64
|
+
nowTime: Number(_this.props.now),
|
|
65
|
+
now: _this.props.now
|
|
66
|
+
};
|
|
67
|
+
_this.timer = null;
|
|
68
|
+
_this.preTime = '';
|
|
69
|
+
|
|
70
|
+
_this.componentWillUnmount = function () {
|
|
71
|
+
_this.clearTimer();
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
_this.calcLastTime = function () {
|
|
75
|
+
try {
|
|
76
|
+
var _a = _this.props,
|
|
77
|
+
effDate = _a.effDate,
|
|
78
|
+
expDate = _a.expDate,
|
|
79
|
+
refresh = _a.refresh;
|
|
80
|
+
var nowTime = _this.state.nowTime;
|
|
81
|
+
var lastTime = 0;
|
|
82
|
+
|
|
83
|
+
if (nowTime > effDate && nowTime < expDate) {
|
|
84
|
+
lastTime = expDate - nowTime;
|
|
85
|
+
} else if (nowTime < effDate) {
|
|
86
|
+
lastTime = effDate - nowTime;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (lastTime === 0) {
|
|
90
|
+
refresh();
|
|
91
|
+
|
|
92
|
+
_this.clearTimer();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
var _b = (0, _commonUtil.calcLastTime)(lastTime).split(':'),
|
|
96
|
+
hour = _b[0],
|
|
97
|
+
min = _b[1],
|
|
98
|
+
second = _b[2];
|
|
99
|
+
|
|
100
|
+
_this.setState({
|
|
101
|
+
hour: hour,
|
|
102
|
+
min: min,
|
|
103
|
+
second: second,
|
|
104
|
+
nowTime: nowTime + 1000
|
|
105
|
+
});
|
|
106
|
+
} catch (error) {
|
|
107
|
+
debug(error);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
_this.clearTimer = function () {
|
|
112
|
+
if (_this.timer) {
|
|
113
|
+
clearInterval(_this.timer);
|
|
114
|
+
_this.timer = null;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
return _this;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
CountDown.getDerivedStateFromProps = function (nextProps, prevState) {
|
|
122
|
+
// 检查是否需要更新sortType
|
|
123
|
+
if (nextProps.now !== prevState.now) {
|
|
124
|
+
return {
|
|
125
|
+
now: nextProps.now,
|
|
126
|
+
nowTime: nextProps.now
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return null;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
CountDown.prototype.componentDidUpdate = function () {
|
|
134
|
+
var now = this.state.now;
|
|
135
|
+
|
|
136
|
+
if (this.preTime != now) {
|
|
137
|
+
this.preTime = now;
|
|
138
|
+
this.clearTimer();
|
|
139
|
+
this.calcLastTime();
|
|
140
|
+
this.timer = setInterval(this.calcLastTime, 1000);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
CountDown.prototype.render = function () {
|
|
145
|
+
var _a = this.state,
|
|
146
|
+
hour = _a.hour,
|
|
147
|
+
min = _a.min,
|
|
148
|
+
second = _a.second;
|
|
149
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
150
|
+
className: "m-campaign-count-down-wrap"
|
|
151
|
+
}, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
152
|
+
bold: true,
|
|
153
|
+
className: "icon_time",
|
|
154
|
+
color: "#fff",
|
|
155
|
+
size: 10,
|
|
156
|
+
type: "icon-time1"
|
|
157
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
158
|
+
className: "num"
|
|
159
|
+
}, hour), /*#__PURE__*/_react["default"].createElement("span", {
|
|
160
|
+
className: "pots"
|
|
161
|
+
}, ":"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
162
|
+
className: "num"
|
|
163
|
+
}, min), /*#__PURE__*/_react["default"].createElement("span", {
|
|
164
|
+
className: "pots"
|
|
165
|
+
}, ":"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
166
|
+
className: "num"
|
|
167
|
+
}, second));
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
CountDown.defaultProps = {
|
|
171
|
+
effDate: '',
|
|
172
|
+
expDate: '',
|
|
173
|
+
now: '',
|
|
174
|
+
refresh: function refresh() {}
|
|
175
|
+
};
|
|
176
|
+
return CountDown;
|
|
177
|
+
}(_react.Component);
|
|
178
|
+
|
|
179
|
+
var _default = CountDown;
|
|
180
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.m-campaign-count-down-wrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
background-color: #0038A7;
|
|
6
|
+
border-radius: 0.2rem;
|
|
7
|
+
padding: 0.04rem 0.1rem;
|
|
8
|
+
}
|
|
9
|
+
.m-campaign-count-down-wrap .icon_time {
|
|
10
|
+
margin-right: 0.04rem;
|
|
11
|
+
}
|
|
12
|
+
.m-campaign-count-down-wrap .num {
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
font-size: 0.18rem;
|
|
15
|
+
color: #fff;
|
|
16
|
+
height: 0.26rem;
|
|
17
|
+
line-height: 0.26rem;
|
|
18
|
+
}
|
|
19
|
+
.m-campaign-count-down-wrap .pots {
|
|
20
|
+
display: inline-block;
|
|
21
|
+
font-weight: 600;
|
|
22
|
+
font-size: 0.18rem;
|
|
23
|
+
color: #fff;
|
|
24
|
+
height: 0.26rem;
|
|
25
|
+
line-height: 0.22rem;
|
|
26
|
+
}
|