Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zuiketang
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
zuiketang
Commits
84975335
Commit
84975335
authored
Oct 09, 2016
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vue 组件调整
简单的添加讲师
parent
615fa57d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
147 additions
and
29 deletions
+147
-29
MyCourseController.php
src/frontend/controllers/MyCourseController.php
+2
-2
TeacherManagerController.php
src/frontend/controllers/TeacherManagerController.php
+10
-0
publish.php
src/frontend/views/my-course/publish.php
+11
-20
style.css
src/frontend/web/css/style.css
+89
-1
thumb-upload.vue
src/frontend/web/js/components/uploader/thumb-upload.vue
+0
-0
video-upload.vue
src/frontend/web/js/components/uploader/video-upload.vue
+0
-0
publish.js
src/frontend/web/js/my-course/publish.js
+35
-6
No files found.
src/frontend/controllers/MyCourseController.php
View file @
84975335
...
...
@@ -20,12 +20,12 @@ class MyCourseController extends \yii\web\Controller
$qiniu
=
Yii
::
$app
->
qiniu
;
//$auth = Yii::$app->qiniu->getAuthInstance();
$returnBody
=
'{"uuid":$(uuid), "key": "$(key)", "size": $(fsize), "w":$(imageInfo.width), "h":$(imageInfo.height)}'
;
//
$returnBody = '{"uuid":$(uuid), "key": "$(key)", "size": $(fsize), "w":$(imageInfo.width), "h":$(imageInfo.height)}';
//图片上传Token
//$imgName = 'preview/'.$qiniu->genRandomDir().'/'.Yii::$app->security->generateRandomString(20);
$imgPath
=
'preview/'
.
$qiniu
->
generateRandomFilePath
(
'$(min)$(sec)$(ext)'
,
8
);
$thumbToken
=
$qiniu
->
getUploadToken
(
'public'
,
$imgPath
,
3600
,
true
);
$thumbToken
=
$qiniu
->
getUploadToken
(
'public'
,
$imgPath
,
3600
);
//视频上传Token
//$videoName = 'source/'.$qiniu->genRandomDir().'/'.Yii::$app->security->generateRandomString(20);
...
...
src/frontend/controllers/TeacherManagerController.php
View file @
84975335
...
...
@@ -2,11 +2,21 @@
namespace
frontend\controllers
;
use
common\models\Teacher
;
class
TeacherManagerController
extends
\yii\web\Controller
{
public
$layout
=
'user-center'
;
public
function
actionIndex
()
{
return
$this
->
render
(
'index'
);
}
public
function
actionAddTeacher
()
{
$model
=
new
Teacher
();
}
}
src/frontend/views/my-course/publish.php
View file @
84975335
...
...
@@ -11,9 +11,9 @@ $this->title = '发布课程';
//AppAsset::addScript($this, '@web/assets/single-lib/plupload/plupload.full.min.js');
AppAsset
::
addScript
(
$this
,
'@web/assets/course_publish.js'
);
$this
->
registerCss
(
'[v-cloak] {display:none;}'
);
?>
<div
class=
"send-class"
id=
"publishMain"
>
<div
class=
"send-class"
id=
"publishMain"
xmlns:v-el=
"http://www.w3.org/1999/xhtml"
>
<div
class=
"tit"
>
发布课程
</div>
<form
method=
"post"
name=
"coursePublish"
>
...
...
@@ -24,25 +24,16 @@ AppAsset::addScript($this, '@web/assets/course_publish.js');
<div
class=
"cls-part teacher-list"
>
<div
class=
"tit"
>
讲师
</div>
<div
class=
"checkbox"
>
<label>
<input
name=
"teacher[]"
type=
"checkbox"
>
杨佩佩
</label>
<label
class=
"m-l-10"
>
<input
name=
"teacher[]"
type=
"checkbox"
>
马骏
<div
class=
"checkbox"
v-cloak
>
<label
v-for=
"(index, item) in teachers"
:class=
"{'m-l-10':index!=0}"
>
<input
name=
"teacher[]"
type=
"checkbox"
value=
"{{item.id}}"
>
{{item.name}}
</label>
<label
class=
"m-l-10"
>
<input
name=
"teacher[]"
type=
"checkbox"
>
花木兰
</label>
<label
class=
"m-l-10"
>
<input
name=
"teacher[]"
type=
"checkbox"
>
张海
</label>
<span
class=
"m-l-10"
><a
href=
"#"
>
+ 添加讲师
</a></span>
<div
class=
"d-i-b"
v-if=
"atState"
>
<input
type=
"text"
class=
"input-r-control reset-input"
placeholder=
"请输入讲师名称"
v-model=
"addTeacherName"
v-el:tni
>
<button
type=
"button"
class=
"btn btn-nobg"
@
click=
"addTeacher"
>
保存
</button>
</div>
<span
class=
"m-l-10"
v-if=
"!atState"
><a
href=
"javascript:;"
@
click=
"addTeacher"
>
+ 添加讲师
</a></span>
</div>
</div>
...
...
@@ -70,7 +61,7 @@ AppAsset::addScript($this, '@web/assets/course_publish.js');
</div>
<input
type=
"hidden"
name=
"v
key"
value=
"{{videoKey
}}"
/>
<input
type=
"hidden"
name=
"v
uid"
value=
"{{vuid
}}"
/>
<input
type=
"hidden"
name=
"preview_pic"
value=
"{{previewKey}}"
/>
<div
class=
"cls-part"
>
<div
class=
"tit"
>
课程介绍
</div>
...
...
src/frontend/web/css/style.css
View file @
84975335
...
...
@@ -15,6 +15,13 @@ html {
width
:
100%
;
}
.m-t-20
{
margin-top
:
20px
;
}
.d-i-b
{
display
:
inline-block
;
}
/*side bar*/
.tp-sidebar
{
...
...
@@ -558,6 +565,11 @@ fieldset[disabled] .input-r-control {
background-color
:
#eee
;
opacity
:
1
;
}
.reset-input
{
width
:
100px
;
display
:
inline-block
;
margin-left
:
20px
;
}
textarea
.input-r-control
{
height
:
auto
;
}
...
...
@@ -747,7 +759,7 @@ textarea.input-r-control {
.cls-list-box
.col-md-4
{
}
.cls-box-main
{
margin
:
0
10px
1
0px
10px
;
margin
:
0
10px
4
0px
10px
;
background-color
:
#fff
;
height
:
350px
;
}
...
...
@@ -770,6 +782,10 @@ textarea.input-r-control {
.video-list-cnt
.tit
{
font-size
:
14px
;
}
.video-list-cnt
.tit
a
{
color
:
#333
;
text-decoration
:
none
;
}
.video-list-cnt
.description
{
font-size
:
12px
;
line-height
:
1.6
;
...
...
@@ -926,4 +942,76 @@ textarea.input-r-control {
.buy-recode-top
.col-md-4
p
{
font-size
:
30px
;
color
:
#259e2b
;
}
/*user center side menu*/
.simple-menu
li
{
width
:
100%
;
}
.simple-menu
li
a
{
position
:
relative
;
display
:
block
;
padding-left
:
50px
;
border-left
:
2px
solid
transparent
;
color
:
#7fa6ad
;
height
:
50px
;
line-height
:
50px
;
text-decoration
:
none
;
}
.simple-menu
li
a
i
{
position
:
absolute
;
left
:
10px
;
top
:
0
;
display
:
inline-block
;
width
:
50px
;
height
:
50px
;
text-align
:
center
;
line-height
:
50px
;
padding-right
:
12px
;
font-size
:
18px
;
}
.simple-menu
li
.active
a
{
background-color
:
#313a46
;
border-left
:
2px
solid
#607ca1
;
color
:
#fff
;
}
.apply-class
button
{
width
:
200px
;
margin-left
:
10px
;
}
.sm-box
{
height
:
320px
;
}
.sm-box
.price
{
height
:
40px
;
line-height
:
40px
;
color
:
#f11300
;
}
.play-mask
{
position
:
absolute
;
display
:
inline-block
;
top
:
0
;
left
:
0
;
width
:
100%
;
background-color
:
rgba
(
0
,
0
,
0
,
.2
);
height
:
220px
;
line-height
:
240px
;
text-align
:
center
;
z-index
:
8
;
opacity
:
0
;
-webkit-transition
:
all
0.4s
ease
;
-o-transition
:
all
0.4s
ease
;
transition
:
all
0.4s
ease
;
}
.play-mask
a
{
display
:
block
;
}
.play-mask
i
{
color
:
#fff
;
font-size
:
38px
;
}
.sm-box
:hover
.play-mask
{
opacity
:
1
;
}
\ No newline at end of file
src/frontend/web/js/components/
common
/thumb-upload.vue
→
src/frontend/web/js/components/
uploader
/thumb-upload.vue
View file @
84975335
File moved
src/frontend/web/js/components/
common
/video-upload.vue
→
src/frontend/web/js/components/
uploader
/video-upload.vue
View file @
84975335
File moved
src/frontend/web/js/my-course/publish.js
View file @
84975335
...
...
@@ -2,26 +2,55 @@
* Created by pader on 16/9/28.
*/
var
Vue
=
require
(
'vue'
);
var
videoUpload
=
require
(
'../components/
common
/video-upload.vue'
);
var
thumbUpload
=
require
(
'../components/
common
/thumb-upload.vue'
);
var
videoUpload
=
require
(
'../components/
uploader
/video-upload.vue'
);
var
thumbUpload
=
require
(
'../components/
uploader
/thumb-upload.vue'
);
var
form
=
document
.
forms
[
"coursePublish"
];
var
vm
=
new
Vue
({
el
:
'#publishMain'
,
el
:
"#publishMain"
,
data
:
{
videoKey
:
""
,
previewKey
:
""
vuid
:
""
,
previewKey
:
""
,
teachers
:
[
{
id
:
1
,
name
:
"杨佩佩"
},
{
id
:
2
,
name
:
"马骏"
},
{
id
:
3
,
name
:
"花木兰"
},
{
id
:
4
,
name
:
"张海"
}
],
atState
:
0
,
addTeacherName
:
""
},
components
:
{
videoUpload
:
videoUpload
,
thumbUpload
:
thumbUpload
},
methods
:
{
addTeacher
:
function
(
e
)
{
if
(
e
.
target
.
tagName
.
toLowerCase
()
==
"a"
)
{
this
.
atState
=
1
;
return
;
}
if
(
$
.
trim
(
this
.
addTeacherName
)
==
""
)
{
this
.
$els
.
tni
.
focus
();
return
;
}
var
self
=
this
;
$
.
post
(
"/teacher-manager/add-teacher"
,
{
name
:
self
.
addTeacherName
},
function
(
t
)
{
},
"json"
);
}
},
ready
:
function
()
{
var
self
=
this
;
this
.
$on
(
"video-uploaded"
,
function
(
name
,
data
)
{
self
.
v
ideoKey
=
data
.
key
;
self
.
v
uid
=
data
.
uuid
;
});
this
.
$on
(
"thumb-uploaded"
,
function
(
name
,
data
)
{
...
...
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