Commit b769a357 authored by 汪波's avatar 汪波

Merge branch 'dev' of http://gitlab.fingerage.com:999/xiabin/zuiketang into dev

parents dce395f1 f06e2694
...@@ -41,25 +41,23 @@ AppAsset::addCss($this, '@web/assets/css/course_publish.css'); ...@@ -41,25 +41,23 @@ AppAsset::addCss($this, '@web/assets/css/course_publish.css');
<teachers init-teachers="<?=join(',', $teacherIds)?>"></teachers> <teachers init-teachers="<?=join(',', $teacherIds)?>"></teachers>
</div> </div>
<?php if ($sourceEditable) { ?>
<div class="cls-part">
<div class="tit">更换视频 <span class="text-info" style="font-size:12px;">不选择则继续使用现有视频</span></div>
<video-upload uptoken="<?=$videoToken?>" text="保留原视频或选择要更换的视频"></video-upload>
</div>
<?php } else { ?>
<div class="cls-part"> <div class="cls-part">
<div class="tit">视频信息</div> <div class="tit">视频文件</div>
<div> <div v-if="dynamicVideo==null">
<div class="upload-ready"> <div class="upload-ready">
<div class="video-detail" style="margin-top:0;"> <h3>原有视频.<?=$lesson->format?></h3>
视频时长:<?=Utils::humanSeconds($lesson->time)?><br> <div class="video-detail" style="margin-top:15px;">
原始大小:<?=Utils::byteConvert($lesson->size)?><br> 视频大小: <?=Utils::byteConvert($lesson->size)?> &nbsp;
原始格式:<?=$lesson->format?><br> 时长: <?=Utils::humanSeconds($lesson->time)?>
</div> </div>
<i class="upload-progress" style="width:100%"></i>
<?php if ($sourceEditable) { ?>
<a href="javascript:;" class="delete" title="删除当前视频" @click="removeVideoClick"><i class="icon-cross"></i></a>
<?php } ?>
</div> </div>
</div> </div>
<component :is="dynamicVideo" uptoken="<?=$videoToken?>"></component>
</div> </div>
<?php } ?>
<div class="cls-part"> <div class="cls-part">
<div class="tit">规则设定</div> <div class="tit">规则设定</div>
......
...@@ -986,8 +986,11 @@ textarea.input-r-control { ...@@ -986,8 +986,11 @@ textarea.input-r-control {
height: 90px; height: 90px;
border-radius: 3px; border-radius: 3px;
border: 1px solid #e7e7e7; border: 1px solid #e7e7e7;
overflow: hidden;
padding: 10px; padding: 10px;
margin-top: 10px; margin-top: 10px;
position:relative;
z-index:2;
} }
.upload-ready h3 { .upload-ready h3 {
...@@ -995,6 +998,9 @@ textarea.input-r-control { ...@@ -995,6 +998,9 @@ textarea.input-r-control {
color: #333; color: #333;
font-weight: normal; font-weight: normal;
margin: 0; margin: 0;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
} }
.upload-ready .video-detail { .upload-ready .video-detail {
...@@ -1012,10 +1018,7 @@ textarea.input-r-control { ...@@ -1012,10 +1018,7 @@ textarea.input-r-control {
position: absolute; position: absolute;
left: 0; left: 0;
bottom: 0; bottom: 0;
display: inline-block;
width: 200px;
height: 3px; height: 3px;
border-radius: 0 0 0 3px;
background-color: #4285f4; background-color: #4285f4;
} }
......
<template xmlns:v-bind="http://www.w3.org/1999/xhtml"> <template xmlns:v-bind="http://www.w3.org/1999/xhtml">
<div> <div>
<div class="upload-video-btn" v-bind:id="uploaderId" v-show="state=='ready' || state=='error'"> <div class="upload-video-btn" v-bind:id="uploaderId" v-show="state=='ready' || state=='error'" style="cursor:pointer;">
<i class="icon-play"></i> <i class="icon-play"></i>
<b>{{text}}</b> <b>上传视频</b>
</div> </div>
<div class="upload-ready" v-else> <div class="upload-ready" v-else>
<h3>{{videoName}}</h3> <h3>{{videoName}}</h3>
<div class="video-detail"> <div class="video-detail">
...@@ -23,11 +22,6 @@ ...@@ -23,11 +22,6 @@
</div> </div>
</div> </div>
</template> </template>
<style>
.upload-video-btn {cursor:pointer;}
.upload-ready {position:relative; z-index:2;}
.upload-ready h3 {overflow:hidden; white-space:nowrap; text-overflow:ellipsis;}
</style>
<script> <script>
import filesize from "file-size"; import filesize from "file-size";
import layer from "layer-js"; import layer from "layer-js";
...@@ -48,11 +42,7 @@ export default { ...@@ -48,11 +42,7 @@ export default {
} }
}, },
props: { props: {
uptoken: String, uptoken: String
text: {
type: String,
default: "上传视频"
}
}, },
methods: { methods: {
cancelClick: function() { cancelClick: function() {
......
...@@ -2,7 +2,18 @@ ...@@ -2,7 +2,18 @@
* Created by pader on 2016/10/31. * Created by pader on 2016/10/31.
*/ */
module.exports = { module.exports = {
generateOption: function(form, create) { generateValidateOption: function(form, create) {
var freeTimeTipIdx = 0;
$(form.free_time).focus(function() {
freeTimeTipIdx = layer.tips("请认真填写,视频通过审核后试看时间不可再修改。", this, {
tips: 2,
time: 0
});
}).blur(function() {
layer.close(freeTimeTipIdx);
});
return { return {
ignore: "", ignore: "",
rules: { rules: {
...@@ -46,7 +57,7 @@ module.exports = { ...@@ -46,7 +57,7 @@ module.exports = {
var org = element.get(0); var org = element.get(0);
var to = null; var to = null;
if (create && org == form.vuid) { if (org == form.vuid) {
to = $(".upload-video-btn").get(0); to = $(".upload-video-btn").get(0);
} else if (org == form.preview) { } else if (org == form.preview) {
to = $(".upload-video-screen").get(0); to = $(".upload-video-screen").get(0);
......
...@@ -8,7 +8,7 @@ var teacherQuickList = require('./components/teacher-quick-list.vue'); ...@@ -8,7 +8,7 @@ var teacherQuickList = require('./components/teacher-quick-list.vue');
var richText = require('./rich-text'); var richText = require('./rich-text');
var layer = require("layer-js"); var layer = require("layer-js");
var str = require("../utils/string"); var str = require("../utils/string");
var validateOption = require('./validate-option'); var commonPart = require('./common-part');
require('jquery-validation'); require('jquery-validation');
...@@ -19,13 +19,20 @@ var vm = new Vue({ ...@@ -19,13 +19,20 @@ var vm = new Vue({
data: { data: {
vuid: "", vuid: "",
previewKey: "", previewKey: "",
tmp: str.rand(20) tmp: str.rand(20),
dynamicVideo: null
}, },
components: { components: {
videoUpload: videoUpload, videoUpload: videoUpload,
thumbUpload: thumbUpload, thumbUpload: thumbUpload,
teachers: teacherQuickList teachers: teacherQuickList
}, },
methods: {
removeVideoClick: function() {
this.dynamicVideo = "videoUpload";
this.vuid = "";
}
},
ready: function() { ready: function() {
var self = this; var self = this;
...@@ -41,7 +48,7 @@ var vm = new Vue({ ...@@ -41,7 +48,7 @@ var vm = new Vue({
self.previewKey = data.uuid; self.previewKey = data.uuid;
}); });
var opt = validateOption.generateOption(form); var opt = commonPart.generateValidateOption(form);
$.extend(opt, { $.extend(opt, {
//debug: true, //debug: true,
...@@ -74,7 +81,11 @@ var vm = new Vue({ ...@@ -74,7 +81,11 @@ var vm = new Vue({
}); });
var validator = $(form).validate(opt); var validator = $(form).validate(opt);
var doValidate = function() { validator.form(); }; var doValidate = function() {
self.$nextTick(function() {
validator.form();
});
};
this.$watch("vuid", doValidate); this.$watch("vuid", doValidate);
this.$watch("previewKey", doValidate); this.$watch("previewKey", doValidate);
......
...@@ -8,7 +8,7 @@ var teacherQuickList = require('./components/teacher-quick-list.vue'); ...@@ -8,7 +8,7 @@ var teacherQuickList = require('./components/teacher-quick-list.vue');
var richText = require('./rich-text'); var richText = require('./rich-text');
var layer = require("layer-js"); var layer = require("layer-js");
var str = require("../utils/string"); var str = require("../utils/string");
var validateOption = require('./validate-option'); var commonPart = require('./common-part');
require('jquery-validation'); require('jquery-validation');
...@@ -41,7 +41,7 @@ var vm = new Vue({ ...@@ -41,7 +41,7 @@ var vm = new Vue({
self.previewKey = data.uuid; self.previewKey = data.uuid;
}); });
var opt = validateOption.generateOption(form, true); var opt = commonPart.generateValidateOption(form, true);
$.extend(opt, { $.extend(opt, {
//debug: true, //debug: true,
...@@ -66,7 +66,11 @@ var vm = new Vue({ ...@@ -66,7 +66,11 @@ var vm = new Vue({
}); });
var validator = $(form).validate(opt); var validator = $(form).validate(opt);
var doValidate = function() { validator.form(); }; var doValidate = function() {
self.$nextTick(function() {
validator.form();
});
};
this.$watch("vuid", doValidate); this.$watch("vuid", doValidate);
this.$watch("previewKey", doValidate); this.$watch("previewKey", doValidate);
......
...@@ -806,14 +806,20 @@ textarea.input-r-control { ...@@ -806,14 +806,20 @@ textarea.input-r-control {
height: 90px; height: 90px;
border-radius: 3px; border-radius: 3px;
border: 1px solid #e7e7e7; border: 1px solid #e7e7e7;
overflow: hidden;
padding: 10px; padding: 10px;
margin-top: 10px; margin-top: 10px;
position:relative;
z-index:2;
} }
.upload-ready h3 { .upload-ready h3 {
font-size: 14px; font-size: 14px;
color: #333; color: #333;
font-weight: normal; font-weight: normal;
margin: 0; margin: 0;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
} }
.upload-ready .video-detail { .upload-ready .video-detail {
color: #999; color: #999;
...@@ -824,14 +830,11 @@ textarea.input-r-control { ...@@ -824,14 +830,11 @@ textarea.input-r-control {
font-size: 12px; font-size: 12px;
padding-top: 8px; padding-top: 8px;
} }
.upload-ready i { .upload-ready > i {
position: absolute; position: absolute;
left: 0; left: 0;
bottom: 0; bottom: 0;
display: inline-block;
width: 200px;
height: 3px; height: 3px;
border-radius: 0 0 0 3px;
background-color: #4285f4; background-color: #4285f4;
} }
.cls-intro-textarea { .cls-intro-textarea {
......
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