Commit e345e5a0 authored by 杨培's avatar 杨培

Merge remote-tracking branch 'origin/dev' into dev

parents ce6b63fb 27948ffd
......@@ -12,6 +12,7 @@ use frontend\models\TokenInputForm;
use Yii;
use yii\filters\AccessControl;
use yii\helpers\HtmlPurifier;
use yii\helpers\Url;
use yii\web\Controller;
/**
......@@ -94,12 +95,19 @@ class SiteController extends Controller
*/
public function actionLogin()
{
if (!Yii::$app->user->isGuest) {
return $this->goHome();
}
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
//保证在讲师状态的时候直接跳到课堂概况
if(Yii::$app->user->identity->role == 1){
if(Yii::$app->user->getReturnUrl() === Yii::$app->getHomeUrl()) {
Yii::$app->user->setReturnUrl(Url::to('/classes-info'));
}
}
return $this->goBack();
} else {
return $this->render('login', [
......
......@@ -12,6 +12,7 @@ namespace frontend\controllers;
use common\libs\Test;
use common\libs\Utils;
use common\models\BrowseRecord;
use common\models\Classes;
use common\models\Favorite;
use common\models\Orders;
use common\models\UploadPools;
......@@ -46,6 +47,24 @@ class UserCenterController extends Controller
];
}
/**
* 获取课堂状态
* @return string
*/
public static function getClassStatus()
{
$classInfo = Classes::getUserClass(Yii::$app->user->id);
if ($classInfo === NULL) {
$status = 0;
} else if ($classInfo['status'] === '0') {
$status = 0;
} else if ($classInfo['status'] === '1') {
$status = 1;
} else if ($classInfo['status'] === '2') {
$status = 2;
}
return $status;
}
/**
* 个人信息页面
......
......@@ -11,7 +11,7 @@ use yii\helpers\Url;
$this->title = '我的课堂';
?>
<div class="class-name">
<span style="display: none"><?=$model->name?> <a href="#"><i class="icon-mode_edit"></i></a></span>
<span class="nomal-class-name" style="display: none"><?=$model->name?> <a href="#"><i class="icon-mode_edit"></i></a></span>
<span class="edit-class-name"><input type="text" class="input-r-control"> <button class="btn btn-default">保存</button> <button class="btn btn-default">取消</button></span>
</div>
......
......@@ -15,5 +15,15 @@ $this->registerMetaTag(['name' => 'keywords', 'content' => $classInfo['name']]);
<course-lists :class-id="classId"></course-lists>
</div>
<script type='text/javascript'>
$(function () {
turmbw = $('.video-img-box img').width();
turmbh = turmbw*5/9;
$('.video-img-box img,.play-mask').css('height',turmbh);
$('.play-mask').css('padding-top',turmbh/2-20);
})
</script>
<div class="copyright m-t-20">© 2016 c.pp.cc 皖ICP备13046642号</div>
......@@ -34,6 +34,9 @@ $this->registerJs($js);
\frontend\assets\AppAsset::addScript($this, '@web/assets/home_video.js');
\frontend\assets\AppAsset::addCss($this, '@web/assets/css/home_video.css');
?>
<style>
</style>
<input type="hidden" id="courseware-info" value="<?= \yii\helpers\Html::encode(json_encode($coursewareInfo)) ?>"/>
<div id="video-container">
<video-play :courseware-info="coursewareInfo"></video-play>
......@@ -42,3 +45,12 @@ $this->registerJs($js);
<div class="xs-show-bg"></div>
<div class="copyright">© 2016 c.pp.cc 皖ICP备13046642号</div>
<script type='text/javascript'>
$(function () {
modeldialog = $('.modal-dialog');
winh = $(window).height();
mth = (winh - 245)/2;
modeldialog.css('margin-top',mth);
})
</script>
......@@ -8,5 +8,15 @@
?>
<div class="tp-head navbar-fixed-top clearfix">
<div class="menu-btn fl"><a href="javascript:;"><i class="icon-menu"></i></a></div>
<div class="avatar fr"><a href="<?= \yii\helpers\Url::base() . '/user-center/'?>"><img src="<?=\common\models\User::getAvatarUrl(Yii::$app->user->identity->avatar) ?>"></a></div>
<div class="avatar fr">
<a href="<?= \yii\helpers\Url::base() . '/user-center/'?>"><img src="<?=\common\models\User::getAvatarUrl(Yii::$app->user->identity->avatar) ?>"></a>
<!--
<ul class="updownmenu">
<li><a href="#">课堂中心</a></li>
<li><a href="#">个人中心</a></li>
<li><a href="#">退出登录</a></li>
</ul>
-->
</div>
</div>
......@@ -40,6 +40,7 @@ $this->beginContent('@app/views/layouts/center.php');
</ul>
</li>
</ul>
<a class="loginout" href="<?=\yii\helpers\Url::base() .'/site/logout'?>"><i class="icon-power_settings_new"></i>退出登录</a>
</div>
</div>
......
......@@ -4,61 +4,66 @@ use frontend\assets\AppAsset;
/* @var $this \yii\web\View */
/* @var $content string */
$baseUrl = \yii\helpers\Url::base();
$status = \frontend\controllers\UserCenterController::getClassStatus();
$this->beginPage();
$this->beginBody();
$this->beginContent('@app/views/layouts/center.php');
?>
<div class="tp-sidebar">
<div class="logo"><a href="<?= \yii\helpers\Url::base() ?>"><img
src="<?= AppAsset::getStaticUrl('img/logo.png') ?>"></a></div>
<div class="side-menu">
<!-- 左侧菜单 -->
<ul class="simple-menu">
<div class="tp-sidebar">
<div class="logo"><a href="<?= \yii\helpers\Url::base() ?>"><img
src="<?= AppAsset::getStaticUrl('img/logo.png') ?>"></a></div>
<div class="side-menu">
<!-- 左侧菜单 -->
<li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'info') ? 'class = "active"' : '' ?>>
<a href="<?= $baseUrl . '/user-center/' ?>"><i class="icon-person_pin"></i>个人信息</a>
</li>
<li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'purchased-course') ? 'class = "active"' : '' ?>>
<a href="<?= $baseUrl . '/user-center/purchased-course' ?>"><i
class="icon-shop"></i>已购课程</a></li>
<li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'favorite') ? 'class = "active"' : '' ?>>
<a href="<?= $baseUrl . '/user-center/favorite' ?>"><i class="icon-stars"></i>收藏纪录</a>
</li>
<li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'browse-record') ? 'class = "active"' : '' ?>>
<a href="<?= $baseUrl . '/user-center/browse-record' ?>"><i class="icon-visibility"></i>浏览记录</a>
</li>
<li><a href="<?=$baseUrl .'/classes-info'?>"><i class="icon-school"></i>我的课堂</a></li>
<li><a href="<?=$baseUrl .'/site/logout'?>"><i class="icon-power_settings_new"></i>退出登录</a></li>
<!--
<li><a href="<?/*=$baseUrl .'/my-course'*/?>"><i class="icon-school"></i>我的课堂</a></li>
<li><a href="<?/*=$baseUrl .'/site/logout'*/?>"><i class="icon-power_settings_new"></i>退出登录</a></li>
-->
</ul>
<div class="apply-class">
<button class="btn btn-danger" onclick="location.href='/classes-info/apply';">申请课堂</button>
</div>
<ul class="simple-menu">
<li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'info') ? 'class = "active"' : '' ?>>
<a href="<?= $baseUrl . '/user-center/' ?>"><i class="icon-person_pin"></i>个人信息</a>
</li>
<li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'purchased-course') ? 'class = "active"' : '' ?>>
<a href="<?= $baseUrl . '/user-center/purchased-course' ?>"><i
class="icon-shop"></i>已购课程</a></li>
<li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'favorite') ? 'class = "active"' : '' ?>>
<a href="<?= $baseUrl . '/user-center/favorite' ?>"><i class="icon-stars"></i>收藏纪录</a>
</li>
<li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'browse-record') ? 'class = "active"' : '' ?>>
<a href="<?= $baseUrl . '/user-center/browse-record' ?>"><i class="icon-visibility"></i>浏览记录</a>
</li>
</ul>
<div class="apply-class">
<?php if ($status === 0): ?>
<button class="btn btn-danger"
onclick="location.href='/classes-info/apply';">申请课堂
</button>
<?php elseif ($status === 2): ?>
<button class="btn btn-danger"
onclick="location.href='/classes-info/apply';">课堂审核中...
</button>
<?php elseif ($status === 1): ?>
<button class="btn btn-primary"
onclick="location.href='/classes-info';">我的课堂
</button>
<?php endif; ?>
</div>
<a class="loginout" href="<?= $baseUrl . '/site/logout' ?>"><i class="icon-power_settings_new"></i>退出登录</a>
</div>
</div>
</div>
<div class="auto-main">
<?= $this->render('centerHeader') ?>
<div class="tp-main">
<div class="container">
<?= $content ?>
<div class="auto-main">
<?= $this->render('centerHeader') ?>
<div class="tp-main">
<div class="container">
<?= $content ?>
</div>
</div>
</div>
</div>
<script type='text/javascript'>
$(function () {
$('.menu-btn').click(function () {
$('.tp-sidebar').animate({left:"0"});
$('.tp-sidebar').animate({left: "0"});
});
})
</script>
......
......@@ -37,6 +37,26 @@ $qiniu = \Yii::$app->qiniu;
</div>
</div>
<?php } ?>
<div class="col-md-4">
<div class="cls-box-main">
<div class="video-img-box">
<a href="#" target="_blank"><img src="http://dev.qdn.pp.cc/preview/f0/97/a3/f8s68SyefrZj3841.jpg-m.preview"></a>
<div class="video-list-cnt">
<div class="tit"><a href="#" target="_blank">课程名称</a></div>
<div class="teacher">讲师:万达</div>
<div class="description">这是一段文章介绍。。</div>
<div class="teacher">提交时间:2016-12-09 18:09</div>
</div>
<!--<span class="video-examine-icon">审</span>-->
<span class="video-examine-icon">荐</span>
<div class="edit"><a href="<?=Url::to(['my-course/edit', 'id'=>$course['id']])?>" title="编辑课程信息"><i class="icon-mode_edit"></i></a></div>
</div>
</div>
</div>
</div>
<div class="text-center">
......
......@@ -33,7 +33,7 @@ AppAsset::addCss($this, '@web/assets/css/course_publish.css');
</div>
<div class="cls-part">
<div class="tit">规则设定</div>
<div class="tit">规则设定<span class="required">*</span></div>
<div class="clearfix">
<div class="checkbox rules-set fl">
......
......@@ -17,13 +17,5 @@ $this->title = $name;
<div class="alert alert-danger">
<?= nl2br(Html::encode($message)) ?>
</div>
<p>
The above error occurred while the Web server was processing your request.
</p>
<p>
Please contact us if you think this is a server error. Thank you.
</p>
</div>
</div>
......@@ -34,7 +34,7 @@ $this->title = '密码设置成功';
</div>
<div class="foot-reg-btn">
<button class="btn btn-reg" onclick="window.location.href='<?= \yii\helpers\Url::base() . "/site" ?>'"
<button class="btn btn-reg" onclick="window.location.href='<?= \yii\helpers\Url::base() . "/site/login" ?>'"
type="submit">去登录
</button>
</div>
......
......@@ -14,6 +14,9 @@ AppAsset::addCss($this, '@web/assets/css/style.css');
\Yii::$app->controller->layout = 'blank';
$css = <<<CSS
body{
background-color: #fff;
}
.sus-tips {
position: absolute;
left: 50%;
......@@ -24,8 +27,6 @@ $css = <<<CSS
padding: 40px;
text-align: center;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0,0,0,.05);
}
.sus-tips i {
display: inline-block;
......
......@@ -7,6 +7,14 @@ AppAsset::addScript($this, '@web/assets/teacher_form.js');
AppAsset::addCss($this, '@web/assets/css/teacher_form.css');
?>
<style>
.simditor {
border: 1px solid #f3f3f3;
}
.simditor .simditor-body, .editor-style {
text-align: left;
}
</style>
<div class="add-box">
<div class="add-box-main">
<div class="tit"><?=$this->title?></div>
......@@ -20,7 +28,6 @@ AppAsset::addCss($this, '@web/assets/css/teacher_form.css');
<div class="teacher-info">
<textarea id="teacher-intro" name="intro" placeholder="请输入讲师介绍..."><?=$teacher->intro?></textarea>
<p class="text-number">20 / 500</p>
</div>
<input type="hidden" name="id" value="<?=$teacher->id?>">
......
......@@ -5,7 +5,6 @@
* Date: 2016/9/29
* Time: 上午9:59
*/
use frontend\assets\AppAsset;
use yii\widgets\LinkPager;
$baseUrl = \yii\helpers\Url::base();
......@@ -22,7 +21,7 @@ $this->title = '浏览记录';
<div class="col-md-4">
<div class="cls-box-main sm-box">
<div class="video-img-box">
<img src="<?= Yii::$app->qiniu->getUrl('public', $value['course']['preview_pic']) ?>">
<img src="<?= Yii::$app->qiniu->getUrl('public', $value['course']['preview_pic'].'-m.preview') ?>">
<div class="video-list-cnt">
<div class="tit"><a href="<?php echo $baseUrl.'/home/video?courseId='.$value['course']['id'];?>"><?=$value['course']['name']?></a></div>
......@@ -36,10 +35,10 @@ $this->title = '浏览记录';
<?php endforeach; ?>
</div>
<div class="teacher"><b>售价:¥<?=$value['course']['price']?></b></div>
<div class="teacher">售价:¥<?=$value['course']['price']?></div>
<div class="teacher">
购买日期:<?=date("Y-m-d H:i:s",$value['time'])?>
<b>日期:<?=date("Y-m-d H:i:s",$value['time'])?></b>
</div>
</div>
<!--<div class="outline">
......
......@@ -20,11 +20,11 @@ $this->title = '收藏记录';
<div class="col-md-4">
<div class="cls-box-main sm-box">
<div class="video-img-box">
<img src="<?= Yii::$app->qiniu->getUrl('public', $value['course']['preview_pic']) ?>">
<img src="<?= Yii::$app->qiniu->getUrl('public', $value['course']['preview_pic'].'-m.preview') ?>">
<div class="video-list-cnt">
<div class="tit"><a href="<?php echo $baseUrl.'/home/video?courseId='.$value['course']['id'];?>"><?=$value['course']['name']?></a></div>
<div class="teacher">
讲师:<?php foreach ($value['course']['teachers'] as $teaKey => $teaValue): ?>
讲师:<?php foreach ($value['course']['teachers'] as $teaKey => $teaValue): ?>
<?php if ($teaKey > 0): ?>
,<?= $teaValue['name']?>
<?php else: ?>
......@@ -32,10 +32,8 @@ $this->title = '收藏记录';
<?php endif ?>
<?php endforeach; ?>
</div>
<div class="price"><?=$value['course']['price']?></div>
</div>
<div class="outline">
<span><?=$value['course']['user']['username']?>收藏了该内容</span>
<div class="teacher">售价:¥<?=$value['course']['price']?></div>
<div class="teacher"><b><?=$value['course']['user']['username']?>收藏了该内容</b></div>
</div>
<div class="play-mask">
......@@ -62,3 +60,11 @@ $this->title = '收藏记录';
<?php endif;?>
<script type='text/javascript'>
$(function () {
turmbw = $('.video-img-box img').width();
turmbh = turmbw*5/9;
$('.video-img-box img,.play-mask').css('height',turmbh);
$('.play-mask').css('padding-top',turmbh/2-20);
})
</script>
\ No newline at end of file
......@@ -20,10 +20,9 @@ $this->title = '已购课程';
<div class="col-md-4">
<div class="cls-box-main sm-box">
<div class="video-img-box">
<img src="<?= Yii::$app->qiniu->getUrl('public', $value['courseWithTeachers']['preview_pic']) ?>">
<img src="<?= Yii::$app->qiniu->getUrl('public', $value['courseWithTeachers']['preview_pic'].'-m.preview') ?>">
<div class="video-list-cnt">
<div class="tit"><a href="<?php echo $baseUrl.'/home/video?courseId='.$value['courseWithTeachers']['id'];?>"><?=$value['courseWithTeachers']['name']?></a></div>
<div class="price"><?=$value['courseWithTeachers']['price']?></div>
<div class="teacher">
讲师:<?php foreach ($value['courseWithTeachers']['teachers'] as $teaKey => $teaValue): ?>
<?php if ($teaKey > 0): ?>
......@@ -32,9 +31,11 @@ $this->title = '已购课程';
<?= $teaValue['name']?>
<?php endif ?>
<?php endforeach; ?>
</div> </div>
<div class="outline">
<span>购买日期:<?=date("Y-m-d H:i:s",$value['updated_at'])?></span>
</div>
<div class="teacher"><?=$value['courseWithTeachers']['price']?></div>
<div class="teacher">
<b><span>购买日期:<?=date("Y-m-d H:i:s",$value['updated_at'])?></span></b>
</div>
</div>
......@@ -60,3 +61,12 @@ $this->title = '已购课程';
</div>
<?php endif;?>
<script type='text/javascript'>
$(function () {
turmbw = $('.video-img-box img').width();
turmbh = turmbw*5/9;
$('.video-img-box img,.play-mask').css('height',turmbh);
$('.play-mask').css('padding-top',turmbh/2-20);
})
</script>
......@@ -6,6 +6,9 @@ body {
a,a:hover,a:link {
text-decoration: none;
}
.mx900 {
max-width: 900px!important;
}
/*icomoon*/
@font-face {
......@@ -303,9 +306,6 @@ a,a:hover,a:link {
/* Swiper幻灯 */
.swiper-container {
width: 100%;
height: 500px;
}
.swiper-slide {
text-align: center;
......@@ -326,14 +326,17 @@ a,a:hover,a:link {
-webkit-align-items: center;
align-items: center;
}
.swiper-slide img {
width: 100%;
}
/*视频列表*/
.v-list {
margin-top: 20px;
}
.v-main-box {
padding-bottom: 10px;
background-color: #fff;
height: 300px;
margin-bottom: 20px;
-webkit-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
......@@ -342,12 +345,13 @@ a,a:hover,a:link {
.v-screen {
position: relative;
width: 100%;
height: 200px;
overflow: hidden;
}
.v-screen a {
position: relative;
display: block;
height: 150px;
overflow: hidden;
}
.v-screen > span {
......@@ -373,7 +377,7 @@ a,a:hover,a:link {
}
.v-tit {
height: 40px;
line-height: 40px;
line-height: 45px;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
......@@ -382,6 +386,8 @@ a,a:hover,a:link {
.v-teacher-list {
font-size: 12px;
color: #666;
height: 22px;
line-height: 22px;
}
.v-tit a {
color: #333333;
......@@ -410,18 +416,17 @@ a,a:hover,a:link {
}
.v-main-box:hover .play-mask {
display: inline-block;
line-height: 200px;
}
.play-mask {
display: none;
position: absolute;
background-color: rgba(0,0,0,.3);
width: 100%;
height: 200px;
left: 0;
top: 0;
height: 180px;
line-height: 180px;
text-align: center;
line-height: 200px;
font-size: 64px;
color: #fff;
-webkit-transition: all 0.4s ease;
......@@ -508,6 +513,7 @@ a,a:hover,a:link {
display: inline-block;
text-align: center;
width: 60px;
cursor: pointer;
}
.video-teacher a {
color: #333;
......@@ -571,6 +577,11 @@ a,a:hover,a:link {
.video-description .text {
color: #999;
}
.video-description .text img {
max-width: 100%;
border: none;
vertical-align: top;
}
.video-comment {
margin-top: 30px;
......@@ -599,6 +610,7 @@ a,a:hover,a:link {
position: relative;
padding-left: 60px;
margin-top: 20px;
padding-bottom: 40px;
}
.comment-head img {
width: 50px;
......@@ -662,6 +674,7 @@ a,a:hover,a:link {
max-width: 500px;
margin: 0 auto;
color: #666;
word-break: break-all;
}
......@@ -789,4 +802,16 @@ a,a:hover,a:link {
border-top: 1px solid #f3f3f3;
z-index: 10
}
}
\ No newline at end of file
}
/*分享样式修改*/
.bd_weixin_popup_head {
font-size: 14px!important;
}
.bd_weixin_popup {
width: 260px!important;
height: 300px!important;
border: 1px solid transparent!important;
}
......@@ -4,7 +4,9 @@ html {
background-color: #f3f3f3;
font-family: "Helvitica Neue",Helvitica,Arial,"Hiragino Sans GB","Microsoft YaHei","Arial Regular","Microsoft JhengHei",sans-serif;
}
a.active {
text-decoration: none;
}
.auto-main {
padding-left: 225px;
height: 100px;
......@@ -152,11 +154,11 @@ html {
padding-right: 30px;
height: 60px;
}
.avatar a {
.avatar > a {
display: block;
margin-top: 15px;
}
.avatar a img {
.avatar > a > img {
height: 30px;
width: 30px;
border-radius: 100%;
......@@ -169,13 +171,38 @@ html {
color: #999;
text-align: center;
}
.updownmenu {
display: none;
width: 120px;
position: absolute;
top:59px;
right: 0;
background-color: #fff;
border: 1px solid #e7e7e7;
text-align: center;
box-shadow: 1px 1px 20px rgba(0,0,0,.1);
}
.updownmenu li a {
display: block;
padding: 0 20px;
height: 44px;
line-height: 44px;
color: #333;
border-bottom: 1px solid #f3f3f3;
}
.updownmenu li a:hover {
background-color: #f3f3f3;
}
.avatar:hover .updownmenu {
display: block;
}
/*main*/
.tp-main {
width: 100%;
margin-top: 90px;
margin-bottom: 90px;
padding-bottom: 120px;
}
.class-name {
......@@ -192,6 +219,7 @@ html {
width: 100px;
text-align: center;
background-color: transparent;
color: #fff;
}
.edit-class-name input:focus {
border-bottom: 1px solid #fff;
......@@ -201,6 +229,9 @@ html {
border: none;
color: #fff;
}
.nomal-class-name a {
color: #fff;
}
.class-intro {
height: 400px;
border-radius: 3px;
......@@ -545,8 +576,6 @@ html {
.teacher-info {
position: relative;
margin: 20px 0;
height: 200px;
border-bottom: 1px solid #e7e7e7;
}
.teacher-info textarea {
width: 100%;
......@@ -963,6 +992,25 @@ textarea.input-r-control {
display: inline-block;
}
.video-examine-icon {
display: block;
position: absolute;
width: 30px;
height: 30px;
text-align: center;
line-height: 30px;
top: 10px;
left: 10px;
font-size: 14px;
background-color: rgba(0,0,0,.5);
color: #fff;
border-radius: 100%;
}
.video-img-box:hover .video-examine-icon {
background-color: red;
}
.examine-box {
margin-top: 100px;
}
......@@ -1152,7 +1200,7 @@ textarea.input-r-control {
.sm-box .price {
height: 40px;
line-height: 40px;
color: #f11300;
color: #666;
}
.play-mask {
position: absolute;
......@@ -1212,6 +1260,34 @@ textarea.input-r-control {
color: #999;
}
.loginout {
position: absolute;
display: inline-block;
width: 225px;
height: 50px;
text-align: center;
line-height: 50px;
bottom: 0;
left: 0;
background-color: #313a46;
color: #999;
}
.loginout:hover {
color: #fff;
}
.loginout i {
font-size: 14px;
padding-right: 10px;
}
/*编辑器边框颜色*/
.simditor {
border: 1px solid #f3f3f3!important;
}
.simditor-body {
text-align: left!important;
}
@media (max-width: 767px) {
.tp-sidebar {
......
<template>
<div class="container v-list" v-show="lists.length > 0">
<div class="container v-list mx900" v-show="lists.length > 0">
<div class="row">
<div v-for="(index,item) in lists" class="col-md-4">
<div class="v-main-box">
......@@ -12,9 +12,10 @@
</div>
<div class="v-tit"><a @click="itemClick(item.id)" href="javascript:;">{{item.name}}</a></div>
<div v-if="item.teachers.length > 0" class="v-teacher-list">
讲师:{{getTeachers(index)}}
<div class="v-teacher-list">
<span v-if="item.teachers.length > 0">讲师:{{getTeachers(index)}}</span>
</div>
<div class="v-foot">
<div class="v-price">
<small>¥</small>
......@@ -65,7 +66,7 @@
,
getFullPreViewPic(pic)
{
return __QINIU_URL__ + '/' + pic;
return __QINIU_URL__ + '/' + pic+'-m.preview';
}
,
moreClick()
......
<template>
<div class="container m-t-20">
<div class="swiper-container" v-if="lists.length !== 0">
<div class="container m-t-20 mx900">
<div class="swiper-container" id="getWidth" v-if="lists.length !== 0">
<div class="swiper-wrapper">
<div v-for="item in lists" @click="itemClick(item.id)" class="swiper-slide"
:style="{background: 'url('+getFullPreViewPic(item.preview_pic)+') top center no-repeat'}">
{{item.name}}
<div v-for="item in lists" @click="itemClick(item.id)" class="swiper-slide">
<!--{{item.name}}-->
<img :src="getFullPreViewPic(item.preview_pic)">
</div>
</div>
<div class="swiper-pagination"></div>
......@@ -30,7 +30,7 @@
watch: {
lists(){
this.$nextTick(function () {
new Swiper('.swiper-container', {
var mySwiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev',
......@@ -38,8 +38,10 @@
spaceBetween: 30,
centeredSlides: true,
autoplay: 2500,
autoHeight:true,
autoplayDisableOnInteraction: false
});
});
}
},
......@@ -48,7 +50,7 @@
window.location.href = __BASE_URL__ + 'home/video?courseId=' + id;
},
getFullPreViewPic(pic){
return __QINIU_URL__ + '/' + pic;
return __QINIU_URL__ + '/' + pic+'-l.preview';
},
getLists(classId){
var url = __BASE_URL__ + 'home/get-recommend-courses?classId=' + classId;
......
......@@ -2,7 +2,7 @@
<div class="warp-box">
<div class="container">
<div class="video-description">
<div class="title">视频介绍</div>
<div class="title">课程介绍</div>
<div class="text">
{{{coursewareInfo.intro}}}
</div>
......@@ -17,13 +17,19 @@
需要 <a @click="login" href="javascript:;">登录</a> 才能评论
</div>
<div v-else class="comment-box">
<div class="comment-head">
<img :src="coursewareInfo.userAvatar">
</div>
<div class="comment-input clearfix">
<div class="comment-input">
<textarea v-model="content" cols="30" rows="10" class="form-control"
placeholder="说几句吧,亲..."></textarea>
<button @click="comment" class="btn btn-default pull-right m-t-10">发表评论</button>
<div class="comment-foot clearfix">
<div class="comment-head pull-left">
<img :src="coursewareInfo.userAvatar">
</div>
<button @click="comment" class="btn btn-default pull-right m-t-10">发表评论</button>
</div>
</div>
</div>
......
......@@ -8,21 +8,14 @@
<a href="javascript:;" class="qzone post-icons bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
</div>
</div>
<div class="video-main">
<video id="my-video-play" class="video-js vjs-default-skin vjs-big-play-centered"
controls preload="auto">
<source :src="coursewareInfo.videoUrl"/>
</video>
</div>
<myvideo :preview-url="coursewareInfo.previewUrl" :video-url="coursewareInfo.videoUrl"></myvideo>
<div class="video-detail-info">
<div v-for="(index,item) in coursewareInfo.teachers" class="video-teacher">
<a data-toggle="modal" data-target="{{{'#teacherInfo'+index}}}"><img
:src="item.avatar"></a>
<p><a href="javascript:;" data-toggle="modal" data-target="#myModal2">{{item.name}}</a></p>
</div>
<div class="video-sm-info pull-right" style="width:100%">
<div class="video-sm-info pull-right">
<p class="mb-right">
<a href="javascript:;"><i class="icon-comment-empty"></i>{{coursewareInfo.comment_count}}</a>
<a @click="favorite" href="javascript:;"><i
......@@ -110,14 +103,8 @@
</div>
</template>
<script>
require('expose?videojs!../../libs/videojs/video.js');
require('../../libs/videojs/video-js.css');
require('../../libs/videojs/lang/zh-CN.js');
videojs.options.flash.swf = __CDN_URL__ + 'assets/videojs/video-js.swf';
window.VIDEOJS_NO_BASE_THEME = true;
import Utils from '../../libs/utils';
import myvideo from './video.vue';
export default{
data(){
return {
......@@ -242,31 +229,14 @@
require: true
}
},
components: {},
components: {
myvideo:myvideo
},
ready(){
var self = this;
this.isMobile = this.coursewareInfo.isMobile;
this.isWeixin = Utils.isWeixin();
videojs("my-video-play", {
"techOrder": ['html5','flash'],
"controls": true,
"autoplay": false,
"language": "zh-CN",
poster: this.coursewareInfo.previewUrl
}).ready(function () {
self.videoShow = true;
var rate = 9 / 16;
$('#my-video-play').css('width', '100%');
var wVideo = $('.video-detail-info').width();
var hVideo = wVideo * rate;
$('#my-video-play').css('height', hVideo);
window.onresize = function () {
var wVideo = $('.video-detail-info').width();
var hVideo = wVideo * rate;
$('#my-video-play').css('height', hVideo);
};
});
}
}
......@@ -275,5 +245,8 @@
</script>
<template>
<div style="width:100%;height:100%" class="video-main">
<video id="my-video-play" class="video-js vjs-default-skin vjs-big-play-centered"
controls preload="auto">
<source :src="videoUrl"/>
</video>
</div>
</template>
<script>
require('expose?videojs!../../libs/videojs/video.js');
require('../../libs/videojs/video-js.css');
require('../../libs/videojs/lang/zh-CN.js');
videojs.options.flash.swf = __CDN_URL__ + 'assets/videojs/video-js.swf';
window.VIDEOJS_NO_BASE_THEME = true;
export default{
data(){
return {}
},
props: {
videoUrl: String,
previewUrl: String
},
ready(){
var self = this;
var rate = 9 / 16;
var w = $('.video-main').width();
var h = w * rate;
videojs("my-video-play", {
"techOrder": ['html5', 'flash'],
"controls": true,
"autoplay": false,
"language": "zh-CN",
"width": w,
"height": h,
"poster": self.previewUrl
}).ready(function () {
$('#my-video-play').css('width', '100%');
var wVideo = $('.video-detail-info').width();
var hVideo = wVideo * rate;
$('#my-video-play').css('height', hVideo);
window.onresize = function () {
var wVideo = $('.video-detail-info').width();
var hVideo = wVideo * rate;
$('#my-video-play').css('height', hVideo);
};
});
}
}
</script>
......@@ -7,7 +7,7 @@ var courseLists = require('./components/course-lists.vue');
var classInfo = JSON.parse($('#class-info').val());
//logo定制
var html = '<a href="' + __BASE_URL__ + 'user-center/'+'">' + classInfo.name + '</a>'
var html = '<a href="' + __BASE_URL__ + 'home?classId='+classInfo.id+'">' + classInfo.name+ '</a>';
$('#main-logo').empty().html(html);
//注册定制
var href = $('#main-sign').attr("href")
......
......@@ -7,6 +7,7 @@
<div class="d-i-b" v-if="addFormShow">
<input type="text" class="input-r-control reset-input" placeholder="请输入讲师名称" v-model="newName" v-el:nameInput>
<button type="button" class="btn btn-nobg" @click="addTeacher">保存</button>
<button type="button" class="btn btn-nobg" @click="addFormShow=false">取消</button>
</div>
<span class="m-l-10" v-else><a href="javascript:;" @click="showAddForm">+ 添加讲师</a></span>
</div>
......
......@@ -85,6 +85,7 @@ var vm = new Vue({
$.post("/my-course/save", data, function(t) {
layer.close(idx);
if (t.status) {
window.onbeforeunload=null;
layer.msg('成功修改课程信息。', {
time: 2000,
icon: 1,
......@@ -109,4 +110,9 @@ var vm = new Vue({
richText.createEditor($("#introEditor"), this.tmp);
}
});
\ No newline at end of file
});
//添加关闭提示页面
window.onbeforeunload=function () {
var warning="确认退出?";
return warning;
};
\ No newline at end of file
......@@ -103,6 +103,7 @@ var vm = new Vue({
$.post("/my-course/submit", data, function(t) {
layer.close(idx);
if (t.status) {
window.onbeforeunload=null;
location.replace("/my-course/result?id=" + t.data.course_id + "&action=publish");
} else {
layer.alert(t.message, {icon:5, title:"提示"});
......@@ -120,4 +121,11 @@ var vm = new Vue({
richText.createEditor($("#introEditor"), this.tmp);
}
});
\ No newline at end of file
});
//添加关闭提示页面
window.onbeforeunload=function () {
var warning="确认退出?";
return warning;
};
\ No newline at end of file
<template>
<div id="edit-container" class="add-box" v-if="showEdit">
<div class="add-box-main">
<div class="tit">基本信息</div>
<div class="tit">个人信息</div>
<avatar-upload :avatar="avatarsrc" :uptoken="publicToken"></avatar-upload>
......@@ -26,7 +26,7 @@
<div v-if="!showEdit" id="normal-container" class="add-box">
<div class="add-box-main">
<div class="tit">基本信息</div>
<div class="tit">个人信息</div>
<div class="upload-avatar">
<img id="avatar-uploader"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment