@fonixtree/magic-design 2.0.205 → 2.0.206
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 +4 -2
- 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 +4 -2
- 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,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
|
+
}
|
|
@@ -0,0 +1,434 @@
|
|
|
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 _dateUtil = require("../../../../../../../utils/dateUtil");
|
|
23
|
+
|
|
24
|
+
var _CountDown = _interopRequireDefault(require("../CountDown"));
|
|
25
|
+
|
|
26
|
+
var _defImg = _interopRequireDefault(require("../../imgs/defImg.png"));
|
|
27
|
+
|
|
28
|
+
require("./index.less");
|
|
29
|
+
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
31
|
+
|
|
32
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
33
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
34
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
35
|
+
__proto__: []
|
|
36
|
+
} instanceof Array && function (d, b) {
|
|
37
|
+
d.__proto__ = b;
|
|
38
|
+
} || function (d, b) {
|
|
39
|
+
for (var p in b) {
|
|
40
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return _extendStatics(d, b);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return function (d, b) {
|
|
48
|
+
_extendStatics(d, b);
|
|
49
|
+
|
|
50
|
+
function __() {
|
|
51
|
+
this.constructor = d;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
55
|
+
};
|
|
56
|
+
}();
|
|
57
|
+
|
|
58
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
59
|
+
__assign = Object.assign || function (t) {
|
|
60
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
61
|
+
s = arguments[i];
|
|
62
|
+
|
|
63
|
+
for (var p in s) {
|
|
64
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return t;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
return __assign.apply(this, arguments);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
75
|
+
function adopt(value) {
|
|
76
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
77
|
+
resolve(value);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
82
|
+
function fulfilled(value) {
|
|
83
|
+
try {
|
|
84
|
+
step(generator.next(value));
|
|
85
|
+
} catch (e) {
|
|
86
|
+
reject(e);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function rejected(value) {
|
|
91
|
+
try {
|
|
92
|
+
step(generator["throw"](value));
|
|
93
|
+
} catch (e) {
|
|
94
|
+
reject(e);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function step(result) {
|
|
99
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
107
|
+
var _ = {
|
|
108
|
+
label: 0,
|
|
109
|
+
sent: function sent() {
|
|
110
|
+
if (t[0] & 1) throw t[1];
|
|
111
|
+
return t[1];
|
|
112
|
+
},
|
|
113
|
+
trys: [],
|
|
114
|
+
ops: []
|
|
115
|
+
},
|
|
116
|
+
f,
|
|
117
|
+
y,
|
|
118
|
+
t,
|
|
119
|
+
g;
|
|
120
|
+
return g = {
|
|
121
|
+
next: verb(0),
|
|
122
|
+
"throw": verb(1),
|
|
123
|
+
"return": verb(2)
|
|
124
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
125
|
+
return this;
|
|
126
|
+
}), g;
|
|
127
|
+
|
|
128
|
+
function verb(n) {
|
|
129
|
+
return function (v) {
|
|
130
|
+
return step([n, v]);
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function step(op) {
|
|
135
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
136
|
+
|
|
137
|
+
while (_) {
|
|
138
|
+
try {
|
|
139
|
+
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;
|
|
140
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
141
|
+
|
|
142
|
+
switch (op[0]) {
|
|
143
|
+
case 0:
|
|
144
|
+
case 1:
|
|
145
|
+
t = op;
|
|
146
|
+
break;
|
|
147
|
+
|
|
148
|
+
case 4:
|
|
149
|
+
_.label++;
|
|
150
|
+
return {
|
|
151
|
+
value: op[1],
|
|
152
|
+
done: false
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
case 5:
|
|
156
|
+
_.label++;
|
|
157
|
+
y = op[1];
|
|
158
|
+
op = [0];
|
|
159
|
+
continue;
|
|
160
|
+
|
|
161
|
+
case 7:
|
|
162
|
+
op = _.ops.pop();
|
|
163
|
+
|
|
164
|
+
_.trys.pop();
|
|
165
|
+
|
|
166
|
+
continue;
|
|
167
|
+
|
|
168
|
+
default:
|
|
169
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
170
|
+
_ = 0;
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
175
|
+
_.label = op[1];
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
180
|
+
_.label = t[1];
|
|
181
|
+
t = op;
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (t && _.label < t[2]) {
|
|
186
|
+
_.label = t[2];
|
|
187
|
+
|
|
188
|
+
_.ops.push(op);
|
|
189
|
+
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (t[2]) _.ops.pop();
|
|
194
|
+
|
|
195
|
+
_.trys.pop();
|
|
196
|
+
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
op = body.call(thisArg, _);
|
|
201
|
+
} catch (e) {
|
|
202
|
+
op = [6, e];
|
|
203
|
+
y = 0;
|
|
204
|
+
} finally {
|
|
205
|
+
f = t = 0;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (op[0] & 5) throw op[1];
|
|
210
|
+
return {
|
|
211
|
+
value: op[0] ? op[1] : void 0,
|
|
212
|
+
done: true
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
var defaultData = [{
|
|
218
|
+
imgUrlContent: {
|
|
219
|
+
url: _defImg["default"]
|
|
220
|
+
},
|
|
221
|
+
offerName: 'Product Name',
|
|
222
|
+
salesPrice: 18000000,
|
|
223
|
+
specialPrice: 18000000,
|
|
224
|
+
marketPrice: 19000000,
|
|
225
|
+
discountPercent: 10,
|
|
226
|
+
salePercent: 500,
|
|
227
|
+
sppType: '2'
|
|
228
|
+
}, {
|
|
229
|
+
imgUrlContent: {
|
|
230
|
+
url: _defImg["default"]
|
|
231
|
+
},
|
|
232
|
+
offerName: 'Product Name',
|
|
233
|
+
salesPrice: 18000000,
|
|
234
|
+
specialPrice: 18000000,
|
|
235
|
+
marketPrice: 19000000,
|
|
236
|
+
discountPercent: 10,
|
|
237
|
+
salePercent: 500,
|
|
238
|
+
sppType: '2'
|
|
239
|
+
}];
|
|
240
|
+
|
|
241
|
+
var FlashSale =
|
|
242
|
+
/** @class */
|
|
243
|
+
function (_super) {
|
|
244
|
+
__extends(FlashSale, _super);
|
|
245
|
+
|
|
246
|
+
function FlashSale() {
|
|
247
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
248
|
+
|
|
249
|
+
_this.state = {
|
|
250
|
+
list: (0, _coreUtil.isDesignMode)() ? [] : (0, _commonUtil.ensure)(function () {
|
|
251
|
+
return (0, _storeUtil.getMagicStore)("flashSale_" + (window.magicDesign.pageId || '') + "_" + _this.props.panelProps.id + " ");
|
|
252
|
+
}, []),
|
|
253
|
+
effDate: '',
|
|
254
|
+
expDate: '',
|
|
255
|
+
now: '',
|
|
256
|
+
isWill: false
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
_this.getFlashData = function (pageSize, campaign) {
|
|
260
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
261
|
+
var res, pageId, _list;
|
|
262
|
+
|
|
263
|
+
return __generator(this, function (_a) {
|
|
264
|
+
switch (_a.label) {
|
|
265
|
+
case 0:
|
|
266
|
+
return [4
|
|
267
|
+
/*yield*/
|
|
268
|
+
, (0, _commonUtil.commonFetch)('/designer/v1/h5/flsale/offer/page', {
|
|
269
|
+
campaignId: campaign.campaignId,
|
|
270
|
+
sortType: '1',
|
|
271
|
+
pageIndex: 1,
|
|
272
|
+
pageSize: pageSize
|
|
273
|
+
})];
|
|
274
|
+
|
|
275
|
+
case 1:
|
|
276
|
+
res = _a.sent();
|
|
277
|
+
pageId = window.magicDesign.pageId || '';
|
|
278
|
+
_list = ((res === null || res === void 0 ? void 0 : res.list) || []).slice(0, 2);
|
|
279
|
+
|
|
280
|
+
if (!(0, _coreUtil.isDesignMode)()) {
|
|
281
|
+
if (_list.length === 0) this.props.onEmpty();
|
|
282
|
+
(0, _storeUtil.setMagicStore)("flashSale_" + pageId + "_" + this.props.panelProps.id, _list);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
this.setState({
|
|
286
|
+
now: +(0, _dateUtil.newDate)(campaign.now),
|
|
287
|
+
effDate: +(0, _dateUtil.newDate)(campaign.effDate),
|
|
288
|
+
expDate: +(0, _dateUtil.newDate)(campaign.expDate),
|
|
289
|
+
isWill: campaign.cmpState === 'A',
|
|
290
|
+
list: _list
|
|
291
|
+
});
|
|
292
|
+
return [2
|
|
293
|
+
/*return*/
|
|
294
|
+
, _list];
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
_this.getNextFlashSale = function () {
|
|
301
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
302
|
+
var data, _i, _a, _b, i, s, v, pageId;
|
|
303
|
+
|
|
304
|
+
return __generator(this, function (_c) {
|
|
305
|
+
switch (_c.label) {
|
|
306
|
+
case 0:
|
|
307
|
+
return [4
|
|
308
|
+
/*yield*/
|
|
309
|
+
, (0, _commonUtil.commonFetch)('/designer/v1/h5/flsale/next', {
|
|
310
|
+
excludeExpireCmp: true
|
|
311
|
+
}, 'GET')];
|
|
312
|
+
|
|
313
|
+
case 1:
|
|
314
|
+
data = _c.sent();
|
|
315
|
+
if (!(data.length > 0)) return [3
|
|
316
|
+
/*break*/
|
|
317
|
+
, 6];
|
|
318
|
+
_i = 0, _a = data.entries();
|
|
319
|
+
_c.label = 2;
|
|
320
|
+
|
|
321
|
+
case 2:
|
|
322
|
+
if (!(_i < _a.length)) return [3
|
|
323
|
+
/*break*/
|
|
324
|
+
, 5];
|
|
325
|
+
_b = _a[_i], i = _b[0], s = _b[1];
|
|
326
|
+
return [4
|
|
327
|
+
/*yield*/
|
|
328
|
+
, this.getFlashData(2, s)];
|
|
329
|
+
|
|
330
|
+
case 3:
|
|
331
|
+
v = _c.sent();
|
|
332
|
+
|
|
333
|
+
if (v.length > 0) {
|
|
334
|
+
return [2
|
|
335
|
+
/*return*/
|
|
336
|
+
, true]; // 查询到秒杀场次,立即退出
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
_c.label = 4;
|
|
340
|
+
|
|
341
|
+
case 4:
|
|
342
|
+
_i++;
|
|
343
|
+
return [3
|
|
344
|
+
/*break*/
|
|
345
|
+
, 2];
|
|
346
|
+
|
|
347
|
+
case 5:
|
|
348
|
+
return [3
|
|
349
|
+
/*break*/
|
|
350
|
+
, 7];
|
|
351
|
+
|
|
352
|
+
case 6:
|
|
353
|
+
// 秒杀场次结束之后,清空列表数据,隐藏秒杀组件
|
|
354
|
+
this.setState({
|
|
355
|
+
list: []
|
|
356
|
+
});
|
|
357
|
+
pageId = window.magicDesign.pageId || '';
|
|
358
|
+
|
|
359
|
+
if (!(0, _coreUtil.isDesignMode)()) {
|
|
360
|
+
this.props.onEmpty();
|
|
361
|
+
(0, _storeUtil.setMagicStore)("flashSale_" + pageId + "_" + this.props.panelProps.id, []);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
_c.label = 7;
|
|
365
|
+
|
|
366
|
+
case 7:
|
|
367
|
+
return [2
|
|
368
|
+
/*return*/
|
|
369
|
+
];
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
});
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
return _this;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
FlashSale.prototype.componentDidMount = function () {
|
|
379
|
+
this.getNextFlashSale();
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
FlashSale.prototype.render = function () {
|
|
383
|
+
var panelProps = this.props.panelProps;
|
|
384
|
+
var _a = this.state,
|
|
385
|
+
list = _a.list,
|
|
386
|
+
effDate = _a.effDate,
|
|
387
|
+
expDate = _a.expDate,
|
|
388
|
+
now = _a.now,
|
|
389
|
+
isWill = _a.isWill;
|
|
390
|
+
|
|
391
|
+
var _list = list.length === 0 && (0, _coreUtil.isDesignMode)() ? defaultData : list;
|
|
392
|
+
|
|
393
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, _list.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
394
|
+
className: "m-campaign-flash-mobile"
|
|
395
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
396
|
+
className: "flash-sale-title"
|
|
397
|
+
}, panelProps.groupName.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
398
|
+
className: "text",
|
|
399
|
+
data: panelProps.groupName
|
|
400
|
+
}), /*#__PURE__*/_react["default"].createElement(_CountDown["default"], {
|
|
401
|
+
effDate: effDate,
|
|
402
|
+
expDate: expDate,
|
|
403
|
+
now: now,
|
|
404
|
+
refresh: this.getNextFlashSale
|
|
405
|
+
}), /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
406
|
+
color: "#0038A8",
|
|
407
|
+
onClick: function onClick() {
|
|
408
|
+
return (0, _coreUtil.clickUrl)('/spike');
|
|
409
|
+
},
|
|
410
|
+
size: 16,
|
|
411
|
+
type: "icon-outlined-right"
|
|
412
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
413
|
+
className: "flash-sale-list"
|
|
414
|
+
}, _list.map(function (item) {
|
|
415
|
+
return /*#__PURE__*/_react["default"].createElement(_ProductItem["default"], {
|
|
416
|
+
key: item.id,
|
|
417
|
+
data: __assign(__assign({}, item), {
|
|
418
|
+
salePercent: isWill ? 0 : item.salePercent
|
|
419
|
+
}),
|
|
420
|
+
onItemClick: function onItemClick() {
|
|
421
|
+
(0, _coreUtil.clickUrl)("proDetail - " + item.offerId + " -" + (item.sppProductId || '') + " ");
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
}))));
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
FlashSale.defaultProps = {
|
|
428
|
+
panelProps: {}
|
|
429
|
+
};
|
|
430
|
+
return FlashSale;
|
|
431
|
+
}(_react["default"].Component);
|
|
432
|
+
|
|
433
|
+
var _default = FlashSale;
|
|
434
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.m-campaign-flash-mobile {
|
|
2
|
+
padding: 0.12rem 0.2rem 0.24rem 0.2rem;
|
|
3
|
+
height: 100%;
|
|
4
|
+
}
|
|
5
|
+
.m-campaign-flash-mobile .flash-sale-title {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
}
|
|
10
|
+
.m-campaign-flash-mobile .flash-sale-title .text {
|
|
11
|
+
width: fit-content !important;
|
|
12
|
+
}
|
|
13
|
+
.m-campaign-flash-mobile .flash-sale-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
|
+
}
|