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:
@@ -1,27 +1,23 @@
|
||||
<template>
|
||||
<view class="flex border-box w-full">
|
||||
<view class="flex flex-col flex-full min-width-0 mr-12">
|
||||
<view class="flex flex-row flex-items-center flex-justify-between min-width-0">
|
||||
<text class="flex-full min-width-0 font-size-20 font-600 color-white ellipsis-1">{{ mainPageDataModel.welcomeContent }}</text>
|
||||
<text class="flex-shrink-0 font-size-20 font-600 color-white mt-4"> {{ weatherText }} </text>
|
||||
</view>
|
||||
|
||||
<NoticeMessage :tipsMessage="props.mainPageDataModel.tipsMessage" />
|
||||
<view class="home-welcome-panel">
|
||||
<view class="home-welcome-header">
|
||||
<text class="home-welcome-title ellipsis-1">
|
||||
{{ props.mainPageDataModel.welcomeContent || "小七欢迎你~" }}
|
||||
</text>
|
||||
<text v-if="weatherText" class="home-welcome-weather">
|
||||
{{ weatherText }}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<SpriteAnimator class="sprite-self-end" :src="spriteStyle.ipLargeImage" :frameWidth="spriteStyle.frameWidth"
|
||||
:frameHeight="spriteStyle.frameHeight" :totalFrames="spriteStyle.totalFrames" :columns="spriteStyle.columns"
|
||||
:displayWidth="spriteStyle.displayWidth" :fps="16" />
|
||||
<NoticeMessage :tipsMessage="props.mainPageDataModel.tipsMessage" />
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import { defineProps, computed } from "vue";
|
||||
import SpriteAnimator from "@/components/Sprite/SpriteAnimator.vue";
|
||||
import NoticeMessage from "../NoticeMessage/index.vue";
|
||||
import { getLocalWeather } from "@/request/api/MainPageDataApi";
|
||||
|
||||
const weatherText = ref('');
|
||||
const weatherText = ref("");
|
||||
|
||||
const props = defineProps({
|
||||
mainPageDataModel: {
|
||||
@@ -38,23 +34,6 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const initPageImages = computed(() => {
|
||||
return props.mainPageDataModel?.initPageImages || {};
|
||||
});
|
||||
|
||||
const spriteStyle = computed(() => {
|
||||
const images = initPageImages.value;
|
||||
return {
|
||||
backgroundImageUrl: images.backgroundImageUrl,
|
||||
ipLargeImage: images.ipLargeImage,
|
||||
frameWidth: images.ipLargeImageWidth,
|
||||
frameHeight: images.ipLargeImageHeight,
|
||||
totalFrames: images.ipLargeTotalFrames,
|
||||
columns: images.ipLargeColumns,
|
||||
displayWidth: 105,
|
||||
};
|
||||
});
|
||||
|
||||
const getLocalWeatherData = async () => {
|
||||
const res = await getLocalWeather();
|
||||
if (res && res.code === 0) {
|
||||
@@ -68,15 +47,16 @@ onMounted(() => {
|
||||
});
|
||||
|
||||
const getWeatherEmoji = (text) => {
|
||||
if (weatherTextMap[text]) return weatherTextMap[text];
|
||||
if (text.includes("晴")) return "☀️";
|
||||
if (text.includes("云")) return "☁️";
|
||||
if (text.includes("雨")) return "🌧️";
|
||||
if (text.includes("雷")) return "⛈️";
|
||||
if (text.includes("雪")) return "🌨️";
|
||||
if (text.includes("雾") || text.includes("霾")) return "😷";
|
||||
if (text.includes("风")) return "🌬️";
|
||||
if (text.includes("沙")) return "🌪️";
|
||||
const weather = String(text || "");
|
||||
if (weatherTextMap[weather]) return weatherTextMap[weather];
|
||||
if (weather.includes("晴")) return "☀️";
|
||||
if (weather.includes("云")) return "☁️";
|
||||
if (weather.includes("雨")) return "🌧️";
|
||||
if (weather.includes("雷")) return "⛈️";
|
||||
if (weather.includes("雪")) return "🌨️";
|
||||
if (weather.includes("雾") || weather.includes("霾")) return "😷";
|
||||
if (weather.includes("风")) return "🌬️";
|
||||
if (weather.includes("沙")) return "🌪️";
|
||||
return "❓";
|
||||
}
|
||||
|
||||
@@ -150,9 +130,38 @@ const weatherTextMap = {
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.sprite-self-end {
|
||||
align-self: flex-end;
|
||||
<style lang="scss" scoped>
|
||||
.home-welcome-panel {
|
||||
width: 100%;
|
||||
height: 92px;
|
||||
padding: 12px 12px 0;
|
||||
box-sizing: border-box;
|
||||
background: $theme-color-50;
|
||||
}
|
||||
|
||||
.home-welcome-header {
|
||||
height: 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.home-welcome-title {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
color: $text-color-900;
|
||||
font-size: 21px;
|
||||
line-height: 28px;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.home-welcome-weather {
|
||||
flex-shrink: 0;
|
||||
margin-left: 12px;
|
||||
color: $text-color-900;
|
||||
font-size: 22px;
|
||||
line-height: 26px;
|
||||
font-weight: 900;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user