Commit 40e13d49 authored by xiabin's avatar xiabin

添加用户浏览页

parent c00e6156
...@@ -5,6 +5,7 @@ namespace common\models; ...@@ -5,6 +5,7 @@ namespace common\models;
use Yii; use Yii;
use yii\behaviors\TimestampBehavior; use yii\behaviors\TimestampBehavior;
use yii\helpers\HtmlPurifier; use yii\helpers\HtmlPurifier;
use yii\redis\ActiveQuery;
use yii\redis\ActiveRecord; use yii\redis\ActiveRecord;
/** /**
...@@ -30,8 +31,11 @@ class Course extends \yii\db\ActiveRecord ...@@ -30,8 +31,11 @@ class Course extends \yii\db\ActiveRecord
const STATUS_OK = 1; const STATUS_OK = 1;
const STATUS_FAILED = 2; const STATUS_FAILED = 2;
const STATUS_LOCKED = 3; const STATUS_LOCKED = 3;
const RECOMMEDN = 1;
const UN_RECOMMEND = 0;
public function formName() { public function formName()
{
return ''; return '';
} }
...@@ -41,13 +45,13 @@ class Course extends \yii\db\ActiveRecord ...@@ -41,13 +45,13 @@ class Course extends \yii\db\ActiveRecord
public function beforeSave($insert) public function beforeSave($insert)
{ {
if (!parent::beforeSave($insert)) { if (!parent::beforeSave($insert)) {
return false; return FALSE;
} }
$this->name = strip_tags($this->name); $this->name = strip_tags($this->name);
$this->intro = HtmlPurifier::process($this->intro); $this->intro = HtmlPurifier::process($this->intro);
return true; return TRUE;
} }
/** /**
...@@ -73,14 +77,14 @@ class Course extends \yii\db\ActiveRecord ...@@ -73,14 +77,14 @@ class Course extends \yii\db\ActiveRecord
{ {
return [ return [
[['name', 'preview_pic'], 'required'], [['name', 'preview_pic'], 'required'],
['name', 'string', 'length'=>[1,60]], ['name', 'string', 'length' => [1, 60]],
[['user_id', 'class_id'], 'integer'], [['user_id', 'class_id'], 'integer'],
['intro', 'string'], ['intro', 'string'],
['price', 'integer', 'min'=>0, 'max'=>9999], ['price', 'integer', 'min' => 0, 'max' => 9999],
['free_time', 'integer', 'min'=>0, 'max'=>15], ['free_time', 'integer', 'min' => 0, 'max' => 15],
['recommend', 'boolean'], ['recommend', 'boolean'],
['recommend', 'default', 'value'=>0], ['recommend', 'default', 'value' => 0],
['status', 'in', 'range'=>[0, 1, 2, 3]] ['status', 'in', 'range' => [0, 1, 2, 3]]
]; ];
} }
...@@ -114,7 +118,50 @@ class Course extends \yii\db\ActiveRecord ...@@ -114,7 +118,50 @@ class Course extends \yii\db\ActiveRecord
{ {
$query = self::find(); $query = self::find();
return $query->select('id,user_id,class_id,name,price,preview_pic,recommend,status,created_at,updated_at') return $query->select('id,user_id,class_id,name,price,preview_pic,recommend,status,created_at,updated_at')
->where(['id'=>$id])->asArray()->one(); ->where(['id' => $id])->asArray()->one();
}
/**
* 获取课程列表
* @param $classId
* @param $page 从0开始
* @param $num
* @return array
*/
public static function getCourseListsByClassId($classId, $page, $num)
{
$status = self::STATUS_OK;
$condition = "class_id=:class_id and status=$status";
$params = [':class_id' => $classId];
//获取总数
$count = self::find()->where($condition, $params)->count();
$start = $page * $num;
if ($count > 0) {
$data = self::find()->select('id,price,name,intro,preview_pic,recommend,created_at')->where($condition, $params)->limit($num)->offset($start)->with('teachers')->asArray()->all();
}
return [
'count' => $count,
'data' => $data
];
} }
/**
* 获取推荐的课程
* @param $classID
* @return array|\yii\db\ActiveRecord[]
*/
public static function getRecommendByClassId($classID)
{
$recommend = self::RECOMMEDN;
return self::find()->select('id,name,intro,preview_pic,recommend,created_at')->where("class_id=:class_id and recommend = $recommend", [':class_id' => $classID])->asArray()->all();
}
/**
* 获取关联的讲师信息
* @return $this
*/
public function getTeachers()
{
return $this->hasMany(Teacher::className(), ['id' => 'teacher_id'])->viaTable(CourseTeacher::tableName(), ['course_id' => 'id']);
}
} }
...@@ -23,6 +23,11 @@ use yii\db\ActiveRecord; ...@@ -23,6 +23,11 @@ use yii\db\ActiveRecord;
*/ */
class Courseware extends ActiveRecord class Courseware extends ActiveRecord
{ {
const STATUS_UNCHECK = 0;
const STATUS_OK = 1;
const STATUS_FAILED = 2;
const STATUS_LOCKED = 3;
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -18,7 +18,6 @@ class m160927_121107_course_init extends Migration ...@@ -18,7 +18,6 @@ class m160927_121107_course_init extends Migration
'id' => $this->primaryKey()->unsigned(), 'id' => $this->primaryKey()->unsigned(),
'user_id' => $this->integer()->notNull()->unsigned(), 'user_id' => $this->integer()->notNull()->unsigned(),
'classed_id' => $this->integer()->notNull()->unsigned(), 'classed_id' => $this->integer()->notNull()->unsigned(),
'avatar' => $this->string(255)->notNull(),
'name' => $this->string(32)->notNull(), 'name' => $this->string(32)->notNull(),
'price' => $this->integer()->notNull(), 'price' => $this->integer()->notNull(),
'free_time' => $this->integer()->notNull(), 'free_time' => $this->integer()->notNull(),
......
...@@ -4,6 +4,7 @@ namespace frontend\controllers; ...@@ -4,6 +4,7 @@ namespace frontend\controllers;
use common\libs\alipay\AliPay; use common\libs\alipay\AliPay;
use common\libs\WeixinPay; use common\libs\WeixinPay;
use common\models\Classes;
use common\models\Comments; use common\models\Comments;
use common\models\Course; use common\models\Course;
use common\models\Courseware; use common\models\Courseware;
...@@ -18,6 +19,7 @@ use yii\base\ErrorException; ...@@ -18,6 +19,7 @@ use yii\base\ErrorException;
use yii\base\InvalidParamException; use yii\base\InvalidParamException;
use yii\filters\AccessControl; use yii\filters\AccessControl;
use yii\helpers\Html; use yii\helpers\Html;
use yii\web\ForbiddenHttpException;
class HomeController extends \yii\web\Controller class HomeController extends \yii\web\Controller
{ {
...@@ -55,18 +57,78 @@ class HomeController extends \yii\web\Controller ...@@ -55,18 +57,78 @@ class HomeController extends \yii\web\Controller
/** /**
* 首页 * 首页
* @param $courseId 课程id * @param $classId 课堂id
* @return string * @return string
*/ */
public function actionIndex($courseId) public function actionIndex($classId)
{ {
$result = Course::findByCourseId($courseId); $classInfo = Classes::findOne(['id' => $classId]);
var_dump($result); if ($classInfo !== NULL) {
return $this->render('index'); $classInfo = $classInfo->toArray();
return $this->render('index', [
'classInfo' => $classInfo
]);
} else {
throw new InvalidParamException('参数错误');
}
}
/**
* 获取课程列表
* @param $classId
* @param $page
* @param int $num
* @throws ForbiddenHttpException
*/
public function actionGetCourseLists($classId, $page, $num = 10)
{
if (Yii::$app->request->isAjax or TRUE) {
if ($page >= 0 and $num > 0) {
$result = Course::getCourseListsByClassId($classId, $page, $num);
} else {
throw new InvalidParamException('参数错误');
}
} else {
throw new ForbiddenHttpException('非法请求');
}
Utils::ajaxResponse(TRUE, 'ok', $result);
}
/**
* 获取推荐的课程列表
* @param $classId
* @throws ForbiddenHttpException
*/
public function actionGetRecommendCourses($classId)
{
if (Yii::$app->request->isAjax) {
$result = Course::getRecommendByClassId($classId);
} else {
throw new ForbiddenHttpException('非法请求');
}
Utils::ajaxResponse(TRUE, 'ok', $result);
} }
/**
* 视频播放
* @param $courseId
* @return string
*/
public function actionVideo($courseId)
{
$coursewareInfo = Courseware::findOne(['id' => $courseId, 'status' => Courseware::STATUS_OK]);
if ($coursewareInfo === NULL) {
throw new InvalidParamException('参数错误');
} else {
return $this->render('video');
}
}
/** /**
* 点赞或者取消点赞 * 点赞或者取消点赞
* @param $coursewareId * @param $coursewareId
...@@ -224,26 +286,25 @@ class HomeController extends \yii\web\Controller ...@@ -224,26 +286,25 @@ class HomeController extends \yii\web\Controller
*/ */
public function actionWeixinPayQrcode() public function actionWeixinPayQrcode()
{ {
// $userId = Yii::$app->user->identity->getId(); $userId = Yii::$app->user->identity->getId();
// $courseBaseInfo = Course::findBaseInfoByCourseId($courseId); $courseBaseInfo = Course::findBaseInfoByCourseId($courseId);
// if ($courseBaseInfo !== NULL) { if ($courseBaseInfo !== NULL) {
// $price = $courseBaseInfo['price']; $price = $courseBaseInfo['price'];
// $productId = $this->generateOrderNumber($userId, $courseId, $price); $productId = $this->generateOrderNumber($userId, $courseId, $price);
// $weixinPay = WeixinPay::getInstance(); $weixinPay = WeixinPay::getInstance();
// return QrCode::jpg($weixinPay->makePayUrl($productId)); return QrCode::jpg($weixinPay->makePayUrl($productId));
// } else { } else {
// throw new InvalidParamException('参数错误'); throw new InvalidParamException('参数错误');
// } }
//
$weixinPay = WeixinPay::getInstance();
$url = $weixinPay->makePayUrl(time());
// var_dump($url);exit;
return QrCode::jpg(($url));
} }
public function actionMobilePay(){ /**
* 移动端微信支付
*/
public function actionMobilePay()
{
$weixinpay = \Yii::$app->params['weixinpay']; $weixinpay = \Yii::$app->params['weixinpay'];
$client = new Client( $client = new Client(
[ [
......
...@@ -125,17 +125,18 @@ class UserCenterController extends Controller ...@@ -125,17 +125,18 @@ class UserCenterController extends Controller
if ($user->avatar !== $avatar) { if ($user->avatar !== $avatar) {
$oldAvatar = $user->avatar; $oldAvatar = $user->avatar;
} }
$user->avatar = Html::encode($avatar);
$user->username = Html::encode($username);
$user->save();
//资源清理
if ($oldAvatar) {
//删除
UploadPools::deleteFile(UploadPools::getSkey('public', $oldAvatar));
//认领资源
UploadPools::claimFileBySkey(UploadPools::getSkey('public', $avatar));
}
} }
$user->avatar = Html::encode($avatar);
$user->username = Html::encode($username);
$user->save();
//资源清理
if ($oldAvatar) {
//删除
UploadPools::deleteFile(UploadPools::getSkey('public', $oldAvatar));
//认领资源
UploadPools::claimFileBySkey(UploadPools::getSkey('public', $avatar));
}
Utils::ajaxResponse($status, $msg); Utils::ajaxResponse($status, $msg);
} else { } else {
throw new \yii\web\ForbiddenHttpException('非法请求'); throw new \yii\web\ForbiddenHttpException('非法请求');
......
...@@ -2,23 +2,13 @@ ...@@ -2,23 +2,13 @@
/* @var $this yii\web\View */ /* @var $this yii\web\View */
\frontend\assets\AppAsset::addScript($this, '@web/assets/home_index.js'); \frontend\assets\AppAsset::addScript($this, '@web/assets/home_index.js');
\frontend\assets\AppAsset::addCss($this, '@web/assets/css/home_index.css'); \frontend\assets\AppAsset::addCss($this, '@web/assets/css/home_index.css');
\frontend\assets\AppAsset::addCss($this, '@web/assets/css/main.css');
?> ?>
<h1>home/index</h1> <input id="class-info" type="hidden" value="<?= \yii\helpers\Html::encode(json_encode($classInfo)) ?>"/>
<p>
<video id="example_video_1" class="video-js vjs-default-skin vjs-big-play-centered"
controls preload="auto" width="640" height="264"
poster="http://dev.qdn.pp.cc/object/test-thumb1.jpg"
data-setup='{"example_option":true,"autoplay":false,"language":"zh-CN"}'>
<source src="http://dev.qdn.pp.cc/object/test-3.mp4" type="video/mp4"/>
</video> <div id="index-container">
</p> <recommend :class-id="classId"></recommend>
<course-lists :class-id="classId"></course-lists>
</div>
<p>
You may change the content of this page by modifying
the file <code><?= __FILE__; ?></code>.
</p>
<?php
/**
* Created by PhpStorm.
* User: xiabin
* Date: 2016/10/14
* Time: 下午5:39
*/
$this->title = "视频播放";
\frontend\assets\AppAsset::addCss($this, '@web/assets/css/main.css');
?>
<div class="container">
<div class="cnt-tit">
<h3>为什么身体会做出不由自主的行为?</h3>
<div class="tit-share hidden-xs">
<a href="javascript:;" class="wechat post-icons"></a>
<a href="javascript:;" class="weibo post-icons"></a>
<a href="javascript:;" class="qzone post-icons"></a>
</div>
</div>
<div class="video-main">
<embed src='http://player.youku.com/player.php/sid/XMTc1NDM3MjUyNA==/v.swf' allowFullScreen='true' quality='high' width='100%' height='630' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash'></embed>
</div>
<div class="video-detail-info">
<div class="video-teacher">
<a href="#"><img src="img/avatar2.jpg"></a>
<p><a href="#">乔布斯</a></p>
<span>2016-10-08</span>
</div>
<div class="video-sm-info">
<a href="#"><i class="icon-comment-empty"></i>543</a>
<a href="#"><i class="icon-fav-empty"></i>31</a>
<a href="#"><i class="icon-zan-empty"></i>97</a>
</div>
</div>
</div>
<!--视频介绍-->
<div class="warp-box">
<div class="container">
<div class="video-description">
<div class="title">视频介绍</div>
<div class="text">
四川水煮鱼,重庆串串香,新疆羊肉串,西北烤全羊,江西酒糟鱼,湖北小龙虾,汕头牛肉丸……虽然一直信奉着“胃有多大,世界就有多大”的至理名言,奈何却被一口烂牙阻挡了前进的脚步。快来看看今天的视频,保护好你的牙齿吧!
</div>
</div>
<div class="video-comment">
<div class="title">评论 <small>607次</small></div>
</div>
<div class="comment-login">
需要 <a href="#">登录</a> 才能评论
</div>
<div class="comment-box">
<div class="comment-head">
<img src="img/avatar2.jpg">
</div>
<div class="comment-input clearfix">
<textarea name="" id="" cols="30" rows="10" class="form-control" placeholder="说几句吧,亲..."></textarea>
<button class="btn btn-default pull-right m-t-10">发表评论</button>
</div>
</div>
<div class="comment-main-list clearfix">
<div class="user-h pull-left"><img src="img/avatar2.jpg"></div>
<div class="user-i">
<span>Frank <small>10分钟前</small></span>
<p>呵呵。。。不知为什么我听了你这么说话特牙疼</p>
</div>
</div>
<div class="comment-main-list clearfix">
<div class="user-h pull-left"><img src="img/avatar2.jpg"></div>
<div class="user-i">
<span>Frank <small>10分钟前</small></span>
<p>呵呵。。。不知为什么我听了你这么说话特牙疼</p>
</div>
</div>
<div class="comment-main-list clearfix">
<div class="user-h pull-left"><img src="img/avatarMax.png"></div>
<div class="user-i">
<span>Frank <small>10分钟前</small></span>
<p>呵呵。。。不知为什么我听了你这么说话特牙疼</p>
</div>
</div>
<div class="comment-main-list clearfix">
<div class="user-h pull-left"><img src="img/avatar2.jpg"></div>
<div class="user-i">
<span>Frank <small>10分钟前</small></span>
<p>呵呵。。。不知为什么我听了你这么说话特牙疼</p>
</div>
</div>
<div class="comment-main-list clearfix">
<div class="user-h pull-left"><img src="img/avatarMax.png"></div>
<div class="user-i">
<span>Frank <small>10分钟前</small></span>
<p>呵呵。。。不知为什么我听了你这么说话特牙疼</p>
</div>
</div>
</div>
</div>
...@@ -16,7 +16,7 @@ $baseUrl = \yii\helpers\Url::base(); ...@@ -16,7 +16,7 @@ $baseUrl = \yii\helpers\Url::base();
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<html lang="<?= Yii::$app->language ?>"> <html lang="<?= Yii::$app->language ?>">
<title><?=$this->title?></title> <title><?= $this->title ?></title>
<meta charset="<?= Yii::$app->charset ?>"> <meta charset="<?= Yii::$app->charset ?>">
<meta name="description" content=""> <meta name="description" content="">
<meta name="keywords" content=""> <meta name="keywords" content="">
...@@ -45,10 +45,7 @@ $baseUrl = \yii\helpers\Url::base(); ...@@ -45,10 +45,7 @@ $baseUrl = \yii\helpers\Url::base();
</nav> </nav>
<div class="container"> <?= $content ?>
<?= $content ?>
</div>
<?php $this->endBody() ?> <?php $this->endBody() ?>
......
<?php
/* @var $this yii\web\View */
use yii\helpers\Html;
$this->title = 'About';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="site-about">
<h1><?= Html::encode($this->title) ?></h1>
<p>This is the About page. You may modify the following file to customize its content:</p>
<code><?= __FILE__ ?></code>
</div>
<?php
/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \frontend\models\ContactForm */
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\captcha\Captcha;
$this->title = 'Contact';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="site-contact">
<h1><?= Html::encode($this->title) ?></h1>
<p>
If you have business inquiries or other questions, please fill out the following form to contact us. Thank you.
</p>
<div class="row">
<div class="col-lg-5">
<?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>
<?= $form->field($model, 'name')->textInput(['autofocus' => true]) ?>
<?= $form->field($model, 'email') ?>
<?= $form->field($model, 'subject') ?>
<?= $form->field($model, 'body')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'verifyCode')->widget(Captcha::className(), [
'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>',
]) ?>
<div class="form-group">
<?= Html::submitButton('Submit', ['class' => 'btn btn-primary', 'name' => 'contact-button']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>
...@@ -9,19 +9,21 @@ use yii\helpers\Html; ...@@ -9,19 +9,21 @@ use yii\helpers\Html;
$this->title = $name; $this->title = $name;
?> ?>
<div class="site-error"> <div class="container">
<div class="site-error">
<h1><?= Html::encode($this->title) ?></h1> <h1><?= Html::encode($this->title) ?></h1>
<div class="alert alert-danger"> <div class="alert alert-danger">
<?= nl2br(Html::encode($message)) ?> <?= nl2br(Html::encode($message)) ?>
</div> </div>
<p> <p>
The above error occurred while the Web server was processing your request. The above error occurred while the Web server was processing your request.
</p> </p>
<p> <p>
Please contact us if you think this is a server error. Thank you. Please contact us if you think this is a server error. Thank you.
</p> </p>
</div>
</div> </div>
...@@ -7,59 +7,61 @@ use yii\widgets\ActiveForm; ...@@ -7,59 +7,61 @@ use yii\widgets\ActiveForm;
$this->title = '登录'; $this->title = '登录';
$baseUrl = \yii\helpers\Url::base(); $baseUrl = \yii\helpers\Url::base();
?> ?>
<div class="z-m-center"> <div class="container">
<h3>云涯</h3> <div class="z-m-center">
<p>欢迎来到最课堂,专注在线直播</p> <h3>云涯</h3>
<p>欢迎来到最课堂,专注在线直播</p>
<div id="myTab" class="tab-a"> <div id="myTab" class="tab-a">
<ul> <ul>
<li class="active"><a href="<?= $baseUrl . "/site/login" ?>" data-toggle="tab">登录</a></li> <li class="active"><a href="<?= $baseUrl . "/site/login" ?>" data-toggle="tab">登录</a></li>
<li><a href="<?= $baseUrl . "/site/signup" ?>" data-toggle="tab">注册</a></li> <li><a href="<?= $baseUrl . "/site/signup" ?>" data-toggle="tab">注册</a></li>
</ul> </ul>
</div> </div>
<div class="tab-content" id="myTabContent">
<div class="tab-content" id="myTabContent"> <div class="tab-pane fade in active" id="login">
<div class="reg-box">
<?php $form = ActiveForm::begin(
[
'id' => 'login-form',
]); ?>
<div class="tab-pane fade in active" id="login">
<div class="reg-box">
<?php $form = ActiveForm::begin(
[
'id' => 'login-form',
]); ?>
<div class=" input-wrapper">
<input name="telephone" value="<?= $model->telephone ?>" type="text" class="" placeholder="手机号码"
autofocus="">
</div>
<div class=" input-wrapper last-wrapper">
<input name="password" type="password" class="" placeholder="密码">
<span class="tips tip-vcode"><?=$model->getFirstError('password')?></span>
<div class=" input-wrapper"> </div>
<input name="telephone" value="<?= $model->telephone ?>" type="text" class="" placeholder="手机号码"
autofocus="">
</div> </div>
<div class=" input-wrapper last-wrapper">
<input name="password" type="password" class="" placeholder="密码">
<span class="tips tip-vcode"><?=$model->getFirstError('password')?></span>
<div class="checkbox part-wap">
<label>
<?=$model->rememberMe?>
<input name="rememberMe" type="checkbox" value="1" <?= $model->rememberMe ? "checked" :'' ?>> 记住密码
</label>
<a href="<?= $baseUrl . "/site/request-password-reset" ?>">忘记密码?</a>
</div> </div>
</div>
<div class="checkbox part-wap"> <div class="foot-reg-btn">
<label> <button class="btn btn-log" type="submit">登录</button>
<?=$model->rememberMe?> </div>
<input name="rememberMe" type="checkbox" value="1" <?= $model->rememberMe ? "checked" :'' ?>> 记住密码 <?php ActiveForm::end(); ?>
</label>
<a href="<?= $baseUrl . "/site/request-password-reset" ?>">忘记密码?</a>
</div>
<div class="foot-reg-btn"> <!-- <div class="div-line">或</div>-->
<button class="btn btn-log" type="submit">登录</button> <!---->
<!-- <div class="foot-reg-btn">-->
<!-- <button class="btn btn-reg" type="submit">微信登录</button>-->
<!-- </div>-->
</div> </div>
<?php ActiveForm::end(); ?>
<!-- <div class="div-line">或</div>-->
<!---->
<!-- <div class="foot-reg-btn">-->
<!-- <button class="btn btn-reg" type="submit">微信登录</button>-->
<!-- </div>-->
</div> </div>
</div>
</div>
</div> </div>
...@@ -11,47 +11,49 @@ $this->title = '找回密码'; ...@@ -11,47 +11,49 @@ $this->title = '找回密码';
$this->registerJsFile('http://static.geetest.com/static/tools/gt.js'); $this->registerJsFile('http://static.geetest.com/static/tools/gt.js');
?> ?>
<div class="z-m-center"> <div class="container">
<h3>找回密码</h3> <div class="z-m-center">
<p>请按步骤获取密码</p> <h3>找回密码</h3>
<p>请按步骤获取密码</p>
<div id="myTab" class="tab-find">
<ul> <div id="myTab" class="tab-find">
<li class="active"><a href="javascript:;" data-toggle="tab">1</a></li> <ul>
<li><a href="javascript:;" data-toggle="tab">2</a></li> <li class="active"><a href="javascript:;" data-toggle="tab">1</a></li>
<li><a href="javascript:;" data-toggle="tab">3</a></li> <li><a href="javascript:;" data-toggle="tab">2</a></li>
<li><a href="javascript:;" data-toggle="tab">4</a></li> <li><a href="javascript:;" data-toggle="tab">3</a></li>
</ul> <li><a href="javascript:;" data-toggle="tab">4</a></li>
</div> </ul>
</div>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade in active" id="one"> <div class="tab-content" id="myTabContent">
<?php $form = ActiveForm::begin(['id' => 'request-password-reset-form']); ?>
<div class="tab-pane fade in active" id="one"> <div class="tab-pane fade in active" id="one">
<div class="reg-box"> <?php $form = ActiveForm::begin(['id' => 'request-password-reset-form']); ?>
<div class="phone input-wrapper last-wrapper">
<input name="telephone" type="text" class="" placeholder="请输入注册的手机号码" required="" autofocus=""> <div class="tab-pane fade in active" id="one">
<!--<span class="tips">手机号或者密码错误</span>--> <div class="reg-box">
<div class="phone input-wrapper last-wrapper">
<input name="telephone" type="text" class="" placeholder="请输入注册的手机号码" required="" autofocus="">
<!--<span class="tips">手机号或者密码错误</span>-->
</div>
<div style="margin-top: 20px;margin-bottom: 20px">
<div id="embed-captcha"></div>
<p id="wait" class="show">正在加载验证码......</p>
<p id="notice" class="hide">请先拖动验证码到相应位置</p>
</div>
</div> </div>
<div style="margin-top: 20px;margin-bottom: 20px">
<div id="embed-captcha"></div>
<p id="wait" class="show">正在加载验证码......</p>
<p id="notice" class="hide">请先拖动验证码到相应位置</p>
</div>
</div>
<div class="foot-reg-btn"> <div class="foot-reg-btn">
<button id="submit" class="btn btn-log" type="submit">获取验证码</button> <button id="submit" class="btn btn-log" type="submit">获取验证码</button>
</div>
</div> </div>
<?php ActiveForm::end(); ?>
</div> </div>
<?php ActiveForm::end(); ?>
</div>
</div> </div>
</div>
</div> </div>
...@@ -21,43 +21,45 @@ JS; ...@@ -21,43 +21,45 @@ JS;
$this->registerJs($jsString); $this->registerJs($jsString);
?> ?>
<div class="z-m-center"> <div class="container">
<h3>找回密码</h3> <div class="z-m-center">
<p>请按步骤获取密码</p> <h3>找回密码</h3>
<p>请按步骤获取密码</p>
<div id="myTab" class="tab-find">
<ul>
<li><a href="javascript:;" data-toggle="tab">1</a></li>
<li><a href="javascript:;" data-toggle="tab">2</a></li>
<li class="active"><a href="javascript:;" data-toggle="tab">3</a></li>
<li><a href="javascript:;" data-toggle="tab">4</a></li>
</ul>
</div>
<div class="tab-content" id="myTabContent"> <div id="myTab" class="tab-find">
<ul>
<li><a href="javascript:;" data-toggle="tab">1</a></li>
<li><a href="javascript:;" data-toggle="tab">2</a></li>
<li class="active"><a href="javascript:;" data-toggle="tab">3</a></li>
<li><a href="javascript:;" data-toggle="tab">4</a></li>
</ul>
</div>
<div class="tab-pane fade in active" id="three"> <div class="tab-content" id="myTabContent">
<?php $form = ActiveForm::begin(['id' => 'request-password-reset-form']); ?>
<div class="reg-box"> <div class="tab-pane fade in active" id="three">
<div class="password input-wrapper"> <?php $form = ActiveForm::begin(['id' => 'request-password-reset-form']); ?>
<input value="<?= $model->password ?>" id="password" name="password" type="password" class=""
placeholder="设置新密码" required="">
</div>
<div class="check-password input-wrapper last-wrapper"> <div class="reg-box">
<input value="<?= $model->rePassword ?>" id id="repassword" name="rePassword" type="password" class="" placeholder="重复输入密码" required=""> <div class="password input-wrapper">
<span id="repassword_tips" class="tips"><?= $model->getFirstError('rePassword') ?></span> <input value="<?= $model->password ?>" id="password" name="password" type="password" class=""
placeholder="设置新密码" required="">
</div>
<div class="check-password input-wrapper last-wrapper">
<input value="<?= $model->rePassword ?>" id id="repassword" name="rePassword" type="password" class="" placeholder="重复输入密码" required="">
<span id="repassword_tips" class="tips"><?= $model->getFirstError('rePassword') ?></span>
</div>
</div> </div>
<div class="foot-reg-btn">
<button id="submit" class="btn btn-log" type="submit">确认</button>
</div>
<?php ActiveForm::end() ?>
</div> </div>
<div class="foot-reg-btn">
<button id="submit" class="btn btn-log" type="submit">确认</button>
</div>
<?php ActiveForm::end() ?>
</div>
</div> </div>
</div>
</div> </div>
...@@ -12,38 +12,40 @@ $this->title = '密码设置成功'; ...@@ -12,38 +12,40 @@ $this->title = '密码设置成功';
?> ?>
<div class="z-m-center"> <div class="container">
<h3>找回密码</h3> <div class="z-m-center">
<p>请按步骤获取密码</p> <h3>找回密码</h3>
<p>请按步骤获取密码</p>
<div id="myTab" class="tab-find">
<ul> <div id="myTab" class="tab-find">
<li><a href="javascript:;" data-toggle="tab">1</a></li> <ul>
<li><a href="javascript:;" data-toggle="tab">2</a></li> <li><a href="javascript:;" data-toggle="tab">1</a></li>
<li><a href="javascript:;" data-toggle="tab">3</a></li> <li><a href="javascript:;" data-toggle="tab">2</a></li>
<li class="active"><a href="javascript:;" data-toggle="tab">4</a></li> <li><a href="javascript:;" data-toggle="tab">3</a></li>
</ul> <li class="active"><a href="javascript:;" data-toggle="tab">4</a></li>
</div> </ul>
</div>
<div class="tab-content" id="myTabContent"> <div class="tab-content" id="myTabContent">
<div class="tab-pane fade in active" id="four"> <div class="tab-pane fade in active" id="four">
<div class="sucess-box"> <div class="sucess-box">
<span><i class="glyphicon glyphicon-ok"></i></span> <span><i class="glyphicon glyphicon-ok"></i></span>
<p>密码重置成功</p> <p>密码重置成功</p>
</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" ?>'"
type="submit">去登录 type="submit">去登录
</button> </button>
</div>
</div> </div>
</div>
</div> </div>
</div>
</div> </div>
...@@ -10,65 +10,67 @@ $baseUrl = \yii\helpers\Url::base(); ...@@ -10,65 +10,67 @@ $baseUrl = \yii\helpers\Url::base();
$this->registerJsFile('http://static.geetest.com/static/tools/gt.js'); $this->registerJsFile('http://static.geetest.com/static/tools/gt.js');
?> ?>
<div class="z-m-center"> <div class="container">
<h3>云涯</h3> <div class="z-m-center">
<p>欢迎来到最课堂,专注在线直播</p> <h3>云涯</h3>
<p>欢迎来到最课堂,专注在线直播</p>
<div id="myTab" class="tab-a">
<ul> <div id="myTab" class="tab-a">
<li><a href="<?= $baseUrl . "/site/login" ?>" data-toggle="tab">登录</a></li> <ul>
<li class="active"><a href="<?= $baseUrl . "/site/singup" ?>" data-toggle="tab">注册</a></li> <li><a href="<?= $baseUrl . "/site/login" ?>" data-toggle="tab">登录</a></li>
</ul> <li class="active"><a href="<?= $baseUrl . "/site/singup" ?>" data-toggle="tab">注册</a></li>
</div> </ul>
</div>
<div class="tab-content" id="myTabContent"> <div class="tab-content" id="myTabContent">
<div class="tab-pane fade in active" id="register"> <div class="tab-pane fade in active" id="register">
<?php $form = ActiveForm::begin(['id' => 'form-signup']); ?> <?php $form = ActiveForm::begin(['id' => 'form-signup']); ?>
<div class="reg-box"> <div class="reg-box">
<div class="phone input-wrapper"> <div class="phone input-wrapper">
<input name="telephone" id="telephone" value="<?= $model->telephone ?>" type="text" class="" <input name="telephone" id="telephone" value="<?= $model->telephone ?>" type="text" class=""
placeholder="手机号码" required="" autofocus=""> placeholder="手机号码" required="" autofocus="">
<span id="telephone_tips" class="tips"><?= $model->getFirstError('telephone') ?></span> <span id="telephone_tips" class="tips"><?= $model->getFirstError('telephone') ?></span>
</div> </div>
<div class="v-code input-wrapper"> <div class="v-code input-wrapper">
<input id="token" name="token" type="text" class="" placeholder="验证码"> <input id="token" name="token" type="text" class="" placeholder="验证码">
<span id="token_tips" class="tips tip-vcode"><?= $model->getFirstError('token') ?></span> <span id="token_tips" class="tips tip-vcode"><?= $model->getFirstError('token') ?></span>
<button class="btn btn-get-vcode" id="send_msg">获取验证码</button> <button class="btn btn-get-vcode" id="send_msg">获取验证码</button>
</div> </div>
<div class="password input-wrapper"> <div class="password input-wrapper">
<input id="password" name="password" type="password" class="" placeholder="输入密码" required=""> <input id="password" name="password" type="password" class="" placeholder="输入密码" required="">
<span id="password_tips" class="tips"><?= $model->getFirstError('password') ?></span> <span id="password_tips" class="tips"><?= $model->getFirstError('password') ?></span>
</div> </div>
<div class="check-password input-wrapper last-wrapper"> <div class="check-password input-wrapper last-wrapper">
<input id="repassword" name="rePassword" type="password" class="" placeholder="再次输入密码" required=""> <input id="repassword" name="rePassword" type="password" class="" placeholder="再次输入密码" required="">
<span class="tips tip-vcode"><?= $model->getFirstError('rePassword') ?></span> <span class="tips tip-vcode"><?= $model->getFirstError('rePassword') ?></span>
<span id="repassword_tips" class="tips"><?= $model->getFirstError('rePassword') ?></span> <span id="repassword_tips" class="tips"><?= $model->getFirstError('rePassword') ?></span>
</div> </div>
<div style="margin-top: 20px;margin-bottom: 20px"> <div style="margin-top: 20px;margin-bottom: 20px">
<div id="embed-captcha"></div> <div id="embed-captcha"></div>
<p id="wait" class="show">正在加载验证码......</p> <p id="wait" class="show">正在加载验证码......</p>
<p id="notice" class="hide">请先拖动验证码到相应位置</p> <p id="notice" class="hide">请先拖动验证码到相应位置</p>
</div>
</div> </div>
</div>
<div id="submit" class="foot-reg-btn"> <div id="submit" class="foot-reg-btn">
<button class="btn btn-reg" type="submit">注册</button> <button class="btn btn-reg" type="submit">注册</button>
</div>
<?php ActiveForm::end(); ?>
</div> </div>
<?php ActiveForm::end(); ?>
</div> </div>
</div> </div>
</div> </div>
...@@ -15,44 +15,46 @@ $this->title = '输入验证码'; ...@@ -15,44 +15,46 @@ $this->title = '输入验证码';
$this->registerJsFile('http://static.geetest.com/static/tools/gt.js'); $this->registerJsFile('http://static.geetest.com/static/tools/gt.js');
?> ?>
<div class="z-m-center"> <div class="container">
<h3>找回密码</h3> <div class="z-m-center">
<p>请按步骤获取密码</p> <h3>找回密码</h3>
<p>请按步骤获取密码</p>
<div id="myTab" class="tab-find">
<ul> <div id="myTab" class="tab-find">
<li><a href="javascript:;" data-toggle="tab">1</a></li> <ul>
<li class="active"><a href="javascript:;" data-toggle="tab">2</a></li> <li><a href="javascript:;" data-toggle="tab">1</a></li>
<li><a href="javascript:;" data-toggle="tab">3</a></li> <li class="active"><a href="javascript:;" data-toggle="tab">2</a></li>
<li><a href="javascript:;" data-toggle="tab">4</a></li> <li><a href="javascript:;" data-toggle="tab">3</a></li>
</ul> <li><a href="javascript:;" data-toggle="tab">4</a></li>
</div> </ul>
</div>
<div class="tab-content" id="myTabContent"> <div class="tab-content" id="myTabContent">
<div class="tab-pane fade in active" id="two"> <div class="tab-pane fade in active" id="two">
<?php $form = ActiveForm::begin(['id' => 'token-input-form']); ?> <?php $form = ActiveForm::begin(['id' => 'token-input-form']); ?>
<div class="reg-box"> <div class="reg-box">
<div class="phone input-wrapper last-wrapper"> <div class="phone input-wrapper last-wrapper">
<input name="token" type="text" class="" value="<?= $model->token?>" placeholder="请输入6位验证码" required="" autofocus=""> <input name="token" type="text" class="" value="<?= $model->token?>" placeholder="请输入6位验证码" required="" autofocus="">
<span class="tips"><?= $model->getFirstError('token') ?></span> <span class="tips"><?= $model->getFirstError('token') ?></span>
</div>
<div style="margin-top: 20px;margin-bottom: 20px">
<div id="embed-captcha"></div>
<p id="wait" class="show">正在加载验证码......</p>
<p id="notice" class="hide">请先拖动验证码到相应位置</p>
</div>
</div> </div>
<div style="margin-top: 20px;margin-bottom: 20px"> <div class="foot-reg-btn">
<div id="embed-captcha"></div> <button id="token_input" class="btn btn-log" type="submit">下一步</button>
<p id="wait" class="show">正在加载验证码......</p>
<p id="notice" class="hide">请先拖动验证码到相应位置</p>
</div> </div>
<?php ActiveForm::end() ?>
</div> </div>
<div class="foot-reg-btn">
<button id="token_input" class="btn btn-log" type="submit">下一步</button>
</div>
<?php ActiveForm::end() ?>
</div>
</div> </div>
</div>
</div> </div>
This diff is collapsed.
...@@ -21,10 +21,7 @@ a,a:hover,a:link { ...@@ -21,10 +21,7 @@ a,a:hover,a:link {
.yun-login-btn li a { .yun-login-btn li a {
color: #333; color: #333;
} }
.yun-login-btn li:last-child a{
background-color: #34bf49;
color: #fff;
}
.z-m-center { .z-m-center {
......
@charset "utf-8";
body {
font-family: "Microsoft YaHei","Helvitica Neue", Helvitica, Arial, "Hiragino Sans GB", "Arial Regular", "Microsoft JhengHei", sans-serif;
background-color: #fafafa;
}
a,a:hover,a:link {
text-decoration: none;
}
/*font*/
@font-face {
font-family: 'icomoon';
src: url('fonts/icomoon.eot?uyryw3');
src: url('fonts/icomoon.eot?uyryw3#iefix') format('embedded-opentype'),
url('fonts/icomoon.ttf?uyryw3') format('truetype'),
url('fonts/icomoon.woff?uyryw3') format('woff'),
url('fonts/icomoon.svg?uyryw3#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="icon-"], [class*=" icon-"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'icomoon' !important;
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-comment-empty:before {
content: "\e900";
}
.icon-comment-full:before {
content: "\e901";
}
.icon-fav-empty:before {
content: "\e902";
}
.icon-fav-full:before {
content: "\e903";
}
.icon-zan-empty:before {
content: "\e904";
}
.icon-zan-full:before {
content: "\e905";
}
.navbar-main {
background-color: #fff;
box-shadow: 0 0 30px rgba(0,0,0,.05);
}
.logo {
line-height: 60px;
margin-left: 30px;
font-size: 16px;
}
.logo a {
color: #333;
}
.yun-login-btn {
margin-right: 30px;
margin-bottom: 0;
}
.yun-login-btn,.yun-login-btn li {
list-style: none;
}
.yun-login-btn li {
display: inline-block;
height: 60px;
line-height: 60px;
padding: 0 10px;
}
.yun-login-btn li a {
color: #333;
display: block;
}
.c-menu-item {
margin-bottom: 0;
margin-left: 20px;
}
.c-menu-item li {
display: inline-block;
height: 60px;
line-height: 60px;
margin: 0 10px 0;
padding: 0;
}
.c-menu-item li a {
display: block;
height: 60px;
color: #333;
}
.c-menu-item li.active a {
display: block;
border-bottom: 4px solid #ef2f11;
}
/* Swiper幻灯 */
.swiper-container {
width: 100%;
height: 500px;
}
.swiper-slide {
text-align: center;
font-size: 18px;
background: #fff;
/* Center slide text vertically */
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
/*视频列表*/
.v-list {
margin-top: 20px;
}
.v-main-box {
background-color: #fff;
height: 300px;
margin-bottom: 20px;
-webkit-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.v-screen {
position: relative;
width: 100%;
height: 200px;
overflow: hidden;
}
.v-screen a {
position: relative;
display: block;
}
.v-screen > span {
position: absolute;
display: inline-block;
width: 30px;
height: 30px;
left: 10px;
top:10px;
}
.v-screen > span > img {
width: 30px;
height: 30px;
border-radius: 100%;
}
.v-tit,
.v-price,
.v-foot {
padding: 0 10px;
}
.v-tit {
height: 40px;
line-height: 40px;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.v-tit a {
color: #333333;
}
.v-price {
color: #ef2f11;
padding-bottom: 10px;
}
.v-foot {
position: relative;
font-size: 12px;
color: #999;
}
.v-detail {
position: absolute;
right: 10px;
bottom: 0;
color: #bbbbbb;
}
.v-detail span {
padding-left: 10px;
}
.v-main-box:hover {
cursor: pointer;
box-shadow: 0 0 20px rgba(0,0,0,.12);
}
.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;
text-align: center;
line-height: 200px;
font-size: 64px;
color: #fff;
-webkit-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.col-md-3 {
padding-right: 10px;
padding-left: 10px;
}
.get-more {
margin: 0 auto;
width: 30%;
text-align: center;
font-size: 12px;
}
.get-more a {
display: block;
height: 45px;
line-height: 45px;
background-color: #fff;
color: #999;
}
.copyright {
height: 40px;
line-height: 40px;
background-color: #fff;
text-align: center;
color: #999;
font-size: 12px;
border-top: 1px solid #f3f3f3;
}
.m-t-20 {
margin-top: 20px;
}
/*视频内容页面*/
.cnt-tit {
position: relative;
height: 22px;
font-size: 22px;
margin: 30px 0;
}
.tit-share {
position: absolute;
display: inline-block;
height: 22px;
right: 0;
top: 0;
}
.post-icons {
width: 25px;
height: 22px;
float: left;
margin-left: 16px;
background: url(../img/share_tit.png) no-repeat;
}
.weibo {
background-position: -25px 0;
}
.qzone {
background-position: -50px 0;
}
.weibo:hover {
background-position: -25px -22px;
}
.qzone:hover {
background-position: -50px -22px;
}
.wechat:hover {
background-position: 0 -22px;
}
.video-detail-info {
position: relative;
height: 80px;
background-color: #fff;
border: 1px solid #f3f3f3;
border-top: none;
}
.video-teacher {
padding: 15px;
}
.video-teacher a {
color: #333;
}
.video-teacher img{
float: left;
width: 50px;
height: 50px;
border-radius: 100%;
margin-right: 10px;
}
.video-teacher p {
font-size: 16px;
margin: 5px 0 0;
}
.video-teacher span {
font-size: 12px;
color: #999;
}
.video-sm-info {
position: absolute;
height: 80px;
line-height: 80px;
right: 15px;
top: 0;
}
.video-sm-info a {
display: inline-block;
position: relative;
margin-right: 15px;
vertical-align: middle;
font-size: 12px;
color: #999;
padding-left: 35px;
height: 30px;
line-height: 30px;
}
.video-sm-info a i {
position: absolute;
width: 30px;
height: 30px;
text-align: center;
line-height: 30px;
top: 0;
left: 0;
font-size: 30px;
}
/*video detail*/
.warp-box {
background-color: #fff;
margin-top: 40px;
padding: 20px 0;
border-top: 1px solid #f3f3f3;
}
.video-description .title {
font-size: 16px;
color: #333;
padding-bottom: 10px;
}
.video-description .text {
color: #999;
}
.video-comment {
margin-top: 30px;
}
.video-comment .title {
font-size: 16px;
color: #333;
padding-bottom: 10px;
}
.video-comment .title small {
font-size: 12px;
color: #999;
padding-left: 10px;
}
.comment-login {
display: block;
width: 100%;
height: 100px;
text-align: center;
line-height: 100px;
border: 1px solid #e5e6e8;
}
.comment-box {
position: relative;
padding-left: 60px;
margin-top: 20px;
}
.comment-head img {
width: 50px;
height: 50px;
border-radius: 100%;
}
.comment-head {
position: absolute;
left: 0;
top: 0;
padding-right: 10px;
}
.comment-input {
display: block;
}
.comment-input textarea {
height: 50px;
}
.m-t-10 {
margin-top: 10px;
}
.user-h {
padding-right: 10px;
}
.user-h img {
height: 50px;
width: 50px;
border-radius: 100%;
}
.user-i span,
.user-i span small {
font-size: 14px;
color: #999;
}
.user-i span small {
padding-left: 5px;
}
.user-i p {
padding-top: 5px;
}
.comment-main-list {
margin-bottom: 40px;
}
.teacher-info {
margin: 40px auto;
}
.teacher-info img {
width: 100px;
height: 100px;
border-radius: 100%;
}
.teacher-info h3 {
font-size: 18px;
}
.teacher-info p {
max-width: 500px;
margin: 0 auto;
color: #666;
}
\ No newline at end of file
...@@ -181,6 +181,7 @@ ul, ...@@ -181,6 +181,7 @@ ul,
ol, ol,
li { li {
list-style: none; list-style: none;
float: left;
} }
i, em { i, em {
...@@ -231,6 +232,24 @@ i, em { ...@@ -231,6 +232,24 @@ i, em {
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-comment-empty:before {
content: "\e900";
}
.icon-comment-full:before {
content: "\e901";
}
.icon-fav-empty:before {
content: "\e902";
}
.icon-fav-full:before {
content: "\e903";
}
.icon-zan-empty:before {
content: "\e904";
}
.icon-zan-full:before {
content: "\e905";
}
.icon-add:before { .icon-add:before {
content: "\e145"; content: "\e145";
} }
...@@ -273,12 +292,21 @@ i, em { ...@@ -273,12 +292,21 @@ i, em {
.icon-crop_original:before { .icon-crop_original:before {
content: "\e3c4"; content: "\e3c4";
} }
.icon-favorite:before {
content: "\e87d";
}
.icon-favorite_border:before {
content: "\e87e";
}
.icon-fingerprint:before { .icon-fingerprint:before {
content: "\e90d"; content: "\e90d";
} }
.icon-ondemand_video:before { .icon-ondemand_video:before {
content: "\e63a"; content: "\e63a";
} }
.icon-power_settings_new:before {
content: "\e8ac";
}
.icon-slideshow:before { .icon-slideshow:before {
content: "\e41b"; content: "\e41b";
} }
...@@ -390,4 +418,3 @@ i, em { ...@@ -390,4 +418,3 @@ i, em {
.icon-menu:before { .icon-menu:before {
content: "\e120"; content: "\e120";
} }
<template>
<div class="container v-list" v-show="lists.length > 0">
<div class="row">
<div v-for="item in lists" class="col-md-3">
<div class="v-main-box">
<div class="v-screen">
<a @click="itemClick(item.id)" href="javascript:;">
<img :src="getFullPreViewPic(item.preview_pic)">
<span class="play-mask"><i class="glyphicon glyphicon-play-circle"></i></span>
</a>
<!--头像-->
<span><img src="http://dev.zuiketang.com/assets/img/avatar2.jpg"></span>
</div>
<div class="v-tit"><a @click="itemClick(item.id)" href="javascript:;">{{item.name}}</a></div>
<div class="v-price">
<small>¥</small>
{{item.price}}
</div>
<div class="v-foot">
<p>{{transcateTime(item.created_at)}}</p>
<!--<div class="v-detail">-->
<!--<span><i class="icon-comment-full"></i> 12031</span>-->
<!--<span><i class="icon-fav-full"></i> 87</span>-->
<!--<span><i class="icon-zan-full"></i> 331</span>-->
<!--</div>-->
</div>
</div>
</div>
</div>
<div @click="moreClick" v-show="more" class="get-more"><a href="javascript:;">点击查看更多</a></div>
</div>
</template>
<script>
import moment from 'moment';
export default{
data(){
return {
lists: [],
page: 0,
num: 10,
more: false
}
},
methods: {
itemClick(id)
{
window.location.href = __BASE_URL__ + 'home/video?courseId=' + id;
},
transcateTime(time)
{
return moment(new Date(time * 1000)).format('YYYY-MM-DD HH:mm:ss');
}
,
getFullPreViewPic(pic)
{
return __QINIU_URL__ + '/' + pic;
}
,
moreClick()
{
this.page++;
this.getLists(this.classId, this.page, this.num);
}
,
getLists(classId, page, num)
{
var url = __BASE_URL__ + 'home/get-course-lists?classId=' + classId + '&page=' +
page + '&num=' + num;
var self = this;
$.getJSON(url, function (reponse) {
if (reponse.status === true) {
var result = reponse.data;
self.count = result.count;
self.lists = self.lists.concat(result.data);
self.more = (self.count > self.lists.length);
} else {
layer.alert(reponse.message, {'icon': 2, 'title': '提示'})
}
}).error(function () {
layer.alert('获取推荐课堂列表错误', {'icon': 2, 'title': '提示'})
})
}
},
props: {
classId: {
required: true
}
}
,
ready()
{
this.getLists(this.classId, this.page, this.num);
}
}
</script>
<template>
<div class="swiper-container" 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>
</div>
<div class="swiper-pagination"></div>
</div>
</template>
<script>
require('../../libs/swiper/swiper.min.css');
var Swiper = require('../../libs/swiper/swiper.min.js');
export default{
data(){
return {
lists: []
}
},
props: {
classId: {
required: true
}
},
watch: {
lists(){
this.$nextTick(function () {
new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev',
paginationClickable: true,
spaceBetween: 30,
centeredSlides: true,
autoplay: 2500,
autoplayDisableOnInteraction: false
});
});
}
},
methods: {
itemClick(id){
window.location.href = __BASE_URL__ + 'home/video?courseId=' + id;
},
getFullPreViewPic(pic){
return __QINIU_URL__ + '/' + pic;
},
getLists(classId){
var url = __BASE_URL__ + 'home/get-recommend-courses?classId=' + classId;
var self = this;
$.getJSON(url, function (reponse) {
if (reponse.status === true) {
self.lists = reponse.data;
} else {
layer.alert(reponse.message, {'icon': 2, 'title': '提示'})
}
}).error(function () {
layer.alert('获取推荐课堂列表错误', {'icon': 2, 'title': '提示'})
})
}
},
components: {},
ready()
{
this.getLists(this.classId);
}
}
</script>
/** /**
* Created by xiabin on 2016/9/29. * Created by xiabin on 2016/9/29.
*/ */
require('expose?videojs!../libs/videojs/video.js'); // require('expose?videojs!../libs/videojs/video.js');
require('../libs/videojs/video-js.css'); // require('../libs/videojs/video-js.css');
require('../libs/videojs/lang/zh-CN.js'); // require('../libs/videojs/lang/zh-CN.js');
// console.log(videojs); // // console.log(videojs);
// layer.msg('home/index'); // // layer.msg('home/index');
videojs.options.flash.swf = __CDN_URL__ + 'assets/videojs/video-js.swf'; // videojs.options.flash.swf = __CDN_URL__ + 'assets/videojs/video-js.swf';
window.VIDEOJS_NO_BASE_THEME = true; // window.VIDEOJS_NO_BASE_THEME = true;
//
// videojs("example_video_1").ready(function () {
// var myPlayer = this;
//
// // EXAMPLE: Start playing the video.
// // myPlayer.play();
//
// });
var Vue = require('vue');
var recommend = require('./components/recommend.vue');
var courseLists = require('./components/course-lists.vue');
var classInfo = JSON.parse($('#class-info').val());
videojs("example_video_1").ready(function () {
var myPlayer = this;
// EXAMPLE: Start playing the video. new Vue({
// myPlayer.play(); el: "#index-container",
data: {
classId: classInfo.id
},
components: {
recommend: recommend,
courseLists: courseLists
}
}); });
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
...@@ -12,6 +12,7 @@ var entry = { ...@@ -12,6 +12,7 @@ var entry = {
vendor: ["jquery", "vue", js_dir + "/utils/layer", js_dir + "/libs/global.js"], vendor: ["jquery", "vue", js_dir + "/utils/layer", js_dir + "/libs/global.js"],
login_css: [css_dir + '/login.css'], login_css: [css_dir + '/login.css'],
style: [css_dir + '/reset.css', css_dir + '/style.css'], style: [css_dir + '/reset.css', css_dir + '/style.css'],
main: [css_dir + '/main.css'],
signup: [js_dir + '/site/signup.js'], signup: [js_dir + '/site/signup.js'],
login: [js_dir + '/site/login.js'], login: [js_dir + '/site/login.js'],
request_password_reset: [js_dir + '/site/request_password_reset'], request_password_reset: [js_dir + '/site/request_password_reset'],
......
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