Commit 09e1f72d authored by 杨培's avatar 杨培

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

# Conflicts:
#	src/frontend/web/js/components/uploader/avatar-upload.vue
parents 2ca46b35 808c58e5
...@@ -171,7 +171,7 @@ class Course extends \yii\db\ActiveRecord ...@@ -171,7 +171,7 @@ class Course extends \yii\db\ActiveRecord
if ($count > 0) { if ($count > 0) {
$return['data'] = self::find() $return['data'] = self::find()
->select('id,user_id,price,name,intro,preview_pic,recommend,status,play_count,comment_count,favorite_count,created_at,updated_at') ->select('id,user_id,price,name,intro,preview_pic,recommend,status,play_count,comment_count,favorite_count,created_at,updated_at')
->where($cond)->orderBy(['id'=>SORT_DESC])->limit($num)->offset($offset)->with('teachers')->asArray()->all(); ->where($cond)->orderBy(['id'=>SORT_DESC])->limit($num)->offset($offset)->with('teachers')->with('courseware')->asArray()->all();
} }
return $return; return $return;
......
...@@ -135,7 +135,7 @@ class HomeController extends \yii\web\Controller ...@@ -135,7 +135,7 @@ class HomeController extends \yii\web\Controller
throw new HttpException(404, '页面不存在'); throw new HttpException(404, '页面不存在');
} else { } else {
$coursewareInfo = $coursewareInfo->toArray(); $coursewareInfo = $coursewareInfo->toArray();
$coursewareInfo['previewUrl'] = Yii::$app->qiniu->getUrl('public', $course->preview_pic); $coursewareInfo['previewUrl'] = Yii::$app->qiniu->getUrl('public', $course->preview_pic).'-l.preview';
$coursewareInfo['intro'] = $course->intro; $coursewareInfo['intro'] = $course->intro;
$coursewareInfo['courseName'] = $course->name; $coursewareInfo['courseName'] = $course->name;
$coursewareInfo['teachers'] = ArrayHelper::toArray($teachers); $coursewareInfo['teachers'] = ArrayHelper::toArray($teachers);
...@@ -190,7 +190,7 @@ class HomeController extends \yii\web\Controller ...@@ -190,7 +190,7 @@ class HomeController extends \yii\web\Controller
throw new HttpException(404, '页面不存在'); throw new HttpException(404, '页面不存在');
} else { } else {
$coursewareInfo = $coursewareInfo->toArray(); $coursewareInfo = $coursewareInfo->toArray();
$coursewareInfo['previewUrl'] = Yii::$app->qiniu->getUrl('public', $course->preview_pic); $coursewareInfo['previewUrl'] = Yii::$app->qiniu->getUrl('public', $course->preview_pic).'-l.preview';
$coursewareInfo['intro'] = $course->intro; $coursewareInfo['intro'] = $course->intro;
$coursewareInfo['courseName'] = $course->name; $coursewareInfo['courseName'] = $course->name;
$coursewareInfo['teachers'] = ArrayHelper::toArray($teachers); $coursewareInfo['teachers'] = ArrayHelper::toArray($teachers);
......
...@@ -75,10 +75,8 @@ class UserCenterController extends Controller ...@@ -75,10 +75,8 @@ class UserCenterController extends Controller
public function actionInfo() public function actionInfo()
{ {
$qiniu = Yii::$app->qiniu; $qiniu = Yii::$app->qiniu;
//图片上传Token //图片上传Token
$imgPath = 'avatar/' . $qiniu->generateRandomFilePath('$(ext)', 10); $imgPath = 'avatar/' . $qiniu->generateRandomFilePath('$(min)$(sec)$(ext)', 12);
$publicToken = $qiniu->getUploadToken('public', $imgPath); $publicToken = $qiniu->getUploadToken('public', $imgPath);
return $this->render('info', compact('publicToken')); return $this->render('info', compact('publicToken'));
} }
......
...@@ -8,16 +8,18 @@ use yii\helpers\Html; ...@@ -8,16 +8,18 @@ use yii\helpers\Html;
$this->title = '申请课堂'; $this->title = '申请课堂';
?> ?>
<div class="send-class apply-class-box"> <div class="apply-class-box">
<div class="tit">申请课堂</div>
<?php if ($model->id) { <?php if ($model->id) {
if ($model->status == \common\models\Classes::STATUS_UNCHECK) {?> if ($model->status == \common\models\Classes::STATUS_UNCHECK) {?>
<p class="bg-info" style="padding:10px;margin-top:10px;">您提交的资料正在等待审核</p> <p class="alert alert-warning text-center">您提交的资料正在等待审核</p>
<?php } elseif ($model->status == \common\models\Classes::STATUS_FAILED) {?> <?php } elseif ($model->status == \common\models\Classes::STATUS_FAILED) {?>
<p class="bg-danger" style="padding:10px;margin-top:10px;">您提交的课堂资料未通过审核!</p> <p class="alert alert-danger text-center">您提交的课堂资料未通过审核!</p>
<?php } } ?> <?php } } ?>
</div>
<div class="send-class apply-class-box">
<div class="tit">申请课堂</div>
<?php $form = MyActiveForm::begin(['id'=>'applyForm', 'options'=>['name'=>'applyClass']]); ?> <?php $form = MyActiveForm::begin(['id'=>'applyForm', 'options'=>['name'=>'applyClass']]); ?>
<?=$form->field($model, 'name', ['inputOptions'=>['placeholder'=>'请输入课堂名称']])?> <?=$form->field($model, 'name', ['inputOptions'=>['placeholder'=>'请输入课堂名称']])?>
<?=$form->field($model, 'intro')->textInput(['placeholder'=>'示例:面向谁?服务是什么?优势是什么?'])?> <?=$form->field($model, 'intro')->textInput(['placeholder'=>'示例:面向谁?服务是什么?优势是什么?'])?>
...@@ -30,7 +32,7 @@ $this->title = '申请课堂'; ...@@ -30,7 +32,7 @@ $this->title = '申请课堂';
<div class="checkbox"> <div class="checkbox">
<label> <label>
<?=Html::checkbox('agreement', $agreement==1)?> <?=Html::checkbox('agreement', $agreement==1)?>
同意 <a href="#">云涯使用协议</a>及 <a href="#">版权声明</a> 同意 <a href="#">云涯使用协议</a> 及 <a href="#">版权声明</a>
</label> </label>
</div> </div>
<?php if ($agreeError) { ?><div class="help-block"><?=$agreeError?></div><?php } ?> <?php if ($agreeError) { ?><div class="help-block"><?=$agreeError?></div><?php } ?>
......
...@@ -11,7 +11,10 @@ $this->beginContent('@app/views/layouts/center.php'); ...@@ -11,7 +11,10 @@ $this->beginContent('@app/views/layouts/center.php');
<div class="tp-sidebar"> <div class="tp-sidebar">
<div class="logo"> <div class="logo">
<?php if (!empty(Yii::$app->controller->classStatus)) { ?> <?php if (!empty(Yii::$app->controller->classStatus)) { ?>
<a href="<?=\yii\helpers\Url::to(['home/index', 'classId'=>Yii::$app->controller->classStatus['id']])?>" target="_blank"><?=Yii::$app->controller->classStatus['name']?></a> <a href="<?=\yii\helpers\Url::to(['home/index', 'classId'=>Yii::$app->controller->classStatus['id']])?>" target="_blank">
<?=Yii::$app->controller->classStatus['name']?>
<i class="icon-home"></i>
</a>
<?php } ?> <?php } ?>
</div> </div>
<div class="side-menu"> <div class="side-menu">
......
...@@ -13,6 +13,17 @@ $this->title = '发布课程'; ...@@ -13,6 +13,17 @@ $this->title = '发布课程';
AppAsset::addScript($this, '@web/assets/course_publish.js'); AppAsset::addScript($this, '@web/assets/course_publish.js');
AppAsset::addCss($this, '@web/assets/css/course_publish.css'); AppAsset::addCss($this, '@web/assets/css/course_publish.css');
?> ?>
<!-- 课程审核未通过提示信息
<div class="alert alert-warning">
<p><i class="glyphicon glyphicon-ban-circle"></i> <b>经过审核,该课堂因为以下原因未通过审核,请根据原因进行修改。不明白之处可联系我们。</b></p>
<p>讲师您好,感谢您的参与!您的课堂因“……“未能通过审核,请修改后重新提交。</p>
<p>烦请确认修改后再提交审核,勿重复操作,谢谢!</p>
<p>如有审核疑问,请联系 企业QQ 800008782,写明具体课堂及疑问。</p>
<p>办公时间:工作日9:30-18:00</p>
</div>
-->
<div class="send-class" id="publishMain"> <div class="send-class" id="publishMain">
<div class="tit">发布课程</div> <div class="tit">发布课程</div>
......
...@@ -57,7 +57,7 @@ $this->registerJsFile('http://static.geetest.com/static/tools/gt.js'); ...@@ -57,7 +57,7 @@ $this->registerJsFile('http://static.geetest.com/static/tools/gt.js');
'captchaAction' => 'site/captcha', 'captchaAction' => 'site/captcha',
])->error(FALSE); ?> ])->error(FALSE); ?>
<input id="verifyCode" name="verifyCode" type="text" placeholder="输入验证码" required=""> <input id="verifyCode" name="verifyCode" type="text" placeholder="输入验证码" required="">
<span id="verifyCode" class="tip-vcode"><?= $model->getFirstError('verifyCode') ?></span> <span id="verifyCode" class="tips"><?= $model->getFirstError('verifyCode') ?></span>
</div> </div>
</div> </div>
......
...@@ -785,11 +785,20 @@ a,a:hover,a:link { ...@@ -785,11 +785,20 @@ a,a:hover,a:link {
padding-right: 30px; padding-right: 30px;
height: 60px; height: 60px;
} }
.avatar a { .avatar > a {
display: block; display: block;
margin-top: 15px; margin-top: 15px;
-webkit-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
transition: all 0.4s ease;
} }
.avatar a img { .avatar > a:hover {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
.avatar > a > img {
height: 30px; height: 30px;
width: 30px; width: 30px;
border-radius: 100%; border-radius: 100%;
...@@ -858,7 +867,7 @@ a,a:hover,a:link { ...@@ -858,7 +867,7 @@ a,a:hover,a:link {
font-size: 48px; font-size: 48px;
padding-top: 170px; padding-top: 170px;
} }
.video-main p { .video-main > p {
font-size: 16px; font-size: 16px;
margin-top: 40px; margin-top: 40px;
line-height: 1.8; line-height: 1.8;
...@@ -886,6 +895,28 @@ a,a:hover,a:link { ...@@ -886,6 +895,28 @@ a,a:hover,a:link {
.look-video a { .look-video a {
color: #f7b940; color: #f7b940;
} }
.has-icon-part {
position: absolute;
left: 0;
width: 100%;
height: 110px;
top: 50%;
margin-top: -55px;
}
.has-icon-part > p > span {
display: block;
}
.has-icon-part p a {
display: inline-block;
color: #fff;
padding-bottom: 40px;
}
.has-icon-part p span a {
color: #f7b940;
}
.has-icon-part span.icon-play {
font-size: 48px;
}
.vjs-big-play-centered .vjs-big-play-button { .vjs-big-play-centered .vjs-big-play-button {
z-index: 2!important; z-index: 2!important;
} }
......
...@@ -230,7 +230,9 @@ i, em { ...@@ -230,7 +230,9 @@ i, em {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-home:before {
content: "\e908";
}
.icon-jian:before { .icon-jian:before {
content: "\e906"; content: "\e906";
} }
......
...@@ -53,13 +53,28 @@ a:link,a:active,a:visited { ...@@ -53,13 +53,28 @@ a:link,a:active,a:visited {
} }
.logo a { .logo a {
display: block; display: block;
font-size: 18px; font-size: 14px;
color: #fff; color: #fff;
height: 60px; height: 60px;
line-height: 60px; line-height: 60px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
-webkit-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.logo a i {
display: none;
width: 20px;
height: 20px;
text-align: center;
line-height: 20px;
font-size: 14px;
color: #fff;
}
.logo a:hover i {
display: inline-block;
} }
.logo a img { .logo a img {
padding: 21px 0; padding: 21px 0;
...@@ -742,10 +757,21 @@ textarea.input-r-control { ...@@ -742,10 +757,21 @@ textarea.input-r-control {
} }
.cls-part .tit { .cls-part .tit {
position: relative;
display: block;
font-size: 14px; font-size: 14px;
color: #777; color: #777;
font-weight: normal; font-weight: normal;
} }
.help-block {
position: absolute;
right: 0;
top: 0;
display: block;
margin: 0;
color: #737373;
font-size: 12px;
}
.cls-part .tit small { .cls-part .tit small {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
...@@ -759,6 +785,9 @@ textarea.input-r-control { ...@@ -759,6 +785,9 @@ textarea.input-r-control {
color: red; color: red;
padding-left: 5px; padding-left: 5px;
} }
.cls-part .checkbox label {
position: relative;
}
.rules-set label span { .rules-set label span {
display: inline-block; display: inline-block;
float: left; float: left;
...@@ -1355,6 +1384,11 @@ textarea.input-r-control { ...@@ -1355,6 +1384,11 @@ textarea.input-r-control {
margin: 0 auto margin: 0 auto
} }
.apply-class-box > p.info {
padding: 20px;
background-color: #fcffca;
}
.empty-data { .empty-data {
height: 300px; height: 300px;
text-align: center; text-align: center;
...@@ -1421,6 +1455,7 @@ textarea.input-r-control { ...@@ -1421,6 +1455,7 @@ textarea.input-r-control {
background-color: #fff; background-color: #fff;
border-bottom: 1px solid #e7e7e7; border-bottom: 1px solid #e7e7e7;
text-align: center; text-align: center;
z-index: 2;
} }
.tab-headbox li { .tab-headbox li {
display: inline-block; display: inline-block;
......
...@@ -93,5 +93,6 @@ ...@@ -93,5 +93,6 @@
<glyph unicode="&#xe905;" glyph-name="zan-full" horiz-adv-x="1025" d="M43.040 558.32c-23.728 0.048-43-19.152-43.040-42.88 0-0.136 0-0.264 0-0.4v-520c-0.048-23.632 19.008-42.864 42.64-43.040 1.040 0 1.92 0.56 2.96 0.56h120.4v605.68h-121.2c-0.64-0.24-1.2 0.080-1.76 0.080zM1022.4 466.56c1.616 25.912-4.72 51.704-18.16 73.92-21.704 35.392-59.56 57.696-101.040 59.52-2.6 0.832-5.28 1.392-8 1.68h-238.16c16.696 48.112 25.216 98.68 25.2 149.6-0.080 33.288-3.752 66.464-10.96 98.96h-0.72c-14.392 66.776-80.192 109.232-146.968 94.832-57.808-12.456-98.704-64.104-97.592-123.232 0-2.16 0.56-4.24 0.64-6.4-0.616-111.104-72.096-209.408-177.6-244.24v-618.72h561.92c23.968-0.136 47.456 6.704 67.6 19.68 18.096 12.032 32.744 28.576 42.48 48 0.8 1.040 1.36 2.16 2.080 3.28s0.4 0.56 0.56 0.88v0c2.568 3.672 4.536 7.72 5.84 12l92.080 412.48c0.856 4.128 1.104 8.36 0.72 12.56 0 0.56 0 1.12 0 1.68s0.24 2.32 0.080 3.52z" /> <glyph unicode="&#xe905;" glyph-name="zan-full" horiz-adv-x="1025" d="M43.040 558.32c-23.728 0.048-43-19.152-43.040-42.88 0-0.136 0-0.264 0-0.4v-520c-0.048-23.632 19.008-42.864 42.64-43.040 1.040 0 1.92 0.56 2.96 0.56h120.4v605.68h-121.2c-0.64-0.24-1.2 0.080-1.76 0.080zM1022.4 466.56c1.616 25.912-4.72 51.704-18.16 73.92-21.704 35.392-59.56 57.696-101.040 59.52-2.6 0.832-5.28 1.392-8 1.68h-238.16c16.696 48.112 25.216 98.68 25.2 149.6-0.080 33.288-3.752 66.464-10.96 98.96h-0.72c-14.392 66.776-80.192 109.232-146.968 94.832-57.808-12.456-98.704-64.104-97.592-123.232 0-2.16 0.56-4.24 0.64-6.4-0.616-111.104-72.096-209.408-177.6-244.24v-618.72h561.92c23.968-0.136 47.456 6.704 67.6 19.68 18.096 12.032 32.744 28.576 42.48 48 0.8 1.040 1.36 2.16 2.080 3.28s0.4 0.56 0.56 0.88v0c2.568 3.672 4.536 7.72 5.84 12l92.080 412.48c0.856 4.128 1.104 8.36 0.72 12.56 0 0.56 0 1.12 0 1.68s0.24 2.32 0.080 3.52z" />
<glyph unicode="&#xe906;" glyph-name="jian" d="M512 940c-271.744 0-492-220.288-492-492s220.256-491.968 492-491.968c271.712 0 492 220.256 492 491.968s-220.32 492-492 492zM282.432 635.072c35.328-2.816 79.552-4.192 132.704-4.192-0.704 26.592-1.76 45.632-3.168 57.184 13.984-2.080 26.752-3.136 38.304-3.136 3.488 0 5.248-1.152 5.248-3.392 0-2.272-1.056-4.128-3.168-5.504-3.84-2.080-5.76-7.52-5.76-16.256v-28.832h133.76c0 23.424-1.056 42.144-3.168 56.128 14.016-2.080 26.752-3.136 38.304-3.136 3.456 0 5.216-0.896 5.216-2.624 0-1.76-1.024-3.328-3.136-4.704-3.84-2.464-5.792-7.872-5.792-16.256v-29.376c52.8 0 96.864 1.376 132.192 4.192v-33.568c-35.328 2.784-79.36 4.192-132.192 4.192v-46.144h-31.456v46.144h-133.76v-44.064h-31.456v44.064c-53.152 0-97.376-1.408-132.704-4.192v33.472zM379.456 208.64c3.136 33.92 4.704 66.976 4.704 99.136v90.752c-26.592-29.024-53.504-53.152-80.768-72.384-8.032 13.632-17.312 23.072-27.808 28.32 59.456 32.192 110.336 81.12 152.64 146.848-55.584-0.352-101.952-1.568-139.008-3.68v34.080c37.056-1.76 88.992-3.136 155.776-4.192 10.848 18.176 19.744 38.464 26.752 60.832 11.552-6.656 21.504-10.752 29.92-12.32s12.576-3.776 12.576-6.56-2.432-5.056-7.328-6.816c-4.896-1.76-14.528-13.472-28.832-35.136 105.984 0 191.296 1.376 255.968 4.192v-34.080c-40.896 2.784-131.456 4.192-271.712 4.192-15.744-25.184-32-48.256-48.768-69.248v-124.832c0-31.136 1.76-64.16 5.248-99.136h-39.36zM746.080 332.928c-37.408 3.488-82.688 5.248-135.84 5.248v-88.672c0-13.632-5.44-23.328-16.288-29.12-10.848-5.76-31.456-8.8-61.888-9.152-1.056 13.28-6.112 26.016-15.232 38.272 18.528-2.784 32.096-4.192 40.672-4.192s14.688 1.12 18.336 3.392c3.68 2.272 5.536 6.72 5.536 13.376v76.064c-61.568 0-109.824-1.76-144.768-5.248v35.648c41.6-3.488 89.856-5.248 144.768-5.248v23.616l63.456 45.088h-89.728c-32.864 0-60.128-1.216-81.824-3.68v32c29.376-2.080 65.568-3.136 108.576-3.136 43.040 0 84.48 1.056 124.32 3.136v-27.808c-11.52 0-21.856-3.328-30.944-9.984l-65.024-48.256v-11.040c51.744 0 97.024 1.76 135.84 5.248v-35.552z" /> <glyph unicode="&#xe906;" glyph-name="jian" d="M512 940c-271.744 0-492-220.288-492-492s220.256-491.968 492-491.968c271.712 0 492 220.256 492 491.968s-220.32 492-492 492zM282.432 635.072c35.328-2.816 79.552-4.192 132.704-4.192-0.704 26.592-1.76 45.632-3.168 57.184 13.984-2.080 26.752-3.136 38.304-3.136 3.488 0 5.248-1.152 5.248-3.392 0-2.272-1.056-4.128-3.168-5.504-3.84-2.080-5.76-7.52-5.76-16.256v-28.832h133.76c0 23.424-1.056 42.144-3.168 56.128 14.016-2.080 26.752-3.136 38.304-3.136 3.456 0 5.216-0.896 5.216-2.624 0-1.76-1.024-3.328-3.136-4.704-3.84-2.464-5.792-7.872-5.792-16.256v-29.376c52.8 0 96.864 1.376 132.192 4.192v-33.568c-35.328 2.784-79.36 4.192-132.192 4.192v-46.144h-31.456v46.144h-133.76v-44.064h-31.456v44.064c-53.152 0-97.376-1.408-132.704-4.192v33.472zM379.456 208.64c3.136 33.92 4.704 66.976 4.704 99.136v90.752c-26.592-29.024-53.504-53.152-80.768-72.384-8.032 13.632-17.312 23.072-27.808 28.32 59.456 32.192 110.336 81.12 152.64 146.848-55.584-0.352-101.952-1.568-139.008-3.68v34.080c37.056-1.76 88.992-3.136 155.776-4.192 10.848 18.176 19.744 38.464 26.752 60.832 11.552-6.656 21.504-10.752 29.92-12.32s12.576-3.776 12.576-6.56-2.432-5.056-7.328-6.816c-4.896-1.76-14.528-13.472-28.832-35.136 105.984 0 191.296 1.376 255.968 4.192v-34.080c-40.896 2.784-131.456 4.192-271.712 4.192-15.744-25.184-32-48.256-48.768-69.248v-124.832c0-31.136 1.76-64.16 5.248-99.136h-39.36zM746.080 332.928c-37.408 3.488-82.688 5.248-135.84 5.248v-88.672c0-13.632-5.44-23.328-16.288-29.12-10.848-5.76-31.456-8.8-61.888-9.152-1.056 13.28-6.112 26.016-15.232 38.272 18.528-2.784 32.096-4.192 40.672-4.192s14.688 1.12 18.336 3.392c3.68 2.272 5.536 6.72 5.536 13.376v76.064c-61.568 0-109.824-1.76-144.768-5.248v35.648c41.6-3.488 89.856-5.248 144.768-5.248v23.616l63.456 45.088h-89.728c-32.864 0-60.128-1.216-81.824-3.68v32c29.376-2.080 65.568-3.136 108.576-3.136 43.040 0 84.48 1.056 124.32 3.136v-27.808c-11.52 0-21.856-3.328-30.944-9.984l-65.024-48.256v-11.040c51.744 0 97.024 1.76 135.84 5.248v-35.552z" />
<glyph unicode="&#xe907;" glyph-name="shen" d="M1023.048 447.048c0-282.244-228.805-511.048-511.048-511.048s-511.048 228.805-511.048 511.048 228.805 511.048 511.048 511.048 511.048-228.805 511.048-511.048zM271.834 555.184h42.042v61.985h409.098v-61.985h42.042v100.793h-238.236l25.333 15.631c-11.142 16.886-24.079 34.673-38.808 53.361l-37.191-22.099c11.677-16.352 22.099-31.982 31.262-46.893h-235.541v-100.793zM319.805 279.218h39.885v25.333h137.444v-117.501h42.042v117.502h137.983v-25.333h39.885v264.108h-177.868v58.211h-42.042v-58.211h-177.33v-264.109zM359.69 505.597h137.444v-63.062h-137.444v63.062zM359.69 405.882h137.444v-63.602h-137.444v63.602zM677.16 442.535h-137.983v63.062h137.983v-63.062zM539.177 405.882h137.983v-63.602h-137.983v63.602z" /> <glyph unicode="&#xe907;" glyph-name="shen" d="M1023.048 447.048c0-282.244-228.805-511.048-511.048-511.048s-511.048 228.805-511.048 511.048 228.805 511.048 511.048 511.048 511.048-228.805 511.048-511.048zM271.834 555.184h42.042v61.985h409.098v-61.985h42.042v100.793h-238.236l25.333 15.631c-11.142 16.886-24.079 34.673-38.808 53.361l-37.191-22.099c11.677-16.352 22.099-31.982 31.262-46.893h-235.541v-100.793zM319.805 279.218h39.885v25.333h137.444v-117.501h42.042v117.502h137.983v-25.333h39.885v264.108h-177.868v58.211h-42.042v-58.211h-177.33v-264.109zM359.69 505.597h137.444v-63.062h-137.444v63.062zM359.69 405.882h137.444v-63.602h-137.444v63.602zM677.16 442.535h-137.983v63.062h137.983v-63.062zM539.177 405.882h137.983v-63.602h-137.983v63.602z" />
<glyph unicode="&#xe908;" glyph-name="home" d="M950.348 504.040l-122.161 96.253v106.356c0 17.976-14.407 32.581-32.159 32.581h-61.304c-17.754 0-32.133-14.605-32.133-32.581v-14.659l-150.758 115.553c-0.633 0.476-1.288 0.9-1.968 1.277-11.1 7.55-24.064 11.605-37.548 11.605-14.068 0-27.523-4.321-38.995-12.509-0.128-0.135-0.315-0.292-0.498-0.374l-398.515-303.502c-10.606-7.822-12.915-22.771-5.265-33.456 7.702-10.681 22.492-13.093 33.073-5.33l398.176 303.347c0.081 0.027 0.184 0.081 0.263 0.133 3.432 2.466 7.516 3.792 11.761 3.792s8.324-1.326 11.73-3.792c0.157-0.106 0.339-0.182 0.525-0.292l397.94-303.188c10.605-7.763 25.402-5.351 33.077 5.33 7.674 10.686 5.365 25.634-5.241 33.456zM820.408 454.364l-276.17 213.479c-0.054 0.054-0.161 0.102-0.187 0.13-9.319 6.732-20.294 10.287-31.735 10.34-11.394 0-22.343-3.582-31.635-10.233-0.080-0.109-0.182-0.135-0.291-0.238l-276.142-213.479c-6.178-4.56-9.793-11.77-9.793-19.381v-270.289c0-46.234 37.186-83.798 82.801-83.798h133.844v201.501c0 35.551 28.412 64.287 63.477 64.287h65.865c35.065 0 63.5-28.735 63.5-64.287v-201.501h143.404c45.668 0 82.802 37.564 82.802 83.798v270.289c0.001 7.612-3.642 14.821-9.739 19.381z" />
<glyph unicode="&#xe90d;" glyph-name="fingerprint" d="M636 0.667h-6c-68 18-112 44-158 90-60 60-92 138-92 222 0 70 58 126 130 126s132-56 132-126c0-46 38-82 88-82s90 36 90 82c0 160-140 292-310 292-122 0-232-68-282-172-16-34-24-76-24-120 0-34 2-86 28-154 9.157-27.471-30.939-36.654-40-14-20 56-32 110-32 168 0 52 10 98 30 138 56 120 182 198 320 198 194 0 352-152 352-336 0-70-60-124-132-124s-130 54-130 124c0 46-40 84-90 84s-88-38-88-84c0-72 28-140 80-192 40-40 80-62 140-78 12-2 16-14 14-26-2-10-12-16-20-16zM530 312.667c0-97.515 80.578-182 192-182 19.928 0 65.546 14.722 70-12 2-12-6-24-18-26-24-4-46-4-52-4-50 0-96 12-132 38-64 44-102 112-102 186 0 12 10 22 22 22s20-10 20-22zM416 8.667c-6 0-10 2-14 6-38 38-58 62-86 114-30 52-46 116-46 184 0 126 108 230 242 230s242-104 242-230c0-12-10-20-22-20s-22 8-22 20c0 104-88 188-198 188s-198-84-198-188c0-62 12-118 38-164 28-50 48-70 80-104 8-8 8-22 0-30-4-4-10-6-16-6zM150 524.667c-17.624 0-27.785 15.691-18 32 42 60 96 108 160 140 134 70 306 70 440 0 64-32 118-78 160-138 6-10 4-24-6-30s-24-4-30 6c-38 54-86 94-144 124-122 62-278 64-400 0-58-30-108-72-146-126-4-6-10-8-16-8zM760 748.667c-4 0-8 0-10 2-82 42-154 60-238 60s-166-20-238-60c-23.381-14.029-43.278 24.033-20 38 80 44 166 64 258 64 90 0 170-20 258-64 18.211-10.927 10.406-40-10-40z" /> <glyph unicode="&#xe90d;" glyph-name="fingerprint" d="M636 0.667h-6c-68 18-112 44-158 90-60 60-92 138-92 222 0 70 58 126 130 126s132-56 132-126c0-46 38-82 88-82s90 36 90 82c0 160-140 292-310 292-122 0-232-68-282-172-16-34-24-76-24-120 0-34 2-86 28-154 9.157-27.471-30.939-36.654-40-14-20 56-32 110-32 168 0 52 10 98 30 138 56 120 182 198 320 198 194 0 352-152 352-336 0-70-60-124-132-124s-130 54-130 124c0 46-40 84-90 84s-88-38-88-84c0-72 28-140 80-192 40-40 80-62 140-78 12-2 16-14 14-26-2-10-12-16-20-16zM530 312.667c0-97.515 80.578-182 192-182 19.928 0 65.546 14.722 70-12 2-12-6-24-18-26-24-4-46-4-52-4-50 0-96 12-132 38-64 44-102 112-102 186 0 12 10 22 22 22s20-10 20-22zM416 8.667c-6 0-10 2-14 6-38 38-58 62-86 114-30 52-46 116-46 184 0 126 108 230 242 230s242-104 242-230c0-12-10-20-22-20s-22 8-22 20c0 104-88 188-198 188s-198-84-198-188c0-62 12-118 38-164 28-50 48-70 80-104 8-8 8-22 0-30-4-4-10-6-16-6zM150 524.667c-17.624 0-27.785 15.691-18 32 42 60 96 108 160 140 134 70 306 70 440 0 64-32 118-78 160-138 6-10 4-24-6-30s-24-4-30 6c-38 54-86 94-144 124-122 62-278 64-400 0-58-30-108-72-146-126-4-6-10-8-16-8zM760 748.667c-4 0-8 0-10 2-82 42-154 60-238 60s-166-20-238-60c-23.381-14.029-43.278 24.033-20 38 80 44 166 64 258 64 90 0 170-20 258-64 18.211-10.927 10.406-40-10-40z" />
</font></defs></svg> </font></defs></svg>
\ No newline at end of file
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
</div> </div>
<div class="v-teacher-list clearfix"> <div class="v-teacher-list clearfix">
<span class="pull-left">发布时间:2016-08-04</span> <span class="pull-left">发布时间:{{transcateTimeUnSecs(item.updated_at)}}</span>
<span class="pull-right">时长:01:28:21</span> <span class="pull-right">时长:{{transcateSeconds(item.courseware.time)}}</span>
</div> </div>
<div class="v-foot"> <div class="v-foot">
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
</template> </template>
<script> <script>
import moment from 'moment'; import moment from 'moment';
import Utils from '../../utils/utils';
export default{ export default{
data(){ data(){
return { return {
...@@ -64,9 +65,16 @@ ...@@ -64,9 +65,16 @@
{ {
window.location.href = __BASE_URL__ + 'home/video?courseId=' + id; window.location.href = __BASE_URL__ + 'home/video?courseId=' + id;
}, },
transcateSeconds(sec){
return Utils.secondsToHms(sec);
},
transcateTime(time) transcateTime(time)
{ {
return moment(new Date(time * 1000)).format('YYYY-MM-DD HH:mm:ss'); return moment(new Date(time * 1000)).format('YYYY-MM-DD HH:mm:ss');
},
transcateTimeUnSecs(time)
{
return moment(new Date(time * 1000)).format('YYYY-MM-DD HH:mm');
} }
, ,
getFullPreViewPic(pic) getFullPreViewPic(pic)
......
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
</div> </div>
</template> </template>
<script> <script>
import Utils from '../../libs/utils'; import Utils from '../../utils/utils';
import myvideo from './video.vue'; import myvideo from './video.vue';
export default{ export default{
data(){ data(){
......
...@@ -9,14 +9,19 @@ ...@@ -9,14 +9,19 @@
<template v-if="showTips"> <template v-if="showTips">
<img v-if="videoInfo.freeTime == 0" :src="videoInfo.previewUrl" width="100%" height="auto"> <img v-if="videoInfo.freeTime == 0" :src="videoInfo.previewUrl" width="100%" height="auto">
<div class="play-mask-box"> <div class="play-mask-box">
<div class="look-video"> <div v-if="videoInfo.freeTime >0" class="look-video">
<p v-if="videoInfo.freeTime >0">本课程可试看{{videoInfo.freeTime}}分钟</p> <p>本课程可试看{{videoInfo.freeTime}}分钟</p>
<p v-else>本课程为付费课程,{{videoInfo.price}} <a @click="pay" href="javascript:;">立即购买</a></p> </div>
<div v-else class="has-icon-part">
<p>
<a @click="pay" href="javascript:;"><span class="icon-play"></span></a>
<span>本课程为付费课程,{{videoInfo.price}} <a @click="pay" href="javascript:;">立即购买</a></span>
</p>
</div> </div>
</div> </div>
</template> </template>
</div> </div>
</template> </template>
...@@ -37,17 +42,18 @@ ...@@ -37,17 +42,18 @@
}, },
methods: { methods: {
pay(){ pay(){
this.$dispatch('pay-click'); this.$dispatch('pay-click');
} }
}, },
ready(){ ready(){
if (this.videoInfo.isShop) { if (this.videoInfo.isShop) {
this.showTips = false; this.showTips = false;
} else { } else {
this.showTips = true; this.showTips = true;
} }
//不显示视频则不绑定 //不显示视频则不绑定 不为没有购买且为不免费
if (this.videoInfo.freeTime > 0) { if (this.videoInfo.freeTime > 0 || this.videoInfo.isShop == true) {
var self = this; var self = this;
var rate = 9 / 16; var rate = 9 / 16;
var w = $('.video-main').width(); var w = $('.video-main').width();
...@@ -70,13 +76,26 @@ ...@@ -70,13 +76,26 @@
var hVideo = wVideo * rate; var hVideo = wVideo * rate;
$('#my-video-play').css('height', hVideo); $('#my-video-play').css('height', hVideo);
}; };
}); })
myPlayer.bigPlayButton.on('click', function () { //没购买显示
self.showTips = false; if (this.videoInfo.isShop == false) {
}); myPlayer.bigPlayButton.on('click', function () {
self.showTips = false;
});
myPlayer.on('ended', function () {
layer.confirm('试看已结束,购买后查看完整版课程?', {
btn: ['立即购买'] //按钮
}, function () {
self.pay();
});
});
}
} }
} }
} }
</script> </script>
/**
* Created by xiabin on 2016/10/19.
*/
var Utils = {
isWeixin: function () {
var ua = navigator.userAgent.toLowerCase();
return ua.indexOf('micromessenger') != -1;
}
};
module.exports = Utils;
\ No newline at end of file
/**
* Created by xiabin on 2016/10/19.
*/
var Utils = {
isWeixin: function () {
var ua = navigator.userAgent.toLowerCase();
return ua.indexOf('micromessenger') != -1;
},
pad: function (num, size) {
var s = num + "";
while (s.length < size) s = "0" + s;
return s;
},
secondsToHms(seconds){
var hour = Math.floor(seconds/3600);
var min = Math.floor(seconds/60);
var sec = Math.floor(seconds % 60);
var result = [];
if(hour > 0){
result.push(this.pad(hour,2));
result.push(this.pad(min,2));
result.push(this.pad(sec,2));
}else if(min > 0){
result.push(this.pad(min,2));
result.push(this.pad(sec,2));
}else{
result.push(this.pad(sec,2));
}
return result.join(':');
}
};
module.exports = Utils;
\ No newline at end of file
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