update course detail style

This commit is contained in:
AceDataCloud committed 2022-10-08 00:51:18 +08:00
1 parent c2d30448d7
commit a94623baac
8 files changed
+136 -21

No files matched your search

+50 -1
View File
@@ -14,7 +14,29 @@
<img :src="course.thumbnail" class="thumbnail" />
</div>
<div class="right">
<h2>{{ course.title }}</h2>
<h2
class="title"
@click="
$router.push({
name: 'course-detail',
params: {
id: $route.params.courseId
}
})
"
>
{{ course.title }}
</h2>
<div class="info">
<div class="duration">
<el-icon class="icon"> <clock /> </el-icon>
<span class="value">{{ course?.duration }}{{ $t('common.entity.minute') }}</span>
</div>
<div class="level">
<el-icon class="icon"> <magic-stick /> </el-icon>
<span class="value">{{ course?.level }}</span>
</div>
</div>
</div>
</div>
</template>
@@ -22,9 +44,14 @@
<script lang="ts">
import { defineComponent } from 'vue';
import { ICourse } from '@/services/course/types';
import { Clock, MagicStick, Collection, ArrowRight } from '@element-plus/icons-vue';
export default defineComponent({
name: 'CoursePreviewCard',
components: {
Clock,
MagicStick
},
props: {
course: {
type: Object as () => ICourse,
@@ -54,7 +81,29 @@ export default defineComponent({
padding: 10px 0;
color: white;
float: left;
width: calc(100% - 100px);
.title {
cursor: pointer;
}
.info {
color: rgb(120, 144, 156);
margin-top: 5px;
.duration,
.level {
font-size: 12px;
display: inline-block;
margin-right: 5px;
.icon {
position: relative;
top: 1px;
}
.value {
display: inline-block;
margin-left: 5px;
}
}
}
}
}
</style>
+8 -4
View File
@@ -6,12 +6,12 @@
:class="{ item: true, active: episode.id === active }"
@click="onClick(episode)"
>
<el-col :span="6" class="left">
<el-col :span="5" class="left">
<span class="index">
{{ episodeIndex + 1 }}
</span>
</el-col>
<el-col :span="18" class="right">
<el-col :span="19" class="right">
<p class="title">
{{ episode?.title }}
</p>
@@ -21,6 +21,7 @@
<clock />
</el-icon>
{{ episode.duration }}
{{ $t('common.entity.minute') }}
</span>
</p>
</el-col>
@@ -77,8 +78,9 @@ export default defineComponent({
border: 1px solid rgba(50, 138, 241, 0.25);
}
.left {
width: 30px;
width: 60px;
color: inherit;
flex: inherit;
.index {
display: block;
width: 30px;
@@ -93,7 +95,7 @@ export default defineComponent({
}
}
.right {
width: calc(100% - 30px);
width: calc(100% - 60px);
.title {
color: white;
font-size: 0.8em;
@@ -104,6 +106,8 @@ export default defineComponent({
font-size: 0.6em;
.icon {
display: inline-block;
position: relative;
top: -1px;
}
}
}
+3 -1
View File
@@ -11,5 +11,7 @@ export default {
info: '提示',
publish: '发布',
watch: '观看',
verify: '去实名认证'
verify: '去实名认证',
learn: '学习',
buy: '购买'
};
+3 -1
View File
@@ -14,5 +14,7 @@ export default {
article: '文章',
course: '课程',
minute: '分钟',
order: '订单'
order: '订单',
episode: '小节',
episodes: '小节'
};
+63 -11
View File
@@ -14,15 +14,24 @@
<div class="title mb-5">
<p>{{ course.title }}</p>
</div>
<div class="category">
<!-- <el-button>{{ course.category }}</el-button> -->
</div>
<div class="introduction mb-5">
<p>{{ course.introduction }}</p>
</div>
<div class="operation">
<p v-if="paid === false">
<el-button @click="onBuy">Buy</el-button>
<el-button @click="onBuy">
<el-icon class="icon"> <arrow-right /> </el-icon>
{{ $t('course.button.startStudy') }}
</el-button>
</p>
<p v-if="paid === true">
{{ $t('course.message.paid') }}
<el-button>
<el-icon class="icon"> <arrow-right /> </el-icon>
{{ $t('course.button.startStudy') }}
</el-button>
</p>
</div>
</el-col>
@@ -33,7 +42,20 @@
</el-row>
<el-row>
<el-col :span="24">
<div class="banner"></div>
<div class="banner">
<div class="duration">
<el-icon class="icon"> <clock /> </el-icon>
<span class="value">{{ course?.duration }}{{ $t('common.entity.minute') }}</span>
</div>
<div class="level">
<el-icon class="icon"> <magic-stick /> </el-icon>
<span class="value">{{ course?.level }}</span>
</div>
<div class="number">
<el-icon class="icon"> <collection /> </el-icon>
<span class="value">{{ episodes?.length }}{{ $t('common.entity.episodes') }}</span>
</div>
</div>
</el-col>
</el-row>
<el-row :class="{ episodes: true, disabled: !verified }">
@@ -54,12 +76,12 @@
"
>
<el-row>
<el-col :span="3" class="left">
<el-col :span="4" class="left">
<span class="index">
{{ episodeIndex + 1 }}
</span>
</el-col>
<el-col :span="21" class="right">
<el-col :span="20" class="right">
<div class="title">
<p>
{{ episode.title }}
@@ -88,7 +110,7 @@ import { episodeService } from '@/services/episode/service';
import { IEpisode, IEpisodeListResponse } from '@/services/episode/types';
import { orderService } from '@/services/order/service';
import { defineComponent } from 'vue';
import { Clock } from '@element-plus/icons-vue';
import { Clock, MagicStick, Collection, ArrowRight } from '@element-plus/icons-vue';
import VerificationAlert from '@/components/common/VerificationAlert.vue';
import { IOrder, IOrderDetailResponse } from '@/services/order/types';
import { v4 as uuidv4 } from 'uuid';
@@ -105,7 +127,10 @@ export default defineComponent({
name: 'CourseDetail',
components: {
Clock,
VerificationAlert
Collection,
MagicStick,
VerificationAlert,
ArrowRight
},
data(): IData {
return {
@@ -205,6 +230,26 @@ export default defineComponent({
margin-right: auto;
width: 100%;
height: 55px;
padding: 12px 50px;
.duration,
.level,
.number {
font-size: 13px;
color: white;
display: inline-block;
margin-right: 10px;
color: 10px;
.icon {
position: relative;
top: 1px;
// margin-right: 5px;
}
.value {
margin-left: 5px;
// font-weight: bold;
display: inline-block;
}
}
}
.verification-alert {
@@ -223,9 +268,10 @@ export default defineComponent({
.episode {
cursor: pointer;
margin-bottom: 2rem;
height: 100px;
height: 140px;
border-radius: 0.934rem !important;
.left {
position: relative;
.index {
width: 50px;
height: 50px;
@@ -237,8 +283,9 @@ export default defineComponent({
font-size: 20px;
border: 2px solid #e5e5e5;
position: absolute;
top: 5px;
left: 35px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
.title {
@@ -246,17 +293,22 @@ export default defineComponent({
font-size: 1.2rem;
font-weight: bold;
margin-bottom: 10px;
margin-top: 10px;
}
}
.introduction {
p {
height: 28px;
overflow: hidden;
white-space: nowrap;
font-size: 0.8rem;
color: rgb(161, 161, 161);
text-overflow: ellipsis;
}
}
.info {
font-size: 12px;
color: #666;
color: rgb(161, 161, 161);
.icon {
position: relative;
top: 1px;
+2 -2
View File
@@ -1,6 +1,6 @@
<template>
<el-row>
<el-col :span="6" class="side">
<el-col :span="5" class="side">
<el-row>
<el-col :span="24">
<course-preview-card v-if="course" :course="course" />
@@ -8,7 +8,7 @@
</el-col>
</el-row>
</el-col>
<el-col :span="18" class="main">
<el-col :span="19" class="main">
<div v-if="paid === true || episode?.isFree">
<episode-player v-if="episode?.resourceUrl" :resource="episode?.resourceUrl" :preview="episode?.thumbnail" />
</div>
+5
View File
@@ -1,9 +1,14 @@
export const COURSE_LEVEL_BEGINNER = 'Beginner';
export const COURSE_LEVEL_INTERMEDIATE = 'Intermediate';
export const COURSE_LEVEL_ADVANCED = 'Advanced';
export interface ICourse {
id: number;
tags?: string[];
title?: string;
cover?: string;
thumbnail?: string;
level?: typeof COURSE_LEVEL_BEGINNER | typeof COURSE_LEVEL_INTERMEDIATE | typeof COURSE_LEVEL_ADVANCED;
discount?: number;
price?: number;
duration?: number;
+2 -1
View File
@@ -12,7 +12,8 @@ export interface IState {
const store = createStore({
state(): IState {
return {
accessToken: undefined,
accessToken:
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjY1MTc5MTE2LCJqdGkiOiJlYjEzNGMzMjZlMTc0YzViODFhNGZlZDgxMjJlYzFhNiIsInVzZXJfaWQiOjQsInBlcm1pc3Npb25zIjpbInZpZXdfYWNhZGVteV9jb3Vyc2UiXSwiaXNfc3VwZXJ1c2VyIjpmYWxzZSwiaXNfdmVyaWZpZWQiOnRydWUsInJlYWxuYW1lIjoiXHU1ZDE0XHU1ZTg2XHU2MjRkIiwicGhvbmUiOiIxNzYwMDE1NTU2NyIsImlkY2FyZCI6IjM3MDc4MTE5OTQwNjI5MzI3MSJ9.Xc4B9GhgJ5i2I9R_6j7bD38yX3bPC_FI7kUVQzCDaq4',
refreshToken: undefined,
user: undefined
};