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
This commit is contained in:
duanshuwen
2026-07-05 14:56:55 +08:00
parent 251f92bc1a
commit ca680ab41b
16 changed files with 1021 additions and 125 deletions

View File

@@ -9,13 +9,24 @@
/>
</view>
<view class="relative">
<image class="w-full block" :src="mainPageDataModel?.initPageImages?.backgroundImageUrl"
mode="aspectFill" style="height: 252px;" />
<view class="absolute bottom-0 left-0 right-0 flex-full">
<view class="px-12 pt-12" style="margin-bottom: -1.5px;">
<HomeWelcome :mainPageDataModel="mainPageDataModel" />
</view>
<view class="home-hero relative flex-shrink-0">
<image
class="home-hero-bg w-full block"
:src="mainPageDataModel?.initPageImages?.backgroundImageUrl"
mode="aspectFill"
/>
<SpriteAnimator
v-if="homeSpriteStyle.ipLargeImage"
class="home-hero-sprite"
:src="homeSpriteStyle.ipLargeImage"
:frameWidth="homeSpriteStyle.frameWidth"
:frameHeight="homeSpriteStyle.frameHeight"
:totalFrames="homeSpriteStyle.totalFrames"
:columns="homeSpriteStyle.columns"
:displayWidth="homeSpriteStyle.displayWidth"
:fps="16"
/>
<view class="home-tabs-layer absolute bottom-0 left-0 right-0 flex-full">
<view style="margin-bottom: -1px;">
<AiTabSwitch v-model="tabIndex" :list="tabList" @change="handleChange" />
</view>
@@ -24,15 +35,21 @@
<view
v-show="tabIndex === 0"
class="main-scroll-area flex-full overflow-hidden min-height-0"
class="main-scroll-area flex flex-col flex-full overflow-hidden min-height-0"
@touchstart.capture="handleScrollAreaTouchStart"
@touchstart="handleScrollAreaTouchStart"
@touchmove="handleScrollAreaTouchMove"
>
<Discovery
@scroll-touch-start="handleScrollAreaTouchStart"
@scroll-touch="handleScrollAreaTouchMove"
<HomeWelcome
class="flex-shrink-0"
:mainPageDataModel="mainPageDataModel"
/>
<view class="flex-full min-height-0 overflow-hidden">
<Discovery
@scroll-touch-start="handleScrollAreaTouchStart"
@scroll-touch="handleScrollAreaTouchMove"
/>
</view>
</view>
<!-- 消息列表可滚动区域 -->
@@ -222,7 +239,7 @@
</template>
<script setup>
import { onMounted, nextTick, onUnmounted, ref } from "vue";
import { computed, onMounted, nextTick, onUnmounted, ref } from "vue";
import { onLoad, onReady } from "@dcloudio/uni-app";
import {
SWITCH_TO_COMPANION_TAB,
@@ -238,6 +255,7 @@ import { MessageRole, MessageType, CompName, Command } from "@/model/ChatModel";
import HomeWelcome from "../HomeWelcome/index.vue";
import AiTabSwitch from "@/components/AiTabSwitch/index.vue";
import Discovery from "../../Discovery/index.vue";
import SpriteAnimator from "@/components/Sprite/SpriteAnimator.vue";
import ChatGuide from "../ChatGuide/index.vue";
import ChatTopNavBar from "../ChatTopNavBar/index.vue";
@@ -351,6 +369,18 @@ let currentSessionMessageId = null;
const tabIndex = ref(0);
const tabList = ["探索发现", "AI伴游"];
const homeSpriteStyle = computed(() => {
const images = mainPageDataModel.value?.initPageImages || {};
return {
ipLargeImage: images.ipLargeImage,
frameWidth: images.ipLargeImageWidth,
frameHeight: images.ipLargeImageHeight,
totalFrames: images.ipLargeTotalFrames,
columns: images.ipLargeColumns,
displayWidth: 105,
};
});
const handleChange = (i) => {
console.log("切换:", i);
};