Commit bd318ef1 authored by 杨培's avatar 杨培

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

parents bc4d47ba 8762a5aa
<?php
/**
* Created by PhpStorm.
* User: xiabin
* Date: 2016/10/27
* Time: 上午11:52
*/
namespace console\controllers;
use yii\console\Controller;
class TestController extends Controller
{
public function actionIndex(){
$t=mktime();
set_time_limit(1000);
$myFile="./insert.sql";
$fhandler=fopen($myFile,'wb');
if($fhandler){
$sql="268\t2\t'0,262,268,'\t0\t '2342'\t'423423'\t'123123'\t'23423423'\t'2012-01-09 09:55:43'\t'upload/product/20111205153432_53211.jpg'\t'upload/product/thumb_20111205153432_53211.jpg'\tNULL\tNULL\t38\t'件'\t''\t123\t123\t0";
$i=0;
while($i<10)//1,000,000
{
$i++;
fwrite($fhandler,$sql."\r\n");
}
echo"写入成功,耗时:",mktime()-$t;
}
}
}
\ No newline at end of file
......@@ -22,10 +22,7 @@ $this->title = '我的课堂';
<div role="tabpanel" class="tab-pane active" id="home">
<div class="class-name m-t-50">
<span class="nomal-class-name"><?=$model->name?><!-- <a href="#"><i class="icon-mode_edit"></i></a>--></span>
<div class="edit"><a href="#" title="课堂设置"><i class="icon-mode_edit"></i></a></div>
<span class="edit-class-name" style="display: none"><input type="text" class="input-r-control"> <button class="btn btn-default">保存</button> <button class="btn btn-default">取消</button></span>
</div>
<div class="class-intro">
......
......@@ -60,7 +60,9 @@ $qiniu = \Yii::$app->qiniu;
<?php if ($course['teachers']) { ?>讲师:<?= join(', ', array_column($course['teachers'], 'name')) ?><?php } ?>
</div>
<div class="description"><?= mb_substr(strip_tags($course['intro']), 0, 250) ?></div>
<div class="teacher clearfix"><span class="pull-left">发布时间:2016-12-11</span> <span class="pull-right">时长:01:23:21</span></div>
<!--<div class="description"><?/*= mb_substr(strip_tags($course['intro']), 0, 250) */?></div>-->
<div class="teacher">
<span><?= $course['play_count'] ?> 次播放</span> ·
......
......@@ -840,6 +840,7 @@ a,a:hover,a:link {
/*审核中视频样式*/
.video-main {
position: relative;
height: 500px;
width: 100%;
background-color: #444;
......@@ -857,4 +858,30 @@ a,a:hover,a:link {
line-height: 1.8;
}
.play-mask-box {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
text-align: center;
background-color: rgba(0,0,0,.4);
}
.look-video {
position: absolute;
left: 0;
width: 100%;
height: 110px;
top: 60%;
}
.look-video p {
margin-top: 10px;
}
.look-video a {
color: #f7b940;
}
.vjs-big-play-centered .vjs-big-play-button {
z-index: 2!important;
}
......@@ -16,6 +16,11 @@
<span v-if="item.teachers.length > 0">讲师:{{getTeachers(index)}}</span>
</div>
<div class="v-teacher-list clearfix">
<span class="pull-left">发布时间:2016-08-04</span>
<span class="pull-right">时长:01:28:21</span>
</div>
<div class="v-foot">
<div class="v-price">
<small>¥</small>
......
......@@ -13,11 +13,13 @@
<a href="javascript:;" class="qzone post-icons bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
</div>
</div>
<myvideo v-if="!coursewareInfo.isPreview" :preview-url="coursewareInfo.previewUrl" :video-url="coursewareInfo.videoUrl"></myvideo>
<myvideo v-if="!coursewareInfo.isPreview" :preview-url="coursewareInfo.previewUrl"
:video-url="coursewareInfo.videoUrl"></myvideo>
<div v-else class="video-main">
<div class="video-empty" style="height:500px; width: 100%; background-color: #444; color: #fff; text-align: center;">
<div class="video-empty"
style="height:500px; width: 100%; background-color: #444; color: #fff; text-align: center;">
<i class="icon-clock"></i>
<p>课程审核中,审核通过后大家才可以看到您的课程 <br />
<p>课程审核中,审核通过后大家才可以看到您的课程 <br/>
审核结果将以短信形式通知您</p>
</div>
</div>
......@@ -37,13 +39,13 @@
</p>
<p v-else class="mb-right">
<a href="javascript:;"><i class="icon-comment-empty"></i>{{coursewareInfo.comment_count}}</a>
<a href="javascript:;"><i
<a href="javascript:;"><i
:class="{'icon-fav-full':coursewareInfo.isFavorite,'icon-fav-empty':!coursewareInfo.isFavorite}"></i>{{coursewareInfo.favorite_count}}</a>
<a href="javascript:;"><i
<a href="javascript:;"><i
:class="{'icon-zan-full':coursewareInfo.isSupport,'icon-zan-empty':!coursewareInfo.isSupport}"></i>{{coursewareInfo.support_count}}</a>
</p>
<button v-if="coursewareInfo.isPreview" class="btn btn-danger m-l-20 mb-left">购买
<button v-if="coursewareInfo.isPreview" class="btn btn-danger m-l-20 mb-left">购买
¥{{coursewareInfo.price}}
</button>
<template v-else>
......@@ -55,7 +57,8 @@
data-toggle="modal" disabled="disabled">已购买
</button>
<template v-else>
<button v-if="isMobile === false && isWeixin === false" class="btn btn-danger m-l-20 mb-left"
<button id="web-pay" v-if="isMobile === false && isWeixin === false"
class="btn btn-danger m-l-20 mb-left"
data-toggle="modal"
data-target="#pay">购买 ¥{{coursewareInfo.price}}
</button>
......@@ -189,14 +192,14 @@
},
mobileAliPay(courseId){
var url = __BASE_URL__ + 'home/pay?courseId=' + courseId;
window.location.href = url;
window.location.href = url;
},
weixinJsPay(courseId){
var url = __BASE_URL__ + 'weixin-js-pay/index?courseId=' + courseId;
window.location.href = url;
},
login(){
var returnUrl = __BASE_URL__ + 'home/video?courseId=' + this.coursewareInfo.course_id;
var returnUrl = __BASE_URL__ + 'home/video?courseId=' + this.coursewareInfo.course_id + '&pay=1';
var url = __BASE_URL__ + 'site/set-return-url?url=' + returnUrl;
$.getJSON(url, function () {
window.location.href = __BASE_URL__ + 'site/login';
......@@ -251,22 +254,37 @@
}
},
components: {
myvideo:myvideo
myvideo: myvideo
},
ready(){
var self = this;
this.isMobile = this.coursewareInfo.isMobile;
this.isWeixin = Utils.isWeixin();
//判断是否要显示支付信息
var pay = getQueryString('pay');
if (pay == 1 && !this.coursewareInfo.isShop) {
if(this.isMobile == false && this.isWeixin == false){
$('#web-pay').trigger('click');
}else if(this.isMobile == true && this.isWeixin == false){
this.mobileAliPay(this.coursewareInfo.course_id);
}else if(this.isWeixin === true){
this.weixinJsPay(this.coursewareInfo.course_id);
}
}
}
}
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
var context = "";
if (r != null)
context = r[2];
reg = null;
r = null;
return context == null || context == "" || context == "undefined" ? "" : context;
}
</script>
......
......@@ -4,6 +4,17 @@
controls preload="auto">
<source :src="videoUrl"/>
</video>
<!-- 付费视频的样式
<img src="http://deimg.c.pp.cc/preview/f0/97/a3/f8s68SyefrZj3841.jpg" width="100%" height="auto">
<div class="play-mask-box">
<div class="look-video">
<p>本课程为付费课程,价格¥108.00 <a href="#">立即购买</a></p>
&lt;!&ndash;<p>本课程可试看2分钟</p>&ndash;&gt;
</div>
</div>
-->
</div>
</template>
......@@ -36,11 +47,11 @@
"poster": self.previewUrl
}).ready(function () {
$('#my-video-play').css('width', '100%');
var wVideo = $('.video-detail-info').width();
var wVideo = $('#my-video-play').width();
var hVideo = wVideo * rate;
$('#my-video-play').css('height', hVideo);
window.onresize = function () {
var wVideo = $('.video-detail-info').width();
var wVideo = $('#my-video-play').width();
var hVideo = wVideo * rate;
$('#my-video-play').css('height', hVideo);
};
......
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