@tbox.cn/app-card-assets 0.1.1 → 1.0.0-alpha.10
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/README.md +1 -1
- package/SOURCE.md +1 -1
- package/assets.json +2 -21
- package/components/Banner/index.tsx +2 -3
- package/components/BlockAnimal/LottiePlayer/index.tsx +2 -3
- package/components/BlockAnimal/index.tsx +13 -14
- package/components/BlockBarrage/index.tsx +10 -11
- package/components/BlockFanSwiper/index.tsx +6 -7
- package/components/BlockIntro/index.tsx +4 -5
- package/components/BlockIntroCenter/index.tsx +3 -4
- package/components/BlockNowList/index.tsx +10 -8
- package/components/BlockQuestionList/index.tsx +12 -13
- package/components/BlockServiceIconList/index.tsx +20 -18
- package/components/BlockServiceList/index.tsx +10 -11
- package/components/BlockTravelCarousel/index.tsx +142 -33
- package/components/BlockTravelCarousel/tags/Tags.tsx +2 -3
- package/components/OneCol/index.tsx +18 -19
- package/components/TwoCol/index.tsx +16 -17
- package/docs/Banner.md +1 -1
- package/docs/BlockAnimal.md +1 -1
- package/docs/BlockBarrage.md +1 -1
- package/docs/BlockFanSwiper.md +1 -1
- package/docs/BlockIntro.md +1 -1
- package/docs/BlockIntroCenter.md +1 -1
- package/docs/BlockNowList.md +1 -1
- package/docs/BlockQuestionList.md +1 -1
- package/docs/BlockServiceIconList.md +1 -1
- package/docs/BlockServiceList.md +1 -1
- package/docs/BlockTravelCarousel.md +3 -1
- package/docs/OneCol.md +1 -1
- package/docs/TwoCol.md +1 -1
- package/package.json +1 -3
- package/shared/home-integration.md +11 -11
- package/components/Banner/index.module.less +0 -13
- package/components/BlockAnimal/LottiePlayer/index.module.less +0 -11
- package/components/BlockAnimal/index.module.less +0 -80
- package/components/BlockBarrage/index.module.less +0 -104
- package/components/BlockFanSwiper/index.module.less +0 -93
- package/components/BlockIntro/index.module.less +0 -32
- package/components/BlockIntroCenter/index.module.less +0 -31
- package/components/BlockNowList/index.module.less +0 -75
- package/components/BlockQuestionList/index.module.less +0 -115
- package/components/BlockServiceIconList/index.module.less +0 -68
- package/components/BlockServiceList/index.module.less +0 -92
- package/components/BlockTravelCarousel/index.module.less +0 -127
- package/components/BlockTravelCarousel/tags/Tags.module.less +0 -20
- package/components/OneCol/index.module.less +0 -161
- package/components/TwoCol/index.module.less +0 -199
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
消费方为开发期 CLI:读取 assets.json 并按需复制 components/shared/docs/examples。生成应用不把本包作为运行时依赖,只安装选中卡片的 dependencies。每个组件用法在 docs/;来源记录见 SOURCE.md。复制后的源文件由应用自行维护,重复安装遇到修改默认报冲突。
|
|
6
6
|
|
|
7
|
-
包不导出全量 React registry;不包含平台模板 ID
|
|
7
|
+
包不导出全量 React registry;不包含平台模板 ID,不解释远程页面配置。组件样式是 TSX 里的 Tailwind 工具类:尺寸与字号为普通物理 px(1:1,不折半);复制进应用后由应用的 `apps/client/src/styles/tailwind.css` 扫描 `apps/client/src` 生成对应工具类,包内不需要单独样式构建。
|
|
8
8
|
|
|
9
9
|
首页交互由 shared/actions.ts 适配:query 使用 home 槽 onSend,跳转使用应用 store 的 openLink 动作;接线示例见 shared/home-integration.md。
|
|
10
10
|
|
package/SOURCE.md
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
Initial source: tbox-inc-agent-ui, commit `e25b78b82adbba2bbdac723ed06335e992b46702`, `src/ThousandFace/components/`.
|
|
4
4
|
|
|
5
|
-
The portable copy is maintained in this package. No automatic upstream synchronization. OneCol and TwoCol originate from Onecol and Twocol. Local adaptations include explicit bridge types,
|
|
5
|
+
The portable copy is maintained in this package. No automatic upstream synchronization. OneCol and TwoCol originate from Onecol and Twocol. Local adaptations include explicit bridge types, Tailwind utility classes in TSX, plain browser px units and lifecycle repairs.
|
package/assets.json
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"scene": "home",
|
|
8
8
|
"entry": "components/BlockIntro/index.tsx",
|
|
9
9
|
"files": [
|
|
10
|
-
"components/BlockIntro/index.module.less",
|
|
11
10
|
"components/BlockIntro/index.tsx"
|
|
12
11
|
],
|
|
13
12
|
"sharedFiles": [
|
|
@@ -24,7 +23,6 @@
|
|
|
24
23
|
"scene": "home",
|
|
25
24
|
"entry": "components/BlockIntroCenter/index.tsx",
|
|
26
25
|
"files": [
|
|
27
|
-
"components/BlockIntroCenter/index.module.less",
|
|
28
26
|
"components/BlockIntroCenter/index.tsx"
|
|
29
27
|
],
|
|
30
28
|
"sharedFiles": [
|
|
@@ -41,7 +39,6 @@
|
|
|
41
39
|
"scene": "home",
|
|
42
40
|
"entry": "components/BlockServiceList/index.tsx",
|
|
43
41
|
"files": [
|
|
44
|
-
"components/BlockServiceList/index.module.less",
|
|
45
42
|
"components/BlockServiceList/index.tsx"
|
|
46
43
|
],
|
|
47
44
|
"sharedFiles": [
|
|
@@ -58,7 +55,6 @@
|
|
|
58
55
|
"scene": "home",
|
|
59
56
|
"entry": "components/BlockServiceIconList/index.tsx",
|
|
60
57
|
"files": [
|
|
61
|
-
"components/BlockServiceIconList/index.module.less",
|
|
62
58
|
"components/BlockServiceIconList/index.tsx"
|
|
63
59
|
],
|
|
64
60
|
"sharedFiles": [
|
|
@@ -66,9 +62,7 @@
|
|
|
66
62
|
"shared/home-integration.md",
|
|
67
63
|
"shared/actions.ts"
|
|
68
64
|
],
|
|
69
|
-
"dependencies": {
|
|
70
|
-
"antd-mobile-icons": "0.3.0"
|
|
71
|
-
},
|
|
65
|
+
"dependencies": {},
|
|
72
66
|
"usage": "docs/BlockServiceIconList.md",
|
|
73
67
|
"example": "examples/BlockServiceIconList.json"
|
|
74
68
|
},
|
|
@@ -77,7 +71,6 @@
|
|
|
77
71
|
"scene": "home",
|
|
78
72
|
"entry": "components/BlockQuestionList/index.tsx",
|
|
79
73
|
"files": [
|
|
80
|
-
"components/BlockQuestionList/index.module.less",
|
|
81
74
|
"components/BlockQuestionList/index.tsx"
|
|
82
75
|
],
|
|
83
76
|
"sharedFiles": [
|
|
@@ -94,7 +87,6 @@
|
|
|
94
87
|
"scene": "home",
|
|
95
88
|
"entry": "components/Banner/index.tsx",
|
|
96
89
|
"files": [
|
|
97
|
-
"components/Banner/index.module.less",
|
|
98
90
|
"components/Banner/index.tsx"
|
|
99
91
|
],
|
|
100
92
|
"sharedFiles": [
|
|
@@ -111,7 +103,6 @@
|
|
|
111
103
|
"scene": "home",
|
|
112
104
|
"entry": "components/BlockNowList/index.tsx",
|
|
113
105
|
"files": [
|
|
114
|
-
"components/BlockNowList/index.module.less",
|
|
115
106
|
"components/BlockNowList/index.tsx"
|
|
116
107
|
],
|
|
117
108
|
"sharedFiles": [
|
|
@@ -128,7 +119,6 @@
|
|
|
128
119
|
"scene": "home",
|
|
129
120
|
"entry": "components/BlockBarrage/index.tsx",
|
|
130
121
|
"files": [
|
|
131
|
-
"components/BlockBarrage/index.module.less",
|
|
132
122
|
"components/BlockBarrage/index.tsx"
|
|
133
123
|
],
|
|
134
124
|
"sharedFiles": [
|
|
@@ -145,9 +135,7 @@
|
|
|
145
135
|
"scene": "home",
|
|
146
136
|
"entry": "components/BlockTravelCarousel/index.tsx",
|
|
147
137
|
"files": [
|
|
148
|
-
"components/BlockTravelCarousel/index.module.less",
|
|
149
138
|
"components/BlockTravelCarousel/index.tsx",
|
|
150
|
-
"components/BlockTravelCarousel/tags/Tags.module.less",
|
|
151
139
|
"components/BlockTravelCarousel/tags/Tags.tsx"
|
|
152
140
|
],
|
|
153
141
|
"sharedFiles": [
|
|
@@ -155,9 +143,7 @@
|
|
|
155
143
|
"shared/home-integration.md",
|
|
156
144
|
"shared/actions.ts"
|
|
157
145
|
],
|
|
158
|
-
"dependencies": {
|
|
159
|
-
"antd-mobile": "5.39.0"
|
|
160
|
-
},
|
|
146
|
+
"dependencies": {},
|
|
161
147
|
"usage": "docs/BlockTravelCarousel.md",
|
|
162
148
|
"example": "examples/BlockTravelCarousel.json"
|
|
163
149
|
},
|
|
@@ -166,7 +152,6 @@
|
|
|
166
152
|
"scene": "home",
|
|
167
153
|
"entry": "components/BlockFanSwiper/index.tsx",
|
|
168
154
|
"files": [
|
|
169
|
-
"components/BlockFanSwiper/index.module.less",
|
|
170
155
|
"components/BlockFanSwiper/index.tsx"
|
|
171
156
|
],
|
|
172
157
|
"sharedFiles": [
|
|
@@ -183,10 +168,8 @@
|
|
|
183
168
|
"scene": "home",
|
|
184
169
|
"entry": "components/BlockAnimal/index.tsx",
|
|
185
170
|
"files": [
|
|
186
|
-
"components/BlockAnimal/LottiePlayer/index.module.less",
|
|
187
171
|
"components/BlockAnimal/LottiePlayer/index.tsx",
|
|
188
172
|
"components/BlockAnimal/LottiePlayer/utils.ts",
|
|
189
|
-
"components/BlockAnimal/index.module.less",
|
|
190
173
|
"components/BlockAnimal/index.tsx"
|
|
191
174
|
],
|
|
192
175
|
"sharedFiles": [
|
|
@@ -206,7 +189,6 @@
|
|
|
206
189
|
"scene": "home",
|
|
207
190
|
"entry": "components/OneCol/index.tsx",
|
|
208
191
|
"files": [
|
|
209
|
-
"components/OneCol/index.module.less",
|
|
210
192
|
"components/OneCol/index.tsx"
|
|
211
193
|
],
|
|
212
194
|
"sharedFiles": [
|
|
@@ -223,7 +205,6 @@
|
|
|
223
205
|
"scene": "home",
|
|
224
206
|
"entry": "components/TwoCol/index.tsx",
|
|
225
207
|
"files": [
|
|
226
|
-
"components/TwoCol/index.module.less",
|
|
227
208
|
"components/TwoCol/index.tsx"
|
|
228
209
|
],
|
|
229
210
|
"sharedFiles": [
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { runCardClick } from '../../shared/actions';
|
|
2
2
|
import type { CardAssetProps as ICardProps } from '../../shared/types';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import styles from './index.module.less';
|
|
5
4
|
|
|
6
5
|
interface BannerProps extends ICardProps {
|
|
7
6
|
cardData?: {
|
|
@@ -27,8 +26,8 @@ const Banner: React.FC<BannerProps> = ({ cardData = {}, bridgeAPI }) => {
|
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
return (
|
|
30
|
-
<div className=
|
|
31
|
-
<img src={bannerImage} alt="banner" className=
|
|
29
|
+
<div className="box-border w-full min-w-0">
|
|
30
|
+
<img src={bannerImage} alt="banner" className="mb-7 block w-full cursor-pointer rounded-[16px]" onClick={handleClick} />
|
|
32
31
|
</div>
|
|
33
32
|
);
|
|
34
33
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import lottie, { type AnimationItem } from 'lottie-web';
|
|
3
|
-
import styles from './index.module.less';
|
|
4
3
|
import { LottieLoader } from './utils';
|
|
5
4
|
|
|
6
5
|
/** Loads local/remote animation data and destroys stale instances. */
|
|
@@ -17,8 +16,8 @@ export default function LottiePlayer({ cardData }: { cardData: { djangoId: strin
|
|
|
17
16
|
}).catch(() => { if (!disposed) setFailed(true); });
|
|
18
17
|
return () => { disposed = true; animation?.destroy(); };
|
|
19
18
|
}, [cardData.djangoId, cardData.fileType]);
|
|
20
|
-
return <div className=
|
|
19
|
+
return <div className="relative flex items-center justify-center">
|
|
21
20
|
{failed && <img style={{ width: '100%' }} src={cardData.placeholder} alt="animation unavailable" />}
|
|
22
|
-
<div className=
|
|
21
|
+
<div className="h-full w-full" style={{ display: failed ? 'none' : undefined }} ref={container} />
|
|
23
22
|
</div>;
|
|
24
23
|
}
|
|
@@ -2,7 +2,6 @@ import { runCardClick } from '../../shared/actions';
|
|
|
2
2
|
import type { CardAssetProps as ICardProps } from '../../shared/types';
|
|
3
3
|
import React, { useEffect } from 'react';
|
|
4
4
|
import LottiePlayer from './LottiePlayer';
|
|
5
|
-
import styles from './index.module.less';
|
|
6
5
|
|
|
7
6
|
interface IProps extends ICardProps {
|
|
8
7
|
cardData?: {
|
|
@@ -68,30 +67,30 @@ const BlockAnimal: React.FC<IProps> = ({ cardData = {}, bridgeAPI }) => {
|
|
|
68
67
|
return <LottiePlayer cardData={{ djangoId: djangoData.djangoId || '', placeholder: djangoData.placeholder || '', fileType }} />;
|
|
69
68
|
}
|
|
70
69
|
if (['gif', 'png', 'jpg', 'jpeg', 'webp'].includes(fileType || '')) {
|
|
71
|
-
return <img className=
|
|
70
|
+
return <img className="w-full" src={djangoData.djangoId} alt="" />;
|
|
72
71
|
}
|
|
73
72
|
if (fileType === 'mp4') {
|
|
74
|
-
return <video playsInline className=
|
|
73
|
+
return <video playsInline className="w-full" src={djangoData.djangoId} autoPlay muted loop controls={false} />;
|
|
75
74
|
}
|
|
76
|
-
return <img className=
|
|
75
|
+
return <img className="w-full" src={djangoData.placeholder} alt="" />;
|
|
77
76
|
};
|
|
78
77
|
|
|
79
78
|
return (
|
|
80
|
-
<div className=
|
|
81
|
-
<div className=
|
|
82
|
-
<div className=
|
|
79
|
+
<div className="relative mb-8 box-border h-full w-full min-w-0">
|
|
80
|
+
<div className="relative">
|
|
81
|
+
<div className="min-h-[300px]">{renderMedia()}</div>
|
|
83
82
|
{button.length > 0 && (
|
|
84
|
-
<div className=
|
|
83
|
+
<div className="absolute top-0 left-0 h-full w-full">
|
|
85
84
|
{button.map(
|
|
86
85
|
(item) =>
|
|
87
86
|
item && (
|
|
88
87
|
<div
|
|
89
88
|
key={`button-${item.title}-${item.query}`}
|
|
90
|
-
className=
|
|
89
|
+
className="absolute flex items-center justify-center rounded-[37px] bg-white px-6 py-3 text-2xl leading-[inherit]"
|
|
91
90
|
style={item.location}
|
|
92
91
|
onClick={() => handleItemClick(item)}
|
|
93
92
|
>
|
|
94
|
-
<span className=
|
|
93
|
+
<span className="ml-2 text-[length:26px] text-[#1f3b63]">{item.title}</span>
|
|
95
94
|
</div>
|
|
96
95
|
),
|
|
97
96
|
)}
|
|
@@ -100,14 +99,14 @@ const BlockAnimal: React.FC<IProps> = ({ cardData = {}, bridgeAPI }) => {
|
|
|
100
99
|
</div>
|
|
101
100
|
|
|
102
101
|
{desc && (
|
|
103
|
-
<div className=
|
|
104
|
-
<div className=
|
|
102
|
+
<div className="mt-6 rounded-[8px_48px_48px_48px] bg-[rgba(255,255,255,0.4)] px-8 py-6">
|
|
103
|
+
<div className="text-3xl leading-[48px] tracking-normal text-[#1f3b63]">{desc}</div>
|
|
105
104
|
</div>
|
|
106
105
|
)}
|
|
107
106
|
{guessQuestionList?.length > 0 && (
|
|
108
|
-
<div className=
|
|
107
|
+
<div className="flex flex-col items-start">
|
|
109
108
|
{guessQuestionList.map((item) => (
|
|
110
|
-
<div key={`guess-${String(item)}`} className=
|
|
109
|
+
<div key={`guess-${String(item)}`} className="mt-4 inline-block rounded-[31px] bg-[rgba(255,255,255,0.8)] px-8 py-2 text-[length:26px] leading-normal text-[#1f3b63]" onClick={() => handleQuery(item)}>
|
|
111
110
|
{item}
|
|
112
111
|
</div>
|
|
113
112
|
))}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { CardAssetProps as ICardProps } from '../../shared/types';
|
|
2
2
|
import React, { useState, useEffect, useRef, useMemo } from 'react';
|
|
3
|
-
import styles from './index.module.less';
|
|
4
3
|
|
|
5
4
|
interface BlockBarrageProps extends ICardProps {
|
|
6
5
|
/** 后端下发的卡片渲染相关的所有字段 */
|
|
@@ -24,11 +23,11 @@ interface DanmuItemProps {
|
|
|
24
23
|
|
|
25
24
|
const DanmuItem: React.FC<DanmuItemProps> = ({ list, onQuery }) => {
|
|
26
25
|
return (
|
|
27
|
-
<div className=
|
|
26
|
+
<div className="mb-4 flex gap-[10px]" style={{ marginLeft: '0.16rem' }}>
|
|
28
27
|
{list.map((item, index) => (
|
|
29
|
-
<div key={`${index}-${item.title}-${item.query}`} className=
|
|
30
|
-
{item.imageUrl && <img src={item.imageUrl} className=
|
|
31
|
-
<span className=
|
|
28
|
+
<div key={`${index}-${item.title}-${item.query}`} className="flex cursor-pointer items-center rounded-[38px] bg-[#f4f9ff] px-8 pt-[13px] pb-3 transition-colors duration-300 ease-[ease] box-border" onClick={() => onQuery(item.query)}>
|
|
29
|
+
{item.imageUrl && <img src={item.imageUrl} className="mr-2 h-7 w-7 shrink-0 rounded-[14px] box-border" alt={item.title} />}
|
|
30
|
+
<span className="box-border whitespace-nowrap text-[length:26px] leading-[1.2] text-[#1f3b63]">{item.title}</span>
|
|
32
31
|
</div>
|
|
33
32
|
))}
|
|
34
33
|
</div>
|
|
@@ -71,17 +70,17 @@ const BlockBarrage: React.FC<BlockBarrageProps> = ({ cardData = {}, bridgeAPI })
|
|
|
71
70
|
};
|
|
72
71
|
|
|
73
72
|
return (
|
|
74
|
-
<div className=
|
|
75
|
-
<div className=
|
|
76
|
-
<span className=
|
|
73
|
+
<div className="mb-7 box-border w-full min-w-0">
|
|
74
|
+
<div className="mb-6">
|
|
75
|
+
<span className="text-3xl font-medium leading-[inherit] text-[#1f3b63]">{title}</span>
|
|
77
76
|
</div>
|
|
78
|
-
<div className=
|
|
77
|
+
<div className="flex overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,transparent_0%,rgba(0,0,0,0.1)_12px,rgba(0,0,0,1)_24px,rgba(0,0,0,1)_calc(100%_-_24px),rgba(0,0,0,0.1)_calc(100%_-_12px),transparent_100%)] [-webkit-mask-image:linear-gradient(to_right,transparent_0%,rgba(0,0,0,0.1)_12px,rgba(0,0,0,1)_24px,rgba(0,0,0,1)_calc(100%_-_24px),rgba(0,0,0,0.1)_calc(100%_-_12px),transparent_100%)]" onTouchStart={() => setPaused(true)} onTouchEnd={() => setPaused(false)} onTouchCancel={() => setPaused(false)}
|
|
79
78
|
onMouseEnter={() => setPaused(true)} onMouseLeave={() => setPaused(false)}>
|
|
80
|
-
<div className=
|
|
79
|
+
<div className="danmuWallBox flex w-full min-w-0 flex-col overflow-x-hidden overflow-y-hidden transition-transform duration-100 ease-linear [scrollbar-width:none]" ref={contentRef}>
|
|
81
80
|
{danmus.map((list, index) => (
|
|
82
81
|
<div
|
|
83
82
|
key={index}
|
|
84
|
-
className=
|
|
83
|
+
className="mr-5 flex flex-col"
|
|
85
84
|
style={{
|
|
86
85
|
marginLeft: index % 2 === 0 ? 0 : '0.2rem',
|
|
87
86
|
}}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { runCardClick } from '../../shared/actions';
|
|
2
2
|
import { useEffect, useState, useRef } from 'react';
|
|
3
3
|
import type { CardAssetBridge } from '../../shared/types';
|
|
4
|
-
import styles from './index.module.less';
|
|
5
4
|
|
|
6
5
|
interface FanItem {
|
|
7
6
|
imageUrl: string;
|
|
@@ -29,8 +28,8 @@ export default function BlockFanSwiper({ cardData = {}, bridgeAPI }: {
|
|
|
29
28
|
if (!list.length) return null;
|
|
30
29
|
const positions = list.length > 1 ? [-2, -1, 0, 1, 2] : [0];
|
|
31
30
|
return (
|
|
32
|
-
<div className=
|
|
33
|
-
<div className=
|
|
31
|
+
<div className="mb-7 box-border w-full min-w-0">
|
|
32
|
+
<div className="relative min-h-[506px] w-full overflow-hidden"
|
|
34
33
|
onTouchStart={(event) => { start.current = event.touches[0].clientX; setPaused(true); }}
|
|
35
34
|
onTouchEnd={(event) => {
|
|
36
35
|
const offset = event.changedTouches[0].clientX - (start.current ?? event.changedTouches[0].clientX);
|
|
@@ -41,12 +40,12 @@ export default function BlockFanSwiper({ cardData = {}, bridgeAPI }: {
|
|
|
41
40
|
onTouchCancel={() => { start.current = null; setPaused(false); }}>
|
|
42
41
|
{positions.map((position) => {
|
|
43
42
|
const item = list[(active + position + list.length * 2) % list.length];
|
|
44
|
-
return <div key={position} className=
|
|
43
|
+
return <div key={position} className="absolute top-0 left-[max(0px,calc(50%_-_197px))] h-[506px] w-[394px] max-w-full rounded-[40px] bg-cover transition-transform duration-300 ease-in-out"
|
|
45
44
|
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
45
|
onClick={() => runCardClick(bridgeAPI, item)}>
|
|
47
|
-
<div className=
|
|
48
|
-
<img src={item.imageUrl} className=
|
|
49
|
-
<span className=
|
|
46
|
+
<div className="relative flex h-full w-full flex-col justify-end">
|
|
47
|
+
<img src={item.imageUrl} className="absolute top-0 left-0 h-full w-full rounded-[40px]" alt={item.title || ''} />
|
|
48
|
+
<span className="relative z-[3] mb-5 px-6 text-[length:34px] font-medium leading-[48px] text-white">{item.title}</span>
|
|
50
49
|
</div>
|
|
51
50
|
</div>;
|
|
52
51
|
})}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { CardAssetProps as ICardProps } from '../../shared/types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import styles from './index.module.less';
|
|
4
3
|
|
|
5
4
|
interface BlockInfoProps extends ICardProps {
|
|
6
5
|
/** 后端下发的卡片渲染相关的所有字段 */
|
|
@@ -9,10 +8,10 @@ interface BlockInfoProps extends ICardProps {
|
|
|
9
8
|
|
|
10
9
|
const BlockInfo: React.FC<BlockInfoProps> = ({ cardData = {} }) => {
|
|
11
10
|
return (
|
|
12
|
-
<div className=
|
|
13
|
-
<div className=
|
|
14
|
-
<span className=
|
|
15
|
-
<span className=
|
|
11
|
+
<div className="mt-8 mb-10 box-border w-full min-w-0">
|
|
12
|
+
<div className="box-border flex flex-col">
|
|
13
|
+
<span className="w-full self-start whitespace-nowrap text-[length:48px] font-bold leading-[64px] text-[#102953] box-border">{cardData?.title}</span>
|
|
14
|
+
<span className="mt-3 text-[length:25px] leading-normal text-[#1f3b63] box-border">{cardData?.desc}</span>
|
|
16
15
|
</div>
|
|
17
16
|
</div>
|
|
18
17
|
);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { CardAssetProps as ICardProps } from '../../shared/types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import styles from './index.module.less';
|
|
4
3
|
|
|
5
4
|
interface BlockInfoCenterProps extends ICardProps {
|
|
6
5
|
cardData: {
|
|
@@ -12,9 +11,9 @@ interface BlockInfoCenterProps extends ICardProps {
|
|
|
12
11
|
|
|
13
12
|
const BlockInfoCenter: React.FC<BlockInfoCenterProps> = ({ cardData = { title: '', desc: '' } }) => {
|
|
14
13
|
return (
|
|
15
|
-
<div className=
|
|
16
|
-
<div className=
|
|
17
|
-
<div className=
|
|
14
|
+
<div className="mt-8 mb-7 flex w-full min-w-0 flex-col items-center box-border">
|
|
15
|
+
<div className="w-full text-center text-[length:44px] font-bold leading-[64px] text-[#102953] box-border">{cardData.title}</div>
|
|
16
|
+
<div className="mt-3 w-full text-center text-[length:25px] leading-[36px] text-[#1f3b63] box-border">{cardData.desc}</div>
|
|
18
17
|
</div>
|
|
19
18
|
);
|
|
20
19
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { runCardClick } from '../../shared/actions';
|
|
2
2
|
import type { CardAssetProps as ICardProps } from '../../shared/types';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import styles from './index.module.less';
|
|
5
4
|
|
|
6
5
|
interface BlockNowListProps extends ICardProps {
|
|
7
6
|
cardData?: {
|
|
@@ -17,6 +16,9 @@ interface BlockNowListProps extends ICardProps {
|
|
|
17
16
|
} & ICardProps['cardData'];
|
|
18
17
|
}
|
|
19
18
|
|
|
19
|
+
/** Per-index tilt from the original item0..item3 rules. */
|
|
20
|
+
const ITEM_TILT = ['rotate-3', '-rotate-3', 'rotate-3', '-rotate-3'];
|
|
21
|
+
|
|
20
22
|
const BlockNowList: React.FC<BlockNowListProps> = ({ cardData = {}, bridgeAPI }) => {
|
|
21
23
|
const { list: originalList = [] } = cardData;
|
|
22
24
|
const list = originalList.slice(0, 4);
|
|
@@ -28,21 +30,21 @@ const BlockNowList: React.FC<BlockNowListProps> = ({ cardData = {}, bridgeAPI })
|
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
return (
|
|
31
|
-
<div className=
|
|
32
|
-
<div className=
|
|
33
|
+
<div className="relative mb-7 box-border w-full min-w-0">
|
|
34
|
+
<div className="grid grid-cols-2 justify-center gap-8">
|
|
33
35
|
{list.map((item, index) => (
|
|
34
36
|
<div
|
|
35
37
|
key={index}
|
|
36
|
-
className={
|
|
38
|
+
className={`h-[416px] w-full min-w-0 bg-[length:100%_100%] ${ITEM_TILT[index] ?? ''}`}
|
|
37
39
|
style={{
|
|
38
40
|
backgroundImage: `url(${item.bg})`,
|
|
39
41
|
}}
|
|
40
42
|
onClick={() => handleClick(item)}
|
|
41
43
|
>
|
|
42
|
-
<div className=
|
|
43
|
-
<span className=
|
|
44
|
-
<span className=
|
|
45
|
-
<span className=
|
|
44
|
+
<div className="mt-[190px] flex flex-col p-6">
|
|
45
|
+
<span className="mb-2 truncate text-3xl font-medium leading-[inherit] text-[#102953]">{item.title}</span>
|
|
46
|
+
<span className="mb-7 truncate text-[length:26px] font-medium text-[#102953]">{item.desc}</span>
|
|
47
|
+
<span className="self-start rounded-[32px] bg-[#102953] px-6 py-3 text-[length:26px] font-medium text-white">{item.btnText}</span>
|
|
46
48
|
</div>
|
|
47
49
|
</div>
|
|
48
50
|
))}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { CardAssetProps as ICardProps } from '../../shared/types';
|
|
2
2
|
import React, { useState, useEffect } from 'react';
|
|
3
|
-
import styles from './index.module.less';
|
|
4
3
|
|
|
5
4
|
interface ArticleListProps extends ICardProps {
|
|
6
5
|
/** 后端下发的卡片渲染相关的所有字段 */
|
|
@@ -25,7 +24,7 @@ interface ArticleItemProps {
|
|
|
25
24
|
const ArticleItem: React.FC<ArticleItemProps> = ({ content, onClick, index = 0 }) => {
|
|
26
25
|
return (
|
|
27
26
|
<div
|
|
28
|
-
className=
|
|
27
|
+
className="mt-6 flex h-[72px] cursor-pointer items-center rounded-[16px] bg-white px-6 py-[18px] box-border"
|
|
29
28
|
style={{
|
|
30
29
|
marginTop: index === 0 ? '0.0rem' : '0.16rem',
|
|
31
30
|
}}
|
|
@@ -33,13 +32,13 @@ const ArticleItem: React.FC<ArticleItemProps> = ({ content, onClick, index = 0 }
|
|
|
33
32
|
>
|
|
34
33
|
<img
|
|
35
34
|
src="https://mdn.alipayobjects.com/huamei_frp8ut/afts/img/A*WkE1Rasmfk4AAAAAAAAAAAAAet-KAQ/original"
|
|
36
|
-
className=
|
|
35
|
+
className="h-4 w-4"
|
|
37
36
|
alt="thumbnail"
|
|
38
37
|
/>
|
|
39
|
-
<span className=
|
|
38
|
+
<span className="ml-2 flex-1 truncate text-[length:26px] leading-[36px] text-[#1f3b63] box-border">{content}</span>
|
|
40
39
|
<img
|
|
41
40
|
src="https://mdn.alipayobjects.com/huamei_frp8ut/afts/img/A*-4_2QZGFzLsAAAAAAAAAAAAAet-KAQ/original"
|
|
42
|
-
className=
|
|
41
|
+
className="ml-12 h-8 w-8 box-border"
|
|
43
42
|
alt="navigation"
|
|
44
43
|
/>
|
|
45
44
|
</div>
|
|
@@ -81,20 +80,20 @@ const ArticleList: React.FC<ArticleListProps> = ({ cardData = {}, bridgeAPI }) =
|
|
|
81
80
|
};
|
|
82
81
|
|
|
83
82
|
return (
|
|
84
|
-
<div className=
|
|
85
|
-
<div className=
|
|
86
|
-
<div className=
|
|
87
|
-
<span className=
|
|
88
|
-
<div className=
|
|
83
|
+
<div className="mb-7 w-full min-w-0 box-border">
|
|
84
|
+
<div className="flex flex-col rounded-[24px] bg-[rgba(255,255,255,0.5)] px-6 pt-6 pb-7 box-border">
|
|
85
|
+
<div className="flex items-center justify-between box-border">
|
|
86
|
+
<span className="whitespace-nowrap text-3xl font-medium leading-[40px] text-[#1f3b63] box-border">{title}</span>
|
|
87
|
+
<div className="flex cursor-pointer items-center box-border" onClick={handleRefresh}>
|
|
89
88
|
<img
|
|
90
89
|
src="https://mdn.alipayobjects.com/huamei_frp8ut/afts/img/A*kDzsRblLTOYAAAAAAAAAAAAAet-KAQ/original"
|
|
91
|
-
className=
|
|
90
|
+
className="h-8 w-8 box-border"
|
|
92
91
|
alt="refresh"
|
|
93
92
|
/>
|
|
94
|
-
<span className=
|
|
93
|
+
<span className="ml-[6px] whitespace-nowrap text-[length:26px] font-medium leading-[36px] text-[#4b6b99] box-border">换一换</span>
|
|
95
94
|
</div>
|
|
96
95
|
</div>
|
|
97
|
-
<div className=
|
|
96
|
+
<div className="flex flex-col box-border">
|
|
98
97
|
{displayedList.map((item, index) => (
|
|
99
98
|
<ArticleItem key={index} content={item.content} onClick={() => handleItemClick(item)} index={index} />
|
|
100
99
|
))}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { runCardClick } from '../../shared/actions';
|
|
2
2
|
import type { CardAssetProps as ICardProps } from '../../shared/types';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import styles from './index.module.less';
|
|
5
|
-
import { PictureWrongOutline } from 'antd-mobile-icons';
|
|
6
4
|
|
|
7
5
|
interface BlockServiceIconListProps extends ICardProps {
|
|
8
6
|
/** 后端下发的卡片渲染相关的所有字段 */
|
|
@@ -18,6 +16,16 @@ interface BlockServiceIconListProps extends ICardProps {
|
|
|
18
16
|
} & ICardProps['cardData'];
|
|
19
17
|
}
|
|
20
18
|
|
|
19
|
+
/** 图标缺省占位(原 antd-mobile-icons 的 PictureWrongOutline 等价物,纯内联 SVG)。 */
|
|
20
|
+
const PlaceholderIcon: React.FC<{ className?: string }> = ({ className }) => (
|
|
21
|
+
<svg className={className} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" aria-hidden="true">
|
|
22
|
+
<rect x="3" y="4.5" width="18" height="15" rx="2.5" />
|
|
23
|
+
<circle cx="8.5" cy="10" r="1.5" />
|
|
24
|
+
<path d="m4 17 5-4.5 3.5 3 3-2.5L20 17" strokeLinecap="round" strokeLinejoin="round" />
|
|
25
|
+
<path d="m4.5 19.5 15-15" strokeLinecap="round" className="text-[#333]" />
|
|
26
|
+
</svg>
|
|
27
|
+
);
|
|
28
|
+
|
|
21
29
|
interface ServiceItemProps {
|
|
22
30
|
icon?: string;
|
|
23
31
|
title?: string;
|
|
@@ -28,25 +36,19 @@ interface ServiceItemProps {
|
|
|
28
36
|
const ServiceItem: React.FC<ServiceItemProps> = ({ icon, title, onClick, index = 0 }) => {
|
|
29
37
|
return (
|
|
30
38
|
<div
|
|
31
|
-
className=
|
|
39
|
+
className="flex h-[86px] min-w-0 cursor-pointer items-center justify-center"
|
|
32
40
|
style={{
|
|
33
41
|
marginTop: index > 3 ? '0.28rem' : 0,
|
|
34
42
|
}}
|
|
35
43
|
onClick={onClick}
|
|
36
44
|
>
|
|
37
|
-
<div className=
|
|
45
|
+
<div className="flex max-w-full min-w-0 flex-col items-center justify-center">
|
|
38
46
|
{icon ? (
|
|
39
|
-
<img className=
|
|
47
|
+
<img className="h-12 w-12" src={icon} alt={title} />
|
|
40
48
|
) : (
|
|
41
|
-
<
|
|
42
|
-
style={{
|
|
43
|
-
color: '#333',
|
|
44
|
-
fontSize: '0.24rem',
|
|
45
|
-
}}
|
|
46
|
-
className={styles.serversIcon}
|
|
47
|
-
/>
|
|
49
|
+
<PlaceholderIcon className="h-12 w-12 text-[#333]" />
|
|
48
50
|
)}
|
|
49
|
-
<span className=
|
|
51
|
+
<span className="mt-2 max-w-full wrap-anywhere text-center text-[length:22px] text-[#1f3b63]">{title}</span>
|
|
50
52
|
</div>
|
|
51
53
|
</div>
|
|
52
54
|
);
|
|
@@ -59,11 +61,11 @@ const BlockServiceIconList: React.FC<BlockServiceIconListProps> = ({ cardData =
|
|
|
59
61
|
const handleServiceClick = (item: any) => runCardClick(bridgeAPI, item);
|
|
60
62
|
|
|
61
63
|
return (
|
|
62
|
-
<div className=
|
|
63
|
-
<div className=
|
|
64
|
-
<span className=
|
|
65
|
-
<div className=
|
|
66
|
-
<div className=
|
|
64
|
+
<div className="mb-7 flex w-full min-w-0 flex-col justify-center rounded-[24px] bg-[rgba(255,255,255,0.5)] p-6 box-border">
|
|
65
|
+
<div className="flex flex-col">
|
|
66
|
+
<span className="text-3xl font-medium leading-[inherit] text-[#1f3b63]">{title}</span>
|
|
67
|
+
<div className="mt-6 flex w-full items-center justify-center">
|
|
68
|
+
<div className="grid w-full min-w-0 grid-cols-4">
|
|
67
69
|
{serviceList.map((item, index) => (
|
|
68
70
|
<ServiceItem
|
|
69
71
|
key={index}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { runCardClick } from '../../shared/actions';
|
|
2
2
|
import type { CardAssetProps as ICardProps } from '../../shared/types';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import styles from './index.module.less';
|
|
5
4
|
|
|
6
5
|
interface BlockServiceListProps extends ICardProps {
|
|
7
6
|
/** 后端下发的卡片渲染相关的所有字段 */
|
|
@@ -31,7 +30,7 @@ const ScenicCard: React.FC<ScenicCardProps> = ({ imageUrl, title, tags = [], onC
|
|
|
31
30
|
|
|
32
31
|
return (
|
|
33
32
|
<div
|
|
34
|
-
className=
|
|
33
|
+
className="relative flex h-[164px] w-[280px] max-w-full shrink-0 grow-0 flex-col items-start justify-between overflow-hidden rounded-[16px] bg-cover px-6 py-5 box-border"
|
|
35
34
|
style={{
|
|
36
35
|
backgroundImage: `url(${imageUrl})`,
|
|
37
36
|
marginLeft: index > 0 ? '0.12rem' : '0',
|
|
@@ -41,15 +40,15 @@ const ScenicCard: React.FC<ScenicCardProps> = ({ imageUrl, title, tags = [], onC
|
|
|
41
40
|
{showMaskFlag && (
|
|
42
41
|
<img
|
|
43
42
|
src="https://mdn.alipayobjects.com/huamei_frp8ut/afts/img/A*EngjSaAIWqgAAAAAAAAAAAAAet-KAQ/original"
|
|
44
|
-
className=
|
|
43
|
+
className="absolute top-0 left-0 h-full w-full"
|
|
45
44
|
alt="mask"
|
|
46
45
|
/>
|
|
47
46
|
)}
|
|
48
|
-
<div className=
|
|
49
|
-
<div className=
|
|
50
|
-
<div className=
|
|
47
|
+
<div className="relative z-[1] h-full w-full">
|
|
48
|
+
<div className="mb-[30px] w-full truncate text-[length:26px] text-white box-border">{title}</div>
|
|
49
|
+
<div className="flex flex-col">
|
|
51
50
|
{tags.map((tag, tagIndex) => (
|
|
52
|
-
<div key={tagIndex} className=
|
|
51
|
+
<div key={tagIndex} className="mb-3 w-full truncate text-[length:22px] text-[#edeef0] box-border">
|
|
53
52
|
{tag}
|
|
54
53
|
</div>
|
|
55
54
|
))}
|
|
@@ -65,10 +64,10 @@ const BlockServiceList: React.FC<BlockServiceListProps> = ({ cardData = {}, brid
|
|
|
65
64
|
const handleItemClick = (item: any) => runCardClick(bridgeAPI, item);
|
|
66
65
|
|
|
67
66
|
return (
|
|
68
|
-
<div className=
|
|
69
|
-
<div className=
|
|
70
|
-
<span className=
|
|
71
|
-
<div className=
|
|
67
|
+
<div className="mb-7 box-border w-full min-w-0">
|
|
68
|
+
<div className="flex flex-col rounded-[24px] bg-[rgba(255,255,255,0.5)] px-6 pb-7 box-border">
|
|
69
|
+
<span className="my-6 text-3xl font-medium leading-[40px] text-[#1f3b63]">{title}</span>
|
|
70
|
+
<div className="flex h-[164px] w-full gap-3 overflow-x-auto [scrollbar-width:none]">
|
|
72
71
|
{list.map((item, index) => (
|
|
73
72
|
<ScenicCard
|
|
74
73
|
key={index}
|