@fonixtree/magic-design 1.0.111 → 1.0.113
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/fonts/magic-box-iconfont.css +59 -7
- package/es/assets/fonts/magic-box-iconfont.js +1 -1
- package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/es/composite-comp/common/components/ImageLabel/index.js +2 -2
- package/es/composite-comp/common/components/ImageLabel/index.less +16 -7
- package/es/composite-comp/common/components/ProductItem/index.js +35 -19
- package/es/composite-comp/common/components/ProductItem/index.less +9 -2
- package/es/composite-comp/dito/components/FlashDeal/mobile/index.less +5 -3
- package/es/composite-comp/dito/components/PersonalInformation/mobile/images/avatar.png +0 -0
- package/es/composite-comp/dito/components/PersonalInformation/mobile/index.js +5 -7
- package/es/composite-comp/dito/components/Recommend/defaultJSON.js +24 -0
- package/es/composite-comp/dito/components/Recommend/mobile/index.less +2 -2
- package/es/composite-comp/dito/components/SearchBanner/defaultJSON.js +158 -0
- package/es/composite-comp/dito/components/SearchBanner/imgs/defaultImg.png +0 -0
- package/es/composite-comp/dito/components/SearchBanner/imgs/pcDefImg1.png +0 -0
- package/es/composite-comp/dito/components/SearchBanner/index.js +108 -0
- package/es/composite-comp/dito/components/SearchBanner/mobile/index.js +294 -0
- package/es/composite-comp/dito/components/SearchBanner/mobile/index.less +108 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigContent/index.js +9 -1
- package/es/composite-comp/dito/config-panels/SearchBannerConfig/ConfigContent/index.js +192 -0
- package/es/composite-comp/dito/config-panels/SearchBannerConfig/ConfigContent/index.less +7 -0
- package/es/composite-comp/dito/config-panels/SearchBannerConfig/ConfigImageGroup/index.js +148 -0
- package/es/composite-comp/dito/config-panels/SearchBannerConfig/ConfigImageGroup/index.less +0 -0
- package/es/composite-comp/dito/config-panels/SearchBannerConfig/ConfigSetting/index.js +226 -0
- package/es/composite-comp/dito/config-panels/SearchBannerConfig/ConfigSetting/index.less +9 -0
- package/es/composite-comp/dito/config-panels/SearchBannerConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/dito/config-panels/SearchBannerConfig/index.js +65 -0
- package/es/composite-comp/dito/second-config-panels/SearchBannerSecondConfig/index.js +98 -0
- package/es/constants/component-types.js +9 -3
- package/es/constants/index.js +4 -0
- package/es/core/Designer/ConfigPanel/index.js +1 -0
- package/es/locale/en/en.json +2 -0
- package/es/locale/es/es.json +2 -0
- package/es/locale/id/id.json +2 -0
- package/lib/assets/fonts/magic-box-iconfont.css +59 -7
- package/lib/assets/fonts/magic-box-iconfont.js +1 -1
- package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/lib/composite-comp/common/components/ImageLabel/index.js +2 -2
- package/lib/composite-comp/common/components/ImageLabel/index.less +16 -7
- package/lib/composite-comp/common/components/ProductItem/index.js +35 -19
- package/lib/composite-comp/common/components/ProductItem/index.less +9 -2
- package/lib/composite-comp/dito/components/FlashDeal/mobile/index.less +5 -3
- package/lib/composite-comp/dito/components/PersonalInformation/mobile/images/avatar.png +0 -0
- package/lib/composite-comp/dito/components/PersonalInformation/mobile/index.js +5 -7
- package/lib/composite-comp/dito/components/Recommend/defaultJSON.js +24 -0
- package/lib/composite-comp/dito/components/Recommend/mobile/index.less +2 -2
- package/lib/composite-comp/dito/components/SearchBanner/defaultJSON.js +158 -0
- package/lib/composite-comp/dito/components/SearchBanner/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/dito/components/SearchBanner/imgs/pcDefImg1.png +0 -0
- package/lib/composite-comp/dito/components/SearchBanner/index.js +108 -0
- package/lib/composite-comp/dito/components/SearchBanner/mobile/index.js +294 -0
- package/lib/composite-comp/dito/components/SearchBanner/mobile/index.less +108 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigContent/index.js +9 -1
- package/lib/composite-comp/dito/config-panels/SearchBannerConfig/ConfigContent/index.js +192 -0
- package/lib/composite-comp/dito/config-panels/SearchBannerConfig/ConfigContent/index.less +7 -0
- package/lib/composite-comp/dito/config-panels/SearchBannerConfig/ConfigImageGroup/index.js +148 -0
- package/lib/composite-comp/dito/config-panels/SearchBannerConfig/ConfigImageGroup/index.less +0 -0
- package/lib/composite-comp/dito/config-panels/SearchBannerConfig/ConfigSetting/index.js +226 -0
- package/lib/composite-comp/dito/config-panels/SearchBannerConfig/ConfigSetting/index.less +9 -0
- package/lib/composite-comp/dito/config-panels/SearchBannerConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/dito/config-panels/SearchBannerConfig/index.js +65 -0
- package/lib/composite-comp/dito/second-config-panels/SearchBannerSecondConfig/index.js +98 -0
- package/lib/constants/component-types.js +9 -3
- package/lib/constants/index.js +4 -0
- package/lib/core/Designer/ConfigPanel/index.js +1 -0
- package/lib/locale/en/en.json +2 -0
- package/lib/locale/es/es.json +2 -0
- package/lib/locale/id/id.json +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,294 @@
|
|
|
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
|
+
require("./index.less");
|
|
11
|
+
|
|
12
|
+
var _antd = require("antd4");
|
|
13
|
+
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
16
|
+
var _common = require("../../../../../common");
|
|
17
|
+
|
|
18
|
+
var _commonUtil = require("../../../../../utils/commonUtil");
|
|
19
|
+
|
|
20
|
+
var _components = require("../../../../../meta-comp/components");
|
|
21
|
+
|
|
22
|
+
require("slick-carousel/slick/slick.css");
|
|
23
|
+
|
|
24
|
+
require("slick-carousel/slick/slick-theme.css");
|
|
25
|
+
|
|
26
|
+
var _ConfigPanel = require("../../../../../core/Designer/ConfigPanel");
|
|
27
|
+
|
|
28
|
+
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
29
|
+
|
|
30
|
+
var _mobx = require("../../../../../mobx");
|
|
31
|
+
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
33
|
+
|
|
34
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
35
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
36
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
37
|
+
__proto__: []
|
|
38
|
+
} instanceof Array && function (d, b) {
|
|
39
|
+
d.__proto__ = b;
|
|
40
|
+
} || function (d, b) {
|
|
41
|
+
for (var p in b) {
|
|
42
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return _extendStatics(d, b);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return function (d, b) {
|
|
50
|
+
_extendStatics(d, b);
|
|
51
|
+
|
|
52
|
+
function __() {
|
|
53
|
+
this.constructor = d;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
57
|
+
};
|
|
58
|
+
}();
|
|
59
|
+
|
|
60
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
61
|
+
__assign = Object.assign || function (t) {
|
|
62
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
63
|
+
s = arguments[i];
|
|
64
|
+
|
|
65
|
+
for (var p in s) {
|
|
66
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return t;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return __assign.apply(this, arguments);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
var SearchBannerMobile =
|
|
77
|
+
/** @class */
|
|
78
|
+
function (_super) {
|
|
79
|
+
__extends(SearchBannerMobile, _super);
|
|
80
|
+
|
|
81
|
+
function SearchBannerMobile() {
|
|
82
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
83
|
+
|
|
84
|
+
_this.state = {
|
|
85
|
+
carouseIndex: 0
|
|
86
|
+
};
|
|
87
|
+
_this.carouselRef = /*#__PURE__*/_react["default"].createRef();
|
|
88
|
+
_this.destroy = null;
|
|
89
|
+
|
|
90
|
+
_this.bannerGoto = function (groupSource) {
|
|
91
|
+
var nextIndex = groupSource.findIndex(function (item) {
|
|
92
|
+
return item.id === _mobx.store.clickedGroup;
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
if (nextIndex != -1 && nextIndex != _this.state.carouseIndex) {
|
|
96
|
+
_this.carouselRef.current.goTo(nextIndex);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
_this.bannerGoto = function (groupSource) {
|
|
101
|
+
var nextIndex = groupSource.findIndex(function (item) {
|
|
102
|
+
return item.id === _mobx.store.clickedGroup;
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
if (nextIndex != -1 && nextIndex != _this.state.carouseIndex) {
|
|
106
|
+
_this.carouselRef.current.goTo(nextIndex);
|
|
107
|
+
}
|
|
108
|
+
}; // padding用统一设置
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
_this.getBackgroundStyle = function (item) {
|
|
112
|
+
var wrapStyle = {}; // 背景
|
|
113
|
+
|
|
114
|
+
if (item.background) {
|
|
115
|
+
if (item.background.bgType === 'color') {
|
|
116
|
+
wrapStyle.backgroundColor = item.background.color;
|
|
117
|
+
wrapStyle.opacity = item.background.opacity ? item.background.opacity : 1;
|
|
118
|
+
} else {
|
|
119
|
+
wrapStyle.backgroundImage = "url(" + item.background.image + ")";
|
|
120
|
+
wrapStyle.backgroundPosition = 'center';
|
|
121
|
+
wrapStyle.backgroundSize = 'cover';
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return __assign({}, wrapStyle);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
return _this;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
SearchBannerMobile.prototype.componentDidMount = function () {
|
|
132
|
+
var _this = this;
|
|
133
|
+
|
|
134
|
+
this.destroy = (0, _mobx.autorun)(function () {
|
|
135
|
+
_this.bannerGoto(_this.props.data.groupSource);
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
SearchBannerMobile.prototype.componentWillReceiveProps = function (nextProps) {
|
|
140
|
+
this.bannerGoto(nextProps.data.groupSource);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
SearchBannerMobile.prototype.componentWillUnmount = function () {
|
|
144
|
+
this.destroy();
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
SearchBannerMobile.prototype.render = function () {
|
|
148
|
+
var _this = this;
|
|
149
|
+
|
|
150
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
151
|
+
|
|
152
|
+
var data = this.props.data;
|
|
153
|
+
var GAData = (0, _commonUtil.getGAData)(data);
|
|
154
|
+
var _s = this.state,
|
|
155
|
+
messageNum = _s.messageNum,
|
|
156
|
+
cartNum = _s.cartNum,
|
|
157
|
+
carouseIndex = _s.carouseIndex;
|
|
158
|
+
var autoplay = data.setting.autoplay.open;
|
|
159
|
+
/** 设计器模式下 如果选中特定group 自动播放关闭 */
|
|
160
|
+
|
|
161
|
+
if ((0, _coreUtil.isDesignMode)() && _mobx.store.clickedGroup) {
|
|
162
|
+
autoplay = false;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
166
|
+
className: "m-search-banner-mobile"
|
|
167
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
168
|
+
className: "search-bar"
|
|
169
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
170
|
+
className: "right"
|
|
171
|
+
}, data.content && ((_a = data.content.box) === null || _a === void 0 ? void 0 : _a.open) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
172
|
+
className: "search-input-wrap",
|
|
173
|
+
onClick: function onClick() {
|
|
174
|
+
return clickUrl('/search-page');
|
|
175
|
+
},
|
|
176
|
+
style: {
|
|
177
|
+
borderColor: (_c = (_b = data.content.box) === null || _b === void 0 ? void 0 : _b.color) === null || _c === void 0 ? void 0 : _c.mobile,
|
|
178
|
+
backgroundColor: (_e = (_d = data.content.box) === null || _d === void 0 ? void 0 : _d.backgroundColor) === null || _e === void 0 ? void 0 : _e.mobile
|
|
179
|
+
}
|
|
180
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
181
|
+
color: (_g = (_f = data.content.box) === null || _f === void 0 ? void 0 : _f.color) === null || _g === void 0 ? void 0 : _g.mobile,
|
|
182
|
+
size: (0, _commonUtil.convertToRem)(20),
|
|
183
|
+
type: "icon-search2"
|
|
184
|
+
})), data.content && ((_j = (_h = data.content.icon) === null || _h === void 0 ? void 0 : _h.cartIcon) === null || _j === void 0 ? void 0 : _j.mobile) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
185
|
+
className: "message-wrap"
|
|
186
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
187
|
+
color: (_l = (_k = data.content.icon) === null || _k === void 0 ? void 0 : _k.color) === null || _l === void 0 ? void 0 : _l.mobile,
|
|
188
|
+
onClick: function onClick() {
|
|
189
|
+
return clickUrl('/new-chat');
|
|
190
|
+
},
|
|
191
|
+
size: (0, _commonUtil.convertToRem)(24),
|
|
192
|
+
type: "icon-chatbot"
|
|
193
|
+
}), !!cartNum && /*#__PURE__*/_react["default"].createElement("span", {
|
|
194
|
+
className: "num"
|
|
195
|
+
}, cartNum)), data.content && ((_o = (_m = data.content.icon) === null || _m === void 0 ? void 0 : _m.messageIcon) === null || _o === void 0 ? void 0 : _o.mobile) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
196
|
+
className: "message-wrap"
|
|
197
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
198
|
+
color: (_q = (_p = data.content.icon) === null || _p === void 0 ? void 0 : _p.color) === null || _q === void 0 ? void 0 : _q.mobile,
|
|
199
|
+
onClick: function onClick() {
|
|
200
|
+
return clickUrl('/message-center');
|
|
201
|
+
},
|
|
202
|
+
size: (0, _commonUtil.convertToRem)(24),
|
|
203
|
+
type: "icon-letter"
|
|
204
|
+
}), !!messageNum && /*#__PURE__*/_react["default"].createElement("span", {
|
|
205
|
+
className: "num"
|
|
206
|
+
}, messageNum))), data.content && ((_r = data.content.logo) === null || _r === void 0 ? void 0 : _r.open) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
207
|
+
className: "logo",
|
|
208
|
+
onClick: function onClick() {
|
|
209
|
+
var _a, _b;
|
|
210
|
+
/** PTO 定制GA */
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
if (window.magicDesign.pushGA) {
|
|
214
|
+
window.magicDesign.pushGA({}, 'select_promotion', {
|
|
215
|
+
event_section: 'Search',
|
|
216
|
+
promotion_name: (_b = (_a = data.content.logo) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.h5Name
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}, /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
|
|
221
|
+
data: data.content.logo,
|
|
222
|
+
style: {
|
|
223
|
+
height: 20
|
|
224
|
+
}
|
|
225
|
+
}))), /*#__PURE__*/_react["default"].createElement(_antd.Carousel, {
|
|
226
|
+
ref: this.carouselRef,
|
|
227
|
+
afterChange: function afterChange(n) {
|
|
228
|
+
return _this.setState({
|
|
229
|
+
carouseIndex: n
|
|
230
|
+
});
|
|
231
|
+
},
|
|
232
|
+
autoplay: autoplay,
|
|
233
|
+
autoplaySpeed: data.setting.autoplay.interval * 1000,
|
|
234
|
+
dots: false
|
|
235
|
+
}, data.groupSource.map(function (item) {
|
|
236
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
237
|
+
key: item.id
|
|
238
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
239
|
+
style: _this.getBackgroundStyle(item)
|
|
240
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
241
|
+
className: "carouselItem",
|
|
242
|
+
onClick: function onClick() {
|
|
243
|
+
/** PTO 定制GA */
|
|
244
|
+
if (window.magicDesign.pushGA) {
|
|
245
|
+
window.magicDesign.pushGA({}, 'select_promotion', {
|
|
246
|
+
event_section: 'Search_Banner',
|
|
247
|
+
promotion_name: item.image.content.h5ImgSrc ? item.image.content.h5Name : i18n('BANNER_GROUP_NAME')
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}, /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
|
|
252
|
+
data: item.image,
|
|
253
|
+
GAData: __assign(__assign({}, GAData), {
|
|
254
|
+
groupId: item.id,
|
|
255
|
+
groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
|
|
256
|
+
}),
|
|
257
|
+
isBackground: true,
|
|
258
|
+
style: {
|
|
259
|
+
width: '100%'
|
|
260
|
+
}
|
|
261
|
+
}))));
|
|
262
|
+
})), data.setting.dots.open && /*#__PURE__*/_react["default"].createElement("div", {
|
|
263
|
+
className: "swiper-ban"
|
|
264
|
+
}, data.groupSource.length > 1 && data.groupSource.map(function (item, i) {
|
|
265
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
266
|
+
key: (item === null || item === void 0 ? void 0 : item.id) || i,
|
|
267
|
+
className: (0, _classnames["default"])('ban', {
|
|
268
|
+
active: i == carouseIndex,
|
|
269
|
+
isCircle: data.setting.dots.layout === 'layout1'
|
|
270
|
+
}),
|
|
271
|
+
onClick: function onClick() {
|
|
272
|
+
var _a;
|
|
273
|
+
|
|
274
|
+
return (_a = _this.carouselRef.current) === null || _a === void 0 ? void 0 : _a.goTo(i);
|
|
275
|
+
},
|
|
276
|
+
style: (0, _commonUtil.pxToRem)({
|
|
277
|
+
backgroundColor: i == carouseIndex ? data.setting.dots.hoverColor.mobile : data.setting.dots.color.mobile,
|
|
278
|
+
fontSize: i == carouseIndex ? data.setting.dots.hoverSize.mobile : data.setting.dots.size.mobile
|
|
279
|
+
})
|
|
280
|
+
});
|
|
281
|
+
})));
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
SearchBannerMobile.defaultProps = {
|
|
285
|
+
data: {
|
|
286
|
+
setting: {},
|
|
287
|
+
groupSource: []
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
return SearchBannerMobile;
|
|
291
|
+
}(_react["default"].Component);
|
|
292
|
+
|
|
293
|
+
var _default = SearchBannerMobile;
|
|
294
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
.m-search-banner-mobile {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
.m-search-banner-mobile .search-bar {
|
|
6
|
+
height: 0.96rem;
|
|
7
|
+
padding: 0.2rem 0.32rem;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: row-reverse;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
width: 100%;
|
|
13
|
+
position: absolute;
|
|
14
|
+
z-index: 2;
|
|
15
|
+
}
|
|
16
|
+
.m-search-banner-mobile .search-bar .right {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex: 1;
|
|
19
|
+
margin-left: 0.3rem;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
}
|
|
23
|
+
.m-search-banner-mobile .search-bar .right .search-input-wrap {
|
|
24
|
+
flex: 1;
|
|
25
|
+
background: transparent;
|
|
26
|
+
border-radius: 0.4rem;
|
|
27
|
+
border: 0.02rem solid #fff;
|
|
28
|
+
padding: 0.08rem 0.2rem;
|
|
29
|
+
height: 0.56rem;
|
|
30
|
+
text-align: right;
|
|
31
|
+
display: flex;
|
|
32
|
+
justify-content: flex-start;
|
|
33
|
+
}
|
|
34
|
+
.m-search-banner-mobile .search-bar .right .message-wrap {
|
|
35
|
+
position: relative;
|
|
36
|
+
margin-left: 0.2rem;
|
|
37
|
+
}
|
|
38
|
+
.m-search-banner-mobile .search-bar .right .message-wrap .num {
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: -0.12rem;
|
|
41
|
+
right: -0.06rem;
|
|
42
|
+
display: inline-block;
|
|
43
|
+
padding: 0.02rem 0.04rem;
|
|
44
|
+
min-width: 0.34rem;
|
|
45
|
+
text-align: center;
|
|
46
|
+
background-color: #0038A7;
|
|
47
|
+
border: 0.02rem solid #0038A7;
|
|
48
|
+
border-radius: 0.16rem;
|
|
49
|
+
font-family: 'Montserrat';
|
|
50
|
+
font-style: normal;
|
|
51
|
+
font-weight: 600;
|
|
52
|
+
font-size: 0.16rem;
|
|
53
|
+
color: #FFFFFF;
|
|
54
|
+
}
|
|
55
|
+
.m-search-banner-mobile .search-bar .logo img {
|
|
56
|
+
width: auto;
|
|
57
|
+
}
|
|
58
|
+
.m-search-banner-mobile .carouselItem {
|
|
59
|
+
position: relative;
|
|
60
|
+
display: flex;
|
|
61
|
+
}
|
|
62
|
+
.m-search-banner-mobile .carouselItem .carouseContent {
|
|
63
|
+
padding: 0 0.56rem;
|
|
64
|
+
position: absolute;
|
|
65
|
+
z-index: 2;
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
margin-bottom: auto;
|
|
69
|
+
}
|
|
70
|
+
.m-search-banner-mobile .carouselItem .title {
|
|
71
|
+
margin-bottom: 0.16rem;
|
|
72
|
+
}
|
|
73
|
+
.m-search-banner-mobile .carouselItem .sub-title {
|
|
74
|
+
margin-bottom: 0.4rem;
|
|
75
|
+
}
|
|
76
|
+
.m-search-banner-mobile .carouselItem .btn-wrap {
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: flex-start;
|
|
80
|
+
}
|
|
81
|
+
.m-search-banner-mobile .carouselItem .btn-wrap .btn {
|
|
82
|
+
margin-right: 0.24rem;
|
|
83
|
+
}
|
|
84
|
+
.m-search-banner-mobile .swiper-ban {
|
|
85
|
+
position: absolute;
|
|
86
|
+
width: 100%;
|
|
87
|
+
bottom: 0.2rem;
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
}
|
|
92
|
+
.m-search-banner-mobile .swiper-ban .ban {
|
|
93
|
+
font-size: 0.32rem;
|
|
94
|
+
width: 1em;
|
|
95
|
+
height: 0.25em;
|
|
96
|
+
background: #FFF;
|
|
97
|
+
cursor: inherit;
|
|
98
|
+
margin-right: 0.16rem;
|
|
99
|
+
transition: all 0.5s;
|
|
100
|
+
}
|
|
101
|
+
.m-search-banner-mobile .swiper-ban .ban.active {
|
|
102
|
+
opacity: 1;
|
|
103
|
+
}
|
|
104
|
+
.m-search-banner-mobile .swiper-ban .ban.isCircle {
|
|
105
|
+
width: 1em;
|
|
106
|
+
height: 1em;
|
|
107
|
+
border-radius: 50%;
|
|
108
|
+
}
|
package/lib/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigContent/index.js
CHANGED
|
@@ -99,6 +99,13 @@ function (_super) {
|
|
|
99
99
|
data: panelProps.salesPrice
|
|
100
100
|
}),
|
|
101
101
|
metaOption: panelProps.salesPrice
|
|
102
|
+
}, {
|
|
103
|
+
key: '5',
|
|
104
|
+
name: (0, _locale.i18n)('SOLD'),
|
|
105
|
+
value: /*#__PURE__*/_react["default"].createElement(_TextConfig["default"], {
|
|
106
|
+
data: panelProps.sold
|
|
107
|
+
}),
|
|
108
|
+
metaOption: panelProps.sold
|
|
102
109
|
}],
|
|
103
110
|
type: "switch"
|
|
104
111
|
}));
|
|
@@ -110,7 +117,8 @@ function (_super) {
|
|
|
110
117
|
label: {},
|
|
111
118
|
productName: {},
|
|
112
119
|
activityPrice: {},
|
|
113
|
-
salesPrice: {}
|
|
120
|
+
salesPrice: {},
|
|
121
|
+
sold: 0
|
|
114
122
|
}
|
|
115
123
|
};
|
|
116
124
|
return AComponent;
|
|
@@ -0,0 +1,192 @@
|
|
|
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 _antd = require("antd4");
|
|
13
|
+
|
|
14
|
+
var _common = require("../../../../../common");
|
|
15
|
+
|
|
16
|
+
var _ImageConfig = _interopRequireDefault(require("../../../../../meta-comp/config-panels/ImageConfig"));
|
|
17
|
+
|
|
18
|
+
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
19
|
+
|
|
20
|
+
var _locale = require("../../../../../locale");
|
|
21
|
+
|
|
22
|
+
require("./index.less");
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
31
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
32
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
33
|
+
__proto__: []
|
|
34
|
+
} instanceof Array && function (d, b) {
|
|
35
|
+
d.__proto__ = b;
|
|
36
|
+
} || function (d, b) {
|
|
37
|
+
for (var p in b) {
|
|
38
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return _extendStatics(d, b);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return function (d, b) {
|
|
46
|
+
_extendStatics(d, b);
|
|
47
|
+
|
|
48
|
+
function __() {
|
|
49
|
+
this.constructor = d;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
53
|
+
};
|
|
54
|
+
}();
|
|
55
|
+
|
|
56
|
+
var SearchBarConfigContent =
|
|
57
|
+
/** @class */
|
|
58
|
+
function (_super) {
|
|
59
|
+
__extends(SearchBarConfigContent, _super);
|
|
60
|
+
|
|
61
|
+
function SearchBarConfigContent() {
|
|
62
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
63
|
+
|
|
64
|
+
_this.selfRender = function () {
|
|
65
|
+
(0, _coreUtil.renderPreview)();
|
|
66
|
+
|
|
67
|
+
_this.setState({});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return _this;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
SearchBarConfigContent.prototype.render = function () {
|
|
74
|
+
var _this = this;
|
|
75
|
+
|
|
76
|
+
var _a, _b, _c, _d;
|
|
77
|
+
|
|
78
|
+
var panelProps = this.props.panelProps;
|
|
79
|
+
var source = [{
|
|
80
|
+
key: 'search1',
|
|
81
|
+
name: (0, _locale.i18n)('LOGO'),
|
|
82
|
+
value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
|
|
83
|
+
data: panelProps.logo
|
|
84
|
+
}),
|
|
85
|
+
metaOption: panelProps.logo,
|
|
86
|
+
toggleType: 'switch'
|
|
87
|
+
}, {
|
|
88
|
+
key: 'search2',
|
|
89
|
+
name: (0, _locale.i18n)('SEARCH_BOX'),
|
|
90
|
+
value: /*#__PURE__*/_react["default"].createElement("div", {
|
|
91
|
+
className: "search_bar_config_box"
|
|
92
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
93
|
+
title: (0, _locale.i18n)('BOX_COLOR')
|
|
94
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
|
|
95
|
+
colorType: "rgba",
|
|
96
|
+
onChange: function onChange(v) {
|
|
97
|
+
if ((0, _coreUtil.isPc)()) {
|
|
98
|
+
panelProps.box.color.pc = v;
|
|
99
|
+
} else {
|
|
100
|
+
panelProps.box.color.mobile = v;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
_this.selfRender();
|
|
104
|
+
},
|
|
105
|
+
value: (0, _coreUtil.isPc)() ? panelProps.box.color.pc : panelProps.box.color.mobile
|
|
106
|
+
})), /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
107
|
+
style: {
|
|
108
|
+
marginTop: 16
|
|
109
|
+
},
|
|
110
|
+
title: (0, _locale.i18n)('BOX_BACKGROUND')
|
|
111
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
|
|
112
|
+
colorType: "rgba",
|
|
113
|
+
onChange: function onChange(v) {
|
|
114
|
+
if ((0, _coreUtil.isPc)()) {
|
|
115
|
+
panelProps.box.backgroundColor.pc = v;
|
|
116
|
+
} else {
|
|
117
|
+
panelProps.box.backgroundColor.mobile = v;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
_this.selfRender();
|
|
121
|
+
},
|
|
122
|
+
value: (0, _coreUtil.isPc)() ? (_b = (_a = panelProps.box) === null || _a === void 0 ? void 0 : _a.backgroundColor) === null || _b === void 0 ? void 0 : _b.pc : (_d = (_c = panelProps.box) === null || _c === void 0 ? void 0 : _c.backgroundColor) === null || _d === void 0 ? void 0 : _d.mobile
|
|
123
|
+
}))),
|
|
124
|
+
metaOption: panelProps.box,
|
|
125
|
+
toggleType: 'switch'
|
|
126
|
+
}, {
|
|
127
|
+
key: 'search3',
|
|
128
|
+
name: (0, _locale.i18n)('ICON'),
|
|
129
|
+
toggleType: 'triangle',
|
|
130
|
+
value: /*#__PURE__*/_react["default"].createElement("div", {
|
|
131
|
+
style: {
|
|
132
|
+
marginTop: 10
|
|
133
|
+
}
|
|
134
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.Field, null, /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
|
|
135
|
+
colorType: "rgba",
|
|
136
|
+
onChange: function onChange(v) {
|
|
137
|
+
if ((0, _coreUtil.isPc)()) {
|
|
138
|
+
panelProps.icon.color.pc = v;
|
|
139
|
+
} else {
|
|
140
|
+
panelProps.icon.color.mobile = v;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
_this.selfRender();
|
|
144
|
+
},
|
|
145
|
+
value: (0, _coreUtil.isPc)() ? panelProps.icon.color.pc : panelProps.icon.color.mobile
|
|
146
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
147
|
+
style: {
|
|
148
|
+
background: '#F5F6F7',
|
|
149
|
+
padding: '14px 12px 1px'
|
|
150
|
+
}
|
|
151
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
152
|
+
layout: "horizontal",
|
|
153
|
+
title: (0, _locale.i18n)('CART_ICON')
|
|
154
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Checkbox, {
|
|
155
|
+
checked: (0, _coreUtil.isPc)() ? panelProps.icon.cartIcon.pc : panelProps.icon.cartIcon.mobile,
|
|
156
|
+
onChange: function onChange(e) {
|
|
157
|
+
if ((0, _coreUtil.isPc)()) {
|
|
158
|
+
panelProps.icon.cartIcon.pc = e.target.checked;
|
|
159
|
+
} else {
|
|
160
|
+
panelProps.icon.cartIcon.mobile = e.target.checked;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
_this.selfRender();
|
|
164
|
+
}
|
|
165
|
+
})), !(0, _coreUtil.isPc)() && /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
166
|
+
layout: "horizontal",
|
|
167
|
+
title: (0, _locale.i18n)('MESSAGE_ICON')
|
|
168
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Checkbox, {
|
|
169
|
+
checked: panelProps.icon.messageIcon.mobile,
|
|
170
|
+
onChange: function onChange(e) {
|
|
171
|
+
panelProps.icon.messageIcon.mobile = e.target.checked;
|
|
172
|
+
|
|
173
|
+
_this.selfRender();
|
|
174
|
+
}
|
|
175
|
+
})))),
|
|
176
|
+
metaOption: panelProps.icon
|
|
177
|
+
}];
|
|
178
|
+
return /*#__PURE__*/_react["default"].createElement(_common.Collapse, {
|
|
179
|
+
headerSize: "middle",
|
|
180
|
+
noChange: true,
|
|
181
|
+
onRefresh: this.selfRender,
|
|
182
|
+
showActiveColor: true,
|
|
183
|
+
source: source,
|
|
184
|
+
type: "switch"
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
return SearchBarConfigContent;
|
|
189
|
+
}(_react.Component);
|
|
190
|
+
|
|
191
|
+
var _default = SearchBarConfigContent;
|
|
192
|
+
exports["default"] = _default;
|