Refactor code structure and remove redundant changes
This commit is contained in:
99
pages/community/components/TeacherDetailCard.vue
Normal file
99
pages/community/components/TeacherDetailCard.vue
Normal file
@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<div class="teacher-detail-card">
|
||||
<div class="header">
|
||||
<div class="avatar">
|
||||
<!-- 这里可以放置教师头像 -->
|
||||
</div>
|
||||
<div class="info">
|
||||
<h3>{{ teacher.name }}</h3>
|
||||
<p class="university">{{ teacher.university }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div class="stat">
|
||||
<span class="number">{{ teacher.works }}</span>
|
||||
<span class="label">作品</span>
|
||||
</div>
|
||||
<div class="stat">
|
||||
<span class="number">{{ teacher.students }}</span>
|
||||
<span class="label">粉丝</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
<span v-for="tag in teacher.tags" :key="tag" class="tag">
|
||||
{{ tag }}
|
||||
</span>
|
||||
</div>
|
||||
<p class="description">{{ teacher.description }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
defineProps({
|
||||
teacher: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.teacher-detail-card {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
background: #eee;
|
||||
border-radius: 50%;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.stats {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
.stat {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.number {
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.tag {
|
||||
background: #e8f3ff;
|
||||
color: #4080ff;
|
||||
padding: 2px 8px;
|
||||
border-radius: 12px;
|
||||
font-size: 12px;
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
.description {
|
||||
margin-top: 15px;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user