@tbox.cn/app-card-assets 0.1.1 → 1.0.0-alpha.6
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 +0 -15
- 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 +10 -11
- package/components/BlockServiceList/index.tsx +10 -11
- package/components/BlockTravelCarousel/index.tsx +16 -15
- 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 +1 -1
- package/docs/OneCol.md +1 -1
- package/docs/TwoCol.md +1 -1
- package/package.json +1 -1
- 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
|
@@ -2,7 +2,6 @@ import { runCardClick } from '../../shared/actions';
|
|
|
2
2
|
import type { CardAssetProps as ICardProps } from '../../shared/types';
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
import { Swiper } from 'antd-mobile';
|
|
5
|
-
import styles from './index.module.less';
|
|
6
5
|
import Tags from './tags/Tags';
|
|
7
6
|
|
|
8
7
|
interface BlockTravelCarouselProps extends ICardProps {
|
|
@@ -32,29 +31,29 @@ interface CarouselItemProps {
|
|
|
32
31
|
const CarouselItem: React.FC<CarouselItemProps> = ({ item, hotTitle, hasDesc, onClick }) => {
|
|
33
32
|
return (
|
|
34
33
|
<div
|
|
35
|
-
className=
|
|
34
|
+
className="relative h-[448px] w-full bg-cover bg-center bg-no-repeat box-border"
|
|
36
35
|
style={{
|
|
37
36
|
backgroundImage: `url(${item.imageUrl})`,
|
|
38
37
|
}}
|
|
39
38
|
onClick={onClick}
|
|
40
39
|
>
|
|
41
|
-
<div className=
|
|
42
|
-
<span className=
|
|
43
|
-
<div className=
|
|
44
|
-
<div className=
|
|
45
|
-
<span className=
|
|
40
|
+
<div className="absolute top-[224px] left-0 h-[224px] w-full rounded-b-[24px] bg-[linear-gradient(to_bottom,rgba(0,0,0,0),rgba(0,0,0,0.5))]" />
|
|
41
|
+
<span className="absolute top-6 left-6 rounded-[8px] bg-[linear-gradient(90deg,#fe5500_0%,#ff8e00_100%)] px-[10px] text-center text-[length:22px] font-medium text-white box-border">{hotTitle}</span>
|
|
42
|
+
<div className="absolute bottom-8 w-full px-6">
|
|
43
|
+
<div className="flex items-center box-border">
|
|
44
|
+
<span className="mb-3 whitespace-nowrap text-[length:40px] font-medium leading-[48px] text-white box-border">{item.title}</span>
|
|
46
45
|
{hasDesc && item.tags && (
|
|
47
|
-
<div className=
|
|
46
|
+
<div className="ml-4">
|
|
48
47
|
<Tags tags={item.tags} />
|
|
49
48
|
</div>
|
|
50
49
|
)}
|
|
51
50
|
</div>
|
|
52
51
|
{!hasDesc && item.tags && (
|
|
53
|
-
<div className=
|
|
52
|
+
<div className="mt-3">
|
|
54
53
|
<Tags tags={item.tags} />
|
|
55
54
|
</div>
|
|
56
55
|
)}
|
|
57
|
-
{hasDesc && item.desc && <span className=
|
|
56
|
+
{hasDesc && item.desc && <span className="mt-4 text-ellipsis text-2xl font-medium leading-[32px] tracking-[1px] text-white opacity-70">{item.desc}</span>}
|
|
58
57
|
</div>
|
|
59
58
|
</div>
|
|
60
59
|
);
|
|
@@ -69,12 +68,14 @@ const BlockTravelCarousel: React.FC<BlockTravelCarouselProps> = ({ cardData = {}
|
|
|
69
68
|
|
|
70
69
|
if (!list.length) return null;
|
|
71
70
|
|
|
72
|
-
const dotsBoxClass = hasDesc
|
|
71
|
+
const dotsBoxClass = hasDesc
|
|
72
|
+
? 'absolute bottom-3 left-0 flex w-full items-center justify-center'
|
|
73
|
+
: 'absolute right-6 bottom-8';
|
|
73
74
|
|
|
74
75
|
return (
|
|
75
|
-
<div className=
|
|
76
|
+
<div className="relative mb-7 h-[448px] w-full min-w-0 rounded-[24px] leading-normal box-border">
|
|
76
77
|
<Swiper
|
|
77
|
-
className=
|
|
78
|
+
className="h-[448px] rounded-[24px]"
|
|
78
79
|
autoplay={list.length > 1}
|
|
79
80
|
autoplayInterval={3000}
|
|
80
81
|
onIndexChange={setCurrentIndex}
|
|
@@ -88,9 +89,9 @@ const BlockTravelCarousel: React.FC<BlockTravelCarouselProps> = ({ cardData = {}
|
|
|
88
89
|
))}
|
|
89
90
|
</Swiper>
|
|
90
91
|
<div className={dotsBoxClass}>
|
|
91
|
-
<div className=
|
|
92
|
+
<div className="flex justify-center">
|
|
92
93
|
{list.map((_, index) => (
|
|
93
|
-
<div key={index} className={
|
|
94
|
+
<div key={index} className={`mx-1 h-2 rounded-[4px] ${currentIndex === index ? 'w-[23px] bg-white' : 'w-2 bg-[rgba(255,255,255,0.4)]'}`} />
|
|
94
95
|
))}
|
|
95
96
|
</div>
|
|
96
97
|
</div>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import styles from './Tags.module.less';
|
|
3
2
|
|
|
4
3
|
interface TagsProps {
|
|
5
4
|
tags?: string[];
|
|
@@ -7,9 +6,9 @@ interface TagsProps {
|
|
|
7
6
|
|
|
8
7
|
const Tags: React.FC<TagsProps> = ({ tags = [] }) => {
|
|
9
8
|
return (
|
|
10
|
-
<div className=
|
|
9
|
+
<div className="flex box-border">
|
|
11
10
|
{tags.map((tag, index) => (
|
|
12
|
-
<span key={index} className=
|
|
11
|
+
<span key={index} className="mr-3 flex h-[38px] items-center justify-center rounded-[19px] border-[1.5px] border-solid border-[#6c6e7e] bg-[rgba(255,255,255,0.14)] px-3 text-2xl leading-[inherit] text-white box-border">
|
|
13
12
|
{tag}
|
|
14
13
|
</span>
|
|
15
14
|
))}
|
|
@@ -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 OneColProps extends ICardProps {
|
|
7
6
|
cardData?: {
|
|
@@ -24,49 +23,49 @@ const OneCol: React.FC<OneColProps> = ({ cardData: { button = [], logo, welcome,
|
|
|
24
23
|
const handleClick = (item: any) => runCardClick(bridgeAPI, item);
|
|
25
24
|
|
|
26
25
|
return (
|
|
27
|
-
<div className=
|
|
28
|
-
<div className=
|
|
29
|
-
<div className=
|
|
26
|
+
<div className="mb-7 box-border w-full min-w-0 px-6 pt-[100px] leading-normal">
|
|
27
|
+
<div className="relative flex items-center rounded-[48px] bg-[rgba(255,255,255,0.5)] pt-[118px] pb-[15px] shadow-[0_2px_38px_#0f2a3138]">
|
|
28
|
+
<div className="w-full">
|
|
30
29
|
{logo && (
|
|
31
|
-
<div className=
|
|
32
|
-
<div className=
|
|
33
|
-
<img src={logo} className=
|
|
30
|
+
<div className="absolute -top-20 flex w-full items-center justify-center">
|
|
31
|
+
<div className="rounded-full bg-[linear-gradient(143deg,#8f64ff_0%,#92b2ff_35%,#bbd5ff_54%,#8dc4ff_73%,#33e4ff_100%)] p-1 leading-[0]">
|
|
32
|
+
<img src={logo} className="h-[148px] w-[148px] rounded-full" alt="logo" />
|
|
34
33
|
</div>
|
|
35
34
|
</div>
|
|
36
35
|
)}
|
|
37
|
-
{welcome && <div className=
|
|
36
|
+
{welcome && <div className="mb-1 shrink overflow-hidden px-6 pb-6 text-center text-3xl font-semibold leading-[42px] text-[#1f3b63] text-ellipsis break-all line-clamp-2">{welcome}</div>}
|
|
38
37
|
{desc && (
|
|
39
|
-
<div className=
|
|
40
|
-
<div className=
|
|
38
|
+
<div className="mx-8">
|
|
39
|
+
<div className="text-3xl leading-[48px] text-[#1f3b63]">{desc}</div>
|
|
41
40
|
</div>
|
|
42
41
|
)}
|
|
43
|
-
<div className=
|
|
42
|
+
<div className="px-6 pt-6">
|
|
44
43
|
{button.map((item, index) => (
|
|
45
44
|
<div
|
|
46
45
|
key={index}
|
|
47
|
-
className=
|
|
46
|
+
className="mb-4"
|
|
48
47
|
>
|
|
49
48
|
<div
|
|
50
|
-
className={
|
|
49
|
+
className={`flex items-center justify-between rounded-[48px] bg-white ${item.clickAction === 'link' ? 'bg-[url(https://mdn.alipayobjects.com/huamei_utmyzw/afts/img/wZNXQpLLo_kAAAAAAAAAAAAADrkDAQFr/original)] bg-[length:100%_100%] bg-left-top' : ''}`}
|
|
51
50
|
style={{
|
|
52
51
|
padding: (item.description ?? item.desc) ? '0.08rem 0.16rem' : '0.24rem 0.28rem',
|
|
53
52
|
}}
|
|
54
53
|
onClick={() => handleClick(item)}
|
|
55
54
|
>
|
|
56
|
-
<div className=
|
|
57
|
-
<div className=
|
|
58
|
-
{item.icon && <img src={item.icon} className=
|
|
55
|
+
<div className="mr-2 shrink">
|
|
56
|
+
<div className="flex items-center">
|
|
57
|
+
{item.icon && <img src={item.icon} className="mr-2 h-8 w-8 shrink-0" alt="icon" />}
|
|
59
58
|
<div
|
|
60
|
-
className={(item.description ?? item.desc) ?
|
|
59
|
+
className={(item.description ?? item.desc) ? 'mb-1 shrink overflow-hidden px-6 pb-6 text-center text-3xl font-semibold leading-[42px] text-[#1f3b63] text-ellipsis break-all line-clamp-2' : 'shrink overflow-hidden text-ellipsis break-all line-clamp-2 text-3xl font-normal leading-[42px]'}
|
|
61
60
|
style={{ color: item.clickAction === 'link' ? '#367EEB' : '#1f3b63' }}
|
|
62
61
|
>
|
|
63
62
|
{item.title}
|
|
64
63
|
</div>
|
|
65
64
|
</div>
|
|
66
|
-
{(item.description ?? item.desc) && <div className=
|
|
65
|
+
{(item.description ?? item.desc) && <div className="text-2xl leading-[42px] text-[#8090a6]">{(item.description ?? item.desc)}</div>}
|
|
67
66
|
</div>
|
|
68
67
|
<img
|
|
69
|
-
className=
|
|
68
|
+
className="w-8"
|
|
70
69
|
src="https://mdn.alipayobjects.com/huamei_dlpkmn/afts/img/A*-uhCQ6Ttuj0AAAAAAAAAAAAADty4AQ/original"
|
|
71
70
|
alt="arrow"
|
|
72
71
|
/>
|
|
@@ -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, { useEffect, useState } from 'react';
|
|
4
|
-
import styles from './index.module.less';
|
|
5
4
|
|
|
6
5
|
interface TwoColProps extends ICardProps {
|
|
7
6
|
cardData?: {
|
|
@@ -42,35 +41,35 @@ const TwoCol: React.FC<TwoColProps> = ({ cardData = {}, bridgeAPI }) => {
|
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
return (
|
|
45
|
-
<div className=
|
|
46
|
-
<div className=
|
|
47
|
-
<div className=
|
|
44
|
+
<div className="mb-7 w-full min-w-0 box-border px-6 pt-[100px]">
|
|
45
|
+
<div className="relative flex items-center rounded-[48px] bg-[rgba(255,255,255,0.5)] pt-[118px] pb-8 shadow-[0_2px_38px_#0f2a3138]">
|
|
46
|
+
<div className="w-full min-w-0">
|
|
48
47
|
{(logo || welcome || desc) && (
|
|
49
|
-
<div className=
|
|
50
|
-
<div className=
|
|
51
|
-
<img src={logo} className=
|
|
48
|
+
<div className="absolute -top-20 flex w-full items-center justify-center">
|
|
49
|
+
<div className="rounded-full bg-[linear-gradient(143deg,#8f64ff_0%,#92b2ff_35%,#bbd5ff_54%,#8dc4ff_73%,#33e4ff_100%)] p-1 leading-[0]">
|
|
50
|
+
<img src={logo} className="h-[148px] w-[148px] rounded-full" alt="logo" />
|
|
52
51
|
</div>
|
|
53
52
|
</div>
|
|
54
53
|
)}
|
|
55
|
-
{welcome && <div className=
|
|
54
|
+
{welcome && <div className="px-6 pb-6 text-center text-3xl font-semibold leading-[48px] text-[#1f3b63]">{welcome}</div>}
|
|
56
55
|
{desc && (
|
|
57
|
-
<div className=
|
|
58
|
-
<div className=
|
|
56
|
+
<div className="mx-8">
|
|
57
|
+
<div className="text-3xl leading-[48px] text-[#1f3b63]">{desc}</div>
|
|
59
58
|
</div>
|
|
60
59
|
)}
|
|
61
|
-
<div className=
|
|
60
|
+
<div className="grid grid-cols-2 gap-3 whitespace-normal px-6 pt-6 box-border">
|
|
62
61
|
{listData.map((item, index) => (
|
|
63
|
-
<div key={index} className={
|
|
64
|
-
{item.class && <div className=
|
|
65
|
-
<div className=
|
|
66
|
-
<div className=
|
|
62
|
+
<div key={index} className={`relative mt-3 w-full min-w-0 rounded-[24px] border border-solid border-[rgba(141,159,184,0.4)] bg-white px-6 py-5 box-border${index === listData.length - 1 && listData.length % 2 === 1 ? ' col-span-2' : ''}`} onClick={() => handleClick(item)}>
|
|
63
|
+
{item.class && <div className="absolute -top-[9px] left-0 rounded-[16px] bg-[#60aaf9] px-3 py-1 text-xl leading-[18px] text-white">{item.class}</div>}
|
|
64
|
+
<div className="flex items-center justify-between">
|
|
65
|
+
<div className="min-w-0 flex-1 truncate text-3xl font-medium leading-[38px] text-[#1f3b63]">{item.title}</div>
|
|
67
66
|
<img
|
|
68
|
-
className=
|
|
67
|
+
className="ml-[10px] h-6 w-6 shrink-0"
|
|
69
68
|
src="https://mdn.alipayobjects.com/huamei_xdqfqd/afts/img/qFhvRJ4k084AAAAAAAAAAAAADmgHAQFr/original"
|
|
70
69
|
alt="arrow"
|
|
71
70
|
/>
|
|
72
71
|
</div>
|
|
73
|
-
{item.desc && <div className=
|
|
72
|
+
{item.desc && <div className="mt-3 truncate text-[length:22px] leading-[30px] text-[#1f3b63] opacity-[0.45] break-all">{item.desc}</div>}
|
|
74
73
|
</div>
|
|
75
74
|
))}
|
|
76
75
|
</div>
|
package/docs/Banner.md
CHANGED
|
@@ -14,4 +14,4 @@ import Banner from '@/components/home/components/Banner';
|
|
|
14
14
|
<Banner cardData={/* 按示例填写 */} bridgeAPI={bridge} />
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
组件样式是 TSX 内的 Tailwind 工具类,由应用的 `apps/client/src/styles/tailwind.css` 扫描 `apps/client/src` 自动生成;不携带独立样式文件。尺寸与字号沿用原值(普通物理 px,1:1,不做折半);组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度),可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
|
package/docs/BlockAnimal.md
CHANGED
|
@@ -14,4 +14,4 @@ import BlockAnimal from '@/components/home/components/BlockAnimal';
|
|
|
14
14
|
<BlockAnimal cardData={/* 按示例填写 */} bridgeAPI={bridge} />
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
组件样式是 TSX 内的 Tailwind 工具类,由应用的 `apps/client/src/styles/tailwind.css` 扫描 `apps/client/src` 自动生成;不携带独立样式文件。尺寸与字号沿用原值(普通物理 px,1:1,不做折半);组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度),可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
|
package/docs/BlockBarrage.md
CHANGED
|
@@ -14,4 +14,4 @@ import BlockBarrage from '@/components/home/components/BlockBarrage';
|
|
|
14
14
|
<BlockBarrage cardData={/* 按示例填写 */} bridgeAPI={bridge} />
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
组件样式是 TSX 内的 Tailwind 工具类,由应用的 `apps/client/src/styles/tailwind.css` 扫描 `apps/client/src` 自动生成;不携带独立样式文件。尺寸与字号沿用原值(普通物理 px,1:1,不做折半);组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度),可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
|
package/docs/BlockFanSwiper.md
CHANGED
|
@@ -14,4 +14,4 @@ import BlockFanSwiper from '@/components/home/components/BlockFanSwiper';
|
|
|
14
14
|
<BlockFanSwiper cardData={/* 按示例填写 */} bridgeAPI={bridge} />
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
组件样式是 TSX 内的 Tailwind 工具类,由应用的 `apps/client/src/styles/tailwind.css` 扫描 `apps/client/src` 自动生成;不携带独立样式文件。尺寸与字号沿用原值(普通物理 px,1:1,不做折半);组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度),可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
|
package/docs/BlockIntro.md
CHANGED
|
@@ -14,4 +14,4 @@ import BlockIntro from '@/components/home/components/BlockIntro';
|
|
|
14
14
|
<BlockIntro cardData={/* 按示例填写 */} bridgeAPI={bridge} />
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
组件样式是 TSX 内的 Tailwind 工具类,由应用的 `apps/client/src/styles/tailwind.css` 扫描 `apps/client/src` 自动生成;不携带独立样式文件。尺寸与字号沿用原值(普通物理 px,1:1,不做折半);组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度),可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
|
package/docs/BlockIntroCenter.md
CHANGED
|
@@ -14,4 +14,4 @@ import BlockIntroCenter from '@/components/home/components/BlockIntroCenter';
|
|
|
14
14
|
<BlockIntroCenter cardData={/* 按示例填写 */} bridgeAPI={bridge} />
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
组件样式是 TSX 内的 Tailwind 工具类,由应用的 `apps/client/src/styles/tailwind.css` 扫描 `apps/client/src` 自动生成;不携带独立样式文件。尺寸与字号沿用原值(普通物理 px,1:1,不做折半);组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度),可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
|
package/docs/BlockNowList.md
CHANGED
|
@@ -14,4 +14,4 @@ import BlockNowList from '@/components/home/components/BlockNowList';
|
|
|
14
14
|
<BlockNowList cardData={/* 按示例填写 */} bridgeAPI={bridge} />
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
组件样式是 TSX 内的 Tailwind 工具类,由应用的 `apps/client/src/styles/tailwind.css` 扫描 `apps/client/src` 自动生成;不携带独立样式文件。尺寸与字号沿用原值(普通物理 px,1:1,不做折半);组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度),可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
|
|
@@ -14,4 +14,4 @@ import BlockQuestionList from '@/components/home/components/BlockQuestionList';
|
|
|
14
14
|
<BlockQuestionList cardData={/* 按示例填写 */} bridgeAPI={bridge} />
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
组件样式是 TSX 内的 Tailwind 工具类,由应用的 `apps/client/src/styles/tailwind.css` 扫描 `apps/client/src` 自动生成;不携带独立样式文件。尺寸与字号沿用原值(普通物理 px,1:1,不做折半);组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度),可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
|
|
@@ -14,4 +14,4 @@ import BlockServiceIconList from '@/components/home/components/BlockServiceIconL
|
|
|
14
14
|
<BlockServiceIconList cardData={/* 按示例填写 */} bridgeAPI={bridge} />
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
组件样式是 TSX 内的 Tailwind 工具类,由应用的 `apps/client/src/styles/tailwind.css` 扫描 `apps/client/src` 自动生成;不携带独立样式文件。尺寸与字号沿用原值(普通物理 px,1:1,不做折半);组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度),可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
|
package/docs/BlockServiceList.md
CHANGED
|
@@ -14,4 +14,4 @@ import BlockServiceList from '@/components/home/components/BlockServiceList';
|
|
|
14
14
|
<BlockServiceList cardData={/* 按示例填写 */} bridgeAPI={bridge} />
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
组件样式是 TSX 内的 Tailwind 工具类,由应用的 `apps/client/src/styles/tailwind.css` 扫描 `apps/client/src` 自动生成;不携带独立样式文件。尺寸与字号沿用原值(普通物理 px,1:1,不做折半);组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度),可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
|
|
@@ -14,4 +14,4 @@ import BlockTravelCarousel from '@/components/home/components/BlockTravelCarouse
|
|
|
14
14
|
<BlockTravelCarousel cardData={/* 按示例填写 */} bridgeAPI={bridge} />
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
组件样式是 TSX 内的 Tailwind 工具类,由应用的 `apps/client/src/styles/tailwind.css` 扫描 `apps/client/src` 自动生成;不携带独立样式文件。尺寸与字号沿用原值(普通物理 px,1:1,不做折半);组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度),可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
|
package/docs/OneCol.md
CHANGED
|
@@ -14,4 +14,4 @@ import OneCol from '@/components/home/components/OneCol';
|
|
|
14
14
|
<OneCol cardData={/* 按示例填写 */} bridgeAPI={bridge} />
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
组件样式是 TSX 内的 Tailwind 工具类,由应用的 `apps/client/src/styles/tailwind.css` 扫描 `apps/client/src` 自动生成;不携带独立样式文件。尺寸与字号沿用原值(普通物理 px,1:1,不做折半);组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度),可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
|
package/docs/TwoCol.md
CHANGED
|
@@ -14,4 +14,4 @@ import TwoCol from '@/components/home/components/TwoCol';
|
|
|
14
14
|
<TwoCol cardData={/* 按示例填写 */} bridgeAPI={bridge} />
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
组件样式是 TSX 内的 Tailwind 工具类,由应用的 `apps/client/src/styles/tailwind.css` 扫描 `apps/client/src` 自动生成;不携带独立样式文件。尺寸与字号沿用原值(普通物理 px,1:1,不做折半);组合父容器宽度与布局约定见 [接入本地首页](../shared/home-integration.md#容器宽度),可直接改本地源码、顺序、样式和数据。图片 URL 仅为示例,生产使用部署者素材;没有请求真实业务数据。依赖声明以 assets.json 为准。
|
package/package.json
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
# 接入本地首页
|
|
2
2
|
|
|
3
|
-
`home add` 复制源码并声明依赖,运行 `pnpm install` 后,在 `apps/client/src/
|
|
3
|
+
`home add` 复制源码并声明依赖,运行 `pnpm install` 后,在 `apps/client/src/components/home/Home.tsx` 组合组件。用法和数据示例见复制目录的 `docs/`、`examples/`,本地源码可直接修改。
|
|
4
4
|
|
|
5
5
|
## 注册首页
|
|
6
6
|
|
|
7
|
-
在 `apps/client/src/cards/registry.ts`
|
|
7
|
+
在 `apps/client/src/cards/registry.ts` 取得 ctx 之后注册:页面首次 import 该文件发生在模块注册完成之后、ChatPage 渲染之前。先检查 `ctx.slots.has('home')`。已有 home(尤其 mall-core)时停止自动接线,确认是否替换及门禁等业务副作用如何保留,不能直接覆盖。无 home 时导入本地 Home 并注册;该文件扩展名为 `.ts`,使用 `createElement`:
|
|
8
8
|
|
|
9
9
|
```ts
|
|
10
10
|
import { createElement } from 'react';
|
|
11
|
-
import Home from '
|
|
11
|
+
import Home from '@/components/home/Home';
|
|
12
12
|
|
|
13
|
+
// registry.ts 内 const ctx = getClientContext(); 之后;保持原有 cards/filter/slots 导出。
|
|
13
14
|
if (ctx.slots.has('home')) throw new Error('已有首页,请确认替换方案');
|
|
14
15
|
ctx.slots.register('home', (props) => createElement(Home, props));
|
|
15
16
|
```
|
|
16
17
|
|
|
18
|
+
Home 的 props 使用 `@tbox.cn/app-contracts` 的 `HomeSlotRenderProps`。不要在 slot 回调里直接运行 Hooks;由 Home 组件处理状态。模板 ChatPage 已按 historyMessages、messages、inlineOrphanCards 判断首页显隐,无需再创建一套显隐逻辑。首页收起时子组件卸载,轮播、弹幕等按自身清理函数停止动画。
|
|
19
|
+
|
|
17
20
|
## 点击接线
|
|
18
21
|
|
|
19
|
-
query 复用 `onSend`,跳转复用 `openLink
|
|
22
|
+
query 复用 `onSend`,跳转复用 `openLink`,不要另建消息或导航链路。`home` 是本地导航动作的来源标识,不需要创建服务端卡片实例;不要使用 sendMessage 类型的 UI_ACTION 或臆造卡片 ID 发起首页 query。将 bridge 传给卡片的 `bridgeAPI`:
|
|
20
23
|
|
|
21
24
|
```tsx
|
|
22
25
|
import { createCardAssetBridge } from '@/components/home/shared/actions';
|
|
@@ -38,12 +41,9 @@ function Home({ onSend }: HomeSlotRenderProps) {
|
|
|
38
41
|
|
|
39
42
|
首页撑满父容器,不设置固定宽度或额外 max-width,左右留白由组合层统一维护:
|
|
40
43
|
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
min-width: 0;
|
|
45
|
-
box-sizing: border-box;
|
|
46
|
-
}
|
|
44
|
+
```tsx
|
|
45
|
+
// 首页根容器
|
|
46
|
+
<div className="box-border w-full min-w-0">
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
保留卡片原有列数、滚动和动画。卡片样式为 TSX 内的 Tailwind 工具类:尺寸与字号为普通物理 px(1:1,不折半),复制进应用后由应用的 `apps/client/src/styles/tailwind.css` 扫描 `apps/client/src` 生成。图片与业务数据使用用户材料;更新资源包不会自动覆盖已复制的应用源码。
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
.blockAnimal {
|
|
2
|
-
min-width: 0;
|
|
3
|
-
box-sizing: border-box;
|
|
4
|
-
position: relative;
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100%;
|
|
7
|
-
margin-bottom: 32px;
|
|
8
|
-
.blockContent {
|
|
9
|
-
position: relative;
|
|
10
|
-
}
|
|
11
|
-
.blockMedia {
|
|
12
|
-
min-height: 300px;
|
|
13
|
-
}
|
|
14
|
-
.animalGif {
|
|
15
|
-
width: 100%;
|
|
16
|
-
}
|
|
17
|
-
.animalMp4 {
|
|
18
|
-
width: 100%;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.welcomeWrapper {
|
|
22
|
-
margin-top: 24px;
|
|
23
|
-
border-radius: 8px 48px 48px 48px;
|
|
24
|
-
padding: 24px 32px;
|
|
25
|
-
background: #1f3b63;
|
|
26
|
-
background: rgba(255, 255, 255, 0.4);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.welcomeText {
|
|
30
|
-
font-size: 30px;
|
|
31
|
-
color: #1f3b63;
|
|
32
|
-
letter-spacing: 0;
|
|
33
|
-
line-height: 48px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.tipsContainer {
|
|
37
|
-
position: absolute;
|
|
38
|
-
width: 100%;
|
|
39
|
-
height: 100%;
|
|
40
|
-
top: 0;
|
|
41
|
-
left: 0;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.lottieTips {
|
|
45
|
-
font-size: 24px;
|
|
46
|
-
position: absolute;
|
|
47
|
-
padding: 12px 24px;
|
|
48
|
-
background-color: #fff;
|
|
49
|
-
flex-direction: row;
|
|
50
|
-
justify-content: center;
|
|
51
|
-
align-items: center;
|
|
52
|
-
border-radius: 37px;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.tips-icon {
|
|
56
|
-
height: 28px;
|
|
57
|
-
width: 28px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.tipsTitle {
|
|
61
|
-
color: #1f3b63;
|
|
62
|
-
font-size: 26px;
|
|
63
|
-
margin-left: 8px;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
.guessbox {
|
|
67
|
-
display: flex;
|
|
68
|
-
flex-direction: column;
|
|
69
|
-
align-items: flex-start;
|
|
70
|
-
}
|
|
71
|
-
.guessItem {
|
|
72
|
-
background: rgba(255, 255, 255, 0.8);
|
|
73
|
-
border-radius: 31px;
|
|
74
|
-
padding: 8px 32px;
|
|
75
|
-
margin-top: 16px;
|
|
76
|
-
font-size: 26px;
|
|
77
|
-
line-height: 1.5;
|
|
78
|
-
color: #1f3b63;
|
|
79
|
-
display: inline-block;
|
|
80
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
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
|
-
}
|