video curcse
All checks were successful
Deploy to Server / deploy (push) Successful in 36s

This commit is contained in:
jeremygan2021
2026-02-27 13:54:22 +08:00
parent b58dc38a2b
commit f9c104452b
3 changed files with 129 additions and 2 deletions

View File

@@ -65,6 +65,55 @@
}
}
.video-section {
.course-video {
width: 100%;
height: 420px;
border-radius: 16px;
background-color: #000;
}
.video-locked {
width: 100%;
height: 420px;
background-color: #111;
border-radius: 16px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border: 1px solid rgba(255, 255, 255, 0.1);
.lock-icon {
font-size: 60px;
margin-bottom: 20px;
}
.lock-text {
color: #fff;
font-size: 32px;
margin-bottom: 30px;
font-weight: bold;
}
.btn-unlock {
background: linear-gradient(90deg, #00f0ff, #0099ff);
color: #000;
font-size: 28px;
padding: 0 40px;
height: 80px;
line-height: 80px;
border-radius: 40px;
font-weight: bold;
border: none;
&::after {
border: none;
}
}
}
}
.section {
margin-bottom: 50px;

View File

@@ -1,4 +1,4 @@
import { View, Text, Button, Image, ScrollView } from '@tarojs/components'
import { View, Text, Button, Image, ScrollView, Video } from '@tarojs/components'
import Taro, { useLoad, useShareAppMessage, useShareTimeline } from '@tarojs/taro'
import { useState } from 'react'
import { getVBCourseDetail } from '../../api'
@@ -86,6 +86,28 @@ export default function CourseDetail() {
<Text className='price'>¥{detail.price}</Text>
</View>
{/* 视频播放区域 */}
{detail.is_video_course && (
<View className='section video-section'>
<Text className='section-title'></Text>
{detail.video_url ? (
<Video
src={detail.video_url}
className='course-video'
poster={detail.cover_image_url}
controls
autoplay={false}
/>
) : (
<View className='video-locked' onClick={handleLaunch}>
<View className='lock-icon'>🔒</View>
<Text className='lock-text'></Text>
<Button className='btn-unlock'></Button>
</View>
)}
</View>
)}
{/* 讲师信息 */}
<View className='section instructor-section'>
<Text className='section-title'></Text>