Commit 02a13c10 authored by 杨培's avatar 杨培

优化修改视频体验和视频信息显示

parent 1e4f0558
...@@ -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="cls-part">
<div class="tit">更换视频 <span class="text-info" style="font-size:12px;">不选择则继续使用现有视频</span></div> <div class="tit">视频文件</div>
<video-upload uptoken="<?=$videoToken?>" text="保留原视频或选择要更换的视频"></video-upload> <div v-if="dynamicVideo==null">
</div>
<?php } else { ?>
<div class="cls-part">
<div class="tit">视频信息</div>
<div>
<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>
......
...@@ -969,8 +969,11 @@ textarea.input-r-control { ...@@ -969,8 +969,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 {
...@@ -978,6 +981,9 @@ textarea.input-r-control { ...@@ -978,6 +981,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 {
...@@ -995,10 +1001,7 @@ textarea.input-r-control { ...@@ -995,10 +1001,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() {
......
...@@ -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;
...@@ -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);
......
...@@ -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);
......
...@@ -46,7 +46,7 @@ module.exports = { ...@@ -46,7 +46,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);
......
...@@ -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