@tbox.cn/app-card-assets 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +10 -2
- package/SOURCE.md +5 -0
- package/assets.json +239 -0
- package/components/Banner/index.module.less +13 -0
- package/components/Banner/index.tsx +36 -0
- package/components/BlockAnimal/LottiePlayer/index.module.less +11 -0
- package/components/BlockAnimal/LottiePlayer/index.tsx +24 -0
- package/components/BlockAnimal/LottiePlayer/utils.ts +72 -0
- package/components/BlockAnimal/index.module.less +80 -0
- package/components/BlockAnimal/index.tsx +120 -0
- package/components/BlockBarrage/index.module.less +104 -0
- package/components/BlockBarrage/index.tsx +98 -0
- package/components/BlockFanSwiper/index.module.less +93 -0
- package/components/BlockFanSwiper/index.tsx +56 -0
- package/components/BlockIntro/index.module.less +32 -0
- package/components/BlockIntro/index.tsx +21 -0
- package/components/BlockIntroCenter/index.module.less +31 -0
- package/components/BlockIntroCenter/index.tsx +22 -0
- package/components/BlockNowList/index.module.less +75 -0
- package/components/BlockNowList/index.tsx +54 -0
- package/components/BlockQuestionList/index.module.less +115 -0
- package/components/BlockQuestionList/index.tsx +107 -0
- package/components/BlockServiceIconList/index.module.less +68 -0
- package/components/BlockServiceIconList/index.tsx +83 -0
- package/components/BlockServiceList/index.module.less +92 -0
- package/components/BlockServiceList/index.tsx +88 -0
- package/components/BlockTravelCarousel/index.module.less +127 -0
- package/components/BlockTravelCarousel/index.tsx +101 -0
- package/components/BlockTravelCarousel/tags/Tags.module.less +20 -0
- package/components/BlockTravelCarousel/tags/Tags.tsx +20 -0
- package/components/OneCol/index.module.less +161 -0
- package/components/OneCol/index.tsx +83 -0
- package/components/TwoCol/index.module.less +199 -0
- package/components/TwoCol/index.tsx +82 -0
- package/docs/Banner.md +17 -0
- package/docs/BlockAnimal.md +17 -0
- package/docs/BlockBarrage.md +17 -0
- package/docs/BlockFanSwiper.md +17 -0
- package/docs/BlockIntro.md +17 -0
- package/docs/BlockIntroCenter.md +17 -0
- package/docs/BlockNowList.md +17 -0
- package/docs/BlockQuestionList.md +17 -0
- package/docs/BlockServiceIconList.md +17 -0
- package/docs/BlockServiceList.md +17 -0
- package/docs/BlockTravelCarousel.md +17 -0
- package/docs/OneCol.md +17 -0
- package/docs/TwoCol.md +17 -0
- package/examples/Banner.json +5 -0
- package/examples/BlockAnimal.json +22 -0
- package/examples/BlockBarrage.json +26 -0
- package/examples/BlockFanSwiper.json +23 -0
- package/examples/BlockIntro.json +4 -0
- package/examples/BlockIntroCenter.json +4 -0
- package/examples/BlockNowList.json +36 -0
- package/examples/BlockQuestionList.json +25 -0
- package/examples/BlockServiceIconList.json +36 -0
- package/examples/BlockServiceList.json +36 -0
- package/examples/BlockTravelCarousel.json +37 -0
- package/examples/OneCol.json +49 -0
- package/examples/TwoCol.json +49 -0
- package/package.json +39 -3
- package/shared/actions.ts +38 -0
- package/shared/home-integration.md +49 -0
- package/shared/types.ts +10 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/* 弹幕组件样式 */
|
|
2
|
+
.danmuWallWrap {
|
|
3
|
+
width: 100%;
|
|
4
|
+
min-width: 0;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
margin-bottom: 28px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.danmuWall {
|
|
10
|
+
white-space: nowrap;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: row;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
|
|
15
|
+
/* 边界淡出效果 - 24px宽度 */
|
|
16
|
+
mask-image: linear-gradient(
|
|
17
|
+
to right,
|
|
18
|
+
transparent 0%,
|
|
19
|
+
rgba(0, 0, 0, 0.1) 12px,
|
|
20
|
+
rgba(0, 0, 0, 1) 24px,
|
|
21
|
+
rgba(0, 0, 0, 1) calc(100% - 24px),
|
|
22
|
+
rgba(0, 0, 0, 0.1) calc(100% - 12px),
|
|
23
|
+
transparent 100%
|
|
24
|
+
);
|
|
25
|
+
-webkit-mask-image: linear-gradient(
|
|
26
|
+
to right,
|
|
27
|
+
transparent 0%,
|
|
28
|
+
rgba(0, 0, 0, 0.1) 12px,
|
|
29
|
+
rgba(0, 0, 0, 1) 24px,
|
|
30
|
+
rgba(0, 0, 0, 1) calc(100% - 24px),
|
|
31
|
+
rgba(0, 0, 0, 0.1) calc(100% - 12px),
|
|
32
|
+
transparent 100%
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.danmuWallBox {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
transition: transform 0.1s linear;
|
|
41
|
+
width: 100%;
|
|
42
|
+
min-width: 0;
|
|
43
|
+
overflow-x: hidden;
|
|
44
|
+
overflow-y: hidden;
|
|
45
|
+
scrollbar-width: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.danmuWallTitleBox {
|
|
49
|
+
margin-bottom: 24px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.danmuWallTitle {
|
|
53
|
+
font-size: 30px;
|
|
54
|
+
color: #1f3b63;
|
|
55
|
+
font-weight: 500;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.danmuWallItem {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
margin-right: 20px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* 弹幕项样式 */
|
|
65
|
+
.danmuItemWrap {
|
|
66
|
+
display: flex;
|
|
67
|
+
gap: 10px;
|
|
68
|
+
margin-bottom: 16px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.danmuItem {
|
|
72
|
+
border-radius: 38px;
|
|
73
|
+
background-color: rgb(244, 249, 255);
|
|
74
|
+
padding: 13px 32px 12px 32px;
|
|
75
|
+
box-sizing: border-box;
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: row;
|
|
78
|
+
align-items: center;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
transition: background-color 0.3s ease;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.danmuWrap {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: row;
|
|
86
|
+
flex-wrap: wrap;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.danmuImage {
|
|
90
|
+
border-radius: 14px;
|
|
91
|
+
width: 28px;
|
|
92
|
+
height: 28px;
|
|
93
|
+
flex-shrink: 0;
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
margin-right: 8px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.danmuTitle {
|
|
99
|
+
color: #1f3b63;
|
|
100
|
+
font-size: 26px;
|
|
101
|
+
white-space: nowrap;
|
|
102
|
+
box-sizing: border-box;
|
|
103
|
+
line-height: 1.2;
|
|
104
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { CardAssetProps as ICardProps } from '../../shared/types';
|
|
2
|
+
import React, { useState, useEffect, useRef, useMemo } from 'react';
|
|
3
|
+
import styles from './index.module.less';
|
|
4
|
+
|
|
5
|
+
interface BlockBarrageProps extends ICardProps {
|
|
6
|
+
/** 后端下发的卡片渲染相关的所有字段 */
|
|
7
|
+
cardData?: {
|
|
8
|
+
title?: string;
|
|
9
|
+
list?: Array<{
|
|
10
|
+
imageUrl?: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
query?: string;
|
|
13
|
+
}>;
|
|
14
|
+
lineNum?: number;
|
|
15
|
+
} & ICardProps['cardData'];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const EMPTY_LIST: NonNullable<NonNullable<BlockBarrageProps['cardData']>['list']> = [];
|
|
19
|
+
|
|
20
|
+
interface DanmuItemProps {
|
|
21
|
+
list: any[];
|
|
22
|
+
onQuery: (query: string) => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const DanmuItem: React.FC<DanmuItemProps> = ({ list, onQuery }) => {
|
|
26
|
+
return (
|
|
27
|
+
<div className={styles.danmuItemWrap} style={{ marginLeft: '0.16rem' }}>
|
|
28
|
+
{list.map((item, index) => (
|
|
29
|
+
<div key={`${index}-${item.title}-${item.query}`} className={styles.danmuItem} onClick={() => onQuery(item.query)}>
|
|
30
|
+
{item.imageUrl && <img src={item.imageUrl} className={styles.danmuImage} alt={item.title} />}
|
|
31
|
+
<span className={styles.danmuTitle}>{item.title}</span>
|
|
32
|
+
</div>
|
|
33
|
+
))}
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const BlockBarrage: React.FC<BlockBarrageProps> = ({ cardData = {}, bridgeAPI }) => {
|
|
39
|
+
const { title, list: originalList = EMPTY_LIST, lineNum = 3 } = cardData;
|
|
40
|
+
const [paused, setPaused] = useState(false);
|
|
41
|
+
const contentRef = useRef<HTMLDivElement>(null);
|
|
42
|
+
const danmus = useMemo(() => {
|
|
43
|
+
if (!originalList.length) return [];
|
|
44
|
+
const lines = Math.min(originalList.length, Number.isFinite(lineNum) ? Math.max(1, Math.floor(lineNum)) : 3);
|
|
45
|
+
const size = Math.ceil(originalList.length / lines);
|
|
46
|
+
const groups = Array.from({ length: Math.ceil(originalList.length / size) }, (_, index) => originalList.slice(index * size, (index + 1) * size));
|
|
47
|
+
return Array.from({ length: lines }, (_, index) => {
|
|
48
|
+
const row = groups.flatMap((_, offset) => groups[(index + offset) % groups.length]);
|
|
49
|
+
return row.concat(row);
|
|
50
|
+
});
|
|
51
|
+
}, [originalList, lineNum]);
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
const content = contentRef.current;
|
|
55
|
+
if (!content || paused || !danmus.length) return;
|
|
56
|
+
content.scrollLeft = 0;
|
|
57
|
+
const timer = setInterval(() => {
|
|
58
|
+
// Measure after content/images/layout updates; scrollWidth is in browser pixels.
|
|
59
|
+
const limit = content.scrollWidth / 2;
|
|
60
|
+
content.scrollLeft = limit > 0 && content.scrollLeft + 1 < limit ? content.scrollLeft + 1 : 0;
|
|
61
|
+
}, 25);
|
|
62
|
+
return () => clearInterval(timer);
|
|
63
|
+
}, [danmus, paused]);
|
|
64
|
+
|
|
65
|
+
const handleQuery = (query: string) => {
|
|
66
|
+
if (query) {
|
|
67
|
+
bridgeAPI?.sendQuery({
|
|
68
|
+
question_content: query,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<div className={styles.danmuWallWrap}>
|
|
75
|
+
<div className={styles.danmuWallTitleBox}>
|
|
76
|
+
<span className={styles.danmuWallTitle}>{title}</span>
|
|
77
|
+
</div>
|
|
78
|
+
<div className={styles.danmuWall} onTouchStart={() => setPaused(true)} onTouchEnd={() => setPaused(false)} onTouchCancel={() => setPaused(false)}
|
|
79
|
+
onMouseEnter={() => setPaused(true)} onMouseLeave={() => setPaused(false)}>
|
|
80
|
+
<div className={styles.danmuWallBox} ref={contentRef}>
|
|
81
|
+
{danmus.map((list, index) => (
|
|
82
|
+
<div
|
|
83
|
+
key={index}
|
|
84
|
+
className={styles.danmuWallItem}
|
|
85
|
+
style={{
|
|
86
|
+
marginLeft: index % 2 === 0 ? 0 : '0.2rem',
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
<DanmuItem list={list} onQuery={handleQuery} />
|
|
90
|
+
</div>
|
|
91
|
+
))}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export default BlockBarrage;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
.cardContainer {
|
|
2
|
+
width: 100%;
|
|
3
|
+
min-width: 0;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
// background-color: aqua;
|
|
6
|
+
// overflow: hidden;
|
|
7
|
+
// height: 506px;
|
|
8
|
+
margin-bottom: 28px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.swiperWrapper {
|
|
12
|
+
padding-top: 44px;
|
|
13
|
+
// padding-bottom: 44px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.slider {
|
|
17
|
+
position: relative;
|
|
18
|
+
width: 100%;
|
|
19
|
+
min-height: 506px;
|
|
20
|
+
|
|
21
|
+
// background-color: khaki;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
// overflow-y: initial;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.sliderItem {
|
|
27
|
+
position: absolute;
|
|
28
|
+
width: 394px;
|
|
29
|
+
max-width: 100%;
|
|
30
|
+
height: 506px;
|
|
31
|
+
// overflow: hidden;
|
|
32
|
+
border-radius: 40px;
|
|
33
|
+
background-size: cover;
|
|
34
|
+
left: max(0px, calc(50% - 394px/2));
|
|
35
|
+
top: 0;
|
|
36
|
+
transition: transform 0.3s ease-in-out;
|
|
37
|
+
visibility: visible;
|
|
38
|
+
// box-shadow: 0 17px 51px rgba(50, 87, 107, 0.22);
|
|
39
|
+
// background-color: lawngreen;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.itemHidden {
|
|
43
|
+
visibility: hidden;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.sliderItemContent {
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: 100%;
|
|
49
|
+
// padding: 28px;
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
justify-content: flex-end;
|
|
53
|
+
position: relative;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.sliderItemImg {
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: 0;
|
|
59
|
+
left: 0;
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
// height: 506px;
|
|
63
|
+
border-radius: 40px;
|
|
64
|
+
}
|
|
65
|
+
.sliderItemTitle {
|
|
66
|
+
position: relative;
|
|
67
|
+
z-index: 3;
|
|
68
|
+
font-size: 34px;
|
|
69
|
+
line-height: 48px;
|
|
70
|
+
color: #fff;
|
|
71
|
+
font-weight: 500;
|
|
72
|
+
margin-bottom: 20px;
|
|
73
|
+
padding: 0 24px;
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.sliderItemCity {
|
|
78
|
+
margin-top: 28px;
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: row;
|
|
81
|
+
align-items: center;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.cityIcon {
|
|
85
|
+
width: 24px;
|
|
86
|
+
height: 24px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.cityText {
|
|
90
|
+
font-size: 18px;
|
|
91
|
+
line-height: 24px;
|
|
92
|
+
color: rgba(255, 255, 255, 0.8);
|
|
93
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { runCardClick } from '../../shared/actions';
|
|
2
|
+
import { useEffect, useState, useRef } from 'react';
|
|
3
|
+
import type { CardAssetBridge } from '../../shared/types';
|
|
4
|
+
import styles from './index.module.less';
|
|
5
|
+
|
|
6
|
+
interface FanItem {
|
|
7
|
+
imageUrl: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
query?: string;
|
|
10
|
+
jumpUrl?: string;
|
|
11
|
+
clickAction?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Fan carousel; the copied source belongs to the application. */
|
|
15
|
+
export default function BlockFanSwiper({ cardData = {}, bridgeAPI }: {
|
|
16
|
+
cardData?: { list?: FanItem[] };
|
|
17
|
+
bridgeAPI?: CardAssetBridge;
|
|
18
|
+
}) {
|
|
19
|
+
const list = cardData.list || [];
|
|
20
|
+
const [active, setActive] = useState(0);
|
|
21
|
+
const [paused, setPaused] = useState(false);
|
|
22
|
+
const start = useRef<number | null>(null);
|
|
23
|
+
useEffect(() => { setActive(0); }, [list]);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (paused || list.length < 2) return;
|
|
26
|
+
const timer = setInterval(() => setActive((value) => (value + 1) % list.length), 3000);
|
|
27
|
+
return () => clearInterval(timer);
|
|
28
|
+
}, [paused, list.length]);
|
|
29
|
+
if (!list.length) return null;
|
|
30
|
+
const positions = list.length > 1 ? [-2, -1, 0, 1, 2] : [0];
|
|
31
|
+
return (
|
|
32
|
+
<div className={styles.cardContainer}>
|
|
33
|
+
<div className={styles.slider}
|
|
34
|
+
onTouchStart={(event) => { start.current = event.touches[0].clientX; setPaused(true); }}
|
|
35
|
+
onTouchEnd={(event) => {
|
|
36
|
+
const offset = event.changedTouches[0].clientX - (start.current ?? event.changedTouches[0].clientX);
|
|
37
|
+
if (Math.abs(offset) > 10) setActive((value) => (value + (offset > 0 ? -1 : 1) + list.length) % list.length);
|
|
38
|
+
start.current = null;
|
|
39
|
+
setPaused(false);
|
|
40
|
+
}}
|
|
41
|
+
onTouchCancel={() => { start.current = null; setPaused(false); }}>
|
|
42
|
+
{positions.map((position) => {
|
|
43
|
+
const item = list[(active + position + list.length * 2) % list.length];
|
|
44
|
+
return <div key={position} className={styles.sliderItem}
|
|
45
|
+
style={{ transform: `translate(${position * 4.14}rem, ${Math.abs(position) * 0.5}rem) scale(${1 - Math.abs(position) * 0.2}) rotateZ(${position * 10}deg)` }}
|
|
46
|
+
onClick={() => runCardClick(bridgeAPI, item)}>
|
|
47
|
+
<div className={styles.sliderItemContent}>
|
|
48
|
+
<img src={item.imageUrl} className={styles.sliderItemImg} alt={item.title || ''} />
|
|
49
|
+
<span className={styles.sliderItemTitle}>{item.title}</span>
|
|
50
|
+
</div>
|
|
51
|
+
</div>;
|
|
52
|
+
})}
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.cityContainer {
|
|
2
|
+
min-width: 0;
|
|
3
|
+
margin-top: 32px;
|
|
4
|
+
width: 100%;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
margin-bottom: 40px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.welcomeSection {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.greetingText {
|
|
16
|
+
color: #102953;
|
|
17
|
+
font-size: 48px;
|
|
18
|
+
line-height: 64px;
|
|
19
|
+
font-weight: 700;
|
|
20
|
+
align-self: flex-start;
|
|
21
|
+
width: 100%;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.descText {
|
|
27
|
+
color: #1f3b63;
|
|
28
|
+
font-size: 25px;
|
|
29
|
+
margin-top: 12px;
|
|
30
|
+
line-height: 1.5;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CardAssetProps as ICardProps } from '../../shared/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styles from './index.module.less';
|
|
4
|
+
|
|
5
|
+
interface BlockInfoProps extends ICardProps {
|
|
6
|
+
/** 后端下发的卡片渲染相关的所有字段 */
|
|
7
|
+
cardData?: Record<string, any>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const BlockInfo: React.FC<BlockInfoProps> = ({ cardData = {} }) => {
|
|
11
|
+
return (
|
|
12
|
+
<div className={styles.cityContainer}>
|
|
13
|
+
<div className={styles.welcomeSection}>
|
|
14
|
+
<span className={styles.greetingText}>{cardData?.title}</span>
|
|
15
|
+
<span className={styles.descText}>{cardData?.desc}</span>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default BlockInfo;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.welcomeSection {
|
|
2
|
+
min-width: 0;
|
|
3
|
+
margin-top: 32px;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
width: 100%;
|
|
8
|
+
align-items: center;
|
|
9
|
+
margin-bottom: 28px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.greetingText {
|
|
13
|
+
width: 100%;
|
|
14
|
+
text-align: center;
|
|
15
|
+
color: #102953;
|
|
16
|
+
font-size: 44px;
|
|
17
|
+
line-height: 64px;
|
|
18
|
+
font-weight: 700;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.descText {
|
|
23
|
+
width: 100%;
|
|
24
|
+
text-align: center;
|
|
25
|
+
// color: rgba(0,0,0,0.5);
|
|
26
|
+
color: #1f3b63;
|
|
27
|
+
font-size: 25px;
|
|
28
|
+
line-height: 36px;
|
|
29
|
+
margin-top: 12px;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CardAssetProps as ICardProps } from '../../shared/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styles from './index.module.less';
|
|
4
|
+
|
|
5
|
+
interface BlockInfoCenterProps extends ICardProps {
|
|
6
|
+
cardData: {
|
|
7
|
+
logo?: string;
|
|
8
|
+
title: string;
|
|
9
|
+
desc: string;
|
|
10
|
+
} & ICardProps['cardData'];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const BlockInfoCenter: React.FC<BlockInfoCenterProps> = ({ cardData = { title: '', desc: '' } }) => {
|
|
14
|
+
return (
|
|
15
|
+
<div className={styles.welcomeSection}>
|
|
16
|
+
<div className={styles.greetingText}>{cardData.title}</div>
|
|
17
|
+
<div className={styles.descText}>{cardData.desc}</div>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default BlockInfoCenter;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
.nowList {
|
|
2
|
+
width: 100%;
|
|
3
|
+
min-width: 0;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
margin-bottom: 28px;
|
|
6
|
+
position: relative;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.listBox {
|
|
10
|
+
width: 100%;
|
|
11
|
+
display: grid;
|
|
12
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
13
|
+
gap: 32px;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.listItem {
|
|
19
|
+
width: 100%;
|
|
20
|
+
min-width: 0;
|
|
21
|
+
height: 416px;
|
|
22
|
+
background-size: 100% 100%;
|
|
23
|
+
}
|
|
24
|
+
.item0 {
|
|
25
|
+
transform: rotate(3deg);
|
|
26
|
+
}
|
|
27
|
+
.item1 {
|
|
28
|
+
transform: rotate(-3deg);
|
|
29
|
+
}
|
|
30
|
+
.item2 {
|
|
31
|
+
transform: rotate(3deg);
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.item3 {
|
|
36
|
+
transform: rotate(-3deg);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
.itemContent {
|
|
41
|
+
margin-top: 190px;
|
|
42
|
+
padding: 24px;
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.itemTitle {
|
|
48
|
+
color: #102953;
|
|
49
|
+
font-size: 30px;
|
|
50
|
+
white-space: nowrap;
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
text-overflow: ellipsis;
|
|
53
|
+
font-weight: 500;
|
|
54
|
+
margin-bottom: 8px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.itemDesc {
|
|
58
|
+
color: #102953;
|
|
59
|
+
font-size: 26px;
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
text-overflow: ellipsis;
|
|
63
|
+
font-weight: 500;
|
|
64
|
+
margin-bottom: 28px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.itemBtn {
|
|
68
|
+
align-self: flex-start;
|
|
69
|
+
padding: 12px 24px;
|
|
70
|
+
background: #102953;
|
|
71
|
+
color: #fff;
|
|
72
|
+
font-weight: 500;
|
|
73
|
+
font-size: 26px;
|
|
74
|
+
border-radius: 32px;
|
|
75
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { runCardClick } from '../../shared/actions';
|
|
2
|
+
import type { CardAssetProps as ICardProps } from '../../shared/types';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import styles from './index.module.less';
|
|
5
|
+
|
|
6
|
+
interface BlockNowListProps extends ICardProps {
|
|
7
|
+
cardData?: {
|
|
8
|
+
list?: Array<{
|
|
9
|
+
bg?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
desc?: string;
|
|
12
|
+
btnText?: string;
|
|
13
|
+
jumpUrl?: string;
|
|
14
|
+
clickAction?: string;
|
|
15
|
+
query?: string;
|
|
16
|
+
}>;
|
|
17
|
+
} & ICardProps['cardData'];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const BlockNowList: React.FC<BlockNowListProps> = ({ cardData = {}, bridgeAPI }) => {
|
|
21
|
+
const { list: originalList = [] } = cardData;
|
|
22
|
+
const list = originalList.slice(0, 4);
|
|
23
|
+
|
|
24
|
+
const handleClick = (item: any) => runCardClick(bridgeAPI, item);
|
|
25
|
+
|
|
26
|
+
if (!list || list.length === 0) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div className={styles.nowList}>
|
|
32
|
+
<div className={styles.listBox}>
|
|
33
|
+
{list.map((item, index) => (
|
|
34
|
+
<div
|
|
35
|
+
key={index}
|
|
36
|
+
className={`${styles.listItem} ${styles[`item${index}`]}`}
|
|
37
|
+
style={{
|
|
38
|
+
backgroundImage: `url(${item.bg})`,
|
|
39
|
+
}}
|
|
40
|
+
onClick={() => handleClick(item)}
|
|
41
|
+
>
|
|
42
|
+
<div className={styles.itemContent}>
|
|
43
|
+
<span className={styles.itemTitle}>{item.title}</span>
|
|
44
|
+
<span className={styles.itemDesc}>{item.desc}</span>
|
|
45
|
+
<span className={styles.itemBtn}>{item.btnText}</span>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
))}
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default BlockNowList;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
.articleList {
|
|
2
|
+
width: 100%;
|
|
3
|
+
min-width: 0;
|
|
4
|
+
margin-bottom: 28px;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.headerSection {
|
|
9
|
+
border-radius: 24px;
|
|
10
|
+
background-color: rgba(255, 255, 255, 0.5);
|
|
11
|
+
padding: 24px 24px 28px 24px;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.titleWrapper {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
align-items: center;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.articleTitle {
|
|
26
|
+
color: #1f3b63;
|
|
27
|
+
font-size: 30px;
|
|
28
|
+
font-weight: 500;
|
|
29
|
+
line-height: 40px;
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.actionBar {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
flex-direction: row;
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.loadingIndicator {
|
|
43
|
+
width: 32px;
|
|
44
|
+
height: 32px;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.refreshButton {
|
|
49
|
+
color: #4b6b99;
|
|
50
|
+
font-size: 26px;
|
|
51
|
+
font-weight: 500;
|
|
52
|
+
line-height: 36px;
|
|
53
|
+
margin-left: 6px;
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.contentArea {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
box-sizing: border-box;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.articleItem {
|
|
65
|
+
border-radius: 16px;
|
|
66
|
+
background-color: #fff;
|
|
67
|
+
padding: 18px 24px;
|
|
68
|
+
height: 72px;
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-direction: row;
|
|
71
|
+
align-items: center;
|
|
72
|
+
box-sizing: border-box;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
margin-top: 24px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.itemThumbnail {
|
|
78
|
+
width: 16px;
|
|
79
|
+
height: 16px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.itemDescription {
|
|
83
|
+
color: #1f3b63;
|
|
84
|
+
font-size: 26px;
|
|
85
|
+
margin-left: 8px;
|
|
86
|
+
line-height: 36px;
|
|
87
|
+
white-space: nowrap;
|
|
88
|
+
box-sizing: border-box;
|
|
89
|
+
flex: 1;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
text-overflow: ellipsis;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.navigationIcon {
|
|
95
|
+
margin-left: 48px;
|
|
96
|
+
width: 32px;
|
|
97
|
+
height: 32px;
|
|
98
|
+
box-sizing: border-box;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.more-options-icon {
|
|
102
|
+
margin-left: 76px;
|
|
103
|
+
width: 36px;
|
|
104
|
+
height: 36px;
|
|
105
|
+
box-sizing: border-box;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.additional-item {
|
|
109
|
+
border-radius: 16px;
|
|
110
|
+
background-color: rgb(255, 255, 255);
|
|
111
|
+
padding: 20px 20px 20px 20px;
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
box-sizing: border-box;
|
|
115
|
+
}
|