feat: refactor PoiDetailCard layout and styles; update mock data for consistency
This commit is contained in:
@@ -1,45 +1,42 @@
|
|||||||
<template>
|
<template>
|
||||||
<CardShell class="poi-detail-card" variant="soft">
|
<view class="poi-detail-card bg-white rounded-24 border-box overflow-hidden">
|
||||||
<view class="poi-detail-card__hero">
|
<view class="poi-detail-card__hero relative">
|
||||||
<MediaFrame class="poi-detail-card__media h-164" :src="data.cover" />
|
<image
|
||||||
<view class="poi-detail-card__tag">
|
class="poi-detail-card__image w-full h-full block rounded-18"
|
||||||
<BadgePill :label="data.category" tone="green" />
|
:src="data.image"
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
<view class="poi-detail-card__badge flex flex-items-center gap-4 font-size-10 font-900">
|
||||||
|
<text class="poi-detail-card__badge-icon">⌖</text>
|
||||||
|
<text>{{ data.badge?.text }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="poi-detail-card__body p-16">
|
|
||||||
<view class="poi-detail-card__title color-1E293B font-size-18 font-900">{{ data.title }}</view>
|
<view class="poi-detail-card__body">
|
||||||
<view class="poi-detail-card__desc color-64748B font-size-12 font-700">{{ data.description }}</view>
|
<view class="poi-detail-card__title color-1E293B font-size-24 font-900">
|
||||||
<view class="poi-detail-card__facts flex mt-16 rounded-18 bg-F8FAFC">
|
{{ data.title }}
|
||||||
<view v-for="fact in facts" :key="fact.label" class="poi-detail-card__fact flex-full px-8 py-12 text-center">
|
</view>
|
||||||
<view class="poi-detail-card__fact-value color-0F172A font-size-14 font-900">{{ fact.value }}</view>
|
|
||||||
<view class="poi-detail-card__fact-label color-94A3B8 font-size-10 font-700">{{ fact.label }}</view>
|
<view class="poi-detail-card__tip flex flex-items-center gap-10">
|
||||||
|
<view class="poi-detail-card__spark color-047857 font-size-18 font-900">✦</view>
|
||||||
|
<view class="poi-detail-card__tip-text color-047857 font-size-14 font-800">
|
||||||
|
{{ data.tip?.text }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="poi-detail-card__chips flex flex-wrap gap-8 mt-14">
|
|
||||||
<BadgePill v-for="tag in tags" :key="tag" :label="tag" tone="slate" />
|
<view
|
||||||
|
class="poi-detail-card__button flex flex-items-center flex-justify-center gap-8 color-white bg-0F172A font-size-16 font-900"
|
||||||
|
:class="{ 'is-disabled': disabled }"
|
||||||
|
@click="handleAction"
|
||||||
|
>
|
||||||
|
<text class="poi-detail-card__button-icon">↗</text>
|
||||||
|
<text>{{ data.action?.text }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="poi-detail-card__action px-12 pb-12">
|
</view>
|
||||||
<ActionRow
|
|
||||||
:title="data.actionTitle"
|
|
||||||
:subtitle="data.actionSubtitle"
|
|
||||||
icon="⌖"
|
|
||||||
tone="green"
|
|
||||||
:disabled="disabled"
|
|
||||||
:payload="data"
|
|
||||||
@action="$emit('action', $event)"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
</CardShell>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from "vue";
|
|
||||||
import CardShell from "../SharedVisual/CardShell.vue";
|
|
||||||
import MediaFrame from "../SharedVisual/MediaFrame.vue";
|
|
||||||
import BadgePill from "../SharedVisual/BadgePill.vue";
|
|
||||||
import ActionRow from "../SharedVisual/ActionRow.vue";
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -51,10 +48,12 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
defineEmits(["select", "action"]);
|
const emit = defineEmits(["action"]);
|
||||||
|
|
||||||
const facts = computed(() => props.data.facts || []);
|
const handleAction = () => {
|
||||||
const tags = computed(() => props.data.tags || []);
|
if (props.disabled) return;
|
||||||
|
emit("action", props.data);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
export default {
|
export default {
|
||||||
title: "翠谷瀑布观景台",
|
title: "小七孔古桥",
|
||||||
category: "必看 POI",
|
image: "https://images.unsplash.com/photo-1500534314209-a25ddb2bd429?auto=format&fit=crop&w=900&q=80",
|
||||||
cover: "https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=900&q=80",
|
badge: {
|
||||||
description: "靠近主步道的核心观景点,适合拍摄瀑布全景,也适合短暂停留休息。",
|
text: "核心地标",
|
||||||
facts: [
|
},
|
||||||
{ label: "步行", value: "8 分钟" },
|
tip: {
|
||||||
{ label: "热度", value: "4.8" },
|
text: "建于道光十五年,走过这座桥就算跨省了哦~",
|
||||||
{ label: "停留", value: "30 分钟" },
|
},
|
||||||
],
|
action: {
|
||||||
tags: ["亲子友好", "拍照", "近游客中心"],
|
text: "带我去",
|
||||||
actionTitle: "打开导航地图",
|
},
|
||||||
actionSubtitle: "查看路线与距离",
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,48 +1,69 @@
|
|||||||
.poi-detail-card {
|
.poi-detail-card {
|
||||||
position: relative;
|
border: 1px solid rgba(15, 23, 42, 0.04);
|
||||||
|
box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
|
||||||
}
|
}
|
||||||
|
|
||||||
.poi-detail-card__hero {
|
.poi-detail-card__hero {
|
||||||
position: relative;
|
height: 206px;
|
||||||
padding: 8px 8px 0;
|
padding: 8px 8px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poi-detail-card__media {
|
.poi-detail-card__badge {
|
||||||
|
position: absolute;
|
||||||
|
top: 18px;
|
||||||
|
left: 22px;
|
||||||
|
min-height: 30px;
|
||||||
|
padding: 0 12px;
|
||||||
|
border-radius: 999px;
|
||||||
|
color: #059669;
|
||||||
|
background: rgba(255, 255, 255, 0.9);
|
||||||
|
backdrop-filter: blur(8px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.poi-detail-card__tag {
|
.poi-detail-card__badge-icon {
|
||||||
position: absolute;
|
font-size: 13px;
|
||||||
left: 18px;
|
line-height: 1;
|
||||||
bottom: 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.poi-detail-card__body {
|
.poi-detail-card__body {
|
||||||
|
padding: 18px 26px 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poi-detail-card__title {
|
.poi-detail-card__title {
|
||||||
line-height: 24px;
|
line-height: 32px;
|
||||||
|
letter-spacing: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poi-detail-card__desc {
|
.poi-detail-card__tip {
|
||||||
margin-top: 8px;
|
min-height: 46px;
|
||||||
|
margin-top: 16px;
|
||||||
|
padding: 0 14px;
|
||||||
|
border: 1px solid #d1fae5;
|
||||||
|
border-radius: 12px;
|
||||||
|
background: linear-gradient(90deg, #ecfdf5 0%, rgba(240, 253, 244, 0.34) 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.poi-detail-card__spark {
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.poi-detail-card__tip-text {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poi-detail-card__facts {
|
.poi-detail-card__button {
|
||||||
|
height: 54px;
|
||||||
|
margin-top: 16px;
|
||||||
|
border-radius: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poi-detail-card__fact {
|
.poi-detail-card__button.is-disabled {
|
||||||
|
opacity: 0.55;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poi-detail-card__fact-value {
|
.poi-detail-card__button-icon {
|
||||||
}
|
font-size: 18px;
|
||||||
|
line-height: 1;
|
||||||
.poi-detail-card__fact-label {
|
|
||||||
margin-top: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.poi-detail-card__chips {
|
|
||||||
}
|
|
||||||
|
|
||||||
.poi-detail-card__action {
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user