From ca680ab41bdb2d9b07287f5da148a18a99fad45c Mon Sep 17 00:00:00 2001 From: duanshuwen Date: Sun, 5 Jul 2026 14:56:55 +0800 Subject: [PATCH] feat: add heritage discovery tab and AIGC consent dialog - Add new HeritageDiscoverySection and HeritageQuickPrompts components for dedicated heritage discovery view - Implement reusable AigcConsentDialog component for AI service user agreement prompts - Update Discovery page to toggle between explore and heritage tab layouts - Refactor legacy CardSwiper component into generic ExploreCards - Adjust ChatMainList layout to include home hero sprite animation and restructure welcome section - Refine NoticeMessage component styling and layout for better consistency - Add build best practices guidance to AGENTS.md documentation - Clean up minor config whitespace and formatting issues across files --- AGENTS.md | 3 + src/pages.json | 93 ++++++----- .../ChatMain/AigcConsentDialog/index.vue | 94 +++++++++++ .../AigcConsentDialog/styles/index.scss | 86 ++++++++++ src/pages/ChatMain/ChatMainList/index.vue | 54 +++++-- .../ChatMain/ChatMainList/styles/index.scss | 24 ++- src/pages/ChatMain/HomeWelcome/index.vue | 95 ++++++----- src/pages/ChatMain/NoticeMessage/index.vue | 55 ++++--- .../components/ExploreCards/index.vue | 80 ++++++++++ .../components/ExploreCards/styles/index.scss | 151 ++++++++++++++++++ .../HeritageDiscoverySection/index.vue | 111 +++++++++++++ .../styles/index.scss | 137 ++++++++++++++++ .../components/HeritageQuickPrompts/index.vue | 56 +++++++ .../HeritageQuickPrompts/styles/index.scss | 83 ++++++++++ src/pages/Discovery/index.vue | 22 ++- src/request/base/config.js | 2 +- 16 files changed, 1021 insertions(+), 125 deletions(-) create mode 100644 src/pages/ChatMain/AigcConsentDialog/index.vue create mode 100644 src/pages/ChatMain/AigcConsentDialog/styles/index.scss create mode 100644 src/pages/Discovery/components/ExploreCards/index.vue create mode 100644 src/pages/Discovery/components/ExploreCards/styles/index.scss create mode 100644 src/pages/Discovery/components/HeritageDiscoverySection/index.vue create mode 100644 src/pages/Discovery/components/HeritageDiscoverySection/styles/index.scss create mode 100644 src/pages/Discovery/components/HeritageQuickPrompts/index.vue create mode 100644 src/pages/Discovery/components/HeritageQuickPrompts/styles/index.scss diff --git a/AGENTS.md b/AGENTS.md index d6177b5..fa81790 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -123,6 +123,9 @@ yarn switch-client 仓库当前没有明确的测试脚本。完成修改后至少做对应平台构建或运行: +- 本地开发阶段不需要频繁使用 `yarn build:mp-weixin` 做构建验证;优先按变更范围使用 `yarn dev:h5`、`yarn dev:mp-weixin`、`git diff --check` 或页面手动检查。 +- 仅在涉及微信小程序编译能力、发布前验证、依赖/配置变更、跨端兼容风险,或用户明确要求时,再运行 `yarn build:mp-weixin`。 + ```bash yarn build:mp-weixin ``` diff --git a/src/pages.json b/src/pages.json index 33c208b..0388f22 100644 --- a/src/pages.json +++ b/src/pages.json @@ -38,47 +38,47 @@ "navigationBarTextStyle": "black" } }, - { - "path": "pages/ChatMain/ChatLongAnswer/index", - "style": { - "navigationStyle": "custom" - } - }, - { - "path": "pages/ChatModule/LongTextGuideCardPreview/guide", - "style": { - "navigationStyle": "custom" - } - }, - { - "path": "pages/ChatModule/LongTextGuideCardPreview/poi", - "style": { - "navigationStyle": "custom" - } - }, - { - "path": "pages/ChatModule/LongTextGuideCardPreview/route", - "style": { - "navigationStyle": "custom" - } - }, - { - "path": "pages/ChatModule/LongTextGuideCardPreview/photo", - "style": { - "navigationStyle": "custom" - } - }, - { - "path": "pages/ChatModule/LongTextGuideCardPreview/fullDoc", - "style": { - "navigationStyle": "custom" - } - }, - { - "path": "pages/ChatMain/NoticeMessage/detail", - "style": { - "navigationStyle": "custom" - } + { + "path": "pages/ChatMain/ChatLongAnswer/index", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/ChatModule/LongTextGuideCardPreview/guide", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/ChatModule/LongTextGuideCardPreview/poi", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/ChatModule/LongTextGuideCardPreview/route", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/ChatModule/LongTextGuideCardPreview/photo", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/ChatModule/LongTextGuideCardPreview/fullDoc", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/ChatMain/NoticeMessage/detail", + "style": { + "navigationStyle": "custom" + } }, { "path": "pages/test/index", @@ -154,6 +154,17 @@ } } ] + }, + { + "root": "pages-aigc", + "pages": [ + { + "path": "home", + "style": { + "navigationStyle": "custom" + } + } + ] } ], "globalStyle": { diff --git a/src/pages/ChatMain/AigcConsentDialog/index.vue b/src/pages/ChatMain/AigcConsentDialog/index.vue new file mode 100644 index 0000000..0e19a94 --- /dev/null +++ b/src/pages/ChatMain/AigcConsentDialog/index.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/src/pages/ChatMain/AigcConsentDialog/styles/index.scss b/src/pages/ChatMain/AigcConsentDialog/styles/index.scss new file mode 100644 index 0000000..d52fc73 --- /dev/null +++ b/src/pages/ChatMain/AigcConsentDialog/styles/index.scss @@ -0,0 +1,86 @@ +.aigc-consent-overlay { + position: absolute; + z-index: 30; + top: 0; + right: 0; + bottom: 0; + left: 0; + display: flex; + align-items: center; + justify-content: center; + padding: 0 28px; + background: rgba(0, 0, 0, 0.58); + box-sizing: border-box; + -webkit-backdrop-filter: blur(1px); + backdrop-filter: blur(1px); +} + +.aigc-consent-dialog { + width: 100%; + padding: 34px 28px 26px; + border-radius: 24px; + background: #ffffff; + box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26); + box-sizing: border-box; +} + +.aigc-consent-title { + display: block; + margin-bottom: 24px; + color: #111827; + font-size: 19px; + line-height: 26px; + font-weight: 900; + text-align: center; +} + +.aigc-consent-content { + color: #606776; + font-size: 14px; + line-height: 25px; + font-weight: 700; + text-align: justify; +} + +.aigc-consent-rule { + color: #18bd78; + font-weight: 900; +} + +.aigc-consent-actions { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 18px; + margin-top: 28px; +} + +.aigc-consent-button { + width: 100%; + height: 54px; + margin: 0; + display: flex; + align-items: center; + justify-content: center; + padding: 0; + border-radius: 999px; + font-size: 16px; + line-height: 22px; + font-weight: 900; + box-sizing: border-box; +} + +.aigc-consent-button::after { + border: 0; +} + +.aigc-consent-cancel { + border: 1px solid #e2e6ea; + background: #ffffff; + color: #172033; +} + +.aigc-consent-agree { + border: 1px solid #061c31; + background: #061c31; + color: #ffffff; +} diff --git a/src/pages/ChatMain/ChatMainList/index.vue b/src/pages/ChatMain/ChatMainList/index.vue index 20b5ea8..b5f08ef 100644 --- a/src/pages/ChatMain/ChatMainList/index.vue +++ b/src/pages/ChatMain/ChatMainList/index.vue @@ -9,13 +9,24 @@ /> - - - - - - + + + + @@ -24,15 +35,21 @@ - + + + @@ -222,7 +239,7 @@ - diff --git a/src/pages/ChatMain/NoticeMessage/index.vue b/src/pages/ChatMain/NoticeMessage/index.vue index 218b476..dd6f2f7 100644 --- a/src/pages/ChatMain/NoticeMessage/index.vue +++ b/src/pages/ChatMain/NoticeMessage/index.vue @@ -3,11 +3,11 @@ - + {{ item.entityName }} - + 发布时间:{{ item.effectiveStartTime }} @@ -19,10 +19,6 @@ - - @@ -83,45 +79,60 @@ const clickItem = (item) => { \ No newline at end of file + diff --git a/src/pages/Discovery/components/ExploreCards/index.vue b/src/pages/Discovery/components/ExploreCards/index.vue new file mode 100644 index 0000000..04dce89 --- /dev/null +++ b/src/pages/Discovery/components/ExploreCards/index.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/src/pages/Discovery/components/ExploreCards/styles/index.scss b/src/pages/Discovery/components/ExploreCards/styles/index.scss new file mode 100644 index 0000000..44864fb --- /dev/null +++ b/src/pages/Discovery/components/ExploreCards/styles/index.scss @@ -0,0 +1,151 @@ +.explore-cards { + width: 100%; + height: 356px; + overflow: hidden; +} + +.explore-scroll { + width: 100%; + height: 356px; + white-space: nowrap; +} + +.explore-track { + display: inline-flex; + flex-direction: row; + min-width: 100%; + height: 356px; + padding: 0 16px; + box-sizing: border-box; +} + +.explore-card { + position: relative; + flex: 0 0 278px; + width: 278px; + height: 356px; + margin-right: 16px; + overflow: hidden; + border-radius: 28px; + background: #47b391; + color: #ffffff; + box-sizing: border-box; + transform: translateZ(0); +} + +.explore-card:last-child { + margin-right: 0; +} + +.explore-card.is-pressed { + opacity: 0.92; +} + +.explore-card-image { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + display: block; +} + +.explore-card-gradient { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + background: linear-gradient(180deg, rgba(43, 107, 122, 0) 42%, rgba(71, 179, 145, 0.72) 74%, #47b391 100%); +} + +.explore-card.is-culture { + background: #b98563; +} + +.explore-card.is-culture .explore-card-gradient { + background: linear-gradient(180deg, rgba(87, 57, 37, 0.08) 36%, rgba(150, 93, 55, 0.62) 72%, #b98563 100%); +} + +.explore-card.is-adventure { + background: #5b895f; +} + +.explore-card.is-adventure .explore-card-gradient { + background: linear-gradient(180deg, rgba(30, 58, 47, 0) 36%, rgba(47, 97, 54, 0.74) 74%, #5b895f 100%); +} + +.explore-card.is-nightlife { + background: #438694; +} + +.explore-card.is-nightlife .explore-card-gradient { + background: linear-gradient(180deg, rgba(12, 47, 78, 0.04) 34%, rgba(28, 92, 111, 0.72) 74%, #438694 100%); +} + +.explore-card-content { + position: absolute; + left: 0; + right: 0; + bottom: 0; + height: 104px; + display: flex; + flex-direction: column; + justify-content: flex-end; + padding: 14px 58px 15px 16px; + border-top: 1px solid rgba(255, 255, 255, 0.3); + background: rgba(255, 255, 255, 0.15); + box-sizing: border-box; +} + +.explore-card-tag { + display: block; + max-width: 100%; + margin-bottom: 9px; + color: rgba(255, 255, 255, 0.92); + font-size: 11px; + line-height: 13px; + font-weight: 700; + letter-spacing: 1.06px; +} + +.explore-card-title { + display: block; + max-width: 100%; + margin-bottom: 4px; + color: #ffffff; + font-size: 22px; + line-height: 27px; + font-weight: 800; +} + +.explore-card-desc { + display: block; + max-width: 100%; + color: rgba(255, 255, 255, 0.82); + font-size: 13px; + line-height: 18px; +} + +.explore-card-arrow { + position: absolute; + right: 16px; + bottom: 35px; + width: 36px; + height: 36px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50%; + background: rgba(255, 255, 255, 0.92); + color: #2a3538; + box-shadow: 0 4px 6px rgba(44, 39, 32, 0.1); +} + +.explore-card-arrow text { + font-size: 18px; + line-height: 18px; + font-weight: 900; +} diff --git a/src/pages/Discovery/components/HeritageDiscoverySection/index.vue b/src/pages/Discovery/components/HeritageDiscoverySection/index.vue new file mode 100644 index 0000000..b482375 --- /dev/null +++ b/src/pages/Discovery/components/HeritageDiscoverySection/index.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/src/pages/Discovery/components/HeritageDiscoverySection/styles/index.scss b/src/pages/Discovery/components/HeritageDiscoverySection/styles/index.scss new file mode 100644 index 0000000..92f9c91 --- /dev/null +++ b/src/pages/Discovery/components/HeritageDiscoverySection/styles/index.scss @@ -0,0 +1,137 @@ +.heritage-section { + width: 100%; + height: 386px; + overflow: hidden; + background: $theme-color-50; +} + +.heritage-carousel, +.heritage-scroll { + width: 100%; + height: 268px; + overflow: hidden; + background: $theme-color-50; +} + +.heritage-track { + display: inline-flex; + align-items: flex-start; + min-width: 100%; + height: 268px; + padding: 8px 69px 26px; + box-sizing: border-box; +} + +.heritage-card { + flex: 0 0 189px; + width: 189px; + height: 227px; + margin-top: 5px; + margin-right: 14px; + display: flex; + flex-direction: column; + padding: 8px; + border-radius: 28px; + border: 1px solid #f1f5f9; + background: #ffffff; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); + box-sizing: border-box; + text-align: left; +} + +.heritage-card:last-child { + margin-right: 0; +} + +.heritage-card.is-featured { + flex-basis: 237px; + width: 237px; + height: 234px; + margin-top: 0; +} + +.heritage-card.is-selected { + border-color: rgba(12, 205, 88, 0.55); + box-shadow: 0 8px 18px rgba(12, 205, 88, 0.12); + transform: translateY(-2px); +} + +.heritage-card.is-pressed { + opacity: 0.92; +} + +.heritage-image { + position: relative; + width: 100%; + height: 138px; + overflow: hidden; + border-radius: 20px; + background: #f1f5f9; +} + +.heritage-card.is-featured .heritage-image { + height: 145px; +} + +.heritage-cover { + width: 100%; + height: 100%; + display: block; +} + +.heritage-badge { + position: absolute; + top: 8px; + right: 8px; + width: 34px; + height: 32px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 8px; + background: rgba(255, 255, 255, 0.8); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + color: $theme-color-500; + font-size: 11px; + line-height: 16px; + font-weight: 900; +} + +.heritage-copy { + min-width: 0; + margin-top: 8px; + padding: 0 8px; +} + +.heritage-tag { + display: inline-flex; + max-width: 100%; + height: 18px; + align-items: center; + padding: 0 6px; + border-radius: 4px; + background: #fffbeb; + color: #d97706; + font-size: 9px; + line-height: 14px; + font-weight: 800; +} + +.heritage-title { + display: block; + max-width: 100%; + margin: 4px 0; + color: #1e293b; + font-size: 16px; + line-height: 20px; + font-weight: 900; +} + +.heritage-desc { + display: block; + max-width: 100%; + color: #94a3b8; + font-size: 10px; + line-height: 15px; + font-weight: 600; +} diff --git a/src/pages/Discovery/components/HeritageQuickPrompts/index.vue b/src/pages/Discovery/components/HeritageQuickPrompts/index.vue new file mode 100644 index 0000000..a800bd7 --- /dev/null +++ b/src/pages/Discovery/components/HeritageQuickPrompts/index.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/src/pages/Discovery/components/HeritageQuickPrompts/styles/index.scss b/src/pages/Discovery/components/HeritageQuickPrompts/styles/index.scss new file mode 100644 index 0000000..acfc9c9 --- /dev/null +++ b/src/pages/Discovery/components/HeritageQuickPrompts/styles/index.scss @@ -0,0 +1,83 @@ +.prompt-strip { + width: 100%; + height: 112px; + overflow-x: auto; + overflow-y: hidden; + background: $theme-color-50; + scrollbar-width: none; +} + +.prompt-strip::-webkit-scrollbar { + display: none; +} + +.prompt-track { + display: inline-flex; + align-items: flex-start; + min-width: 100%; + height: 112px; + padding: 4px 16px 12px; + box-sizing: border-box; +} + +.prompt-card { + flex: 0 0 148px; + width: 148px; + height: 82px; + margin-right: 10px; + display: flex; + align-items: center; + padding: 14px 12px; + border-radius: 18px; + background: #ffffff; + color: #172033; + box-shadow: 0 3px 10px rgba(27, 58, 48, 0.05); + box-sizing: border-box; + text-align: left; +} + +.prompt-card:last-child { + margin-right: 0; +} + +.prompt-card.is-pressed { + opacity: 0.92; +} + +.prompt-mark { + flex: 0 0 30px; + width: 30px; + height: 30px; + border-radius: 10px; + background: + radial-gradient(circle at 30% 30%, $theme-color-500 0 20%, transparent 22%), + radial-gradient(circle at 70% 30%, #f8c425 0 18%, transparent 20%), + radial-gradient(circle at 30% 70%, $theme-color-500 0 20%, transparent 22%), + radial-gradient(circle at 70% 70%, $theme-color-500 0 18%, transparent 20%), + #eefaf3; +} + +.prompt-copy { + min-width: 0; + flex: 1; + margin-left: 8px; +} + +.prompt-title { + display: block; + max-width: 100%; + color: #172033; + font-size: 14px; + line-height: 18px; + font-weight: 900; +} + +.prompt-desc { + display: block; + max-width: 100%; + margin-top: 2px; + color: #8f9bad; + font-size: 11px; + line-height: 16px; + font-weight: 700; +} diff --git a/src/pages/Discovery/index.vue b/src/pages/Discovery/index.vue index fbd3f96..21dc772 100644 --- a/src/pages/Discovery/index.vue +++ b/src/pages/Discovery/index.vue @@ -17,24 +17,34 @@ @touchmove="emitScrollTouch" @scroll="emitScrollTouch" > - + - +