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; ...@@ -12,6 +12,7 @@ use frontend\models\TokenInputForm;
use Yii; use Yii;
use yii\filters\AccessControl; use yii\filters\AccessControl;
use yii\helpers\HtmlPurifier; use yii\helpers\HtmlPurifier;
use yii\helpers\Url;
use yii\web\Controller; use yii\web\Controller;
/** /**
...@@ -94,12 +95,19 @@ class SiteController extends Controller ...@@ -94,12 +95,19 @@ class SiteController extends Controller
*/ */
public function actionLogin() public function actionLogin()
{ {
if (!Yii::$app->user->isGuest) { if (!Yii::$app->user->isGuest) {
return $this->goHome(); return $this->goHome();
} }
$model = new LoginForm(); $model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) { 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(); return $this->goBack();
} else { } else {
return $this->render('login', [ return $this->render('login', [
......
...@@ -12,6 +12,7 @@ namespace frontend\controllers; ...@@ -12,6 +12,7 @@ namespace frontend\controllers;
use common\libs\Test; use common\libs\Test;
use common\libs\Utils; use common\libs\Utils;
use common\models\BrowseRecord; use common\models\BrowseRecord;
use common\models\Classes;
use common\models\Favorite; use common\models\Favorite;
use common\models\Orders; use common\models\Orders;
use common\models\UploadPools; use common\models\UploadPools;
...@@ -46,6 +47,24 @@ class UserCenterController extends Controller ...@@ -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; ...@@ -11,7 +11,7 @@ use yii\helpers\Url;
$this->title = '我的课堂'; $this->title = '我的课堂';
?> ?>
<div class="class-name"> <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> <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> </div>
......
...@@ -15,5 +15,15 @@ $this->registerMetaTag(['name' => 'keywords', 'content' => $classInfo['name']]); ...@@ -15,5 +15,15 @@ $this->registerMetaTag(['name' => 'keywords', 'content' => $classInfo['name']]);
<course-lists :class-id="classId"></course-lists> <course-lists :class-id="classId"></course-lists>
</div> </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> <div class="copyright m-t-20">© 2016 c.pp.cc 皖ICP备13046642号</div>
...@@ -34,6 +34,9 @@ $this->registerJs($js); ...@@ -34,6 +34,9 @@ $this->registerJs($js);
\frontend\assets\AppAsset::addScript($this, '@web/assets/home_video.js'); \frontend\assets\AppAsset::addScript($this, '@web/assets/home_video.js');
\frontend\assets\AppAsset::addCss($this, '@web/assets/css/home_video.css'); \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)) ?>"/> <input type="hidden" id="courseware-info" value="<?= \yii\helpers\Html::encode(json_encode($coursewareInfo)) ?>"/>
<div id="video-container"> <div id="video-container">
<video-play :courseware-info="coursewareInfo"></video-play> <video-play :courseware-info="coursewareInfo"></video-play>
...@@ -42,3 +45,12 @@ $this->registerJs($js); ...@@ -42,3 +45,12 @@ $this->registerJs($js);
<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备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 @@ ...@@ -8,5 +8,15 @@
?> ?>
<div class="tp-head navbar-fixed-top clearfix"> <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="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> </div>
...@@ -40,6 +40,7 @@ $this->beginContent('@app/views/layouts/center.php'); ...@@ -40,6 +40,7 @@ $this->beginContent('@app/views/layouts/center.php');
</ul> </ul>
</li> </li>
</ul> </ul>
<a class="loginout" href="<?=\yii\helpers\Url::base() .'/site/logout'?>"><i class="icon-power_settings_new"></i>退出登录</a>
</div> </div>
</div> </div>
......
...@@ -4,61 +4,66 @@ use frontend\assets\AppAsset; ...@@ -4,61 +4,66 @@ use frontend\assets\AppAsset;
/* @var $this \yii\web\View */ /* @var $this \yii\web\View */
/* @var $content string */ /* @var $content string */
$baseUrl = \yii\helpers\Url::base(); $baseUrl = \yii\helpers\Url::base();
$status = \frontend\controllers\UserCenterController::getClassStatus();
$this->beginPage(); $this->beginPage();
$this->beginBody(); $this->beginBody();
$this->beginContent('@app/views/layouts/center.php'); $this->beginContent('@app/views/layouts/center.php');
?> ?>
<div class="tp-sidebar"> <div class="tp-sidebar">
<div class="logo"><a href="<?= \yii\helpers\Url::base() ?>"><img <div class="logo"><a href="<?= \yii\helpers\Url::base() ?>"><img
src="<?= AppAsset::getStaticUrl('img/logo.png') ?>"></a></div> src="<?= AppAsset::getStaticUrl('img/logo.png') ?>"></a></div>
<div class="side-menu"> <div class="side-menu">
<!-- 左侧菜单 --> <!-- 左侧菜单 -->
<ul class="simple-menu">
<li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'info') ? 'class = "active"' : '' ?>> <ul class="simple-menu">
<a href="<?= $baseUrl . '/user-center/' ?>"><i class="icon-person_pin"></i>个人信息</a> <li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'info') ? 'class = "active"' : '' ?>>
</li> <a href="<?= $baseUrl . '/user-center/' ?>"><i class="icon-person_pin"></i>个人信息</a>
<li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'purchased-course') ? 'class = "active"' : '' ?>> </li>
<a href="<?= $baseUrl . '/user-center/purchased-course' ?>"><i <li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'purchased-course') ? 'class = "active"' : '' ?>>
class="icon-shop"></i>已购课程</a></li> <a href="<?= $baseUrl . '/user-center/purchased-course' ?>"><i
<li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'favorite') ? 'class = "active"' : '' ?>> class="icon-shop"></i>已购课程</a></li>
<a href="<?= $baseUrl . '/user-center/favorite' ?>"><i class="icon-stars"></i>收藏纪录</a> <li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'favorite') ? 'class = "active"' : '' ?>>
</li> <a href="<?= $baseUrl . '/user-center/favorite' ?>"><i class="icon-stars"></i>收藏纪录</a>
<li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'browse-record') ? 'class = "active"' : '' ?>> </li>
<a href="<?= $baseUrl . '/user-center/browse-record' ?>"><i class="icon-visibility"></i>浏览记录</a> <li <?= (Yii::$app->controller->id === 'user-center' and Yii::$app->controller->action->id === 'browse-record') ? 'class = "active"' : '' ?>>
</li> <a href="<?= $baseUrl . '/user-center/browse-record' ?>"><i class="icon-visibility"></i>浏览记录</a>
<li><a href="<?=$baseUrl .'/classes-info'?>"><i class="icon-school"></i>我的课堂</a></li> </li>
<li><a href="<?=$baseUrl .'/site/logout'?>"><i class="icon-power_settings_new"></i>退出登录</a></li> </ul>
<!--
<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>
<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> <div class="auto-main">
<div class="auto-main"> <?= $this->render('centerHeader') ?>
<?= $this->render('centerHeader') ?> <div class="tp-main">
<div class="tp-main"> <div class="container">
<div class="container"> <?= $content ?>
<?= $content ?> </div>
</div> </div>
</div> </div>
</div>
<script type='text/javascript'> <script type='text/javascript'>
$(function () { $(function () {
$('.menu-btn').click(function () { $('.menu-btn').click(function () {
$('.tp-sidebar').animate({left:"0"}); $('.tp-sidebar').animate({left: "0"});
}); });
}) })
</script> </script>
......
...@@ -37,6 +37,26 @@ $qiniu = \Yii::$app->qiniu; ...@@ -37,6 +37,26 @@ $qiniu = \Yii::$app->qiniu;
</div> </div>
</div> </div>
<?php } ?> <?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>
<div class="text-center"> <div class="text-center">
......
...@@ -33,7 +33,7 @@ AppAsset::addCss($this, '@web/assets/css/course_publish.css'); ...@@ -33,7 +33,7 @@ AppAsset::addCss($this, '@web/assets/css/course_publish.css');
</div> </div>
<div class="cls-part"> <div class="cls-part">
<div class="tit">规则设定</div> <div class="tit">规则设定<span class="required">*</span></div>
<div class="clearfix"> <div class="clearfix">
<div class="checkbox rules-set fl"> <div class="checkbox rules-set fl">
......
...@@ -17,13 +17,5 @@ $this->title = $name; ...@@ -17,13 +17,5 @@ $this->title = $name;
<div class="alert alert-danger"> <div class="alert alert-danger">
<?= nl2br(Html::encode($message)) ?> <?= nl2br(Html::encode($message)) ?>
</div> </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>
</div> </div>
...@@ -34,7 +34,7 @@ $this->title = '密码设置成功'; ...@@ -34,7 +34,7 @@ $this->title = '密码设置成功';
</div> </div>
<div class="foot-reg-btn"> <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">去登录 type="submit">去登录
</button> </button>
</div> </div>
......
...@@ -14,6 +14,9 @@ AppAsset::addCss($this, '@web/assets/css/style.css'); ...@@ -14,6 +14,9 @@ AppAsset::addCss($this, '@web/assets/css/style.css');
\Yii::$app->controller->layout = 'blank'; \Yii::$app->controller->layout = 'blank';
$css = <<<CSS $css = <<<CSS
body{
background-color: #fff;
}
.sus-tips { .sus-tips {
position: absolute; position: absolute;
left: 50%; left: 50%;
...@@ -24,8 +27,6 @@ $css = <<<CSS ...@@ -24,8 +27,6 @@ $css = <<<CSS
padding: 40px; padding: 40px;
text-align: center; text-align: center;
background-color: #fff; background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0,0,0,.05);
} }
.sus-tips i { .sus-tips i {
display: inline-block; display: inline-block;
......
...@@ -7,6 +7,14 @@ AppAsset::addScript($this, '@web/assets/teacher_form.js'); ...@@ -7,6 +7,14 @@ AppAsset::addScript($this, '@web/assets/teacher_form.js');
AppAsset::addCss($this, '@web/assets/css/teacher_form.css'); 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">
<div class="add-box-main"> <div class="add-box-main">
<div class="tit"><?=$this->title?></div> <div class="tit"><?=$this->title?></div>
...@@ -20,7 +28,6 @@ AppAsset::addCss($this, '@web/assets/css/teacher_form.css'); ...@@ -20,7 +28,6 @@ AppAsset::addCss($this, '@web/assets/css/teacher_form.css');
<div class="teacher-info"> <div class="teacher-info">
<textarea id="teacher-intro" name="intro" placeholder="请输入讲师介绍..."><?=$teacher->intro?></textarea> <textarea id="teacher-intro" name="intro" placeholder="请输入讲师介绍..."><?=$teacher->intro?></textarea>
<p class="text-number">20 / 500</p>
</div> </div>
<input type="hidden" name="id" value="<?=$teacher->id?>"> <input type="hidden" name="id" value="<?=$teacher->id?>">
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Date: 2016/9/29 * Date: 2016/9/29
* Time: 上午9:59 * Time: 上午9:59
*/ */
use frontend\assets\AppAsset;
use yii\widgets\LinkPager; use yii\widgets\LinkPager;
$baseUrl = \yii\helpers\Url::base(); $baseUrl = \yii\helpers\Url::base();
...@@ -22,7 +21,7 @@ $this->title = '浏览记录'; ...@@ -22,7 +21,7 @@ $this->title = '浏览记录';
<div class="col-md-4"> <div class="col-md-4">
<div class="cls-box-main sm-box"> <div class="cls-box-main sm-box">
<div class="video-img-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="video-list-cnt">
<div class="tit"><a href="<?php echo $baseUrl.'/home/video?courseId='.$value['course']['id'];?>"><?=$value['course']['name']?></a></div> <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 = '浏览记录'; ...@@ -36,10 +35,10 @@ $this->title = '浏览记录';
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<div class="teacher"><b>售价:¥<?=$value['course']['price']?></b></div> <div class="teacher">售价:¥<?=$value['course']['price']?></div>
<div class="teacher"> <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> </div>
<!--<div class="outline"> <!--<div class="outline">
......
...@@ -20,11 +20,11 @@ $this->title = '收藏记录'; ...@@ -20,11 +20,11 @@ $this->title = '收藏记录';
<div class="col-md-4"> <div class="col-md-4">
<div class="cls-box-main sm-box"> <div class="cls-box-main sm-box">
<div class="video-img-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="video-list-cnt">
<div class="tit"><a href="<?php echo $baseUrl.'/home/video?courseId='.$value['course']['id'];?>"><?=$value['course']['name']?></a></div> <div class="tit"><a href="<?php echo $baseUrl.'/home/video?courseId='.$value['course']['id'];?>"><?=$value['course']['name']?></a></div>
<div class="teacher"> <div class="teacher">
讲师:<?php foreach ($value['course']['teachers'] as $teaKey => $teaValue): ?> 讲师:<?php foreach ($value['course']['teachers'] as $teaKey => $teaValue): ?>
<?php if ($teaKey > 0): ?> <?php if ($teaKey > 0): ?>
,<?= $teaValue['name']?> ,<?= $teaValue['name']?>
<?php else: ?> <?php else: ?>
...@@ -32,10 +32,8 @@ $this->title = '收藏记录'; ...@@ -32,10 +32,8 @@ $this->title = '收藏记录';
<?php endif ?> <?php endif ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<div class="price"><?=$value['course']['price']?></div> <div class="teacher">售价:¥<?=$value['course']['price']?></div>
</div> <div class="teacher"><b><?=$value['course']['user']['username']?>收藏了该内容</b></div>
<div class="outline">
<span><?=$value['course']['user']['username']?>收藏了该内容</span>
</div> </div>
<div class="play-mask"> <div class="play-mask">
...@@ -62,3 +60,11 @@ $this->title = '收藏记录'; ...@@ -62,3 +60,11 @@ $this->title = '收藏记录';
<?php endif;?> <?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 = '已购课程'; ...@@ -20,10 +20,9 @@ $this->title = '已购课程';
<div class="col-md-4"> <div class="col-md-4">
<div class="cls-box-main sm-box"> <div class="cls-box-main sm-box">
<div class="video-img-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="video-list-cnt">
<div class="tit"><a href="<?php echo $baseUrl.'/home/video?courseId='.$value['courseWithTeachers']['id'];?>"><?=$value['courseWithTeachers']['name']?></a></div> <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"> <div class="teacher">
讲师:<?php foreach ($value['courseWithTeachers']['teachers'] as $teaKey => $teaValue): ?> 讲师:<?php foreach ($value['courseWithTeachers']['teachers'] as $teaKey => $teaValue): ?>
<?php if ($teaKey > 0): ?> <?php if ($teaKey > 0): ?>
...@@ -32,9 +31,11 @@ $this->title = '已购课程'; ...@@ -32,9 +31,11 @@ $this->title = '已购课程';
<?= $teaValue['name']?> <?= $teaValue['name']?>
<?php endif ?> <?php endif ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div> </div>
<div class="outline"> <div class="teacher"><?=$value['courseWithTeachers']['price']?></div>
<span>购买日期:<?=date("Y-m-d H:i:s",$value['updated_at'])?></span> <div class="teacher">
<b><span>购买日期:<?=date("Y-m-d H:i:s",$value['updated_at'])?></span></b>
</div>
</div> </div>
...@@ -60,3 +61,12 @@ $this->title = '已购课程'; ...@@ -60,3 +61,12 @@ $this->title = '已购课程';
</div> </div>
<?php endif;?> <?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 { ...@@ -6,6 +6,9 @@ body {
a,a:hover,a:link { a,a:hover,a:link {
text-decoration: none; text-decoration: none;
} }
.mx900 {
max-width: 900px!important;
}
/*icomoon*/ /*icomoon*/
@font-face { @font-face {
...@@ -303,9 +306,6 @@ a,a:hover,a:link { ...@@ -303,9 +306,6 @@ a,a:hover,a:link {
/* Swiper幻灯 */ /* Swiper幻灯 */
.swiper-container { .swiper-container {
width: 100%;
height: 500px;
} }
.swiper-slide { .swiper-slide {
text-align: center; text-align: center;
...@@ -326,14 +326,17 @@ a,a:hover,a:link { ...@@ -326,14 +326,17 @@ a,a:hover,a:link {
-webkit-align-items: center; -webkit-align-items: center;
align-items: center; align-items: center;
} }
.swiper-slide img {
width: 100%;
}
/*视频列表*/ /*视频列表*/
.v-list { .v-list {
margin-top: 20px; margin-top: 20px;
} }
.v-main-box { .v-main-box {
padding-bottom: 10px;
background-color: #fff; background-color: #fff;
height: 300px;
margin-bottom: 20px; margin-bottom: 20px;
-webkit-transition: all 0.4s ease; -webkit-transition: all 0.4s ease;
-o-transition: all 0.4s ease; -o-transition: all 0.4s ease;
...@@ -342,12 +345,13 @@ a,a:hover,a:link { ...@@ -342,12 +345,13 @@ a,a:hover,a:link {
.v-screen { .v-screen {
position: relative; position: relative;
width: 100%; width: 100%;
height: 200px;
overflow: hidden; overflow: hidden;
} }
.v-screen a { .v-screen a {
position: relative; position: relative;
display: block; display: block;
height: 150px;
overflow: hidden;
} }
.v-screen > span { .v-screen > span {
...@@ -373,7 +377,7 @@ a,a:hover,a:link { ...@@ -373,7 +377,7 @@ a,a:hover,a:link {
} }
.v-tit { .v-tit {
height: 40px; height: 40px;
line-height: 40px; line-height: 45px;
font-size: 14px; font-size: 14px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -382,6 +386,8 @@ a,a:hover,a:link { ...@@ -382,6 +386,8 @@ a,a:hover,a:link {
.v-teacher-list { .v-teacher-list {
font-size: 12px; font-size: 12px;
color: #666; color: #666;
height: 22px;
line-height: 22px;
} }
.v-tit a { .v-tit a {
color: #333333; color: #333333;
...@@ -410,18 +416,17 @@ a,a:hover,a:link { ...@@ -410,18 +416,17 @@ a,a:hover,a:link {
} }
.v-main-box:hover .play-mask { .v-main-box:hover .play-mask {
display: inline-block; display: inline-block;
line-height: 200px;
} }
.play-mask { .play-mask {
display: none; display: none;
position: absolute; position: absolute;
background-color: rgba(0,0,0,.3); background-color: rgba(0,0,0,.3);
width: 100%; width: 100%;
height: 200px;
left: 0; left: 0;
top: 0; top: 0;
height: 180px;
line-height: 180px;
text-align: center; text-align: center;
line-height: 200px;
font-size: 64px; font-size: 64px;
color: #fff; color: #fff;
-webkit-transition: all 0.4s ease; -webkit-transition: all 0.4s ease;
...@@ -508,6 +513,7 @@ a,a:hover,a:link { ...@@ -508,6 +513,7 @@ a,a:hover,a:link {
display: inline-block; display: inline-block;
text-align: center; text-align: center;
width: 60px; width: 60px;
cursor: pointer;
} }
.video-teacher a { .video-teacher a {
color: #333; color: #333;
...@@ -571,6 +577,11 @@ a,a:hover,a:link { ...@@ -571,6 +577,11 @@ a,a:hover,a:link {
.video-description .text { .video-description .text {
color: #999; color: #999;
} }
.video-description .text img {
max-width: 100%;
border: none;
vertical-align: top;
}
.video-comment { .video-comment {
margin-top: 30px; margin-top: 30px;
...@@ -599,6 +610,7 @@ a,a:hover,a:link { ...@@ -599,6 +610,7 @@ a,a:hover,a:link {
position: relative; position: relative;
padding-left: 60px; padding-left: 60px;
margin-top: 20px; margin-top: 20px;
padding-bottom: 40px;
} }
.comment-head img { .comment-head img {
width: 50px; width: 50px;
...@@ -662,6 +674,7 @@ a,a:hover,a:link { ...@@ -662,6 +674,7 @@ a,a:hover,a:link {
max-width: 500px; max-width: 500px;
margin: 0 auto; margin: 0 auto;
color: #666; color: #666;
word-break: break-all;
} }
...@@ -789,4 +802,16 @@ a,a:hover,a:link { ...@@ -789,4 +802,16 @@ a,a:hover,a:link {
border-top: 1px solid #f3f3f3; border-top: 1px solid #f3f3f3;
z-index: 10 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 { ...@@ -4,7 +4,9 @@ html {
background-color: #f3f3f3; background-color: #f3f3f3;
font-family: "Helvitica Neue",Helvitica,Arial,"Hiragino Sans GB","Microsoft YaHei","Arial Regular","Microsoft JhengHei",sans-serif; font-family: "Helvitica Neue",Helvitica,Arial,"Hiragino Sans GB","Microsoft YaHei","Arial Regular","Microsoft JhengHei",sans-serif;
} }
a.active {
text-decoration: none;
}
.auto-main { .auto-main {
padding-left: 225px; padding-left: 225px;
height: 100px; height: 100px;
...@@ -152,11 +154,11 @@ html { ...@@ -152,11 +154,11 @@ html {
padding-right: 30px; padding-right: 30px;
height: 60px; height: 60px;
} }
.avatar a { .avatar > a {
display: block; display: block;
margin-top: 15px; margin-top: 15px;
} }
.avatar a img { .avatar > a > img {
height: 30px; height: 30px;
width: 30px; width: 30px;
border-radius: 100%; border-radius: 100%;
...@@ -169,13 +171,38 @@ html { ...@@ -169,13 +171,38 @@ html {
color: #999; color: #999;
text-align: center; 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*/ /*main*/
.tp-main { .tp-main {
width: 100%; width: 100%;
margin-top: 90px; margin-top: 90px;
margin-bottom: 90px; padding-bottom: 120px;
} }
.class-name { .class-name {
...@@ -192,6 +219,7 @@ html { ...@@ -192,6 +219,7 @@ html {
width: 100px; width: 100px;
text-align: center; text-align: center;
background-color: transparent; background-color: transparent;
color: #fff;
} }
.edit-class-name input:focus { .edit-class-name input:focus {
border-bottom: 1px solid #fff; border-bottom: 1px solid #fff;
...@@ -201,6 +229,9 @@ html { ...@@ -201,6 +229,9 @@ html {
border: none; border: none;
color: #fff; color: #fff;
} }
.nomal-class-name a {
color: #fff;
}
.class-intro { .class-intro {
height: 400px; height: 400px;
border-radius: 3px; border-radius: 3px;
...@@ -545,8 +576,6 @@ html { ...@@ -545,8 +576,6 @@ html {
.teacher-info { .teacher-info {
position: relative; position: relative;
margin: 20px 0; margin: 20px 0;
height: 200px;
border-bottom: 1px solid #e7e7e7;
} }
.teacher-info textarea { .teacher-info textarea {
width: 100%; width: 100%;
...@@ -963,6 +992,25 @@ textarea.input-r-control { ...@@ -963,6 +992,25 @@ textarea.input-r-control {
display: inline-block; 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 { .examine-box {
margin-top: 100px; margin-top: 100px;
} }
...@@ -1152,7 +1200,7 @@ textarea.input-r-control { ...@@ -1152,7 +1200,7 @@ textarea.input-r-control {
.sm-box .price { .sm-box .price {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
color: #f11300; color: #666;
} }
.play-mask { .play-mask {
position: absolute; position: absolute;
...@@ -1212,6 +1260,34 @@ textarea.input-r-control { ...@@ -1212,6 +1260,34 @@ textarea.input-r-control {
color: #999; 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) { @media (max-width: 767px) {
.tp-sidebar { .tp-sidebar {
......
<template> <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 class="row">
<div v-for="(index,item) in lists" class="col-md-4"> <div v-for="(index,item) in lists" class="col-md-4">
<div class="v-main-box"> <div class="v-main-box">
...@@ -12,9 +12,10 @@ ...@@ -12,9 +12,10 @@
</div> </div>
<div class="v-tit"><a @click="itemClick(item.id)" href="javascript:;">{{item.name}}</a></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"> <div class="v-teacher-list">
讲师:{{getTeachers(index)}} <span v-if="item.teachers.length > 0">讲师:{{getTeachers(index)}}</span>
</div> </div>
<div class="v-foot"> <div class="v-foot">
<div class="v-price"> <div class="v-price">
<small>¥</small> <small>¥</small>
...@@ -65,7 +66,7 @@ ...@@ -65,7 +66,7 @@
, ,
getFullPreViewPic(pic) getFullPreViewPic(pic)
{ {
return __QINIU_URL__ + '/' + pic; return __QINIU_URL__ + '/' + pic+'-m.preview';
} }
, ,
moreClick() moreClick()
......
<template> <template>
<div class="container m-t-20"> <div class="container m-t-20 mx900">
<div class="swiper-container" v-if="lists.length !== 0"> <div class="swiper-container" id="getWidth" v-if="lists.length !== 0">
<div class="swiper-wrapper"> <div class="swiper-wrapper">
<div v-for="item in lists" @click="itemClick(item.id)" class="swiper-slide" <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}}-->
{{item.name}} <img :src="getFullPreViewPic(item.preview_pic)">
</div> </div>
</div> </div>
<div class="swiper-pagination"></div> <div class="swiper-pagination"></div>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
watch: { watch: {
lists(){ lists(){
this.$nextTick(function () { this.$nextTick(function () {
new Swiper('.swiper-container', { var mySwiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination', pagination: '.swiper-pagination',
nextButton: '.swiper-button-next', nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev', prevButton: '.swiper-button-prev',
...@@ -38,8 +38,10 @@ ...@@ -38,8 +38,10 @@
spaceBetween: 30, spaceBetween: 30,
centeredSlides: true, centeredSlides: true,
autoplay: 2500, autoplay: 2500,
autoHeight:true,
autoplayDisableOnInteraction: false autoplayDisableOnInteraction: false
}); });
}); });
} }
}, },
...@@ -48,7 +50,7 @@ ...@@ -48,7 +50,7 @@
window.location.href = __BASE_URL__ + 'home/video?courseId=' + id; window.location.href = __BASE_URL__ + 'home/video?courseId=' + id;
}, },
getFullPreViewPic(pic){ getFullPreViewPic(pic){
return __QINIU_URL__ + '/' + pic; return __QINIU_URL__ + '/' + pic+'-l.preview';
}, },
getLists(classId){ getLists(classId){
var url = __BASE_URL__ + 'home/get-recommend-courses?classId=' + classId; var url = __BASE_URL__ + 'home/get-recommend-courses?classId=' + classId;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="warp-box"> <div class="warp-box">
<div class="container"> <div class="container">
<div class="video-description"> <div class="video-description">
<div class="title">视频介绍</div> <div class="title">课程介绍</div>
<div class="text"> <div class="text">
{{{coursewareInfo.intro}}} {{{coursewareInfo.intro}}}
</div> </div>
...@@ -17,13 +17,19 @@ ...@@ -17,13 +17,19 @@
需要 <a @click="login" href="javascript:;">登录</a> 才能评论 需要 <a @click="login" href="javascript:;">登录</a> 才能评论
</div> </div>
<div v-else class="comment-box"> <div v-else class="comment-box">
<div class="comment-head">
<img :src="coursewareInfo.userAvatar"> <div class="comment-input">
</div>
<div class="comment-input clearfix">
<textarea v-model="content" cols="30" rows="10" class="form-control" <textarea v-model="content" cols="30" rows="10" class="form-control"
placeholder="说几句吧,亲..."></textarea> 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>
</div> </div>
......
...@@ -8,21 +8,14 @@ ...@@ -8,21 +8,14 @@
<a href="javascript:;" class="qzone post-icons bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a> <a href="javascript:;" class="qzone post-icons bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
</div> </div>
</div> </div>
<myvideo :preview-url="coursewareInfo.previewUrl" :video-url="coursewareInfo.videoUrl"></myvideo>
<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>
<div class="video-detail-info"> <div class="video-detail-info">
<div v-for="(index,item) in coursewareInfo.teachers" class="video-teacher"> <div v-for="(index,item) in coursewareInfo.teachers" class="video-teacher">
<a data-toggle="modal" data-target="{{{'#teacherInfo'+index}}}"><img <a data-toggle="modal" data-target="{{{'#teacherInfo'+index}}}"><img
:src="item.avatar"></a> :src="item.avatar"></a>
<p><a href="javascript:;" data-toggle="modal" data-target="#myModal2">{{item.name}}</a></p> <p><a href="javascript:;" data-toggle="modal" data-target="#myModal2">{{item.name}}</a></p>
</div> </div>
<div class="video-sm-info pull-right" style="width:100%"> <div class="video-sm-info pull-right">
<p class="mb-right"> <p class="mb-right">
<a href="javascript:;"><i class="icon-comment-empty"></i>{{coursewareInfo.comment_count}}</a> <a href="javascript:;"><i class="icon-comment-empty"></i>{{coursewareInfo.comment_count}}</a>
<a @click="favorite" href="javascript:;"><i <a @click="favorite" href="javascript:;"><i
...@@ -110,14 +103,8 @@ ...@@ -110,14 +103,8 @@
</div> </div>
</template> </template>
<script> <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 Utils from '../../libs/utils';
import myvideo from './video.vue';
export default{ export default{
data(){ data(){
return { return {
...@@ -242,31 +229,14 @@ ...@@ -242,31 +229,14 @@
require: true require: true
} }
}, },
components: {}, components: {
myvideo:myvideo
},
ready(){ ready(){
var self = this; var self = this;
this.isMobile = this.coursewareInfo.isMobile; this.isMobile = this.coursewareInfo.isMobile;
this.isWeixin = Utils.isWeixin(); 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 @@ ...@@ -275,5 +245,8 @@
</script> </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'); ...@@ -7,7 +7,7 @@ var courseLists = require('./components/course-lists.vue');
var classInfo = JSON.parse($('#class-info').val()); var classInfo = JSON.parse($('#class-info').val());
//logo定制 //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); $('#main-logo').empty().html(html);
//注册定制 //注册定制
var href = $('#main-sign').attr("href") var href = $('#main-sign').attr("href")
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<div class="d-i-b" v-if="addFormShow"> <div class="d-i-b" v-if="addFormShow">
<input type="text" class="input-r-control reset-input" placeholder="请输入讲师名称" v-model="newName" v-el:nameInput> <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="addTeacher">保存</button>
<button type="button" class="btn btn-nobg" @click="addFormShow=false">取消</button>
</div> </div>
<span class="m-l-10" v-else><a href="javascript:;" @click="showAddForm">+ 添加讲师</a></span> <span class="m-l-10" v-else><a href="javascript:;" @click="showAddForm">+ 添加讲师</a></span>
</div> </div>
......
...@@ -85,6 +85,7 @@ var vm = new Vue({ ...@@ -85,6 +85,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;
layer.msg('成功修改课程信息。', { layer.msg('成功修改课程信息。', {
time: 2000, time: 2000,
icon: 1, icon: 1,
...@@ -109,4 +110,9 @@ var vm = new Vue({ ...@@ -109,4 +110,9 @@ var vm = new Vue({
richText.createEditor($("#introEditor"), this.tmp); 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({ ...@@ -103,6 +103,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;
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:"提示"});
...@@ -120,4 +121,11 @@ var vm = new Vue({ ...@@ -120,4 +121,11 @@ var vm = new Vue({
richText.createEditor($("#introEditor"), this.tmp); 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> <template>
<div id="edit-container" class="add-box" v-if="showEdit"> <div id="edit-container" class="add-box" v-if="showEdit">
<div class="add-box-main"> <div class="add-box-main">
<div class="tit">基本信息</div> <div class="tit">个人信息</div>
<avatar-upload :avatar="avatarsrc" :uptoken="publicToken"></avatar-upload> <avatar-upload :avatar="avatarsrc" :uptoken="publicToken"></avatar-upload>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<div v-if="!showEdit" id="normal-container" class="add-box"> <div v-if="!showEdit" id="normal-container" class="add-box">
<div class="add-box-main"> <div class="add-box-main">
<div class="tit">基本信息</div> <div class="tit">个人信息</div>
<div class="upload-avatar"> <div class="upload-avatar">
<img id="avatar-uploader" <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