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
0d7c258a
Commit
0d7c258a
authored
Oct 31, 2016
by
xiabin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/test' into test
parents
a8737bae
85e453d1
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
339 additions
and
248 deletions
+339
-248
BootstrapAsset.php
src/backend/assets/BootstrapAsset.php
+5
-1
TranscodeQueue.php
src/common/models/TranscodeQueue.php
+1
-1
ClassesInfoController.php
src/frontend/controllers/ClassesInfoController.php
+16
-0
MyCourseController.php
src/frontend/controllers/MyCourseController.php
+67
-7
CoursePublishForm.php
src/frontend/models/CoursePublishForm.php
+11
-17
apply.php
src/frontend/views/classes-info/apply.php
+5
-5
index.php
src/frontend/views/classes-info/index.php
+25
-59
setting.php
src/frontend/views/classes-info/setting.php
+32
-0
index.php
src/frontend/views/home/index.php
+1
-1
preview.php
src/frontend/views/home/preview.php
+1
-1
video.php
src/frontend/views/home/video.php
+1
-1
center.php
src/frontend/views/layouts/center.php
+7
-0
main.php
src/frontend/views/layouts/main.php
+1
-1
edit.php
src/frontend/views/my-course/edit.php
+25
-1
publish.php
src/frontend/views/my-course/publish.php
+1
-1
signup.php
src/frontend/views/site/signup.php
+1
-1
login.css
src/frontend/web/css/login.css
+6
-0
main.css
src/frontend/web/css/main.css
+2
-3
style.css
src/frontend/web/css/style.css
+4
-4
favicon.ico
src/frontend/web/img/favicon.ico
+0
-0
logo.png
src/frontend/web/img/logo.png
+0
-0
logo_white.png
src/frontend/web/img/logo_white.png
+0
-0
video-upload.vue
src/frontend/web/js/components/uploader/video-upload.vue
+20
-14
edit.js
src/frontend/web/js/my-course/edit.js
+20
-55
publish.js
src/frontend/web/js/my-course/publish.js
+13
-75
validate-option.js
src/frontend/web/js/my-course/validate-option.js
+74
-0
No files found.
src/backend/assets/BootstrapAsset.php
View file @
0d7c258a
...
@@ -15,11 +15,15 @@ class BootstrapAsset extends AssetBundle
...
@@ -15,11 +15,15 @@ class BootstrapAsset extends AssetBundle
public
$sourcePath
=
'@bower/bootstrap/dist'
;
public
$sourcePath
=
'@bower/bootstrap/dist'
;
public
$css
=
[
public
$css
=
[
'css/bootstrap.css'
,
'css/bootstrap.
min.
css'
,
];
];
public
$js
=
[
public
$js
=
[
'js/bootstrap.min.js'
'js/bootstrap.min.js'
];
];
public
$depends
=
[
'yii\web\JqueryAsset'
];
}
}
src/common/models/TranscodeQueue.php
View file @
0d7c258a
...
@@ -96,7 +96,7 @@ class TranscodeQueue extends ActiveRecord
...
@@ -96,7 +96,7 @@ class TranscodeQueue extends ActiveRecord
{
{
//非视频不可发送转码请求
//非视频不可发送转码请求
if
(
$courseware
->
type
!=
0
)
{
if
(
$courseware
->
type
!=
0
)
{
self
::
$lastError
=
'视频不可发送转码请求'
;
self
::
$lastError
=
'
非
视频不可发送转码请求'
;
return
false
;
return
false
;
}
}
...
...
src/frontend/controllers/ClassesInfoController.php
View file @
0d7c258a
...
@@ -96,5 +96,21 @@ class ClassesInfoController extends \yii\web\Controller
...
@@ -96,5 +96,21 @@ class ClassesInfoController extends \yii\web\Controller
return
$this
->
render
(
'apply'
,
compact
(
'model'
,
'agreement'
));
return
$this
->
render
(
'apply'
,
compact
(
'model'
,
'agreement'
));
}
}
public
function
actionSetting
()
{
//课堂信息
$model
=
Classes
::
findOne
(
$this
->
classStatus
[
'id'
]);
if
(
Yii
::
$app
->
request
->
getIsPost
())
{
$model
->
load
(
Yii
::
$app
->
request
->
post
());
if
(
$model
->
update
())
{
return
$this
->
redirect
([
'classes-info/index'
]);
}
}
return
$this
->
render
(
'setting'
,
compact
(
'model'
));
}
}
}
src/frontend/controllers/MyCourseController.php
View file @
0d7c258a
...
@@ -142,7 +142,6 @@ class MyCourseController extends \yii\web\Controller
...
@@ -142,7 +142,6 @@ class MyCourseController extends \yii\web\Controller
$form
=
new
CoursePublishForm
(
true
);
$form
=
new
CoursePublishForm
(
true
);
$form
->
class_id
=
$classId
;
$form
->
class_id
=
$classId
;
$form
->
user_id
=
$userId
;
$form
->
load
(
Yii
::
$app
->
request
->
post
());
$form
->
load
(
Yii
::
$app
->
request
->
post
());
if
(
!
$form
->
validate
())
{
if
(
!
$form
->
validate
())
{
...
@@ -174,9 +173,6 @@ class MyCourseController extends \yii\web\Controller
...
@@ -174,9 +173,6 @@ class MyCourseController extends \yii\web\Controller
$courseware
->
time
=
round
(
$videoInfo
[
'av'
][
'format'
][
'duration'
]);
$courseware
->
time
=
round
(
$videoInfo
[
'av'
][
'format'
][
'duration'
]);
$courseware
->
format
=
pathinfo
(
$form
->
vuid
[
'key'
],
PATHINFO_EXTENSION
);
$courseware
->
format
=
pathinfo
(
$form
->
vuid
[
'key'
],
PATHINFO_EXTENSION
);
//list($video, $audio) = $avInfo['streams'];
//$format = $avInfo['format'];
//验证课件数据
//验证课件数据
if
(
!
$courseware
->
validate
())
{
if
(
!
$courseware
->
validate
())
{
Utils
::
ajaxResponse
(
false
,
Utils
::
fetchErrorFirst
(
$courseware
->
errors
));
Utils
::
ajaxResponse
(
false
,
Utils
::
fetchErrorFirst
(
$courseware
->
errors
));
...
@@ -219,7 +215,6 @@ class MyCourseController extends \yii\web\Controller
...
@@ -219,7 +215,6 @@ class MyCourseController extends \yii\web\Controller
$form
=
new
CoursePublishForm
();
$form
=
new
CoursePublishForm
();
$form
->
class_id
=
$classId
;
$form
->
class_id
=
$classId
;
$form
->
user_id
=
$userId
;
$form
->
load
(
Yii
::
$app
->
request
->
post
());
$form
->
load
(
Yii
::
$app
->
request
->
post
());
if
(
!
$form
->
validate
())
{
if
(
!
$form
->
validate
())
{
...
@@ -236,29 +231,70 @@ class MyCourseController extends \yii\web\Controller
...
@@ -236,29 +231,70 @@ class MyCourseController extends \yii\web\Controller
throw
new
ForbiddenHttpException
();
throw
new
ForbiddenHttpException
();
}
}
//是否提交重新审核,仅待审核和已拒绝状态允许重新进入审核
$isRecheck
=
in_array
(
$course
->
status
,
[
Course
::
STATUS_UNCHECK
,
Course
::
STATUS_FAILED
]);
$courseware
=
Courseware
::
findOne
([
'course_id'
=>
$course
->
id
]);
$coursewareUpdate
=
false
;
$oldPreview
=
$course
->
preview_pic
;
$oldPreview
=
$course
->
preview_pic
;
//修改课程数据
//修改课程数据
$course
->
name
=
$form
->
name
;
$course
->
name
=
$form
->
name
;
$course
->
price
=
$form
->
price
;
$course
->
price
=
$form
->
price
;
$course
->
free_time
=
$form
->
free_time
;
$course
->
intro
=
$form
->
intro
;
$course
->
intro
=
$form
->
intro
;
$course
->
recommend
=
$form
->
recommend
;
$course
->
recommend
=
$form
->
recommend
;
$form
->
preview
&&
$course
->
preview_pic
=
$form
->
preview
[
'key'
];
$form
->
preview
&&
$course
->
preview_pic
=
$form
->
preview
[
'key'
];
if
(
$isRecheck
)
{
$course
->
free_time
=
$form
->
free_time
;
$course
->
status
=
Course
::
STATUS_UNCHECK
;
}
//仅重审核时可以更换视频
if
(
$form
->
vuid
&&
!
$isRecheck
)
{
Utils
::
ajaxResponse
(
false
,
'当前课程状态不允许更换视频!'
);
}
//验证课程数据
//验证课程数据
if
(
!
$course
->
validate
())
{
if
(
!
$course
->
validate
())
{
Utils
::
ajaxResponse
(
false
,
Utils
::
fetchErrorFirst
(
$course
->
errors
));
Utils
::
ajaxResponse
(
false
,
Utils
::
fetchErrorFirst
(
$course
->
errors
));
}
}
//保存课程数据
//保存课程数据
if
(
!
$course
->
sav
e
())
{
if
(
!
$course
->
updat
e
())
{
Utils
::
ajaxResponse
(
false
,
'课程保存失败'
);
Utils
::
ajaxResponse
(
false
,
'课程保存失败'
);
}
}
//保存讲师与课程关联数据
//保存讲师与课程关联数据
CourseTeacher
::
autoSaveRelations
(
$course
->
id
,
$form
->
teacher
);
CourseTeacher
::
autoSaveRelations
(
$course
->
id
,
$form
->
teacher
);
//更换视频
if
(
$form
->
vuid
&&
$form
->
vuid
[
'key'
]
!=
$course
[
'name'
])
{
UploadPools
::
deleteFile
(
'video:'
.
$courseware
->
name
);
UploadPools
::
claimFile
(
$form
->
vuid
[
'uuid'
]);
$courseware
->
name
=
$form
->
vuid
[
'key'
];
if
(
$courseware
->
src_stand
)
{
UploadPools
::
deleteFile
(
'video:'
.
$courseware
->
src_stand
);
$courseware
->
src_stand
=
''
;
}
if
(
$courseware
->
src_free
)
{
UploadPools
::
deleteFile
(
'video:'
.
$courseware
->
src_free
);
$courseware
->
src_free
=
''
;
}
$coursewareUpdate
=
true
;
}
if
(
$isRecheck
&&
$courseware
->
status
!=
Course
::
STATUS_UNCHECK
)
{
$courseware
->
status
=
Course
::
STATUS_UNCHECK
;
$coursewareUpdate
=
true
;
}
$coursewareUpdate
&&
$courseware
->
update
();
//认领文件与附件,删除老文件
//认领文件与附件,删除老文件
if
(
$form
->
preview
)
{
if
(
$form
->
preview
)
{
UploadPools
::
claimFile
(
$form
->
preview
[
'uuid'
]);
UploadPools
::
claimFile
(
$form
->
preview
[
'uuid'
]);
...
@@ -323,4 +359,28 @@ class MyCourseController extends \yii\web\Controller
...
@@ -323,4 +359,28 @@ class MyCourseController extends \yii\web\Controller
return
[
'success'
=>
true
,
'msg'
=>
''
,
'file_path'
=>
$result
[
'src'
],
'key'
=>
$result
[
'key'
],
'uuid'
=>
$result
[
'uuid'
]];
return
[
'success'
=>
true
,
'msg'
=>
''
,
'file_path'
=>
$result
[
'src'
],
'key'
=>
$result
[
'key'
],
'uuid'
=>
$result
[
'uuid'
]];
}
}
/*
public function actionTest()
{
//$key = 'source/ea/52/80/3mnxijfpy5bvC8_eKHXT.mp4';
$key = 'source/b5/42/29/dc_nvGJm5Vvj6WOU_tNr.flv';
//$key = 'source/18/d3/23/UUQtSkbQMfvp3tITL29j.mp4';
define('BR', '<br>');
$auth = new \Qiniu\Auth('Tm34_10r5kYLrUProU3Rx82HXCOnYuF8MhirB_YR', 'NwLeT4eF_C2UStiHzNAQmzqnIq_ru-BdHFK43Isn');
$url = $auth->privateDownloadUrl('http://vdn.c.pp.cc/'.$key.'?avinfo');
//$url = 'http://vdn.c.pp.cc/source/ea/52/80/3mnxijfpy5bvC8_eKHXT.mp4?avinfo&e=1477627689&token='.urlencode('Tm34_10r5kYLrUProU3Rx82HXCOnYuF8MhirB_YR:3EHHpfAdrEqbaMh8q0RJeHDkA0E=');
echo $url.BR;
$response = \Qiniu\Http\Client::get($url);
//$avInfo = $response->json();
echo $response->statusCode;
opcache_invalidate(__FILE__);
}
*/
}
}
src/frontend/models/CoursePublishForm.php
View file @
0d7c258a
...
@@ -21,8 +21,7 @@ use yii\base\Model;
...
@@ -21,8 +21,7 @@ use yii\base\Model;
*
*
* @property $id int
* @property $id int
* @property $tmp string
* @property $tmp string
* @property $class_id int
* @property $class_id int 课堂ID,用于内部数据验证等
* @property $user_id int
* @property $preview string|array
* @property $preview string|array
* @property $vuid string|array
* @property $vuid string|array
* @property $name string
* @property $name string
...
@@ -37,7 +36,6 @@ class CoursePublishForm extends Model
...
@@ -37,7 +36,6 @@ class CoursePublishForm extends Model
public
$id
;
public
$id
;
public
$tmp
;
public
$tmp
;
public
$class_id
;
public
$class_id
;
public
$user_id
;
public
$vuid
;
public
$vuid
;
public
$preview
;
public
$preview
;
public
$name
;
public
$name
;
...
@@ -70,8 +68,6 @@ class CoursePublishForm extends Model
...
@@ -70,8 +68,6 @@ class CoursePublishForm extends Model
return
[
return
[
'id'
=>
'ID'
,
'id'
=>
'ID'
,
'tmp'
=>
'Tmp'
,
'tmp'
=>
'Tmp'
,
'user_id'
=>
'User ID'
,
'class_id'
=>
'Class ID'
,
'name'
=>
'标题'
,
'name'
=>
'标题'
,
'teacher'
=>
'讲师'
,
'teacher'
=>
'讲师'
,
'price'
=>
'价格'
,
'price'
=>
'价格'
,
...
@@ -85,29 +81,27 @@ class CoursePublishForm extends Model
...
@@ -85,29 +81,27 @@ class CoursePublishForm extends Model
public
function
rules
()
public
function
rules
()
{
{
$requiredFields
=
[
'tmp'
,
'class_id'
,
'user_id'
,
'name'
,
'price'
,
'free_time'
,
'preview
'
];
//$requiredFields = ['tmp', 'name', 'price', 'free_time', 'preview', 'vuid
'];
//创建模式下将验证视频文件
//创建模式下将验证视频文件
if
(
$this
->
createMode
)
{
//
if ($this->createMode) {
$requiredFields
[]
=
'vuid'
;
//
$requiredFields[] = 'vuid';
}
//
}
$rules
=
[
$rules
=
[
[
$requiredFields
,
'required'
],
[
[
'tmp'
,
'name'
,
'price'
,
'preview'
,
'vuid'
]
,
'required'
],
[[
'id'
,
'
class_id'
,
'user_id'
,
'
free_time'
],
'integer'
],
[[
'id'
,
'free_time'
],
'integer'
],
[[
'tmp'
,
'name'
,
'preview'
,
'intro'
],
'string'
],
[[
'tmp'
,
'name'
,
'preview'
,
'intro'
],
'string'
],
[
'recommend'
,
'boolean'
],
[
'free_time'
,
'default'
,
'value'
=>
0
],
[
'free_time'
,
'integer'
,
'min'
=>
0
,
'max'
=>
15
],
[
'tmp'
,
'match'
,
'pattern'
=>
'/^\w{20}$/i'
],
[
'tmp'
,
'match'
,
'pattern'
=>
'/^\w{20}$/i'
],
[
'teacher'
,
'validateTeachers'
],
[
'teacher'
,
'validateTeachers'
],
[
'teacher'
,
'default'
,
'value'
=>
[]],
[
'teacher'
,
'default'
,
'value'
=>
[]],
[
'free_time'
,
'integer'
,
'min'
=>
0
,
'max'
=>
15
],
[
'preview'
,
'validateUploadKey'
],
[
'preview'
,
'validateUploadKey'
],
[
'
recommend'
,
'boolean
'
]
[
'
vuid'
,
'validateUploadKey
'
]
];
];
if
(
$this
->
createMode
)
{
$rules
[]
=
[
'vuid'
,
'validateUploadKey'
];
}
return
$rules
;
return
$rules
;
}
}
...
...
src/frontend/views/classes-info/apply.php
View file @
0d7c258a
...
@@ -62,13 +62,13 @@ $this->title = '申请课堂';
...
@@ -62,13 +62,13 @@ $this->title = '申请课堂';
</p>
</p>
<p>
<p>
<b>
一、定义:
</b>
<b>
一、定义:
</b>
<br
/>
1.1 您:指有效申请并经深圳指掌时代网络科技有限公司审核同意后,在云涯平台制作及发布作品的自然人、法人、其他组织。
<br
/>
1.1 您:指有效申请并经深圳指掌时代网络科技有限公司审核同意后,在云涯平台制作及发布作品的自然人、法人、其他组织。
<br
/>
1.2 云涯平台:供著作权人或其合法授权人发布、查询、管理数字内容的聚合平台。
<br
/>
1.2 云涯平台:供著作权人或其合法授权人发布、查询、管理数字内容的聚合平台。
<br
/>
1.3 作品:指您在云涯平台所发布的视频、文字、图片、链接等内容。
<br
/>
1.3 作品:指您在云涯平台所发布的视频、文字、图片、链接等内容。
<br
/>
</p>
</p>
<p>
<p>
<b>
二、您的权利和义务
</b>
<b>
二、您的权利和义务
</b>
<br
/>
2.1 您同意:按照云涯平台公布和提示的规则、流程进行注册操作。注册完成后,请您妥善保存有关帐号和密码,并对该帐号进行的所有活动和行为负责。如因您自身过错(包括但不限于转让帐号、与他人共用、自己泄露等)或您所用计算机或其他终端产品感染病毒或木马,而导致帐号密码泄漏、遗失或其他损失后果将由您独自承担。
<br
/>
2.1 您同意:按照云涯平台公布和提示的规则、流程进行注册操作。注册完成后,请您妥善保存有关帐号和密码,并对该帐号进行的所有活动和行为负责。如因您自身过错(包括但不限于转让帐号、与他人共用、自己泄露等)或您所用计算机或其他终端产品感染病毒或木马,而导致帐号密码泄漏、遗失或其他损失后果将由您独自承担。
<br
/>
2.2 您保证:对在云涯平台发布的作品享有合法权益,是该作品的著作权人或已获得著作权人的合法授权,可以对该作品行使相关权利;若因您发布的作品发生权利纠纷或侵犯了任何第三方的合法权益,责任由您本人承担,因此给云涯或其关联公司等第三方造成损失的,您应负责全额赔偿。
<br
/>
2.2 您保证:对在云涯平台发布的作品享有合法权益,是该作品的著作权人或已获得著作权人的合法授权,可以对该作品行使相关权利;若因您发布的作品发生权利纠纷或侵犯了任何第三方的合法权益,责任由您本人承担,因此给云涯或其关联公司等第三方造成损失的,您应负责全额赔偿。
<br
/>
2.3 您保证:提供给深圳指掌时代网络科技有限公司的所有信息、数据,包括但不限于其姓名(名称)、地址、链接、电子邮箱等相关资料真实、合法、准确。如深圳指掌时代网络科技有限公司发现不真实、不合法或不准确的,则有权暂停或终止向您提供本协议下服务,由此产生的一切法律责任由您自行承担。
<br
/>
2.3 您保证:提供给深圳指掌时代网络科技有限公司的所有信息、数据,包括但不限于其姓名(名称)、地址、链接、电子邮箱等相关资料真实、合法、准确。如深圳指掌时代网络科技有限公司发现不真实、不合法或不准确的,则有权暂停或终止向您提供本协议下服务,由此产生的一切法律责任由您自行承担。
<br
/>
...
@@ -76,7 +76,7 @@ $this->title = '申请课堂';
...
@@ -76,7 +76,7 @@ $this->title = '申请课堂';
</p>
</p>
<p>
<p>
<b>
三、深圳指掌时代网络科技有限公司的权利和义务
</b>
<b>
三、深圳指掌时代网络科技有限公司的权利和义务
</b>
<br
/>
3.1 深圳指掌时代网络科技有限公司尊重知识产权并注重保护您享有的各项权利。您在云涯发布(上传)内容和授权深圳指掌时代网络科技有限公司的行为不会对您就这些内容所享有的知识产权产生任何不良影响,上传(发布)作品的著作权一律归作品的创作者所有。为了更好地对您、您发布(上传)的内容以及云涯进行宣传推广,您同意深圳指掌时代网络科技有限公司可在其旗下其他产品中使用和传播这些内容,以及为宣传推广的目的将上述内容许可给第三方使用和传播(包括但不限于网络、电子杂志、软件、出版等)。为了更好地维护您的各项知识产权,您同意深圳指掌时代网络科技有限公司有权针对侵犯您发布(上传)内容相关权利的行为进行维权。若此类维权行为产生任何收益,深圳指掌时代网络科技有限公司将在扣除维权成本后将维权收益支付给您。
<br
/>
3.1 深圳指掌时代网络科技有限公司尊重知识产权并注重保护您享有的各项权利。您在云涯发布(上传)内容和授权深圳指掌时代网络科技有限公司的行为不会对您就这些内容所享有的知识产权产生任何不良影响,上传(发布)作品的著作权一律归作品的创作者所有。为了更好地对您、您发布(上传)的内容以及云涯进行宣传推广,您同意深圳指掌时代网络科技有限公司可在其旗下其他产品中使用和传播这些内容,以及为宣传推广的目的将上述内容许可给第三方使用和传播(包括但不限于网络、电子杂志、软件、出版等)。为了更好地维护您的各项知识产权,您同意深圳指掌时代网络科技有限公司有权针对侵犯您发布(上传)内容相关权利的行为进行维权。若此类维权行为产生任何收益,深圳指掌时代网络科技有限公司将在扣除维权成本后将维权收益支付给您。
<br
/>
3.2 深圳指掌时代网络科技有限公司有权对您上传的作品进行事先审核,经审核通过的作品方可在云涯发布。但该审核仅以合理程度为限,深圳指掌时代网络科技有限公司并不实际控制您或其作品,不对其审核结果承担任何法律责任,亦不对您作品的合法性、不侵权、完整性做出任何明示或暗示的担保、保证责任。
<br
/>
3.2 深圳指掌时代网络科技有限公司有权对您上传的作品进行事先审核,经审核通过的作品方可在云涯发布。但该审核仅以合理程度为限,深圳指掌时代网络科技有限公司并不实际控制您或其作品,不对其审核结果承担任何法律责任,亦不对您作品的合法性、不侵权、完整性做出任何明示或暗示的担保、保证责任。
<br
/>
3.3 深圳指掌时代网络科技有限公司有权知悉您的身份信息、注册数据,如发现该等信息、数据中存在任何问题或怀疑,可要求您改正,或者直接做出删除、屏蔽等处理。
<br
/>
3.3 深圳指掌时代网络科技有限公司有权知悉您的身份信息、注册数据,如发现该等信息、数据中存在任何问题或怀疑,可要求您改正,或者直接做出删除、屏蔽等处理。
<br
/>
...
@@ -86,7 +86,7 @@ $this->title = '申请课堂';
...
@@ -86,7 +86,7 @@ $this->title = '申请课堂';
</p>
</p>
<p>
<p>
<b>
四、云涯平台的使用规则
</b>
<b>
四、云涯平台的使用规则
</b>
<br
/>
4.1 深圳指掌时代网络科技有限公司谢绝任何形式的转载,严禁剽窃、抄袭,否则因此产生的一切后果、责任由行为人承担。深圳指掌时代网络科技有限公司保留追究行为人责任的权利。
<br
/>
4.1 深圳指掌时代网络科技有限公司谢绝任何形式的转载,严禁剽窃、抄袭,否则因此产生的一切后果、责任由行为人承担。深圳指掌时代网络科技有限公司保留追究行为人责任的权利。
<br
/>
4.2 如您或您上传、发布或发表的作品违反下述规则,深圳指掌时代网络科技有限公司有完全的权利在不通知您的情况下,删除您帐号及\或您帐号下发表的全部或部分内容,由此产生的损失由您承担。
<br
/>
4.2 如您或您上传、发布或发表的作品违反下述规则,深圳指掌时代网络科技有限公司有完全的权利在不通知您的情况下,删除您帐号及\或您帐号下发表的全部或部分内容,由此产生的损失由您承担。
<br
/>
1) 您的行为干扰了云涯平台任何部分或功能的正常运行;
<br
/>
1) 您的行为干扰了云涯平台任何部分或功能的正常运行;
<br
/>
...
@@ -96,7 +96,7 @@ $this->title = '申请课堂';
...
@@ -96,7 +96,7 @@ $this->title = '申请课堂';
4.3 您同意:您自行负责对发布到云涯平台的作品进行校对和审核。您使用云涯平台服务过程的所有行为,均以该平台服务器记录的数据为准。
<br
/>
4.3 您同意:您自行负责对发布到云涯平台的作品进行校对和审核。您使用云涯平台服务过程的所有行为,均以该平台服务器记录的数据为准。
<br
/>
</p>
</p>
<p>
<p>
如您对本协议内容有任何疑问,可邮件至yunya@pp.cc。
<b>
如您对本协议内容有任何疑问,可邮件至yunya@pp.cc。
</b>
</p>
</p>
</div>
</div>
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
...
...
src/frontend/views/classes-info/index.php
View file @
0d7c258a
...
@@ -10,66 +10,32 @@ use yii\helpers\Url;
...
@@ -10,66 +10,32 @@ use yii\helpers\Url;
$this
->
title
=
'我的课堂'
;
$this
->
title
=
'我的课堂'
;
?>
?>
<ul
class=
"tab-headbox"
>
<!-- Nav tabs -->
<li
class=
"active"
><a
href=
"#"
>
基本信息
</a></li>
<ul
class=
"tab-headbox"
role=
"tablist"
>
<li
><a
href=
"
<?=
Url
::
to
([
'classes-info/setting'
])
?>
"
>
课堂设置
</a></li>
<li
role=
"presentation"
class=
"active"
><a
href=
"#home"
role=
"tab"
data-toggle=
"tab"
>
基本信息
</a></li>
<li
role=
"presentation"
><a
href=
"#profile"
role=
"tab"
data-toggle=
"tab"
>
课堂设置
</a></li>
</ul>
</ul>
<!-- Tab panes -->
<div
class=
"class-name m-t-50"
>
<div
class=
"tab-content"
>
<span
class=
"nomal-class-name"
>
<?=
$model
->
name
?>
<!-- <a href="#"><i class="icon-mode_edit"></i></a>-->
</span>
<div
role=
"tabpanel"
class=
"tab-pane active"
id=
"home"
>
<!--<div class="edit"><a href="#" title="课堂设置"><i class="icon-mode_edit"></i></a></div>-->
<div
class=
"class-name m-t-50"
>
<span
class=
"edit-class-name"
style=
"display: none"
><input
type=
"text"
class=
"input-r-control"
>
<button
class=
"btn btn-default"
>
保存
</button>
<button
class=
"btn btn-default"
>
取消
</button></span>
<span
class=
"nomal-class-name"
>
<?=
$model
->
name
?>
<!-- <a href="#"><i class="icon-mode_edit"></i></a>-->
</span>
</div>
<div
class=
"edit"
><a
href=
"#"
title=
"课堂设置"
><i
class=
"icon-mode_edit"
></i></a></div>
<div
class=
"class-intro"
>
<span
class=
"edit-class-name"
style=
"display: none"
><input
type=
"text"
class=
"input-r-control"
>
<button
class=
"btn btn-default"
>
保存
</button>
<button
class=
"btn btn-default"
>
取消
</button></span>
<div
class=
"col-md-4"
>
</div>
<h3>
课程总数
</h3>
<div
class=
"class-intro"
>
<p>
<?=
$courseCount
?>
<small>
讲
</small></p>
<div
class=
"col-md-4"
>
<a
href=
"
<?=
Url
::
to
([
'my-course/publish'
])
?>
"
>
发布课程
</a>
<h3>
课程总数
</h3>
<i
class=
"icon-play"
></i>
<p>
<?=
$courseCount
?>
<small>
讲
</small></p>
<a
href=
"
<?=
Url
::
to
([
'my-course/publish'
])
?>
"
>
发布课程
</a>
<i
class=
"icon-play"
></i>
</div>
<div
class=
"col-md-4"
>
<h3>
今日收益
</h3>
<p>
<?=
$todayIncome
?>
<small>
元
</small></p>
<a
href=
"
<?=
Url
::
to
([
'my-income/index'
])
?>
"
>
查看账单
</a>
<i
class=
"icon-clipboard"
></i>
</div>
<div
class=
"col-md-4"
>
<h3>
今日发言
</h3>
<p>
<?=
$commentCount
?>
<small>
条
</small></p>
<i
class=
"icon-speech-bubble"
></i>
</div>
</div>
</div>
</div>
<div
class=
"col-md-4"
>
<div
role=
"tabpanel"
class=
"tab-pane"
id=
"profile"
>
<h3>
今日收益
</h3>
<div
class=
"send-class apply-class-box m-t-50"
>
<p>
<?=
$todayIncome
?>
<small>
元
</small></p>
<div
class=
"tit"
>
课堂设置
</div>
<a
href=
"
<?=
Url
::
to
([
'my-income/index'
])
?>
"
>
查看账单
</a>
<i
class=
"icon-clipboard"
></i>
<div
class=
"cls-part"
>
<div
class=
"tit"
>
课堂名称
</div>
<input
type=
"text"
class=
"input-r-control"
placeholder=
"请输入课堂名称"
>
</div>
<div
class=
"cls-part"
>
<div
class=
"tit"
>
课堂介绍
</div>
<div
class=
"cls-intro-textarea"
>
<textarea
name=
""
id=
""
class=
"input-r-control"
placeholder=
"填写分享或培训的案例链接……"
></textarea>
</div>
</div>
<div
class=
"btn-box text-center"
style=
"margin-top: 10px; "
>
<button
class=
"btn btn-link m-l-10"
>
取消
</button><button
class=
"btn btn-save m-l-10"
>
保存
</button>
</div>
</div>
</div>
</div>
<div
class=
"col-md-4"
>
</div
>
<h3>
今日发言
</h3
>
<p>
<?=
$commentCount
?>
<small>
条
</small></p>
<i
class=
"icon-speech-bubble"
></i>
</div>
</div>
\ No newline at end of file
src/frontend/views/classes-info/setting.php
0 → 100644
View file @
0d7c258a
<?php
/**
* @var $this yii\web\View
* @var \common\models\Classes $model
* @var $courseCount int
* @var $todayIncome float
* @var $commentCount int
*/
use
frontend\models\MyActiveForm
;
use
yii\helpers\Url
;
$this
->
title
=
'课堂设置'
;
?>
<ul
class=
"tab-headbox"
>
<li><a
href=
"
<?=
Url
::
to
([
'classes-info/index'
])
?>
"
>
基本信息
</a></li>
<li
class=
"active"
><a
href=
"#"
>
课堂设置
</a></li>
</ul>
<div
class=
"send-class apply-class-box m-t-50"
>
<div
class=
"tit"
>
课堂设置
</div>
<?php
$form
=
MyActiveForm
::
begin
([
'id'
=>
'applyForm'
,
'options'
=>
[
'name'
=>
'applyClass'
]]);
?>
<?=
$form
->
field
(
$model
,
'name'
,
[
'inputOptions'
=>
[
'placeholder'
=>
'请输入课堂名称'
]])
?>
<?=
$form
->
field
(
$model
,
'intro'
,
[
'template'
=>
"
{
label
}
\n
<div class=
\"
cls-intro-textarea
\"
>
{
input}</div>\n{hint}\n{error
}
"
])
->
textarea
([
'placeholder'
=>
'填写分享或培训的案例链接…'
])
?>
<div
class=
"btn-box text-center"
style=
"margin-top: 10px; "
>
<a
href=
"
<?=
Url
::
to
([
'classes-info/index'
])
?>
"
class=
"btn btn-link m-l-10"
>
取消
</a><button
type=
"submit"
class=
"btn btn-save m-l-10"
>
保存
</button>
</div>
<?php
MyActiveForm
::
end
();
?>
</div>
\ No newline at end of file
src/frontend/views/home/index.php
View file @
0d7c258a
...
@@ -25,5 +25,5 @@ $this->registerMetaTag(['name' => 'keywords', 'content' => $classInfo['name']]);
...
@@ -25,5 +25,5 @@ $this->registerMetaTag(['name' => 'keywords', 'content' => $classInfo['name']]);
})
})
</script>
</script>
<div
class=
"copyright m-t-20"
>
© 2016 c.pp.cc
皖ICP备13046642号
</div>
<div
class=
"copyright m-t-20"
>
© 2016 c.pp.cc
粤ICP备11034506号-3
</div>
src/frontend/views/home/preview.php
View file @
0d7c258a
...
@@ -19,7 +19,7 @@ $coursewareInfo['isPreview'] = true;
...
@@ -19,7 +19,7 @@ $coursewareInfo['isPreview'] = true;
</div>
</div>
<div
class=
"xs-show-bg"
></div>
<div
class=
"xs-show-bg"
></div>
<div
class=
"copyright"
>
© 2016 c.pp.cc
皖ICP备13046642号
</div>
<div
class=
"copyright"
>
© 2016 c.pp.cc
粤ICP备11034506号-3
</div>
<script
type=
'text/javascript'
>
<script
type=
'text/javascript'
>
$
(
function
()
{
$
(
function
()
{
...
...
src/frontend/views/home/video.php
View file @
0d7c258a
...
@@ -41,7 +41,7 @@ $this->registerJs($js);
...
@@ -41,7 +41,7 @@ $this->registerJs($js);
</div>
</div>
<div
class=
"xs-show-bg"
></div>
<div
class=
"xs-show-bg"
></div>
<div
class=
"copyright"
>
© 2016 c.pp.cc
皖ICP备13046642号
</div>
<div
class=
"copyright"
>
© 2016 c.pp.cc
粤ICP备11034506号-3
</div>
<script
type=
'text/javascript'
>
<script
type=
'text/javascript'
>
$
(
function
()
{
$
(
function
()
{
...
...
src/frontend/views/layouts/center.php
View file @
0d7c258a
...
@@ -109,6 +109,13 @@ $this->registerCss('[v-cloak] {display:none;}');
...
@@ -109,6 +109,13 @@ $this->registerCss('[v-cloak] {display:none;}');
turmbh
=
turmbw
*
5
/
9
;
turmbh
=
turmbw
*
5
/
9
;
$
(
'.video-img-box img,.play-mask'
).
css
(
'height'
,
turmbh
);
$
(
'.video-img-box img,.play-mask'
).
css
(
'height'
,
turmbh
);
$
(
'.play-mask'
).
css
(
'padding-top'
,
turmbh
/
2
-
20
);
$
(
'.play-mask'
).
css
(
'padding-top'
,
turmbh
/
2
-
20
);
//设置主体内容最大宽度
if
(
justic
<
1300
){
$
(
'.container'
).
css
(
'max-width'
,
'980px'
);
}
})
})
</script>
</script>
...
...
src/frontend/views/layouts/main.php
View file @
0d7c258a
...
@@ -28,7 +28,7 @@ $baseUrl = \yii\helpers\Url::base();
...
@@ -28,7 +28,7 @@ $baseUrl = \yii\helpers\Url::base();
<?php
if
(
Yii
::
$app
->
user
->
isGuest
)
:
?>
<?php
if
(
Yii
::
$app
->
user
->
isGuest
)
:
?>
<div
class=
"navbar-main navbar-static-top clearfix"
>
<div
class=
"navbar-main navbar-static-top clearfix"
>
<div
id=
"main-logo"
class=
"logo pull-left
"
><a
href=
"
<?=
$baseUrl
.
"/user-center/"
?>
"
>
云涯
</a></div>
<div
id=
"main-logo"
class=
"logo pull-left
logo-home"
><a
href=
"
<?=
$baseUrl
.
"/user-center/"
?>
"
>
</a></div>
<!--
<!--
<ul class="c-menu-item pull-left">
<ul class="c-menu-item pull-left">
<li class="active"><a href="#">首页</a></li>
<li class="active"><a href="#">首页</a></li>
...
...
src/frontend/views/my-course/edit.php
View file @
0d7c258a
...
@@ -6,10 +6,14 @@
...
@@ -6,10 +6,14 @@
* @var $teacherIds [\common\models\CourseTeacher]
* @var $teacherIds [\common\models\CourseTeacher]
*/
*/
use
common\libs\Utils
;
use
frontend\assets\AppAsset
;
use
frontend\assets\AppAsset
;
use
common\models\Course
;
$this
->
title
=
'编辑课程信息'
;
$this
->
title
=
'编辑课程信息'
;
$sourceEditable
=
(
$course
->
status
==
Course
::
STATUS_UNCHECK
||
$course
->
status
==
Course
::
STATUS_FAILED
);
AppAsset
::
addScript
(
$this
,
'@web/assets/course_edit.js'
);
AppAsset
::
addScript
(
$this
,
'@web/assets/course_edit.js'
);
AppAsset
::
addCss
(
$this
,
'@web/assets/css/course_publish.css'
);
AppAsset
::
addCss
(
$this
,
'@web/assets/css/course_publish.css'
);
?>
?>
...
@@ -37,6 +41,26 @@ AppAsset::addCss($this, '@web/assets/css/course_publish.css');
...
@@ -37,6 +41,26 @@ AppAsset::addCss($this, '@web/assets/css/course_publish.css');
<teachers
init-teachers=
"
<?=
join
(
','
,
$teacherIds
)
?>
"
></teachers>
<teachers
init-teachers=
"
<?=
join
(
','
,
$teacherIds
)
?>
"
></teachers>
</div>
</div>
<?php
if
(
$sourceEditable
)
{
?>
<div
class=
"cls-part"
>
<div
class=
"tit"
>
更换视频
<span
class=
"text-info"
style=
"font-size:12px;"
>
不选择则继续使用现有视频
</span></div>
<video-upload
uptoken=
"
<?=
$videoToken
?>
"
text=
"保留原视频或选择要更换的视频"
></video-upload>
</div>
<?php
}
else
{
?>
<div
class=
"cls-part"
>
<div
class=
"tit"
>
视频信息
</div>
<div>
<div
class=
"upload-ready"
>
<div
class=
"video-detail"
style=
"margin-top:0;"
>
视频时长:
<?=
Utils
::
humanSeconds
(
$lesson
->
time
)
?>
<br>
原始大小:
<?=
Utils
::
byteConvert
(
$lesson
->
size
)
?>
<br>
原始格式:
<?=
$lesson
->
format
?>
<br>
</div>
</div>
</div>
</div>
<?php
}
?>
<div
class=
"cls-part"
>
<div
class=
"cls-part"
>
<div
class=
"tit"
>
规则设定
</div>
<div
class=
"tit"
>
规则设定
</div>
<div
class=
"clearfix"
>
<div
class=
"clearfix"
>
...
@@ -49,7 +73,7 @@ AppAsset::addCss($this, '@web/assets/css/course_publish.css');
...
@@ -49,7 +73,7 @@ AppAsset::addCss($this, '@web/assets/css/course_publish.css');
<div
class=
"checkbox rules-set m-l-20 fl"
>
<div
class=
"checkbox rules-set m-l-20 fl"
>
<label
class=
"clearfix"
>
<label
class=
"clearfix"
>
<span>
免费试看
</span>
<input
type=
"text"
name=
"free_time"
class=
"input-r-control text-center"
value=
"
<?=
$course
->
free_time
?>
"
>
<span>
分钟
</span>
<span>
免费试看
</span>
<input
type=
"text"
name=
"free_time"
class=
"input-r-control text-center"
value=
"
<?=
$course
->
free_time
?>
"
:disabled=
"vuid=='@orig'"
>
<span>
分钟
</span>
</label>
</label>
</div>
</div>
</div>
</div>
...
...
src/frontend/views/my-course/publish.php
View file @
0d7c258a
...
@@ -28,7 +28,7 @@ AppAsset::addCss($this, '@web/assets/css/course_publish.css');
...
@@ -28,7 +28,7 @@ AppAsset::addCss($this, '@web/assets/css/course_publish.css');
</div>
</div>
<div
class=
"cls-part"
>
<div
class=
"cls-part"
>
<div
class=
"tit"
>
上传视频
<span
class=
"required"
>
*
</span></div>
<div
class=
"tit"
>
上传视频
<span
class=
"required"
>
*
</span></div>
<video-upload
uptoken=
"
<?=
$videoToken
?>
"
></video-upload>
<video-upload
uptoken=
"
<?=
$videoToken
?>
"
></video-upload>
</div>
</div>
...
...
src/frontend/views/site/signup.php
View file @
0d7c258a
...
@@ -17,7 +17,7 @@ $this->registerJsFile('http://static.geetest.com/static/tools/gt.js');
...
@@ -17,7 +17,7 @@ $this->registerJsFile('http://static.geetest.com/static/tools/gt.js');
<div
id=
"myTab"
class=
"tab-a"
>
<div
id=
"myTab"
class=
"tab-a"
>
<ul>
<ul>
<li><a
href=
"
<?=
$baseUrl
.
"/site/login"
?>
"
>
登录
</a></li>
<li><a
href=
"
<?=
$baseUrl
.
"/site/login"
?>
"
>
登录
</a></li>
<li
class=
"active"
><a
href=
"
<?=
$baseUrl
.
"/site/si
ng
up"
?>
"
>
注册
</a></li>
<li
class=
"active"
><a
href=
"
<?=
$baseUrl
.
"/site/si
gn
up"
?>
"
>
注册
</a></li>
</ul>
</ul>
</div>
</div>
...
...
src/frontend/web/css/login.css
View file @
0d7c258a
...
@@ -18,6 +18,12 @@ a,a:hover,a:link {
...
@@ -18,6 +18,12 @@ a,a:hover,a:link {
.logo
a
{
.logo
a
{
color
:
#333
;
color
:
#333
;
}
}
.logo-home
a
{
display
:
block
;
width
:
120px
;
height
:
60px
;
background
:
url(../img/logo_white.png)
left
top
no-repeat
;
}
.yun-login-btn
{
.yun-login-btn
{
margin-right
:
30px
;
margin-right
:
30px
;
margin-bottom
:
0
;
margin-bottom
:
0
;
...
...
src/frontend/web/css/main.css
View file @
0d7c258a
...
@@ -454,11 +454,9 @@ a,a:hover,a:link {
...
@@ -454,11 +454,9 @@ a,a:hover,a:link {
.copyright
{
.copyright
{
height
:
40px
;
height
:
40px
;
line-height
:
40px
;
line-height
:
40px
;
background-color
:
#fff
;
text-align
:
center
;
text-align
:
center
;
color
:
#999
;
color
:
#999
;
font-size
:
12px
;
font-size
:
12px
;
border-top
:
1px
solid
#f3f3f3
;
}
}
.m-t-20
{
.m-t-20
{
margin-top
:
20px
;
margin-top
:
20px
;
...
@@ -467,9 +465,10 @@ a,a:hover,a:link {
...
@@ -467,9 +465,10 @@ a,a:hover,a:link {
/*视频内容页面*/
/*视频内容页面*/
.cnt-tit
{
.cnt-tit
{
position
:
relative
;
position
:
relative
;
height
:
22px
;
min-
height
:
22px
;
font-size
:
22px
;
font-size
:
22px
;
margin
:
30px
0
;
margin
:
30px
0
;
line-height
:
1.6
;
}
}
.tit-share
{
.tit-share
{
position
:
absolute
;
position
:
absolute
;
...
...
src/frontend/web/css/style.css
View file @
0d7c258a
...
@@ -86,9 +86,6 @@ a:link, a:active, a:visited {
...
@@ -86,9 +86,6 @@ a:link, a:active, a:visited {
display
:
inline-block
;
display
:
inline-block
;
}
}
.logo
a
img
{
padding
:
21px
0
;
}
.accordion
,
.accordion
,
.accordion
li
{
.accordion
li
{
...
@@ -473,7 +470,7 @@ a:link, a:active, a:visited {
...
@@ -473,7 +470,7 @@ a:link, a:active, a:visited {
width
:
30px
;
width
:
30px
;
border-radius
:
100%
;
border-radius
:
100%
;
text-align
:
center
;
text-align
:
center
;
line-height
:
3
4
px
;
line-height
:
3
2
px
;
font-size
:
16px
;
font-size
:
16px
;
background-color
:
rgba
(
0
,
0
,
0
,
.3
);
background-color
:
rgba
(
0
,
0
,
0
,
.3
);
color
:
#ffffff
;
color
:
#ffffff
;
...
@@ -1599,6 +1596,9 @@ textarea.input-r-control {
...
@@ -1599,6 +1596,9 @@ textarea.input-r-control {
.simditor-body
{
.simditor-body
{
text-align
:
left
!important
;
text-align
:
left
!important
;
}
}
.simditor-body
li
,
.simditor-body
ol
,
.simditor-body
ul
{
list-style
:
inherit
;
}
/*选项卡*/
/*选项卡*/
.tab-headbox
{
.tab-headbox
{
...
...
src/frontend/web/img/favicon.ico
View replaced file @
a8737bae
View file @
0d7c258a
318 Bytes
|
W:
|
H:
16.6 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/frontend/web/img/logo.png
View replaced file @
a8737bae
View file @
0d7c258a
2.12 KB
|
W:
|
H:
2.13 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/frontend/web/img/logo_white.png
0 → 100644
View file @
0d7c258a
2.2 KB
src/frontend/web/js/components/uploader/video-upload.vue
View file @
0d7c258a
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div>
<div>
<div
class=
"upload-video-btn"
v-bind:id=
"uploaderId"
v-show=
"state=='ready' || state=='error'"
>
<div
class=
"upload-video-btn"
v-bind:id=
"uploaderId"
v-show=
"state=='ready' || state=='error'"
>
<i
class=
"icon-play"
></i>
<i
class=
"icon-play"
></i>
<b>
上传视频
</b>
<b>
{{
text
}}
</b>
</div>
</div>
<div
class=
"upload-ready"
v-else
>
<div
class=
"upload-ready"
v-else
>
...
@@ -18,11 +18,8 @@
...
@@ -18,11 +18,8 @@
<i
class=
"upload-progress"
v-bind:style=
"
{width:progress + '%'}">
</i>
<i
class=
"upload-progress"
v-bind:style=
"
{width:progress + '%'}">
</i>
<!--上传完成-->
<!--上传完成-->
<!--
<span
class=
"tip-upload-rdy"
v-show=
"state=='completed'"
><i
class=
"icon-check"
></i>
上传完成
</span>
<span
class=
"tip-upload-rdy"
><i
class=
"icon-check"
></i>
上传完成
</span>
<a
href=
"javascript:;"
class=
"delete"
title=
"取消"
@
click=
"cancelClick"
><i
class=
"icon-cross"
></i></a>
-->
<a
href=
"#"
class=
"delete"
><i
class=
"icon-cross"
></i></a>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -37,6 +34,8 @@ import layer from "layer-js";
...
@@ -37,6 +34,8 @@ import layer from "layer-js";
import
str
from
"../../utils/string"
;
import
str
from
"../../utils/string"
;
import
qiniu
from
"../../utils/qiniu"
;
import
qiniu
from
"../../utils/qiniu"
;
var
uploader
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -49,7 +48,20 @@ export default {
...
@@ -49,7 +48,20 @@ export default {
}
}
},
},
props
:
{
props
:
{
uptoken
:
String
uptoken
:
String
,
text
:
{
type
:
String
,
default
:
"上传视频"
}
},
methods
:
{
cancelClick
:
function
()
{
uploader
.
stop
();
this
.
state
=
"ready"
;
uploader
.
refresh
();
this
.
$dispatch
(
"video-upload-cancel"
);
}
},
},
ready
()
{
ready
()
{
var
container
=
$
(
this
.
$el
),
var
container
=
$
(
this
.
$el
),
...
@@ -81,7 +93,7 @@ export default {
...
@@ -81,7 +93,7 @@ export default {
}
}
});
});
var
uploader
=
new
qiniu
.
Uploader
({
uploader
=
new
qiniu
.
Uploader
({
browse_button
:
self
.
uploaderId
,
browse_button
:
self
.
uploaderId
,
drop_element
:
self
.
uploaderId
,
drop_element
:
self
.
uploaderId
,
upload_token
:
self
.
uptoken
,
upload_token
:
self
.
uptoken
,
...
@@ -102,8 +114,6 @@ export default {
...
@@ -102,8 +114,6 @@ export default {
self
.
videoName
=
file
.
name
;
self
.
videoName
=
file
.
name
;
});
});
// container.find(".upload-video-btn").hide();
// ready.show();
self
.
state
=
'uploading'
;
self
.
state
=
'uploading'
;
up
.
start
();
up
.
start
();
...
@@ -123,10 +133,6 @@ export default {
...
@@ -123,10 +133,6 @@ export default {
var
toDate
=
new
Date
();
var
toDate
=
new
Date
();
toDate
.
setTime
((
new
Date
()).
getTime
()
+
leftSeconds
*
1000
);
toDate
.
setTime
((
new
Date
()).
getTime
()
+
leftSeconds
*
1000
);
infoRemain
.
text
(
moment
(
toDate
).
toNow
(
true
));
infoRemain
.
text
(
moment
(
toDate
).
toNow
(
true
));
// infoProgress.text(file.percent);
// $("#" + file.id + " .attachup-list-element-status").html("上传中 - " + file.percent + "%");
},
},
//每个文件上传成功后
//每个文件上传成功后
'FileUploaded'
:
function
(
up
,
file
,
info
)
{
'FileUploaded'
:
function
(
up
,
file
,
info
)
{
...
...
src/frontend/web/js/my-course/edit.js
View file @
0d7c258a
...
@@ -2,11 +2,13 @@
...
@@ -2,11 +2,13 @@
* Created by pader on 16/10/21.
* Created by pader on 16/10/21.
*/
*/
var
Vue
=
require
(
'vue'
);
var
Vue
=
require
(
'vue'
);
var
videoUpload
=
require
(
'../components/uploader/video-upload.vue'
);
var
thumbUpload
=
require
(
'../components/uploader/thumb-upload.vue'
);
var
thumbUpload
=
require
(
'../components/uploader/thumb-upload.vue'
);
var
teacherQuickList
=
require
(
'./components/teacher-quick-list.vue'
);
var
teacherQuickList
=
require
(
'./components/teacher-quick-list.vue'
);
var
richText
=
require
(
'./rich-text'
);
var
richText
=
require
(
'./rich-text'
);
var
layer
=
require
(
"layer-js"
);
var
layer
=
require
(
"layer-js"
);
var
str
=
require
(
"../utils/string"
);
var
str
=
require
(
"../utils/string"
);
var
validateOption
=
require
(
'./validate-option'
);
require
(
'jquery-validation'
);
require
(
'jquery-validation'
);
...
@@ -20,70 +22,31 @@ var vm = new Vue({
...
@@ -20,70 +22,31 @@ var vm = new Vue({
tmp
:
str
.
rand
(
20
)
tmp
:
str
.
rand
(
20
)
},
},
components
:
{
components
:
{
videoUpload
:
videoUpload
,
thumbUpload
:
thumbUpload
,
thumbUpload
:
thumbUpload
,
teachers
:
teacherQuickList
teachers
:
teacherQuickList
},
},
ready
:
function
()
{
ready
:
function
()
{
var
self
=
this
;
var
self
=
this
;
this
.
$on
(
"video-uploaded"
,
function
(
name
,
data
)
{
self
.
vuid
=
data
.
uuid
;
});
this
.
$on
(
"video-upload-cancel"
,
function
()
{
self
.
vuid
=
"@orig"
;
});
this
.
$on
(
"thumb-uploaded"
,
function
(
name
,
data
)
{
this
.
$on
(
"thumb-uploaded"
,
function
(
name
,
data
)
{
self
.
previewKey
=
data
.
uuid
;
self
.
previewKey
=
data
.
uuid
;
});
});
var
validator
=
$
(
form
).
validate
({
var
opt
=
validateOption
.
generateOption
(
form
);
$
.
extend
(
opt
,
{
//debug: true,
//debug: true,
//errorClass: "",
//errorClass: "",
//validClass: "",
//validClass: "",
ignore
:
""
,
rules
:
{
name
:
{
required
:
true
},
price
:
{
min
:
0.01
},
preview
:
{
required
:
true
}
},
messages
:
{
name
:
{
required
:
"请填写标题"
},
price
:
{
min
:
"必须设置一个价格"
},
preview
:
{
required
:
"必须上传缩略图"
}
},
errorPlacement
:
function
(
error
,
element
)
{
var
text
=
error
.
text
();
var
org
=
element
.
get
(
0
);
var
to
=
null
;
if
(
org
==
form
.
preview
)
{
to
=
$
(
".upload-video-screen"
).
get
(
0
);
}
else
{
to
=
org
;
}
//绑定提示到元素上
if
(
text
)
{
if
(
to
.
tipIndex
)
{
layer
.
close
(
to
.
tipIndex
);
}
to
.
tipIndex
=
layer
.
tips
(
text
,
to
,
{
tips
:
org
==
form
.
name
?
3
:
2
,
time
:
0
,
tipsMore
:
true
});
}
else
if
(
to
.
tipIndex
)
{
layer
.
close
(
to
.
tipIndex
);
to
.
tipIndex
=
null
;
}
},
success
:
function
()
{},
//添加 success 后,当表单验证成功时才会触发 errorPlacement,否则验证成功不触发
submitHandler
:
function
()
{
submitHandler
:
function
()
{
var
data
=
$
(
form
).
serialize
();
var
data
=
$
(
form
).
serialize
();
var
idx
=
layer
.
msg
(
"正在提交.."
,
{
icon
:
16
,
shade
:
[
0.2
,
'#000'
],
time
:
0
});
var
idx
=
layer
.
msg
(
"正在提交.."
,
{
icon
:
16
,
shade
:
[
0.2
,
'#000'
],
time
:
0
});
...
@@ -91,7 +54,7 @@ var vm = new Vue({
...
@@ -91,7 +54,7 @@ var vm = new Vue({
$
.
post
(
"/my-course/save"
,
data
,
function
(
t
)
{
$
.
post
(
"/my-course/save"
,
data
,
function
(
t
)
{
layer
.
close
(
idx
);
layer
.
close
(
idx
);
if
(
t
.
status
)
{
if
(
t
.
status
)
{
window
.
onbeforeunload
=
null
;
window
.
onbeforeunload
=
null
;
layer
.
msg
(
'成功修改课程信息。'
,
{
layer
.
msg
(
'成功修改课程信息。'
,
{
time
:
2000
,
time
:
2000
,
icon
:
1
,
icon
:
1
,
...
@@ -103,12 +66,14 @@ var vm = new Vue({
...
@@ -103,12 +66,14 @@ var vm = new Vue({
}
else
{
}
else
{
layer
.
alert
(
t
.
message
,
{
icon
:
5
,
title
:
"提示"
});
layer
.
alert
(
t
.
message
,
{
icon
:
5
,
title
:
"提示"
});
}
}
},
"json"
);
},
"json"
);
return
false
;
return
false
;
}
}
});
});
var
validator
=
$
(
form
).
validate
(
opt
);
var
doValidate
=
function
()
{
validator
.
form
();
};
var
doValidate
=
function
()
{
validator
.
form
();
};
this
.
$watch
(
"vuid"
,
doValidate
);
this
.
$watch
(
"vuid"
,
doValidate
);
...
@@ -117,8 +82,8 @@ var vm = new Vue({
...
@@ -117,8 +82,8 @@ var vm = new Vue({
richText
.
createEditor
(
$
(
"#introEditor"
),
this
.
tmp
);
richText
.
createEditor
(
$
(
"#introEditor"
),
this
.
tmp
);
}
}
});
});
//添加关闭提示页面
//添加关闭提示页面
window
.
onbeforeunload
=
function
()
{
window
.
onbeforeunload
=
function
()
{
var
warning
=
"确认退出?"
;
return
"确认退出?"
;
return
warning
;
};
};
\ No newline at end of file
src/frontend/web/js/my-course/publish.js
View file @
0d7c258a
...
@@ -8,6 +8,7 @@ var teacherQuickList = require('./components/teacher-quick-list.vue');
...
@@ -8,6 +8,7 @@ var teacherQuickList = require('./components/teacher-quick-list.vue');
var
richText
=
require
(
'./rich-text'
);
var
richText
=
require
(
'./rich-text'
);
var
layer
=
require
(
"layer-js"
);
var
layer
=
require
(
"layer-js"
);
var
str
=
require
(
"../utils/string"
);
var
str
=
require
(
"../utils/string"
);
var
validateOption
=
require
(
'./validate-option'
);
require
(
'jquery-validation'
);
require
(
'jquery-validation'
);
...
@@ -31,83 +32,21 @@ var vm = new Vue({
...
@@ -31,83 +32,21 @@ var vm = new Vue({
this
.
$on
(
"video-uploaded"
,
function
(
name
,
data
)
{
this
.
$on
(
"video-uploaded"
,
function
(
name
,
data
)
{
self
.
vuid
=
data
.
uuid
;
self
.
vuid
=
data
.
uuid
;
});
});
this
.
$on
(
"video-upload-cancel"
,
function
()
{
self
.
vuid
=
""
;
});
this
.
$on
(
"thumb-uploaded"
,
function
(
name
,
data
)
{
this
.
$on
(
"thumb-uploaded"
,
function
(
name
,
data
)
{
self
.
previewKey
=
data
.
uuid
;
self
.
previewKey
=
data
.
uuid
;
});
});
$
.
validator
.
addMethod
(
'courseName'
,
function
(
value
,
element
,
param
)
{
return
value
.
indexOf
(
'云涯'
);
var
opt
=
validateOption
.
generateOption
(
form
,
true
);
});
var
validator
=
$
(
form
).
validate
(
{
$
.
extend
(
opt
,
{
//debug: true,
//debug: true,
//errorClass: "",
//errorClass: "",
//validClass: "",
//validClass: "",
ignore
:
""
,
rules
:
{
name
:
{
required
:
true
,
courseName
:
true
},
price
:
{
min
:
0.01
},
intro
:
{
required
:
true
},
preview
:
{
required
:
true
},
vuid
:
{
required
:
true
}
},
messages
:
{
name
:
{
required
:
"请填写标题"
,
courseName
:
'课堂名称不允许出现“云涯”二字。'
},
price
:
{
min
:
"必须设置一个价格"
},
intro
:
{
required
:
"必须填写课程介绍"
},
preview
:
{
required
:
"必须上传缩略图"
},
vuid
:
{
required
:
"您还没有上传视频"
}
},
errorPlacement
:
function
(
error
,
element
)
{
var
text
=
error
.
text
();
var
org
=
element
.
get
(
0
);
var
to
=
null
;
if
(
org
==
form
.
vuid
)
{
to
=
$
(
".upload-video-btn"
).
get
(
0
);
}
else
if
(
org
==
form
.
preview
)
{
to
=
$
(
".upload-video-screen"
).
get
(
0
);
}
else
{
to
=
org
;
}
//绑定提示到元素上
if
(
text
)
{
if
(
to
.
tipIndex
)
{
layer
.
close
(
to
.
tipIndex
);
}
to
.
tipIndex
=
layer
.
tips
(
text
,
to
,
{
tips
:
org
==
form
.
name
?
3
:
2
,
time
:
0
,
tipsMore
:
true
});
}
else
if
(
to
.
tipIndex
)
{
layer
.
close
(
to
.
tipIndex
);
to
.
tipIndex
=
null
;
}
},
success
:
function
()
{},
//添加 success 后,当表单验证成功时才会触发 errorPlacement,否则验证成功不触发
submitHandler
:
function
()
{
submitHandler
:
function
()
{
var
data
=
$
(
form
).
serialize
();
var
data
=
$
(
form
).
serialize
();
var
idx
=
layer
.
msg
(
"正在提交.."
,
{
icon
:
16
,
shade
:
[
0.2
,
'#000'
],
time
:
0
});
var
idx
=
layer
.
msg
(
"正在提交.."
,
{
icon
:
16
,
shade
:
[
0.2
,
'#000'
],
time
:
0
});
...
@@ -115,7 +54,7 @@ var vm = new Vue({
...
@@ -115,7 +54,7 @@ var vm = new Vue({
$
.
post
(
"/my-course/submit"
,
data
,
function
(
t
)
{
$
.
post
(
"/my-course/submit"
,
data
,
function
(
t
)
{
layer
.
close
(
idx
);
layer
.
close
(
idx
);
if
(
t
.
status
)
{
if
(
t
.
status
)
{
window
.
onbeforeunload
=
null
;
window
.
onbeforeunload
=
null
;
location
.
replace
(
"/my-course/result?id="
+
t
.
data
.
course_id
+
"&action=publish"
);
location
.
replace
(
"/my-course/result?id="
+
t
.
data
.
course_id
+
"&action=publish"
);
}
else
{
}
else
{
layer
.
alert
(
t
.
message
,
{
icon
:
5
,
title
:
"提示"
});
layer
.
alert
(
t
.
message
,
{
icon
:
5
,
title
:
"提示"
});
...
@@ -126,6 +65,7 @@ var vm = new Vue({
...
@@ -126,6 +65,7 @@ var vm = new Vue({
}
}
});
});
var
validator
=
$
(
form
).
validate
(
opt
);
var
doValidate
=
function
()
{
validator
.
form
();
};
var
doValidate
=
function
()
{
validator
.
form
();
};
this
.
$watch
(
"vuid"
,
doValidate
);
this
.
$watch
(
"vuid"
,
doValidate
);
...
@@ -135,9 +75,7 @@ var vm = new Vue({
...
@@ -135,9 +75,7 @@ var vm = new Vue({
}
}
});
});
//添加关闭提示页面
//添加关闭提示页面
window
.
onbeforeunload
=
function
()
{
window
.
onbeforeunload
=
function
()
{
var
warning
=
"确认退出?"
;
return
"确认退出?"
;
return
warning
;
};
};
\ No newline at end of file
src/frontend/web/js/my-course/validate-option.js
0 → 100644
View file @
0d7c258a
/**
* Created by pader on 2016/10/31.
*/
module
.
exports
=
{
generateOption
:
function
(
form
,
create
)
{
return
{
ignore
:
""
,
rules
:
{
name
:
{
required
:
true
},
price
:
{
min
:
0.01
},
intro
:
{
required
:
true
},
preview
:
{
required
:
true
},
vuid
:
{
required
:
true
}
},
messages
:
{
name
:
{
required
:
"请填写标题"
,
courseName
:
'课程名称不允许出现“云涯”二字。'
},
price
:
{
min
:
"必须设置一个价格"
},
intro
:
{
required
:
"必须填写课程介绍"
},
preview
:
{
required
:
"必须上传缩略图"
},
vuid
:
{
required
:
"您还没有上传视频"
}
},
success
:
function
()
{},
//添加 success 后,当表单验证成功时才会触发 errorPlacement,否则验证成功不触发
errorPlacement
:
function
(
error
,
element
)
{
var
text
=
error
.
text
();
var
org
=
element
.
get
(
0
);
var
to
=
null
;
if
(
create
&&
org
==
form
.
vuid
)
{
to
=
$
(
".upload-video-btn"
).
get
(
0
);
}
else
if
(
org
==
form
.
preview
)
{
to
=
$
(
".upload-video-screen"
).
get
(
0
);
}
else
{
to
=
org
;
}
//绑定提示到元素上
if
(
text
)
{
if
(
to
.
tipIndex
)
{
layer
.
close
(
to
.
tipIndex
);
}
to
.
tipIndex
=
layer
.
tips
(
text
,
to
,
{
tips
:
org
==
form
.
name
?
3
:
2
,
time
:
0
,
tipsMore
:
true
});
}
else
if
(
to
.
tipIndex
)
{
layer
.
close
(
to
.
tipIndex
);
to
.
tipIndex
=
null
;
}
}
};
}
};
\ No newline at end of file
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