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:
80
src/pages/Discovery/components/ExploreCards/index.vue
Normal file
80
src/pages/Discovery/components/ExploreCards/index.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<view class="explore-cards">
|
||||
<scroll-view
|
||||
class="explore-scroll"
|
||||
scroll-x
|
||||
show-scrollbar="false"
|
||||
>
|
||||
<view class="explore-track">
|
||||
<view
|
||||
v-for="(item, index) in normalizedList"
|
||||
:key="getItemKey(item, index)"
|
||||
class="explore-card"
|
||||
:class="`is-${item.tone}`"
|
||||
hover-class="is-pressed"
|
||||
hover-stay-time="80"
|
||||
@tap="handleCardTap(item.raw, index)"
|
||||
>
|
||||
<image
|
||||
v-if="item.coverImage"
|
||||
class="explore-card-image"
|
||||
:src="item.coverImage"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
|
||||
<view class="explore-card-gradient" />
|
||||
|
||||
<view class="explore-card-content">
|
||||
<text class="explore-card-tag ellipsis-1">{{ item.tag }}</text>
|
||||
<text class="explore-card-title ellipsis-1">{{ item.title }}</text>
|
||||
<text v-if="item.subTitle" class="explore-card-desc ellipsis-1">
|
||||
{{ item.subTitle }}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view class="explore-card-arrow">
|
||||
<text>→</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(["didSelectItem"]);
|
||||
|
||||
const FALLBACK_TAGS = ["MUST VISIT", "CULTURE", "ADVENTURE", "NIGHTLIFE"];
|
||||
const TONES = ["default", "culture", "adventure", "nightlife"];
|
||||
|
||||
const normalizedList = computed(() =>
|
||||
props.list.map((item, index) => ({
|
||||
raw: item,
|
||||
id: item.id ?? item.tabContentId,
|
||||
title: item.title || "",
|
||||
subTitle: item.subTitle || "",
|
||||
tag: item.tag || FALLBACK_TAGS[index % FALLBACK_TAGS.length],
|
||||
coverImage: item.coverImage || "",
|
||||
tone: TONES[index % TONES.length],
|
||||
}))
|
||||
);
|
||||
|
||||
const getItemKey = (item, index) => item.id ?? item.title ?? index;
|
||||
|
||||
const handleCardTap = (item, index) => {
|
||||
emit("didSelectItem", item, index);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "./styles/index.scss";
|
||||
</style>
|
||||
151
src/pages/Discovery/components/ExploreCards/styles/index.scss
Normal file
151
src/pages/Discovery/components/ExploreCards/styles/index.scss
Normal file
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user