@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
|
@@ -128,6 +128,18 @@ function (_super) {
|
|
|
128
128
|
},
|
|
129
129
|
unit: "px",
|
|
130
130
|
value: data[(0, _coreUtil.isPc)() ? 'pcHeight' : 'mobileHeight']
|
|
131
|
+
})), /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
132
|
+
title: "Arc"
|
|
133
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.Slider, {
|
|
134
|
+
onChange: function onChange(_a) {
|
|
135
|
+
var count = _a.count;
|
|
136
|
+
data.arc = count;
|
|
137
|
+
|
|
138
|
+
_this.selfRender();
|
|
139
|
+
},
|
|
140
|
+
value: {
|
|
141
|
+
count: data.arc
|
|
142
|
+
}
|
|
131
143
|
})))
|
|
132
144
|
}, {
|
|
133
145
|
key: 'Spacing',
|
|
@@ -163,7 +163,7 @@ function (_super) {
|
|
|
163
163
|
}, data.url && /*#__PURE__*/_react["default"].createElement("img", {
|
|
164
164
|
alt: "welcome advertise",
|
|
165
165
|
onClick: function onClick() {
|
|
166
|
-
(
|
|
166
|
+
if (window.magicDesign.h5JumpUrlConfig) window.magicDesign.h5JumpUrlConfig(data.adObj, 'voucherRedeemed');
|
|
167
167
|
},
|
|
168
168
|
src: data.url
|
|
169
169
|
}));
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.groupSourceJSON = exports.getDefaultJSON = void 0;
|
|
7
|
+
|
|
8
|
+
var _uuid = require("uuid");
|
|
9
|
+
|
|
10
|
+
var groupSourceJSON = function groupSourceJSON(parentId, type) {
|
|
11
|
+
var groupId = (0, _uuid.v4)();
|
|
12
|
+
return {
|
|
13
|
+
id: groupId,
|
|
14
|
+
parentId: parentId,
|
|
15
|
+
type: type,
|
|
16
|
+
open: true,
|
|
17
|
+
groupName: {
|
|
18
|
+
parentId: groupId,
|
|
19
|
+
id: (0, _uuid.v4)(),
|
|
20
|
+
open: true,
|
|
21
|
+
type: 'TEXT',
|
|
22
|
+
specialContent: [],
|
|
23
|
+
text: 'PAYDAY SALE!',
|
|
24
|
+
content: {
|
|
25
|
+
sizeType: 'Customize font styles',
|
|
26
|
+
fontWeight: 700,
|
|
27
|
+
fontSize: 10,
|
|
28
|
+
color: '#0038A7'
|
|
29
|
+
},
|
|
30
|
+
underline: {
|
|
31
|
+
open: false,
|
|
32
|
+
textDecorationColor: '',
|
|
33
|
+
textDecorationStyle: 'solid'
|
|
34
|
+
},
|
|
35
|
+
vertical: {}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
exports.groupSourceJSON = groupSourceJSON;
|
|
41
|
+
|
|
42
|
+
var getDefaultJSON = function getDefaultJSON() {
|
|
43
|
+
var groupId = (0, _uuid.v4)();
|
|
44
|
+
return {
|
|
45
|
+
id: (0, _uuid.v4)(),
|
|
46
|
+
type: 'CAMPAIGN',
|
|
47
|
+
title: {
|
|
48
|
+
headline: {
|
|
49
|
+
id: (0, _uuid.v4)(),
|
|
50
|
+
open: true,
|
|
51
|
+
type: 'TEXT',
|
|
52
|
+
specialContent: [],
|
|
53
|
+
text: 'Lorem Ipsum',
|
|
54
|
+
content: {
|
|
55
|
+
sizeType: 'Customize font styles',
|
|
56
|
+
fontWeight: 600,
|
|
57
|
+
fontSize: 14,
|
|
58
|
+
color: '#000000'
|
|
59
|
+
},
|
|
60
|
+
underline: {
|
|
61
|
+
open: false,
|
|
62
|
+
textDecorationColor: '',
|
|
63
|
+
textDecorationStyle: 'solid'
|
|
64
|
+
},
|
|
65
|
+
vertical: {
|
|
66
|
+
open: false,
|
|
67
|
+
lineHeight: 18
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
content: {
|
|
72
|
+
image: {
|
|
73
|
+
id: (0, _uuid.v4)(),
|
|
74
|
+
open: true,
|
|
75
|
+
type: 'IMAGE',
|
|
76
|
+
content: {
|
|
77
|
+
h5Name: 'name2',
|
|
78
|
+
pcName: 'name2',
|
|
79
|
+
h5ImgSrc: '',
|
|
80
|
+
pcImgSrc: '',
|
|
81
|
+
clickUrl: ''
|
|
82
|
+
},
|
|
83
|
+
hover: {
|
|
84
|
+
open: false,
|
|
85
|
+
backgroundType: 'enlarge',
|
|
86
|
+
magnification: 1.5,
|
|
87
|
+
pcImgHoverUrl: '',
|
|
88
|
+
h5ImgHoverUrl: ''
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
groupSource: [groupSourceJSON(groupId, 'Flash Sale'), groupSourceJSON(groupId, 'Group Buy'), groupSourceJSON(groupId, 'Bargain')],
|
|
93
|
+
spacing: {
|
|
94
|
+
mobile: {
|
|
95
|
+
paddingTop: 0,
|
|
96
|
+
paddingBottom: 0,
|
|
97
|
+
marginBottom: 0
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
customize: {
|
|
101
|
+
layout: 'layout1'
|
|
102
|
+
},
|
|
103
|
+
background: {
|
|
104
|
+
opacity: 100,
|
|
105
|
+
color: '#fff',
|
|
106
|
+
image: '',
|
|
107
|
+
bgType: 'color'
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
exports.getDefaultJSON = getDefaultJSON;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _mobile = _interopRequireDefault(require("./mobile"));
|
|
11
|
+
|
|
12
|
+
var _defaultJSON = require("./defaultJSON");
|
|
13
|
+
|
|
14
|
+
var _coreUtil = require("../../../../utils/coreUtil");
|
|
15
|
+
|
|
16
|
+
var _compositeDecorator = _interopRequireDefault(require("../../../../decorator/compositeDecorator"));
|
|
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
|
+
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); }
|
|
25
|
+
|
|
26
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
27
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
28
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
29
|
+
__proto__: []
|
|
30
|
+
} instanceof Array && function (d, b) {
|
|
31
|
+
d.__proto__ = b;
|
|
32
|
+
} || function (d, b) {
|
|
33
|
+
for (var p in b) {
|
|
34
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return _extendStatics(d, b);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return function (d, b) {
|
|
42
|
+
_extendStatics(d, b);
|
|
43
|
+
|
|
44
|
+
function __() {
|
|
45
|
+
this.constructor = d;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
49
|
+
};
|
|
50
|
+
}();
|
|
51
|
+
|
|
52
|
+
var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
|
|
53
|
+
var c = arguments.length,
|
|
54
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
55
|
+
d;
|
|
56
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
|
|
57
|
+
if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
58
|
+
}
|
|
59
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
var Campaign =
|
|
63
|
+
/** @class */
|
|
64
|
+
function (_super) {
|
|
65
|
+
__extends(Campaign, _super);
|
|
66
|
+
|
|
67
|
+
function Campaign() {
|
|
68
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
Campaign.prototype.render = function () {
|
|
72
|
+
var nodeData = this.props.nodeData;
|
|
73
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, (0, _coreUtil.isPc)() ? null : /*#__PURE__*/_react["default"].createElement(_mobile["default"], {
|
|
74
|
+
panelProps: nodeData
|
|
75
|
+
}));
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
Campaign.defaultProps = {
|
|
79
|
+
nodeData: (0, _defaultJSON.getDefaultJSON)()
|
|
80
|
+
};
|
|
81
|
+
Campaign.type = 'CAMPAIGN';
|
|
82
|
+
Campaign.getDefaultJSON = _defaultJSON.getDefaultJSON;
|
|
83
|
+
Campaign = __decorate([_compositeDecorator["default"]], Campaign);
|
|
84
|
+
return Campaign;
|
|
85
|
+
}(_react.Component);
|
|
86
|
+
|
|
87
|
+
var _default = Campaign;
|
|
88
|
+
exports["default"] = _default;
|
|
@@ -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
|
+
}
|