feat:消息中心和案例库
This commit is contained in:
173
src/pages/project-center/components/ProjectCenterCard.vue
Normal file
173
src/pages/project-center/components/ProjectCenterCard.vue
Normal file
@@ -0,0 +1,173 @@
|
||||
<script setup lang="ts">
|
||||
import type { ProjectCenterItem } from '@/types/project-center'
|
||||
|
||||
defineProps<{
|
||||
item: ProjectCenterItem
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
detail: [id: string]
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="project-center-card">
|
||||
<view class="project-center-card__header">
|
||||
<text class="project-center-card__title">
|
||||
{{ item.title }}
|
||||
</text>
|
||||
<text class="project-center-card__status">
|
||||
{{ item.status }}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view class="project-center-card__meta">
|
||||
<text class="project-center-card__tag">
|
||||
{{ item.category }}
|
||||
</text>
|
||||
<text class="project-center-card__no">
|
||||
项目编号:{{ item.projectNo }}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view
|
||||
v-if="item.status === '进行中' && item.progress !== undefined"
|
||||
class="project-center-card__progress"
|
||||
>
|
||||
<view class="project-center-card__progress-bar">
|
||||
<view
|
||||
class="project-center-card__progress-fill"
|
||||
:style="{ width: `${item.progress}%` }"
|
||||
/>
|
||||
</view>
|
||||
<text class="project-center-card__progress-value">
|
||||
{{ item.progress }}%
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="project-center-card__footer"
|
||||
:class="{ 'project-center-card__footer--simple': item.status !== '进行中' }"
|
||||
>
|
||||
<text
|
||||
v-if="item.updateTime"
|
||||
class="project-center-card__time"
|
||||
>
|
||||
更新时间:{{ item.updateTime }}
|
||||
</text>
|
||||
<text
|
||||
class="project-center-card__detail"
|
||||
@tap.stop="emit('detail', item.id)"
|
||||
>
|
||||
查看详情 >
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '@/styles/variables.scss';
|
||||
|
||||
.project-center-card {
|
||||
padding: 28rpx 24rpx;
|
||||
margin-bottom: 24rpx;
|
||||
background: $color-bg-page;
|
||||
border-radius: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.project-center-card__header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.project-center-card__title {
|
||||
flex: 1;
|
||||
padding-right: 16rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: $color-text-primary;
|
||||
}
|
||||
|
||||
.project-center-card__status {
|
||||
flex-shrink: 0;
|
||||
font-size: 24rpx;
|
||||
color: $color-text-secondary;
|
||||
}
|
||||
|
||||
.project-center-card__meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.project-center-card__tag {
|
||||
flex-shrink: 0;
|
||||
padding: 4rpx 12rpx;
|
||||
font-size: 20rpx;
|
||||
color: $color-primary;
|
||||
background: $color-primary-light;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.project-center-card__no {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-left: 12rpx;
|
||||
font-size: 22rpx;
|
||||
color: #666666;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.project-center-card__progress {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.project-center-card__progress-bar {
|
||||
flex: 1;
|
||||
height: 12rpx;
|
||||
overflow: hidden;
|
||||
background: #eef2ff;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.project-center-card__progress-fill {
|
||||
height: 100%;
|
||||
background: $color-primary;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.project-center-card__progress-value {
|
||||
flex-shrink: 0;
|
||||
margin-left: 16rpx;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.project-center-card__footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 20rpx;
|
||||
|
||||
&--simple {
|
||||
justify-content: flex-end;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.project-center-card__time {
|
||||
font-size: 22rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.project-center-card__detail {
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
</style>
|
||||
703
src/pages/project-center/detail/index.vue
Normal file
703
src/pages/project-center/detail/index.vue
Normal file
@@ -0,0 +1,703 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getProjectDetail } from '@/constants/project-detail'
|
||||
import cardBg from '@/static/icons/new-card.png'
|
||||
import deleteIcon from '@/static/icons/X.png'
|
||||
import type { ProjectDetail, ProjectDetailTab } from '@/types/project-detail'
|
||||
import { navigateBackWithFallback } from '@/utils/navigate-back'
|
||||
|
||||
const detail = ref<ProjectDetail | null>(null)
|
||||
const activeTab = ref<ProjectDetailTab>('progress')
|
||||
|
||||
const tabs: Array<{ key: ProjectDetailTab, label: string }> = [
|
||||
{ key: 'progress', label: '项目进度' },
|
||||
{ key: 'files', label: '项目文件' },
|
||||
{ key: 'finance', label: '合同财务' },
|
||||
{ key: 'aftersales', label: '售后信息' },
|
||||
]
|
||||
|
||||
onLoad((options) => {
|
||||
const rawId = options?.id
|
||||
const id = rawId ? decodeURIComponent(String(rawId)) : '1'
|
||||
detail.value = getProjectDetail(id)
|
||||
|
||||
if (!detail.value) {
|
||||
uni.showToast({ title: '项目不存在', icon: 'none' })
|
||||
setTimeout(() => uni.navigateBack(), 1500)
|
||||
}
|
||||
})
|
||||
|
||||
function handleBack() {
|
||||
navigateBackWithFallback('/pages/project-center/index')
|
||||
}
|
||||
|
||||
function handleSelectTab(key: ProjectDetailTab) {
|
||||
activeTab.value = key
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view
|
||||
v-if="detail"
|
||||
class="project-detail"
|
||||
>
|
||||
<view class="project-detail__navbar">
|
||||
<view
|
||||
class="project-detail__back"
|
||||
@tap="handleBack"
|
||||
>
|
||||
<image
|
||||
class="project-detail__back-icon"
|
||||
src="/static/icons/icon-back.svg"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
<text class="project-detail__navbar-title">
|
||||
项目详情
|
||||
</text>
|
||||
<view class="project-detail__navbar-placeholder" />
|
||||
</view>
|
||||
|
||||
<scroll-view
|
||||
class="project-detail__scroll"
|
||||
scroll-y
|
||||
:show-scrollbar="false"
|
||||
>
|
||||
<view class="project-detail__content">
|
||||
<view class="project-detail__hero">
|
||||
<image
|
||||
class="project-detail__hero-bg"
|
||||
:src="cardBg"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
<view class="project-detail__hero-inner">
|
||||
<view class="project-detail__hero-top">
|
||||
<text class="project-detail__tag">
|
||||
{{ detail.category }}
|
||||
</text>
|
||||
<view class="project-detail__hero-status">
|
||||
<text class="project-detail__status">
|
||||
{{ detail.status }}
|
||||
</text>
|
||||
<text
|
||||
v-if="detail.progress !== undefined"
|
||||
class="project-detail__progress-text"
|
||||
>
|
||||
{{ detail.progress }}%
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<text class="project-detail__title">
|
||||
{{ detail.title }}
|
||||
</text>
|
||||
<text class="project-detail__no">
|
||||
项目编号:{{ detail.projectNo }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view
|
||||
class="project-detail__tabs"
|
||||
scroll-x
|
||||
:show-scrollbar="false"
|
||||
>
|
||||
<view class="project-detail__tabs-inner">
|
||||
<text
|
||||
v-for="tab in tabs"
|
||||
:key="tab.key"
|
||||
class="project-detail__tab"
|
||||
:class="{ 'project-detail__tab--active': activeTab === tab.key }"
|
||||
@tap="handleSelectTab(tab.key)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view
|
||||
v-if="activeTab === 'progress'"
|
||||
class="project-detail__panel"
|
||||
>
|
||||
<view class="project-detail__dev-progress">
|
||||
<text class="project-detail__panel-title">
|
||||
开发进度
|
||||
</text>
|
||||
<view class="project-detail__overall">
|
||||
<text class="project-detail__overall-label">
|
||||
总体进度
|
||||
</text>
|
||||
<text class="project-detail__overall-value">
|
||||
{{ detail.progress ?? 0 }}%
|
||||
</text>
|
||||
</view>
|
||||
<view class="project-detail__slider">
|
||||
<view class="project-detail__slider-track">
|
||||
<view
|
||||
class="project-detail__slider-fill"
|
||||
:style="{ width: `${detail.progress ?? 0}%` }"
|
||||
/>
|
||||
<view
|
||||
class="project-detail__slider-thumb"
|
||||
:style="{ left: `${detail.progress ?? 0}%` }"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="project-detail__dates">
|
||||
<text>开始时间:{{ detail.progressStartTime }}</text>
|
||||
<text>结束时间:{{ detail.progressEndTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="project-detail__timeline">
|
||||
<text class="project-detail__panel-title project-detail__timeline-heading">
|
||||
项目进度(里程碑)
|
||||
</text>
|
||||
<view
|
||||
v-for="(step, index) in detail.steps"
|
||||
:key="step.id"
|
||||
class="project-detail__timeline-item"
|
||||
>
|
||||
<view class="project-detail__timeline-left">
|
||||
<view
|
||||
class="project-detail__timeline-dot"
|
||||
:class="{
|
||||
'project-detail__timeline-dot--done': step.status === 'done',
|
||||
'project-detail__timeline-dot--active': step.status === 'active',
|
||||
'project-detail__timeline-dot--pending': step.status === 'pending',
|
||||
}"
|
||||
>
|
||||
<text
|
||||
v-if="step.status === 'done'"
|
||||
class="project-detail__timeline-check"
|
||||
>
|
||||
✓
|
||||
</text>
|
||||
<text
|
||||
v-else
|
||||
class="project-detail__timeline-index"
|
||||
>
|
||||
{{ index + 1 }}
|
||||
</text>
|
||||
</view>
|
||||
<view
|
||||
v-if="index < detail.steps.length - 1"
|
||||
class="project-detail__timeline-line"
|
||||
:class="{ 'project-detail__timeline-line--done': step.status === 'done' }"
|
||||
/>
|
||||
</view>
|
||||
<view class="project-detail__timeline-body">
|
||||
<text class="project-detail__timeline-title">
|
||||
{{ step.title }}
|
||||
</text>
|
||||
<text
|
||||
v-if="step.time"
|
||||
class="project-detail__timeline-time"
|
||||
>
|
||||
{{ step.time }}
|
||||
</text>
|
||||
<text
|
||||
v-else-if="step.statusText"
|
||||
class="project-detail__timeline-status"
|
||||
:class="{ 'project-detail__timeline-status--active': step.status === 'active' }"
|
||||
>
|
||||
{{ step.statusText }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="project-detail__team">
|
||||
<text class="project-detail__panel-title">
|
||||
项目团队
|
||||
</text>
|
||||
<scroll-view
|
||||
class="project-detail__team-scroll"
|
||||
scroll-x
|
||||
:show-scrollbar="false"
|
||||
>
|
||||
<view class="project-detail__team-inner">
|
||||
<view
|
||||
v-for="member in detail.team"
|
||||
:key="member.id"
|
||||
class="project-detail__member"
|
||||
>
|
||||
<view class="project-detail__avatar">
|
||||
<text>{{ member.name.slice(0, 2) }}</text>
|
||||
</view>
|
||||
<text class="project-detail__member-name">
|
||||
{{ member.name }}
|
||||
</text>
|
||||
<text class="project-detail__member-role">
|
||||
{{ member.role }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
v-else-if="activeTab === 'files'"
|
||||
class="project-detail__panel"
|
||||
>
|
||||
<view class="project-detail__files">
|
||||
<view
|
||||
v-for="file in detail.files"
|
||||
:key="file.id"
|
||||
class="project-detail__file"
|
||||
>
|
||||
<view class="project-detail__file-remove">
|
||||
<image
|
||||
class="project-detail__file-remove-icon"
|
||||
:src="deleteIcon"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
<image
|
||||
class="project-detail__file-icon"
|
||||
:src="file.icon"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<text class="project-detail__file-name">
|
||||
{{ file.name }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
v-else-if="activeTab === 'finance'"
|
||||
class="project-detail__panel"
|
||||
>
|
||||
<text class="project-detail__paragraph">
|
||||
{{ detail.financeSummary }}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view
|
||||
v-else
|
||||
class="project-detail__panel"
|
||||
>
|
||||
<text class="project-detail__paragraph">
|
||||
{{ detail.afterSalesSummary }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '@/styles/variables.scss';
|
||||
|
||||
.project-detail {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
background: $color-bg-section;
|
||||
}
|
||||
|
||||
.project-detail__navbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-shrink: 0;
|
||||
padding: calc(var(--status-bar-height, 44px) + 12rpx) 24rpx 20rpx;
|
||||
background: $color-bg-page;
|
||||
}
|
||||
|
||||
.project-detail__back {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
|
||||
.project-detail__back-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.project-detail__navbar-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
color: $color-text-primary;
|
||||
}
|
||||
|
||||
.project-detail__navbar-placeholder {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
|
||||
.project-detail__scroll {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.project-detail__content {
|
||||
padding: 24rpx 24rpx calc(32rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.project-detail__hero {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.project-detail__hero-bg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.project-detail__hero-inner {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: 28rpx 24rpx;
|
||||
}
|
||||
|
||||
.project-detail__hero-top {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.project-detail__tag {
|
||||
padding: 4rpx 12rpx;
|
||||
font-size: 20rpx;
|
||||
color: $color-primary;
|
||||
background: $color-primary-light;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.project-detail__hero-status {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.project-detail__status {
|
||||
font-size: 24rpx;
|
||||
color: $color-text-secondary;
|
||||
}
|
||||
|
||||
.project-detail__progress-text {
|
||||
margin-top: 4rpx;
|
||||
font-size: 24rpx;
|
||||
color: $color-text-secondary;
|
||||
}
|
||||
|
||||
.project-detail__title {
|
||||
display: block;
|
||||
margin-top: 20rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: $color-text-primary;
|
||||
}
|
||||
|
||||
.project-detail__no {
|
||||
display: block;
|
||||
margin-top: 16rpx;
|
||||
font-size: 22rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.project-detail__tabs {
|
||||
margin-top: 24rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.project-detail__tabs-inner {
|
||||
display: inline-flex;
|
||||
gap: 32rpx;
|
||||
padding: 0 4rpx;
|
||||
}
|
||||
|
||||
.project-detail__tab {
|
||||
flex-shrink: 0;
|
||||
padding-bottom: 12rpx;
|
||||
font-size: 28rpx;
|
||||
color: $color-text-secondary;
|
||||
|
||||
&--active {
|
||||
font-weight: 600;
|
||||
color: $color-text-primary;
|
||||
border-bottom: 4rpx solid $color-primary;
|
||||
}
|
||||
}
|
||||
|
||||
.project-detail__panel {
|
||||
margin-top: 24rpx;
|
||||
padding: 28rpx 24rpx;
|
||||
background: $color-bg-page;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.project-detail__panel-title {
|
||||
display: block;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: $color-text-primary;
|
||||
}
|
||||
|
||||
.project-detail__dev-progress {
|
||||
padding-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.project-detail__overall {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.project-detail__overall-label {
|
||||
font-size: 26rpx;
|
||||
color: $color-text-secondary;
|
||||
}
|
||||
|
||||
.project-detail__overall-value {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: $color-primary;
|
||||
}
|
||||
|
||||
.project-detail__slider {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.project-detail__slider-track {
|
||||
position: relative;
|
||||
height: 8rpx;
|
||||
background: #e8eaef;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
|
||||
.project-detail__slider-fill {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
background: $color-primary;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
|
||||
.project-detail__slider-thumb {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-left: -12rpx;
|
||||
background: $color-bg-page;
|
||||
border: 4rpx solid $color-primary;
|
||||
border-radius: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.project-detail__dates {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 20rpx;
|
||||
font-size: 22rpx;
|
||||
color: $color-text-secondary;
|
||||
}
|
||||
|
||||
.project-detail__timeline {
|
||||
margin-top: 32rpx;
|
||||
padding-top: 8rpx;
|
||||
}
|
||||
|
||||
.project-detail__timeline-heading {
|
||||
display: block;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.project-detail__timeline-item {
|
||||
display: flex;
|
||||
min-height: 96rpx;
|
||||
}
|
||||
|
||||
.project-detail__timeline-left {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 48rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.project-detail__timeline-dot {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
|
||||
&--done {
|
||||
background: $color-primary;
|
||||
}
|
||||
|
||||
&--active {
|
||||
background: $color-primary;
|
||||
}
|
||||
|
||||
&--pending {
|
||||
background: $color-bg-page;
|
||||
border: 2rpx solid #d8dde6;
|
||||
}
|
||||
}
|
||||
|
||||
.project-detail__timeline-check {
|
||||
font-size: 22rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.project-detail__timeline-index {
|
||||
font-size: 22rpx;
|
||||
color: #ffffff;
|
||||
|
||||
.project-detail__timeline-dot--pending & {
|
||||
color: $color-text-secondary;
|
||||
}
|
||||
}
|
||||
|
||||
.project-detail__timeline-line {
|
||||
flex: 1;
|
||||
width: 2rpx;
|
||||
min-height: 40rpx;
|
||||
margin-top: 8rpx;
|
||||
background: #e8eaef;
|
||||
|
||||
&--done {
|
||||
background: $color-primary;
|
||||
}
|
||||
}
|
||||
|
||||
.project-detail__timeline-body {
|
||||
flex: 1;
|
||||
padding-bottom: 28rpx;
|
||||
}
|
||||
|
||||
.project-detail__timeline-title {
|
||||
display: block;
|
||||
font-size: 28rpx;
|
||||
color: $color-text-primary;
|
||||
}
|
||||
|
||||
.project-detail__timeline-time,
|
||||
.project-detail__timeline-status {
|
||||
display: block;
|
||||
margin-top: 8rpx;
|
||||
font-size: 22rpx;
|
||||
color: $color-text-secondary;
|
||||
}
|
||||
|
||||
.project-detail__timeline-status--active {
|
||||
color: $color-primary;
|
||||
}
|
||||
|
||||
.project-detail__team {
|
||||
margin-top: 32rpx;
|
||||
padding-top: 28rpx;
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.project-detail__team-scroll {
|
||||
margin-top: 24rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.project-detail__team-inner {
|
||||
display: inline-flex;
|
||||
gap: 32rpx;
|
||||
}
|
||||
|
||||
.project-detail__member {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 140rpx;
|
||||
}
|
||||
|
||||
.project-detail__avatar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
background: $color-primary;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.project-detail__member-name {
|
||||
margin-top: 12rpx;
|
||||
font-size: 26rpx;
|
||||
color: $color-text-primary;
|
||||
}
|
||||
|
||||
.project-detail__member-role {
|
||||
margin-top: 6rpx;
|
||||
font-size: 22rpx;
|
||||
color: $color-text-secondary;
|
||||
}
|
||||
|
||||
.project-detail__files {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 20rpx;
|
||||
padding: 10rpx 10rpx 0 0;
|
||||
}
|
||||
|
||||
.project-detail__file {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 160rpx;
|
||||
padding: 20rpx 16rpx;
|
||||
background: $color-bg-section;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.project-detail__file-remove {
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
right: -10rpx;
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.project-detail__file-remove-icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.project-detail__file-icon {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
|
||||
.project-detail__file-name {
|
||||
margin-top: 12rpx;
|
||||
font-size: 22rpx;
|
||||
color: $color-text-primary;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.project-detail__paragraph {
|
||||
display: block;
|
||||
font-size: 28rpx;
|
||||
line-height: 1.8;
|
||||
color: $color-text-primary;
|
||||
}
|
||||
</style>
|
||||
@@ -1,41 +1,259 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import AppTabBar from '@/components/AppTabBar.vue'
|
||||
import { DEFAULT_CASE_FILTER } from '@/constants/case-library'
|
||||
import {
|
||||
PROJECT_CATEGORIES,
|
||||
PROJECT_CENTER_LIST,
|
||||
} from '@/constants/project-center'
|
||||
import filterIcon from '@/static/icons/icon-filter.svg'
|
||||
import type { CaseFilterValues } from '@/types/case-library'
|
||||
import type { ProjectCategory } from '@/types/project-center'
|
||||
import { cloneCaseFilter, matchCaseFilter } from '@/utils/case-filter'
|
||||
import CaseFilterPanel from '../case-library/components/CaseFilterPanel.vue'
|
||||
import ProjectCenterCard from './components/ProjectCenterCard.vue'
|
||||
|
||||
const keyword = ref('')
|
||||
const activeCategory = ref<ProjectCategory>('全部')
|
||||
const projectList = ref(PROJECT_CENTER_LIST.map(item => ({ ...item })))
|
||||
const filterVisible = ref(false)
|
||||
const appliedFilter = ref<CaseFilterValues>(cloneCaseFilter(DEFAULT_CASE_FILTER))
|
||||
|
||||
const filteredProjects = computed(() => {
|
||||
const text = keyword.value.trim()
|
||||
|
||||
return projectList.value.filter((item) => {
|
||||
const matchCategory = activeCategory.value === '全部' || item.category === activeCategory.value
|
||||
const matchKeyword = !text
|
||||
|| item.title.includes(text)
|
||||
|| item.category.includes(text)
|
||||
|| item.projectNo.includes(text)
|
||||
|| item.status.includes(text)
|
||||
|| item.industry.includes(text)
|
||||
const matchFilter = matchCaseFilter(item, appliedFilter.value)
|
||||
return matchCategory && matchKeyword && matchFilter
|
||||
})
|
||||
})
|
||||
|
||||
function handleSelectCategory(category: ProjectCategory) {
|
||||
activeCategory.value = category
|
||||
}
|
||||
|
||||
function handleOpenFilter() {
|
||||
filterVisible.value = true
|
||||
}
|
||||
|
||||
function handleCloseFilter() {
|
||||
filterVisible.value = false
|
||||
}
|
||||
|
||||
function handleConfirmFilter(value: CaseFilterValues) {
|
||||
appliedFilter.value = cloneCaseFilter(value)
|
||||
}
|
||||
|
||||
function handleViewDetail(id: string) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/project-center/detail/index?id=${encodeURIComponent(id)}`,
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="placeholder-page">
|
||||
<text class="placeholder-page__title">
|
||||
项目中心
|
||||
</text>
|
||||
<text class="placeholder-page__desc">
|
||||
功能开发中
|
||||
</text>
|
||||
<view class="project-center">
|
||||
<view class="project-center__header">
|
||||
<text class="project-center__title">
|
||||
项目中心
|
||||
</text>
|
||||
|
||||
<view class="project-center__search">
|
||||
<image
|
||||
class="project-center__search-icon"
|
||||
src="/static/icons/icon-search.svg"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<input
|
||||
v-model="keyword"
|
||||
class="project-center__search-input"
|
||||
placeholder="搜索案例标题、描述、标签..."
|
||||
placeholder-class="project-center__search-placeholder"
|
||||
>
|
||||
</view>
|
||||
|
||||
<scroll-view
|
||||
class="project-center__tabs"
|
||||
scroll-x
|
||||
:show-scrollbar="false"
|
||||
>
|
||||
<view class="project-center__tabs-inner">
|
||||
<text
|
||||
v-for="category in PROJECT_CATEGORIES"
|
||||
:key="category"
|
||||
class="project-center__tab"
|
||||
:class="{ 'project-center__tab--active': activeCategory === category }"
|
||||
@tap="handleSelectCategory(category)"
|
||||
>
|
||||
{{ category }}
|
||||
</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view class="project-center__toolbar">
|
||||
<text class="project-center__count">
|
||||
共 {{ filteredProjects.length }}
|
||||
</text>
|
||||
<view
|
||||
class="project-center__filter"
|
||||
@tap="handleOpenFilter"
|
||||
>
|
||||
<image
|
||||
class="project-center__filter-icon"
|
||||
:src="filterIcon"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<text class="project-center__filter-text">
|
||||
筛选
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view
|
||||
class="project-center__scroll"
|
||||
scroll-y
|
||||
:show-scrollbar="false"
|
||||
>
|
||||
<view class="project-center__list">
|
||||
<ProjectCenterCard
|
||||
v-for="item in filteredProjects"
|
||||
:key="item.id"
|
||||
:item="item"
|
||||
@detail="handleViewDetail"
|
||||
/>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<AppTabBar active="project" />
|
||||
|
||||
<CaseFilterPanel
|
||||
:visible="filterVisible"
|
||||
:cases="projectList"
|
||||
:value="appliedFilter"
|
||||
@close="handleCloseFilter"
|
||||
@confirm="handleConfirmFilter"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '@/styles/variables.scss';
|
||||
|
||||
.placeholder-page {
|
||||
.project-center {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 100vh;
|
||||
padding-bottom: calc(120rpx + env(safe-area-inset-bottom));
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
background: $color-bg-section;
|
||||
}
|
||||
|
||||
.project-center__header {
|
||||
flex-shrink: 0;
|
||||
padding: calc(var(--status-bar-height, 44px) + 60rpx) 24rpx 0;
|
||||
background: $color-bg-page;
|
||||
}
|
||||
|
||||
.placeholder-page__title {
|
||||
.project-center__title {
|
||||
display: block;
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: $color-text-primary;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.placeholder-page__desc {
|
||||
margin-top: 16rpx;
|
||||
.project-center__search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 72rpx;
|
||||
margin-top: 24rpx;
|
||||
padding: 0 24rpx;
|
||||
background: $color-bg-section;
|
||||
border-radius: 36rpx;
|
||||
}
|
||||
|
||||
.project-center__search-icon {
|
||||
flex-shrink: 0;
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.project-center__search-input {
|
||||
flex: 1;
|
||||
font-size: 26rpx;
|
||||
color: $color-text-primary;
|
||||
}
|
||||
|
||||
.project-center__search-placeholder {
|
||||
color: $color-text-placeholder;
|
||||
}
|
||||
|
||||
.project-center__tabs {
|
||||
margin-top: 24rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.project-center__tabs-inner {
|
||||
display: inline-flex;
|
||||
gap: 32rpx;
|
||||
padding-right: 24rpx;
|
||||
}
|
||||
|
||||
.project-center__tab {
|
||||
flex-shrink: 0;
|
||||
padding-bottom: 12rpx;
|
||||
font-size: 28rpx;
|
||||
color: $color-text-secondary;
|
||||
|
||||
&--active {
|
||||
font-weight: 600;
|
||||
color: $color-text-primary;
|
||||
border-bottom: 4rpx solid $color-primary;
|
||||
}
|
||||
}
|
||||
|
||||
.project-center__toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0 24rpx;
|
||||
}
|
||||
|
||||
.project-center__count {
|
||||
font-size: 24rpx;
|
||||
color: $color-text-secondary;
|
||||
}
|
||||
|
||||
.project-center__filter {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.project-center__filter-icon {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.project-center__filter-text {
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.project-center__scroll {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.project-center__list {
|
||||
padding: 0 24rpx calc(140rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user