@dckj-npm/dc-material 0.1.147 → 0.1.149
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/build/lowcode/assets-daily.json +13 -13
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +13 -13
- package/build/lowcode/meta.design.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/bottom-navigation/bottom-navigation.d.ts +15 -0
- package/es/components/bottom-navigation/index.d.ts +3 -0
- package/es/components/button/button.d.ts +14 -0
- package/es/components/button/index.d.ts +6 -0
- package/es/components/carousel/carousel.d.ts +14 -0
- package/es/components/colorful-button/colorful-button.d.ts +12 -0
- package/es/components/colorful-button/index.d.ts +3 -0
- package/es/components/colorful-input/colorful-input.d.ts +8 -0
- package/es/components/colorful-input/index.d.ts +3 -0
- package/es/components/form/form-item.d.ts +42 -0
- package/es/components/form/form.d.ts +57 -0
- package/es/components/form/form.js +46 -0
- package/es/components/form/index.d.ts +6 -0
- package/es/components/form/index.js +6 -0
- package/es/components/form/index.scss +22 -0
- package/es/components/form/next-wrapper.d.ts +54 -0
- package/es/components/form/next-wrapper.js +43 -0
- package/es/components/goods-card-list/goods-card-list-common.d.ts +5 -0
- package/es/components/goods-card-list/goods-card-list-common.js +60 -0
- package/es/components/goods-card-list/goods-card-list-common.scss +118 -0
- package/es/components/goods-card-list/goods-card-list.d.ts +5 -0
- package/es/components/goods-card-list/goods-card-list.js +156 -0
- package/es/components/goods-card-list/goods-card-list.scss +112 -0
- package/es/components/goods-card-list/index.d.ts +4 -0
- package/es/components/goods-card-list/index.js +3 -0
- package/es/components/goods-card-list/types.d.ts +45 -0
- package/es/components/goods-card-list/types.js +1 -0
- package/es/components/grid-nav/grid-nav.d.ts +13 -0
- package/es/components/grid-nav/grid-nav.js +102 -0
- package/es/components/grid-nav/index.d.ts +3 -0
- package/es/components/grid-nav/index.js +2 -0
- package/es/components/grid-nav/index.scss +50 -0
- package/es/components/integral-task/index.d.ts +6 -0
- package/es/components/integral-task/index.js +5 -0
- package/es/components/integral-task/index.scss +35 -0
- package/es/components/integral-task/integral-task.d.ts +40 -0
- package/es/components/integral-task/integral-task.js +54 -0
- package/es/components/menu-list/index.d.ts +6 -0
- package/es/components/menu-list/index.js +6 -0
- package/es/components/menu-list/index.scss +16 -0
- package/es/components/menu-list/menu-list-item.d.ts +5 -0
- package/es/components/menu-list/menu-list-item.js +32 -0
- package/es/components/menu-list/menu-list-item.scss +49 -0
- package/es/components/menu-list/menu-list.d.ts +5 -0
- package/es/components/menu-list/menu-list.js +25 -0
- package/es/components/menu-list/types.d.ts +23 -0
- package/es/components/menu-list/types.js +1 -0
- package/es/components/message-list/index.d.ts +6 -0
- package/es/components/message-list/index.js +6 -0
- package/es/components/message-list/index.scss +22 -0
- package/es/components/message-list/message-list-item.d.ts +33 -0
- package/es/components/message-list/message-list-item.js +41 -0
- package/es/components/message-list/message-list-item.scss +60 -0
- package/es/components/message-list/message-list.d.ts +28 -0
- package/es/components/message-list/message-list.js +53 -0
- package/es/components/notice-bar/index.d.ts +3 -0
- package/es/components/notice-bar/index.js +2 -0
- package/es/components/notice-bar/index.scss +84 -0
- package/es/components/notice-bar/notice-bar-item.d.ts +18 -0
- package/es/components/notice-bar/notice-bar-item.js +30 -0
- package/es/components/notice-bar/notice-bar-item.scss +26 -0
- package/es/components/notice-bar/notice-bar.d.ts +46 -0
- package/es/components/notice-bar/notice-bar.js +57 -0
- package/es/components/position/entity.d.ts +5 -0
- package/es/components/position/entity.js +1 -0
- package/es/components/position/index.d.ts +3 -0
- package/es/components/position/index.js +2 -0
- package/es/components/position/index.scss +27 -0
- package/es/components/position/position-left.d.ts +9 -0
- package/es/components/position/position-left.js +28 -0
- package/es/components/position/position-list.d.ts +11 -0
- package/es/components/position/position-list.js +29 -0
- package/es/components/position/position.d.ts +8 -0
- package/es/components/position/position.js +48 -0
- package/es/components/radio-group/index.d.ts +8 -0
- package/es/components/radio-group/index.js +7 -0
- package/es/components/radio-group/index.scss +40 -0
- package/es/components/radio-group/radio-group-item.d.ts +48 -0
- package/es/components/radio-group/radio-group-item.js +74 -0
- package/es/components/radio-group/radio-group.d.ts +52 -0
- package/es/components/radio-group/radio-group.js +80 -0
- package/es/components/rich-text/index.d.ts +6 -0
- package/es/components/rich-text/index.js +6 -0
- package/es/components/rich-text/index.scss +19 -0
- package/es/components/rich-text/rich-text.d.ts +14 -0
- package/es/components/rich-text/rich-text.js +37 -0
- package/es/components/search-bar/index.d.ts +3 -0
- package/es/components/search-bar/index.js +2 -0
- package/es/components/search-bar/index.scss +39 -0
- package/es/components/search-bar/search-bar.d.ts +10 -0
- package/es/components/search-bar/search-bar.js +73 -0
- package/es/components/stream-list/index.d.ts +6 -0
- package/es/components/stream-list/index.js +6 -0
- package/es/components/stream-list/index.scss +26 -0
- package/es/components/stream-list/stream-list.d.ts +54 -0
- package/es/components/stream-list/stream-list.js +159 -0
- package/es/components/swiper/index.d.ts +3 -0
- package/es/components/swiper/index.js +2 -0
- package/es/components/swiper/index.scss +33 -0
- package/es/components/swiper/swiper.d.ts +26 -0
- package/es/components/swiper/swiper.js +77 -0
- package/es/components/tab/index.d.ts +6 -0
- package/es/components/tab/index.js +5 -0
- package/es/components/tab/index.scss +39 -0
- package/es/components/tab/tab.d.ts +27 -0
- package/es/components/tab/tab.js +50 -0
- package/es/components/tab-container/index.d.ts +3 -0
- package/es/components/tab-container/index.js +2 -0
- package/es/components/tab-container/index.scss +48 -0
- package/es/components/tab-container/tab-container.d.ts +10 -0
- package/es/components/tab-container/tab-container.js +26 -0
- package/es/components/tab-container-item/index.d.ts +3 -0
- package/es/components/tab-container-item/index.js +2 -0
- package/es/components/tab-container-item/index.scss +0 -0
- package/es/components/tab-container-item/tab-container-item.d.ts +11 -0
- package/es/components/tab-container-item/tab-container-item.js +19 -0
- package/es/components/tag/index.d.ts +6 -0
- package/es/components/tag/index.js +5 -0
- package/es/components/tag/index.scss +24 -0
- package/es/components/tag/tag.d.ts +14 -0
- package/es/components/tag/tag.js +14 -0
- package/es/components/teletext-list/index.d.ts +6 -0
- package/es/components/teletext-list/index.js +6 -0
- package/es/components/teletext-list/index.scss +40 -0
- package/es/components/teletext-list/teletext-list-item.d.ts +33 -0
- package/es/components/teletext-list/teletext-list-item.js +61 -0
- package/es/components/teletext-list/teletext-list-item.scss +57 -0
- package/es/components/teletext-list/teletext-list.d.ts +61 -0
- package/es/components/teletext-list/teletext-list.js +48 -0
- package/es/components/title/index.d.ts +8 -0
- package/es/components/title/index.js +7 -0
- package/es/components/title/title-1.d.ts +10 -0
- package/es/components/title/title-1.js +16 -0
- package/es/components/title/title-1.scss +25 -0
- package/es/components/title/title-2.d.ts +18 -0
- package/es/components/title/title-2.js +31 -0
- package/es/components/title/title-2.scss +22 -0
- package/es/entity/dynamic-column-data-type.d.ts +47 -0
- package/es/entity/dynamic-column-data-type.js +165 -0
- package/es/index.d.ts +46 -0
- package/es/index.js +86 -0
- package/es/index.scss +6 -0
- package/es/style.js +4 -0
- package/es/utils/children-node-handle.d.ts +9 -0
- package/es/utils/children-node-handle.js +25 -0
- package/es/utils/component-wrapper.d.ts +9 -0
- package/es/utils/component-wrapper.js +38 -0
- package/es/utils/debounce.d.ts +1 -0
- package/es/utils/debounce.js +14 -0
- package/es/utils/textUtil.d.ts +10 -0
- package/es/utils/textUtil.js +51 -0
- package/es/utils/time-util.d.ts +5 -0
- package/es/utils/time-util.js +18 -0
- package/es/variables.d.ts +2 -0
- package/es/variables.js +2 -0
- package/es/variables.scss +3 -0
- package/lib/assets/icon/grid-nav/right.png +0 -0
- package/lib/assets/icon/position/img.png +0 -0
- package/lib/assets/icon/position/location.png +0 -0
- package/lib/assets/icon/search/delete.png +0 -0
- package/lib/assets/icon/search/search.png +0 -0
- package/lib/assets/icon/teletext-list/arr.png +0 -0
- package/lib/components/bottom-navigation/bottom-navigation.d.ts +15 -0
- package/lib/components/bottom-navigation/index.d.ts +3 -0
- package/lib/components/button/button.d.ts +14 -0
- package/lib/components/button/index.d.ts +6 -0
- package/lib/components/carousel/carousel.d.ts +14 -0
- package/lib/components/colorful-button/colorful-button.d.ts +12 -0
- package/lib/components/colorful-button/index.d.ts +3 -0
- package/lib/components/colorful-input/colorful-input.d.ts +8 -0
- package/lib/components/colorful-input/index.d.ts +3 -0
- package/lib/components/form/form-item.d.ts +42 -0
- package/lib/components/form/form-item.js +86 -0
- package/lib/components/form/form-item.scss +20 -0
- package/lib/components/form/form.d.ts +57 -0
- package/lib/components/form/form.js +49 -0
- package/lib/components/form/index.d.ts +6 -0
- package/lib/components/form/index.js +6 -0
- package/lib/components/form/index.scss +22 -0
- package/lib/components/form/next-wrapper.d.ts +54 -0
- package/lib/components/form/next-wrapper.js +49 -0
- package/lib/components/goods-card-list/goods-card-list-common.d.ts +5 -0
- package/lib/components/goods-card-list/goods-card-list.d.ts +5 -0
- package/lib/components/goods-card-list/index.d.ts +4 -0
- package/lib/components/goods-card-list/types.d.ts +45 -0
- package/lib/components/grid-nav/grid-nav.d.ts +13 -0
- package/lib/components/grid-nav/grid-nav.js +15 -4
- package/lib/components/grid-nav/index.d.ts +3 -0
- package/lib/components/grid-nav/index.scss +27 -18
- package/lib/components/integral-task/index.d.ts +6 -0
- package/lib/components/integral-task/integral-task.d.ts +40 -0
- package/lib/components/menu-list/index.d.ts +6 -0
- package/lib/components/menu-list/menu-list-item.d.ts +5 -0
- package/lib/components/menu-list/menu-list.d.ts +5 -0
- package/lib/components/menu-list/types.d.ts +23 -0
- package/lib/components/message-list/index.d.ts +6 -0
- package/lib/components/message-list/message-list-item.d.ts +33 -0
- package/lib/components/message-list/message-list-item.scss +1 -1
- package/lib/components/message-list/message-list.d.ts +28 -0
- package/lib/components/notice-bar/index.d.ts +3 -0
- package/lib/components/notice-bar/index.scss +56 -14
- package/lib/components/notice-bar/notice-bar-item.d.ts +18 -0
- package/lib/components/notice-bar/notice-bar-item.js +6 -5
- package/lib/components/notice-bar/notice-bar-item.scss +1 -1
- package/lib/components/notice-bar/notice-bar.d.ts +46 -0
- package/lib/components/notice-bar/notice-bar.js +28 -56
- package/lib/components/position/entity.d.ts +5 -0
- package/lib/components/position/index.d.ts +3 -0
- package/lib/components/position/position-left.d.ts +9 -0
- package/lib/components/position/position-list.d.ts +11 -0
- package/lib/components/position/position-list.js +2 -3
- package/lib/components/position/position.d.ts +8 -0
- package/lib/components/radio-group/index.d.ts +8 -0
- package/lib/components/radio-group/radio-group-item.d.ts +48 -0
- package/lib/components/radio-group/radio-group.d.ts +52 -0
- package/lib/components/rich-text/index.d.ts +6 -0
- package/lib/components/rich-text/rich-text.d.ts +14 -0
- package/lib/components/search-bar/index.d.ts +3 -0
- package/lib/components/search-bar/index.scss +36 -10
- package/lib/components/search-bar/search-bar.d.ts +10 -0
- package/lib/components/search-bar/search-bar.js +67 -27
- package/lib/components/stream-list/index.d.ts +6 -0
- package/lib/components/stream-list/index.js +6 -0
- package/lib/components/stream-list/index.scss +26 -0
- package/lib/components/stream-list/stream-list.d.ts +54 -0
- package/lib/components/stream-list/stream-list.js +166 -0
- package/lib/components/swiper/index.d.ts +3 -0
- package/lib/components/swiper/index.scss +29 -8
- package/lib/components/swiper/swiper.d.ts +26 -0
- package/lib/components/swiper/swiper.js +60 -19
- package/lib/components/tab/index.d.ts +6 -0
- package/lib/components/tab/tab.d.ts +27 -0
- package/lib/components/tab-container/index.d.ts +3 -0
- package/lib/components/tab-container/tab-container.d.ts +10 -0
- package/lib/components/tab-container-item/index.d.ts +3 -0
- package/lib/components/tab-container-item/tab-container-item.d.ts +11 -0
- package/lib/components/tag/index.d.ts +6 -0
- package/lib/components/tag/tag.d.ts +14 -0
- package/lib/components/teletext-list/index.d.ts +6 -0
- package/lib/components/teletext-list/index.scss +21 -0
- package/lib/components/teletext-list/teletext-list-item.d.ts +33 -0
- package/lib/components/teletext-list/teletext-list-item.scss +4 -2
- package/lib/components/teletext-list/teletext-list.d.ts +61 -0
- package/lib/components/teletext-list/teletext-list.js +17 -7
- package/lib/components/title/index.d.ts +8 -0
- package/lib/components/title/title-1.d.ts +10 -0
- package/lib/components/title/title-2.d.ts +18 -0
- package/lib/entity/dynamic-column-data-type.d.ts +47 -0
- package/lib/entity/dynamic-column-data-type.js +169 -0
- package/lib/index.d.ts +46 -0
- package/lib/index.js +9 -1
- package/lib/style.js +1 -2
- package/lib/utils/children-node-handle.d.ts +9 -0
- package/lib/utils/component-wrapper.d.ts +9 -0
- package/lib/utils/debounce.d.ts +1 -0
- package/lib/utils/textUtil.d.ts +10 -0
- package/lib/utils/textUtil.js +55 -0
- package/lib/utils/time-util.d.ts +5 -0
- package/lib/variables.d.ts +2 -0
- package/lowcode/{d-c-form → form}/meta.ts +6 -6
- package/lowcode_es/{d-c-form → form}/meta.js +6 -6
- package/lowcode_es/meta.js +3 -3
- package/lowcode_lib/{d-c-form → form}/meta.js +6 -6
- package/lowcode_lib/meta.js +3 -3
- package/package.json +3 -3
- package/lib/components/notice-bar/components/ScrollSwitcher.js +0 -52
- package/lib/components/notice-bar/components/ScrollSwitcher.scss +0 -17
- /package/lowcode_es/{d-c-form → form}/meta.d.ts +0 -0
- /package/lowcode_lib/{d-c-form → form}/meta.d.ts +0 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["dataList", "maxSales", "onClick"];
|
|
4
|
+
import React, { useEffect, useState } from 'react';
|
|
5
|
+
import { debounce } from "../../utils/debounce";
|
|
6
|
+
import Carousel from "../carousel/carousel";
|
|
7
|
+
import "./goods-card-list.scss";
|
|
8
|
+
var GoodsCardList = function GoodsCardList(_ref) {
|
|
9
|
+
var _ref$dataList = _ref.dataList,
|
|
10
|
+
dataList = _ref$dataList === void 0 ? [] : _ref$dataList,
|
|
11
|
+
_ref$maxSales = _ref.maxSales,
|
|
12
|
+
maxSales = _ref$maxSales === void 0 ? 1000 : _ref$maxSales,
|
|
13
|
+
_ref$onClick = _ref.onClick,
|
|
14
|
+
_onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
15
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
16
|
+
var _useState = useState([]),
|
|
17
|
+
positions = _useState[0],
|
|
18
|
+
setPositions = _useState[1];
|
|
19
|
+
var _useState2 = useState(0),
|
|
20
|
+
columnWidth = _useState2[0],
|
|
21
|
+
setColumnWidth = _useState2[1];
|
|
22
|
+
var _useState3 = useState(0),
|
|
23
|
+
maxContainerHeight = _useState3[0],
|
|
24
|
+
setMaxContainerHeight = _useState3[1];
|
|
25
|
+
useEffect(function () {
|
|
26
|
+
var updateLayout = function updateLayout() {
|
|
27
|
+
var container = document.querySelector('.waterfall-container');
|
|
28
|
+
if (container) {
|
|
29
|
+
var itemElements = document.querySelectorAll('.waterfall-item');
|
|
30
|
+
// 横向间距
|
|
31
|
+
var horizontalGap = 12;
|
|
32
|
+
// 纵向间距
|
|
33
|
+
var verticalGap = 10;
|
|
34
|
+
var containerWidth = container.offsetWidth;
|
|
35
|
+
// 每列宽度为容器宽度的一半减去间距
|
|
36
|
+
var calculatedColumnWidth = (containerWidth - horizontalGap) / 2;
|
|
37
|
+
setColumnWidth(calculatedColumnWidth);
|
|
38
|
+
// 两列布局
|
|
39
|
+
var columnHeights = Array.from({
|
|
40
|
+
length: 2
|
|
41
|
+
}).fill(0);
|
|
42
|
+
var newPositions = [];
|
|
43
|
+
// 循环计算所有的子元素的信息
|
|
44
|
+
itemElements.forEach(function (item) {
|
|
45
|
+
var _item$getBoundingClie = item.getBoundingClientRect(),
|
|
46
|
+
height = _item$getBoundingClie.height;
|
|
47
|
+
// 找到最短的那一列
|
|
48
|
+
var minHeight = Math.min.apply(Math, columnHeights);
|
|
49
|
+
// 获取该列的索引
|
|
50
|
+
var columnIndex = columnHeights.indexOf(minHeight);
|
|
51
|
+
var left = columnIndex * (calculatedColumnWidth + horizontalGap);
|
|
52
|
+
var top = columnHeights[columnIndex];
|
|
53
|
+
// 存储元素的定位
|
|
54
|
+
newPositions.push({
|
|
55
|
+
left: left,
|
|
56
|
+
top: top
|
|
57
|
+
});
|
|
58
|
+
// 更新该列的高度
|
|
59
|
+
columnHeights[columnIndex] += height + verticalGap;
|
|
60
|
+
});
|
|
61
|
+
// 更新位置
|
|
62
|
+
setPositions(newPositions);
|
|
63
|
+
setMaxContainerHeight(Math.max.apply(Math, columnHeights));
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
var debouncedUpdateLayout = dataList.length < 15 ? updateLayout : debounce(updateLayout, 200);
|
|
67
|
+
// 图片加载完成后更新布局
|
|
68
|
+
var handleImageLoad = function handleImageLoad() {
|
|
69
|
+
debouncedUpdateLayout();
|
|
70
|
+
};
|
|
71
|
+
// 初始化布局
|
|
72
|
+
debouncedUpdateLayout();
|
|
73
|
+
// 监听图片加载事件,以确保所有图片都加载完后再更新布局
|
|
74
|
+
var images = document.querySelectorAll('.waterfall-container img');
|
|
75
|
+
images.forEach(function (img) {
|
|
76
|
+
// 如果图片已经加载完成(缓存中加载),则立即更新布局
|
|
77
|
+
if (img.complete) {
|
|
78
|
+
handleImageLoad();
|
|
79
|
+
} else {
|
|
80
|
+
// 如果图片未加载完成,监听加载事件
|
|
81
|
+
img.addEventListener('load', handleImageLoad);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// 窗口变化时更新布局
|
|
86
|
+
window.addEventListener('resize', debouncedUpdateLayout);
|
|
87
|
+
return function () {
|
|
88
|
+
// 清理事件监听
|
|
89
|
+
window.removeEventListener('resize', debouncedUpdateLayout);
|
|
90
|
+
images.forEach(function (img) {
|
|
91
|
+
return img.removeEventListener('load', handleImageLoad);
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
// 当 dataList 变化时重新计算
|
|
96
|
+
[dataList]);
|
|
97
|
+
var resolveResultDesc = function resolveResultDesc(desc) {
|
|
98
|
+
var htmlString = "<div>" + desc + "</div>";
|
|
99
|
+
// 创建一个虚拟的 DOM 容器
|
|
100
|
+
var tempDiv = document.createElement('div');
|
|
101
|
+
tempDiv.innerHTML = htmlString;
|
|
102
|
+
// 提取文本
|
|
103
|
+
return tempDiv.textContent || tempDiv.innerText;
|
|
104
|
+
};
|
|
105
|
+
var resultStyle = _extends({}, otherProps.style || {}, {
|
|
106
|
+
height: maxContainerHeight + 20 + "px"
|
|
107
|
+
});
|
|
108
|
+
var _otherProps = _extends({}, otherProps || {}, {
|
|
109
|
+
style: resultStyle
|
|
110
|
+
});
|
|
111
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
112
|
+
className: "card-list-goods__container waterfall-container",
|
|
113
|
+
style: {
|
|
114
|
+
height: maxContainerHeight + 20 + "px"
|
|
115
|
+
}
|
|
116
|
+
}, _otherProps), dataList.map(function (item, index) {
|
|
117
|
+
var _positions$index, _positions$index2;
|
|
118
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
key: item.key,
|
|
120
|
+
className: "card-list-goods__item waterfall-item",
|
|
121
|
+
onClick: function onClick() {
|
|
122
|
+
return _onClick(item);
|
|
123
|
+
},
|
|
124
|
+
style: {
|
|
125
|
+
left: ((_positions$index = positions[index]) === null || _positions$index === void 0 ? void 0 : _positions$index.left) + "px",
|
|
126
|
+
top: ((_positions$index2 = positions[index]) === null || _positions$index2 === void 0 ? void 0 : _positions$index2.top) + "px",
|
|
127
|
+
width: columnWidth + "px"
|
|
128
|
+
}
|
|
129
|
+
}, item.imageList && item.imageList.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
130
|
+
className: "card-list-goods__image"
|
|
131
|
+
}, /*#__PURE__*/React.createElement(Carousel, {
|
|
132
|
+
images: item.imageList,
|
|
133
|
+
interval: 3000
|
|
134
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
135
|
+
className: "card-list-goods__content"
|
|
136
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
137
|
+
className: "card-list-goods__title"
|
|
138
|
+
}, item.title), /*#__PURE__*/React.createElement("div", {
|
|
139
|
+
className: "card-list-goods__desc"
|
|
140
|
+
}, resolveResultDesc(item.desc)), /*#__PURE__*/React.createElement("div", {
|
|
141
|
+
className: "card-list-goods__bottom"
|
|
142
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
143
|
+
className: "card-list-goods__unit"
|
|
144
|
+
}, "\uFFE5"), /*#__PURE__*/React.createElement("div", {
|
|
145
|
+
className: "card-list-goods__price"
|
|
146
|
+
}, item.activePrice || item.price), item.activePrice && /*#__PURE__*/React.createElement("div", {
|
|
147
|
+
className: "card-list-goods__unit__delete"
|
|
148
|
+
}, "\uFFE5"), item.activePrice && /*#__PURE__*/React.createElement("div", {
|
|
149
|
+
className: "card-list-goods__price__delete"
|
|
150
|
+
}, item.price), /*#__PURE__*/React.createElement("div", {
|
|
151
|
+
className: "card-list-goods__sales"
|
|
152
|
+
}, "\u5DF2\u552E", item.sales > maxSales ? maxSales + "+" : item.sales))));
|
|
153
|
+
}));
|
|
154
|
+
};
|
|
155
|
+
GoodsCardList.displayName = 'GoodsCardList';
|
|
156
|
+
export default GoodsCardList;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
.card-list-goods__container {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
|
|
5
|
+
& > .card-list-goods__item {
|
|
6
|
+
position: absolute;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
transition: top 0.35s ease, left 0.35s ease, width 0.35s ease;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
border-radius: 8px;
|
|
11
|
+
box-shadow: 0 3px 9px 1px rgba(204, 204, 204, 0.35);
|
|
12
|
+
|
|
13
|
+
& > .card-list-goods__image {
|
|
14
|
+
height: 200px;
|
|
15
|
+
width: 100%;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
display: flex;
|
|
18
|
+
|
|
19
|
+
& > img {
|
|
20
|
+
height: 100%;
|
|
21
|
+
width: 100%;
|
|
22
|
+
object-fit: cover;
|
|
23
|
+
object-position: center;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
& > .card-list-goods__content {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
padding: 0.5rem;
|
|
32
|
+
|
|
33
|
+
.card-list-goods__title {
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
display: -webkit-box;
|
|
36
|
+
-webkit-box-orient: vertical;
|
|
37
|
+
-webkit-line-clamp: 2;
|
|
38
|
+
line-clamp: 2;
|
|
39
|
+
margin-top: 0.25rem;
|
|
40
|
+
margin-bottom: 0.25rem;
|
|
41
|
+
font-size: 14px;
|
|
42
|
+
font-weight: 700;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.card-list-goods__desc {
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
text-overflow: ellipsis;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
line-clamp: 2;
|
|
50
|
+
margin-top: 0.25rem;
|
|
51
|
+
margin-bottom: 0.25rem;
|
|
52
|
+
font-size: 12px;
|
|
53
|
+
color: #333333;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.card-list-goods__bottom {
|
|
57
|
+
margin-top: 0.25rem;
|
|
58
|
+
margin-bottom: 0.25rem;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: baseline;
|
|
61
|
+
flex-wrap: wrap;
|
|
62
|
+
row-gap: 0.5rem;
|
|
63
|
+
|
|
64
|
+
& > div {
|
|
65
|
+
display: flex;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.card-list-goods__unit {
|
|
69
|
+
font-size: 12px;
|
|
70
|
+
color: #F57D51;
|
|
71
|
+
font-weight: 700;
|
|
72
|
+
line-height: 1;
|
|
73
|
+
|
|
74
|
+
&__delete {
|
|
75
|
+
margin-left: 0;
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
color: #666666;
|
|
78
|
+
line-height: 1;
|
|
79
|
+
text-decoration: line-through
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.card-list-goods__price {
|
|
85
|
+
font-size: 17px;
|
|
86
|
+
color: #F57D51;
|
|
87
|
+
font-weight: 700;
|
|
88
|
+
line-height: 1;
|
|
89
|
+
|
|
90
|
+
&__delete {
|
|
91
|
+
margin-left: 0;
|
|
92
|
+
font-size: 14px;
|
|
93
|
+
color: #666666;
|
|
94
|
+
line-height: 1;
|
|
95
|
+
text-decoration: line-through
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.card-list-goods__sales {
|
|
100
|
+
margin-left: 3px;
|
|
101
|
+
font-size: 12px;
|
|
102
|
+
color: #666666;
|
|
103
|
+
line-height: 1;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface GoodsCardListProps {
|
|
2
|
+
/**
|
|
3
|
+
* 卡片列表数据
|
|
4
|
+
*/
|
|
5
|
+
dataList: GoodsCardListItemProps[];
|
|
6
|
+
/**
|
|
7
|
+
* 最大销量
|
|
8
|
+
*/
|
|
9
|
+
maxSales?: number;
|
|
10
|
+
/**
|
|
11
|
+
* 点击事件
|
|
12
|
+
* @param item
|
|
13
|
+
*/
|
|
14
|
+
onClick?: (item: GoodsCardListItemProps) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface GoodsCardListItemProps {
|
|
17
|
+
/**
|
|
18
|
+
* 唯一标识
|
|
19
|
+
*/
|
|
20
|
+
key: string;
|
|
21
|
+
/**
|
|
22
|
+
* 缩略图列表
|
|
23
|
+
*/
|
|
24
|
+
imageList: string[];
|
|
25
|
+
/**
|
|
26
|
+
* 标题
|
|
27
|
+
*/
|
|
28
|
+
title: string;
|
|
29
|
+
/**
|
|
30
|
+
* 简介
|
|
31
|
+
*/
|
|
32
|
+
desc: string;
|
|
33
|
+
/**
|
|
34
|
+
* 价格
|
|
35
|
+
*/
|
|
36
|
+
price: string;
|
|
37
|
+
/**
|
|
38
|
+
* 促销价格
|
|
39
|
+
*/
|
|
40
|
+
activePrice?: string;
|
|
41
|
+
/**
|
|
42
|
+
* 销量
|
|
43
|
+
*/
|
|
44
|
+
sales: number;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface GridNavProps {
|
|
3
|
+
dataSourceSetting: [];
|
|
4
|
+
columns: number;
|
|
5
|
+
iconSize: string;
|
|
6
|
+
fontWeight: string;
|
|
7
|
+
fontSize: number;
|
|
8
|
+
fontColor: string;
|
|
9
|
+
lineHeight: string;
|
|
10
|
+
lineNum: number;
|
|
11
|
+
}
|
|
12
|
+
declare const GridNav: React.ForwardRefExoticComponent<GridNavProps & React.RefAttributes<any>>;
|
|
13
|
+
export default GridNav;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import gridNavImg from "../../assets/icon/grid-nav/right.png";
|
|
5
|
+
var ExampleComponent = function ExampleComponent(props, ref) {
|
|
6
|
+
var columns = props.columns,
|
|
7
|
+
_props$iconSize = props.iconSize,
|
|
8
|
+
iconSize = _props$iconSize === void 0 ? 'medium' : _props$iconSize,
|
|
9
|
+
_props$fontWeight = props.fontWeight,
|
|
10
|
+
fontWeight = _props$fontWeight === void 0 ? 'normal' : _props$fontWeight,
|
|
11
|
+
_props$fontSize = props.fontSize,
|
|
12
|
+
fontSize = _props$fontSize === void 0 ? 12 : _props$fontSize,
|
|
13
|
+
_props$fontColor = props.fontColor,
|
|
14
|
+
fontColor = _props$fontColor === void 0 ? '#222' : _props$fontColor,
|
|
15
|
+
_props$lineHeight = props.lineHeight,
|
|
16
|
+
lineHeight = _props$lineHeight === void 0 ? 'auto' : _props$lineHeight,
|
|
17
|
+
_props$lineNum = props.lineNum,
|
|
18
|
+
lineNum = _props$lineNum === void 0 ? 1 : _props$lineNum,
|
|
19
|
+
dataSourceSetting = props.dataSourceSetting;
|
|
20
|
+
console.log('dataSourceSetting的值为', dataSourceSetting);
|
|
21
|
+
|
|
22
|
+
// 设置图标尺寸
|
|
23
|
+
var iconStyle = {};
|
|
24
|
+
switch (iconSize) {
|
|
25
|
+
case 'large':
|
|
26
|
+
iconStyle = {
|
|
27
|
+
width: '64px',
|
|
28
|
+
height: '64px'
|
|
29
|
+
};
|
|
30
|
+
break;
|
|
31
|
+
case 'medium':
|
|
32
|
+
iconStyle = {
|
|
33
|
+
width: '48px',
|
|
34
|
+
height: '48px'
|
|
35
|
+
};
|
|
36
|
+
break;
|
|
37
|
+
case 'small':
|
|
38
|
+
iconStyle = {
|
|
39
|
+
width: '32px',
|
|
40
|
+
height: '32px'
|
|
41
|
+
};
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
iconStyle = {
|
|
45
|
+
width: '48px',
|
|
46
|
+
height: '48px'
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 设置字重
|
|
51
|
+
var fontStyle = {
|
|
52
|
+
fontWeight: fontWeight,
|
|
53
|
+
fontSize: fontSize,
|
|
54
|
+
color: fontColor,
|
|
55
|
+
lineHeight: lineHeight
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// 设置行数
|
|
59
|
+
var fontLineStyle = {};
|
|
60
|
+
fontLineStyle = {
|
|
61
|
+
maxWidth: '80px',
|
|
62
|
+
overflow: 'hidden',
|
|
63
|
+
// whiteSpace: lineNum === 1 ? 'nowrap' : 'none',
|
|
64
|
+
textOverflow: 'ellipsis',
|
|
65
|
+
display: '-webkit-box',
|
|
66
|
+
WebkitLineClamp: lineNum,
|
|
67
|
+
WebkitBoxOrient: 'vertical'
|
|
68
|
+
};
|
|
69
|
+
var fontAllStyle = _extends({}, fontStyle, fontLineStyle);
|
|
70
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
ref: ref,
|
|
72
|
+
className: "dc-grid-nav",
|
|
73
|
+
style: {
|
|
74
|
+
gridTemplateColumns: "repeat(" + columns + ", 1fr)"
|
|
75
|
+
}
|
|
76
|
+
}, dataSourceSetting.map(function (item, index) {
|
|
77
|
+
var _item$rightText;
|
|
78
|
+
return item ? /*#__PURE__*/React.createElement("a", {
|
|
79
|
+
key: index,
|
|
80
|
+
href: item.link || '#',
|
|
81
|
+
className: "grid-item"
|
|
82
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
83
|
+
src: item.icon || 'https://qcloudimg.tencent-cloud.cn/raw/fe54a986a821473655ba20afe30a543a.png',
|
|
84
|
+
alt: item.title || '导航',
|
|
85
|
+
style: iconStyle,
|
|
86
|
+
className: "dc-grid-nav-item-img"
|
|
87
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
88
|
+
style: fontAllStyle,
|
|
89
|
+
className: "dc-grid-nav-item-title"
|
|
90
|
+
}, item.title || '无标题'), item.rightText ? /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
className: "dc-grid-nav-item-right"
|
|
92
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
93
|
+
src: gridNavImg,
|
|
94
|
+
className: "dc-grid-nav-item-right-img"
|
|
95
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
96
|
+
className: "dc-grid-nav-item-right-title"
|
|
97
|
+
}, (_item$rightText = item.rightText) !== null && _item$rightText !== void 0 ? _item$rightText : '右侧')) : '') : null;
|
|
98
|
+
}));
|
|
99
|
+
};
|
|
100
|
+
var GridNav = /*#__PURE__*/forwardRef(ExampleComponent);
|
|
101
|
+
GridNav.displayName = 'GridNav';
|
|
102
|
+
export default GridNav;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* write style here */
|
|
2
|
+
.dc-grid-nav {
|
|
3
|
+
width: 100%;
|
|
4
|
+
display: grid;
|
|
5
|
+
// gap: 14px 38px;
|
|
6
|
+
margin: 0;
|
|
7
|
+
grid-row-gap: 14px;
|
|
8
|
+
&-item {
|
|
9
|
+
&-title {
|
|
10
|
+
color: #222222;
|
|
11
|
+
}
|
|
12
|
+
&-right {
|
|
13
|
+
position: absolute;
|
|
14
|
+
top: -10px;
|
|
15
|
+
right: 2px;
|
|
16
|
+
z-index: 9;
|
|
17
|
+
&-title {
|
|
18
|
+
font-size: 8px;
|
|
19
|
+
color: #fff;
|
|
20
|
+
position: absolute;
|
|
21
|
+
left: 8px;
|
|
22
|
+
top: 2px;
|
|
23
|
+
z-index: 10;
|
|
24
|
+
}
|
|
25
|
+
&-img {
|
|
26
|
+
width: 32px;
|
|
27
|
+
height: 19.5px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.grid-item {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
align-items: center;
|
|
37
|
+
text-align: center;
|
|
38
|
+
text-decoration: none;
|
|
39
|
+
color: #333;
|
|
40
|
+
position: relative;
|
|
41
|
+
|
|
42
|
+
img {
|
|
43
|
+
object-fit: cover;
|
|
44
|
+
margin-bottom: 3px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&:hover {
|
|
48
|
+
color: #007bff;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.integral-task__container {
|
|
2
|
+
padding: 0 12px;
|
|
3
|
+
&__item {
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
align-items: center;
|
|
7
|
+
&__left {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
&__img {
|
|
11
|
+
width: 53px;
|
|
12
|
+
height: 53px;
|
|
13
|
+
margin-right: 9px;
|
|
14
|
+
}
|
|
15
|
+
&__content {
|
|
16
|
+
&__title {
|
|
17
|
+
font-size: 15px;
|
|
18
|
+
color: #333333;
|
|
19
|
+
}
|
|
20
|
+
&__integral {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
&--icon {
|
|
24
|
+
width: 15px;
|
|
25
|
+
height: 15px;
|
|
26
|
+
}
|
|
27
|
+
&--number {
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
color: #EA6A3D;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
interface DataProps {
|
|
4
|
+
/**
|
|
5
|
+
* 任务名称
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* 积分
|
|
10
|
+
*/
|
|
11
|
+
integral: number;
|
|
12
|
+
/**
|
|
13
|
+
* 状态 0 未完成 1 已完成
|
|
14
|
+
*/
|
|
15
|
+
status: number;
|
|
16
|
+
}
|
|
17
|
+
export interface IntegralTaskProps {
|
|
18
|
+
/**
|
|
19
|
+
* 任务名称
|
|
20
|
+
*/
|
|
21
|
+
list: DataProps[];
|
|
22
|
+
/**
|
|
23
|
+
* 图标
|
|
24
|
+
*/
|
|
25
|
+
icon: string;
|
|
26
|
+
/**
|
|
27
|
+
* 图片
|
|
28
|
+
*/
|
|
29
|
+
images: string[];
|
|
30
|
+
/**
|
|
31
|
+
* 完成文案
|
|
32
|
+
*/
|
|
33
|
+
completeLabel: string;
|
|
34
|
+
/**
|
|
35
|
+
* 未完成文案
|
|
36
|
+
*/
|
|
37
|
+
undoneLabel: string;
|
|
38
|
+
}
|
|
39
|
+
declare const IntegralTask: React.FC<IntegralTaskProps>;
|
|
40
|
+
export default IntegralTask;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["list", "icon", "images", "undoneLabel", "completeLabel", "children"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import "./index.scss";
|
|
6
|
+
import { convertChildren } from "../../utils/children-node-handle";
|
|
7
|
+
var Status = /*#__PURE__*/function (Status) {
|
|
8
|
+
Status[Status["undone"] = 0] = "undone";
|
|
9
|
+
Status[Status["complete"] = 1] = "complete";
|
|
10
|
+
return Status;
|
|
11
|
+
}(Status || {});
|
|
12
|
+
var IntegralTask = function IntegralTask(_ref) {
|
|
13
|
+
var list = _ref.list,
|
|
14
|
+
icon = _ref.icon,
|
|
15
|
+
images = _ref.images,
|
|
16
|
+
undoneLabel = _ref.undoneLabel,
|
|
17
|
+
completeLabel = _ref.completeLabel,
|
|
18
|
+
children = _ref.children,
|
|
19
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
|
+
console.log(images, 'images');
|
|
21
|
+
images = images || [];
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
23
|
+
className: "integral-task__container"
|
|
24
|
+
}, otherProps), list && list.length ? list.map(function (item, index) {
|
|
25
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
className: "integral-task__container__item"
|
|
27
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: "integral-task__container__item__left"
|
|
29
|
+
}, convertChildren(children, 'image-left', {
|
|
30
|
+
src: images[index % images.length],
|
|
31
|
+
className: 'integral-task__container__item__left__img'
|
|
32
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: "integral-task__container__item__left__content"
|
|
34
|
+
}, convertChildren(children, 'title', {
|
|
35
|
+
children: item.name,
|
|
36
|
+
className: 'integral-task__container__item__left__content__title'
|
|
37
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
className: "integral-task__container__item__left__content__integral"
|
|
39
|
+
}, icon ? convertChildren(children, 'image-icon', {
|
|
40
|
+
src: icon,
|
|
41
|
+
className: 'integral-task__container__item__left__content__integral--icon'
|
|
42
|
+
}) : '', convertChildren(children, 'integral', {
|
|
43
|
+
children: item.integral + ' 积分',
|
|
44
|
+
className: 'integral-task__container__item__left__content__integral--number'
|
|
45
|
+
})))), /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
className: "integral-task__container__item__right"
|
|
47
|
+
}, convertChildren(children, 'button2', {
|
|
48
|
+
children: item.integral + ' 积分',
|
|
49
|
+
name: item.status === Status.undone ? undoneLabel : completeLabel,
|
|
50
|
+
color: Status[item.status]
|
|
51
|
+
})));
|
|
52
|
+
}) : '暂无数据');
|
|
53
|
+
};
|
|
54
|
+
export default IntegralTask;
|