Commit da662a60 authored by kingweight's avatar kingweight

调整 视频上传组件

parent d0c9452a
......@@ -30,7 +30,7 @@
<div class="i-bg" [style.width]="progress+'%'"></div>
<div class="i-text">
<fa-icon icon="cloud-upload-alt"></fa-icon>
Uploading...
上传中,请耐心等待...
</div>
</div>
<div class="p-upload-check-bg" *ngIf="checking">
......
<div style="margin: 30px;">
<div style="margin: 30px; display: flex; align-items: center; ">
<h3>单元名称:</h3>
<textarea nz-input [(ngModel)]="item.title" (blur)="save()" style=" width: 350px; min-height: 60px;"></textarea>
</div>
<div style="margin: 30px; display: flex; align-items: center; ">
<h3>视频互动课名称:</h3>
<textarea nz-input [(ngModel)]="item.video_title" (blur)="save()" style=" width: 350px; min-height: 60px;"></textarea>
</div>
<div class="model-content">
<!-- <div
......@@ -24,26 +14,25 @@
align='center' >
<div style="width: 100px; background-color: white; transform: translateY(-30px);" > 视频 </div>
<div style="margin: 30px; display: flex; align-items: center; ">
<h3>单元名称:</h3>
<textarea nz-input [(ngModel)]="item.title" (blur)="save()" style=" width: 350px; min-height: 60px;"></textarea>
<div style="margin: 20px; display: flex; align-items: center; ">
<h3 style="width: 120px;">单元名称:</h3>
<textarea nz-input [(ngModel)]="item.title" (blur)="save()" style=" width: 100%; min-height: 60px;"></textarea>
</div>
<div style="margin: 30px; display: flex; align-items: center; ">
<div style="margin: 20px; display: flex; align-items: center; ">
<h3>视频互动课名称:</h3>
<textarea nz-input [(ngModel)]="item.video_title" (blur)="save()" style=" width: 350px; min-height: 60px;"></textarea>
<textarea nz-input [(ngModel)]="item.video_title" (blur)="save()" style=" width: 320px; min-height: 60px;"></textarea>
</div>
<br>
<app-upload-image-with-preview style="width: 80%;" [picUrl]="item.cover" (imageUploaded)="onImageUploadSuccess($event)">
</app-upload-image-with-preview>
<app-upload-video [videoUrl]="item.video_url.replace('.mp4', '_h.mp4')" [showUploadBtn]="true" (videoUploaded)="onVideoUploaded($event)" (onCapture)="handleOnCapture($event)" (parentRef)="onParentRef($event)"></app-upload-video>
<div style="padding: 5px 0;" align='center'>
<input type="text" nz-input [(ngModel)]="item.video_url" (blur)="save()">
<h3>视频地址</h3>
<input type="text" nz-input [(ngModel)]="item.video_url" disabled (blur)="save()">
</div>
<button style="margin-top: 10px; " (click)="onRemoveData()">删除视频</button>
<!-- <button style="margin-top: 10px; " (click)="onRemoveVideo()">删除视频</button> -->
</div>
<button style="width: 30% ;min-width: 300px;height: 170px; margin-top: 20px; margin-left:2.5%;"
(click)="onAddData()">添加视频</button>
</div>
</div>
......
......@@ -716,14 +716,6 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
*/
save() {
// if (this.tempItem) {
// this.item.tempItem = this.tempItem;
// }
// if (this.customTypeGroupArr) {
// this.item.customTypeGroupArr = this.customTypeGroupArr;
// }
(<any>window).courseware.setData(this.item, null, this.saveKey);
this.refresh();
......@@ -767,11 +759,13 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
}
/**
* 删除卡片
* 删除视频
*/
onRemoveData() {
onRemoveVideo() {
// 清除视频URL和封面,使用户可以重新上传视频
this.item.video_url = "";
this.item.cover = "";
this.save();
}
/** 添加卡片 */
......@@ -787,6 +781,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
onParentRef(e) {
const item = this.item;
if (!item.file) return;
const uploadXHRArgs:UploadXHRArgs={
file: item.file,
name:'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