You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
189 lines
4.0 KiB
189 lines
4.0 KiB
<template>
|
|
<view class="container" v-if="detail.user">
|
|
<view class="user-info-header">
|
|
<u-avatar :text="detail.user.name.charAt(0)" size="80"></u-avatar>
|
|
<view class="user-details">
|
|
<text class="user-name">{{ detail.user.name }}</text>
|
|
<text class="post-time">{{ detail.time }}</text>
|
|
</view>
|
|
<view class="stats">
|
|
<text class="type-badge">{{ detail.type === 'supply' ? '供应' : '需求' }}</text>
|
|
<text class="views">{{ detail.messageCount }}人私信 {{ detail.viewCount }}浏览</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="content-card">
|
|
<text class="title">{{ detail.title }}</text>
|
|
<text class="description">{{ detail.description }}</text>
|
|
<!-- <image class="content-image" :src="detail.image" mode="widthFix"></image> -->
|
|
<view class="tags">
|
|
<text v-for="tag in detail.tags" :key="tag" class="tag">{{ tag }}</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="footer">
|
|
<view class="footer-action">
|
|
<u-icon name="star" size="40"></u-icon>
|
|
<text>收藏</text>
|
|
</view>
|
|
<u-button type="primary" shape="circle" class="message-btn">私信</u-button>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
detail: {}
|
|
}
|
|
},
|
|
onLoad(options) {
|
|
// 在实际应用中, 你会用 options.id 去请求服务器数据
|
|
console.log("页面ID:", options.id)
|
|
this.fetchDetailData(options.id);
|
|
},
|
|
methods: {
|
|
fetchDetailData(id) {
|
|
// 这是模拟数据
|
|
this.detail = {
|
|
id: id,
|
|
user: {
|
|
id: 'user123',
|
|
name: '张云',
|
|
avatar: '' // avatar an be used here if available
|
|
},
|
|
time: '2小时前',
|
|
type: 'supply',
|
|
messageCount: 16,
|
|
viewCount: 265,
|
|
title: '提供企业管理咨询服务',
|
|
description: '专业企业管理咨询团队, 具有10年以上行业经验, 擅长企业战略规划、组织架构优化、流程梳理等。已服务过多家上市公司专业企业管理咨询团队, 具有10年以上行业经验, 擅长企业战略规划、组织架构优化、流程梳理等。',
|
|
image: 'https://via.placeholder.com/700x300.png/E8E8E8/A9A9A9?text=专业诚信敬业高能', // Placeholder image
|
|
tags: ['管理咨询', '战略规划', '管理咨询']
|
|
};
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.container {
|
|
background: linear-gradient(to bottom, #e9f2fa, #f5f7fa);
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.user-info-header {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 30rpx;
|
|
background: transparent;
|
|
}
|
|
|
|
.user-details {
|
|
display: flex;
|
|
flex-direction: column;
|
|
margin-left: 20rpx;
|
|
flex-grow: 1;
|
|
}
|
|
|
|
.user-name {
|
|
font-size: 32rpx;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.post-time {
|
|
font-size: 24rpx;
|
|
color: #909399;
|
|
margin-top: 5rpx;
|
|
}
|
|
|
|
.stats {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: flex-end;
|
|
}
|
|
|
|
.type-badge {
|
|
font-size: 24rpx;
|
|
background-color: #fdf3e8;
|
|
color: #C9A36D;
|
|
padding: 8rpx 15rpx;
|
|
border-radius: 10rpx;
|
|
}
|
|
|
|
.views {
|
|
font-size: 24rpx;
|
|
color: #909399;
|
|
margin-top: 10rpx;
|
|
}
|
|
|
|
.content-card {
|
|
background-color: #fff;
|
|
margin: 30rpx 30rpx 0;
|
|
padding: 30rpx;
|
|
border-radius: 20rpx;
|
|
}
|
|
|
|
.title {
|
|
font-size: 36rpx;
|
|
font-weight: bold;
|
|
display: block;
|
|
margin-bottom: 20rpx;
|
|
}
|
|
|
|
.description {
|
|
font-size: 28rpx;
|
|
color: #606266;
|
|
line-height: 1.8;
|
|
display: block;
|
|
margin-bottom: 30rpx;
|
|
}
|
|
|
|
.content-image {
|
|
width: 100%;
|
|
border-radius: 12rpx;
|
|
margin-bottom: 30rpx;
|
|
}
|
|
|
|
.tags {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.tag {
|
|
background-color: #f5f5f5;
|
|
color: #606266;
|
|
font-size: 24rpx;
|
|
padding: 10rpx 20rpx;
|
|
border-radius: 30rpx;
|
|
margin-right: 15rpx;
|
|
margin-bottom: 10rpx;
|
|
}
|
|
|
|
.footer {
|
|
position: fixed;
|
|
bottom: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 20rpx 70rpx;
|
|
background-color: #fff;
|
|
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.footer-action {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
color: #606266;
|
|
font-size: 24rpx;
|
|
}
|
|
|
|
.message-btn {
|
|
width: 250rpx;
|
|
}
|
|
</style> |