Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projecttwo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangtao
projecttwo
Commits
a7cd2348
Commit
a7cd2348
authored
Aug 12, 2025
by
wangtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
课时图文
parent
be07cff2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
188 additions
and
4 deletions
+188
-4
CourseClass.php
app/admin/controller/course/CourseClass.php
+9
-0
detail.html
app/admin/view/course/course_class/detail.html
+161
-0
index.html
app/admin/view/course/course_class/index.html
+17
-3
ShCourseClass.php
app/api/controller/manage/ShCourseClass.php
+1
-1
No files found.
app/admin/controller/course/CourseClass.php
View file @
a7cd2348
...
...
@@ -109,5 +109,14 @@ class CourseClass extends AdminBase
}
}
//课时内容
public
function
detail
()
{
$post
=
input
();
$info
=
$this
->
courseclass
->
where
(
'id'
,
$post
[
'id'
])
->
find
();
$this
->
assign
(
'info'
,
$info
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
}
\ No newline at end of file
app/admin/view/course/course_class/detail.html
0 → 100644
View file @
a7cd2348
{extend name="base/header" /}
{block name="body"}
<style>
.layui-table
.widthtd
{
width
:
120px
;}
.clss_contnet
{
margin-top
:
10px
;
font-size
:
14px
;}
.clss_contnet
img
{
max-width
:
100%
;}
/* 自定义代码块样式 */
pre
{
position
:
relative
;
border-radius
:
10px
;
margin
:
25px
0
;
box-shadow
:
0
4px
20px
rgba
(
0
,
0
,
0
,
0.15
);
overflow
:
hidden
;
}
.copy-btn
{
position
:
absolute
;
top
:
12px
;
right
:
12px
;
background
:
rgba
(
255
,
255
,
255
,
0.15
);
backdrop-filter
:
blur
(
10px
);
border
:
none
;
border-radius
:
6px
;
color
:
white
;
padding
:
8px
15px
;
font-size
:
14px
;
cursor
:
pointer
;
display
:
flex
;
align-items
:
center
;
gap
:
8px
;
transition
:
all
0.3s
ease
;
z-index
:
10
;
}
.copy-btn
:hover
{
background
:
rgba
(
255
,
255
,
255
,
0.25
);
transform
:
translateY
(
-2px
);
}
.copy-btn
:active
{
transform
:
translateY
(
0
);
}
.copy-btn.success
{
background
:
rgba
(
46
,
204
,
113
,
0.9
);
}
.copy-btn
i
{
font-size
:
16px
;
}
code
{
font-family
:
'Fira Code'
,
'Consolas'
,
monospace
;
font-size
:
15px
;
line-height
:
1.5
;
}
</style>
<link
rel=
"stylesheet"
href=
"{STATIC__PATH}/admin/wangedit/github-dark.min.css"
>
<div
style=
"margin: 0px 10px"
>
<table
class=
"layui-table"
>
<tbody>
<tr>
<td
class=
"widthtd"
><strong>
视频
</strong></td>
<td
colspan=
"4"
>
{if $info.tv_file}
<div
style=
"text-align: center; width: 100%; height: 300px; margin: 0px auto;"
><video
width=
"100%"
height=
"100%"
controls
autoplay
>
<source
width=
"100%"
height=
"100%"
style=
"object-fit: cover;"
src=
"{$info.tv_file.fileurl}"
type=
"video/mp4"
>
</video>
</div>
{/if}
</td>
</tr>
<tr>
<td
class=
"widthtd"
><strong>
图文
</strong></td>
<td
colspan=
"4"
>
<div
class=
"clss_contnet"
>
{$info.content|raw}
</div>
</td>
</tr>
</tbody>
</table>
</div>
{/block}
{block name="script"}
<script
src=
"{STATIC__PATH}/admin/wangedit/highlight.min.js"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/languages/javascript.min.js"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/languages/python.min.js"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/languages/xml.min.js"
></script>
<script>
// 初始化代码高亮
document
.
addEventListener
(
'DOMContentLoaded'
,
(
event
)
=>
{
document
.
querySelectorAll
(
'pre code'
).
forEach
((
el
)
=>
{
hljs
.
highlightElement
(
el
);
// 创建复制按钮
const
copyBtn
=
document
.
createElement
(
'button'
);
copyBtn
.
className
=
'copy-btn'
;
copyBtn
.
innerHTML
=
'<i class="far fa-copy"></i> 复制'
;
// 添加到代码块
const
pre
=
el
.
parentElement
;
pre
.
appendChild
(
copyBtn
);
// 添加复制功能
copyBtn
.
addEventListener
(
'click'
,
()
=>
{
const
textArea
=
document
.
createElement
(
'textarea'
);
textArea
.
value
=
el
.
textContent
;
document
.
body
.
appendChild
(
textArea
);
textArea
.
select
();
document
.
execCommand
(
'copy'
);
document
.
body
.
removeChild
(
textArea
);
// 显示复制成功反馈
copyBtn
.
innerHTML
=
'<i class="fas fa-check"></i> 已复制!'
;
copyBtn
.
classList
.
add
(
'success'
);
// 3秒后恢复原状
setTimeout
(()
=>
{
copyBtn
.
innerHTML
=
'<i class="far fa-copy"></i> 复制'
;
copyBtn
.
classList
.
remove
(
'success'
);
},
2000
);
});
});
});
layui
.
use
([
'buildItems'
,
'form'
,
'laydate'
,
'util'
,
'vinfo'
,
'element'
],
function
()
{
var
layer
=
layui
.
layer
,
table
=
layui
.
table
,
form
=
layui
.
form
,
admin
=
layui
.
admin
;
});
$
(
".imgclick"
).
click
(
function
(){
var
src
=
$
(
this
).
attr
(
'src'
),
alt
=
$
(
this
).
attr
(
'alt'
);
layer
.
photos
({
photos
:{
data
:[{
alt
:
alt
,
src
:
src
}],
start
:
'0'
},
anim
:
5
,
shade
:[
0.4
,
'#000'
]});
});
var
callbackdata
=
function
()
{
};
</script>
{/block}
\ No newline at end of file
app/admin/view/course/course_class/index.html
View file @
a7cd2348
...
...
@@ -67,7 +67,7 @@
{
field
:
'createtime'
,
width
:
120
,
align
:
'center'
,
title
:
'创建时间'
},
{
field
:
'issktext'
,
width
:
120
,
align
:
'center'
,
title
:
'是否试看'
},
{
field
:
'sort'
,
width
:
50
,
align
:
'center'
,
title
:
'排序'
,
edit
:
'text'
},
{
fixed
:
'right'
,
width
:
1
30
,
align
:
'center'
,
toolbar
:
'<div><a class="layui-btn layui-btn-xs" lay-event="clicktv">查看视频
</a><a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a></div>'
,
title
:
'操作'
}
{
fixed
:
'right'
,
width
:
1
50
,
align
:
'center'
,
toolbar
:
'<div><a class="layui-btn layui-btn-xs" lay-event="clicktv">查看视频</a><a class="layui-btn layui-btn-xs" lay-event="clickcontent">查看内容
</a><a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a></div>'
,
title
:
'操作'
}
]],
done
:
function
(){
admin
.
vShow
(
$
(
'[lay-table-id="courseclass"]'
));
...
...
@@ -87,8 +87,6 @@
var
id
=
data
.
id
;
if
(
obj
.
event
===
'clicktv'
){
// 在此处输入 layer 的任意代码
layer
.
open
({
type
:
1
,
// page 层类型
area
:
[
'50%'
,
'560px'
],
...
...
@@ -103,6 +101,22 @@
});
}
else
if
(
obj
.
event
===
'del'
){
del
(
id
);
}
else
if
(
obj
.
event
===
'clickcontent'
){
/*弹出窗*/
layer
.
open
({
type
:
2
,
area
:
[
'1000px'
,
'90%'
],
title
:
"课时内容"
,
btn
:
[
'确定'
,
'关闭'
],
// fixed: false, //不固定
content
:
'/admin/course.course_class/detail?id='
+
id
,
yes
:
function
(
index
,
layero
){
layer
.
close
(
index
);
},
});
}
else
if
(
obj
.
event
===
'courseclass-event-image'
){
var
src
=
$
(
this
).
attr
(
'src'
),
alt
=
$
(
this
).
attr
(
'alt'
);
layer
.
photos
({
photos
:{
data
:[{
alt
:
alt
,
src
:
src
}],
start
:
'0'
},
anim
:
5
,
shade
:[
0.4
,
'#000'
]});
...
...
app/api/controller/manage/ShCourseClass.php
View file @
a7cd2348
...
...
@@ -86,7 +86,7 @@ class ShCourseClass extends BaseController
$where
=
[
'is_del'
=>
0
,
'user_id'
=>
$request
->
userId
];
$list
=
ShCourseClassModel
::
where
(
$where
)
->
where
(
$map
)
->
order
(
'sort desc,createtime
de
sc'
)
->
order
(
'sort desc,createtime
a
sc'
)
->
append
([
'course_class_cate'
,
'course_title'
])
->
paginate
([
'page'
=>
$page
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment