feat: add new features, update theme and build config
- Add 40+ new UI components including chat modules, discovery cards, photo galleries, FAQ and booking tools - Standardize brand color across all styles by replacing $theme-color-500 SCSS variables with #0ccd58 - Add sass 1.58.3 dependency and update vite config for modern scss compiler support - Refactor existing components (AddCarCrad, login page) and remove unused /quick/list router route - Add utility functions for URL parameter handling - Add static assets including custom znicons font, component images and icons - Fix scss syntax issues and deprecation warnings
This commit is contained in:
91
src/pages/home/components/NoticeCard/index.vue
Normal file
91
src/pages/home/components/NoticeCard/index.vue
Normal file
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<div class="notice-card w-full">
|
||||
<div v-if="!detailOpen" class="notice-card__summary bg-FFFBEB rounded-24 w-full">
|
||||
<div class="notice-card__summary-title color-B45309 font-size-16 font-900">
|
||||
{{ summary.title }}
|
||||
</div>
|
||||
<div class="notice-card__summary-content color-D97706 font-size-14 font-900">
|
||||
{{ summary.content }}
|
||||
</div>
|
||||
<div class="notice-card__summary-footer flex flex-items-center flex-justify-between">
|
||||
<div class="notice-card__summary-time color-D97706 font-size-12 font-900">
|
||||
{{ summary.publishTime }}
|
||||
</div>
|
||||
<div class="notice-card__summary-link color-B45309 font-size-14 font-900" :class="{ 'is-disabled': disabled }"
|
||||
@click="openDetail">
|
||||
{{ summary.actionText }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="notice-card__detail bg-white rounded-24 overflow-hidden w-full">
|
||||
<div class="notice-card__detail-head flex flex-items-center">
|
||||
<div class="notice-card__back flex flex-items-center flex-justify-center rounded-full flex-shrink-0"
|
||||
@click="closeDetail">
|
||||
<uni-icons type="left" size="16" color="#CBD5E1"></uni-icons>
|
||||
</div>
|
||||
<div class="notice-card__head-title color-1E293B font-size-18 font-900">
|
||||
{{ detail.navTitle }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<image class="notice-card__image block w-full" :src="detail.image" mode="aspectFill" />
|
||||
|
||||
<div class="notice-card__detail-body">
|
||||
<div class="notice-card__detail-title color-1E293B font-size-20 font-900">
|
||||
{{ detail.title }}
|
||||
</div>
|
||||
<div class="notice-card__time-pill flex flex-items-center bg-F8FAFC color-475569 font-size-13 font-900">
|
||||
<span class="notice-card__time-icon">{{ detail.timeIcon }}</span>
|
||||
<span>{{ detail.publishTime }}</span>
|
||||
</div>
|
||||
<div class="notice-card__divider"></div>
|
||||
<div v-for="paragraph in paragraphs" :key="paragraph.id"
|
||||
class="notice-card__paragraph color-475569 font-size-14 font-800">
|
||||
<span v-for="segment in paragraph.segments" :key="segment.text"
|
||||
:class="{ 'notice-card__strong': segment.strong }">
|
||||
{{ segment.text }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(["select", "back", "action"]);
|
||||
|
||||
const detailOpen = ref(false);
|
||||
const summary = computed(() => props.data.summary || {});
|
||||
const detail = computed(() => props.data.detail || {});
|
||||
const paragraphs = computed(() => detail.value.paragraphs || []);
|
||||
|
||||
const openDetail = () => {
|
||||
if (props.disabled) return;
|
||||
detailOpen.value = true;
|
||||
emit("select", props.data);
|
||||
emit("action", props.data);
|
||||
};
|
||||
|
||||
const closeDetail = () => {
|
||||
detailOpen.value = false;
|
||||
emit("back");
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "./styles/index.scss";
|
||||
</style>
|
||||
49
src/pages/home/components/NoticeCard/mocks.js
Normal file
49
src/pages/home/components/NoticeCard/mocks.js
Normal file
@@ -0,0 +1,49 @@
|
||||
export default {
|
||||
id: "wolongtan-trail-notice",
|
||||
summary: {
|
||||
title: "卧龙潭",
|
||||
content: "卧龙潭排队严重。",
|
||||
publishTime: "发布时间:2025年7月12日 09:30",
|
||||
actionText: "详情",
|
||||
},
|
||||
detail: {
|
||||
navTitle: "交通公告",
|
||||
image: "https://images.unsplash.com/photo-1500534314209-a25ddb2bd429?auto=format&fit=crop&w=1000&q=80",
|
||||
title: "卧龙潭至鸳鸯湖步道临时封闭通知",
|
||||
timeIcon: "◷",
|
||||
publishTime: "发布时间:2025年7月12日 09:30",
|
||||
paragraphs: [
|
||||
{
|
||||
id: "rain",
|
||||
segments: [
|
||||
{
|
||||
text: "因近日持续降雨导致景区内水位明显上升,为保障游客人身安全,景区管理部门决定自即日起临时封闭",
|
||||
},
|
||||
{
|
||||
text: "卧龙潭至鸳鸯湖沉溪步道",
|
||||
strong: true,
|
||||
},
|
||||
{
|
||||
text: ",封闭时间视水位情况另行通知。",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "route",
|
||||
segments: [
|
||||
{
|
||||
text: "受影响游客可改走景区主干道绕行,全程增加约15分钟。观光车服务正常运营,建议优先乘车前往鸳鸯湖区域。",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "reopen",
|
||||
segments: [
|
||||
{
|
||||
text: "如水位下降恢复安全标准,景区将第一时间通过广播及公告重新开放步道,请游客留意景区实时公告。",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
123
src/pages/home/components/NoticeCard/styles/index.scss
Normal file
123
src/pages/home/components/NoticeCard/styles/index.scss
Normal file
@@ -0,0 +1,123 @@
|
||||
.notice-card {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.notice-card__summary,
|
||||
.notice-card__detail {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.notice-card__summary {
|
||||
padding: 16px 20px 14px;
|
||||
border: 1px solid #fde68a;
|
||||
box-shadow: 0 8px 22px rgba(245, 158, 11, 0.08);
|
||||
}
|
||||
|
||||
.notice-card__summary-title {
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.notice-card__summary-content {
|
||||
margin-top: 6px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.notice-card__summary-footer {
|
||||
min-width: 0;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.notice-card__summary-time {
|
||||
min-width: 0;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.notice-card__summary-link {
|
||||
margin-left: 16px;
|
||||
line-height: 18px;
|
||||
text-decoration: underline;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.notice-card__summary-link:active {
|
||||
opacity: 0.82;
|
||||
}
|
||||
|
||||
.notice-card__summary-link.is-disabled {
|
||||
opacity: 0.55;
|
||||
}
|
||||
|
||||
.notice-card__detail {
|
||||
border: 1px solid rgba(226, 232, 240, 0.72);
|
||||
box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
|
||||
}
|
||||
|
||||
.notice-card__detail-head {
|
||||
height: 68px;
|
||||
padding: 0 20px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.notice-card__back {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
margin-right: 14px;
|
||||
color: #64748b;
|
||||
font-size: 28px;
|
||||
line-height: 1;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.notice-card__head-title {
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.notice-card__image {
|
||||
height: 250px;
|
||||
}
|
||||
|
||||
.notice-card__detail-body {
|
||||
padding: 22px 20px 28px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.notice-card__detail-title {
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.notice-card__time-pill {
|
||||
display: inline-flex;
|
||||
height: 34px;
|
||||
margin-top: 16px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 999px;
|
||||
line-height: 34px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.notice-card__time-icon {
|
||||
margin-right: 6px;
|
||||
color: #64748b;
|
||||
font-size: 15px;
|
||||
line-height: 15px;
|
||||
}
|
||||
|
||||
.notice-card__divider {
|
||||
height: 1px;
|
||||
margin: 26px 0 20px;
|
||||
background: #e5e7eb;
|
||||
}
|
||||
|
||||
.notice-card__paragraph {
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.notice-card__paragraph + .notice-card__paragraph {
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.notice-card__strong {
|
||||
color: #1e293b;
|
||||
font-weight: 900;
|
||||
}
|
||||
Reference in New Issue
Block a user