Commit b6f6d8ed authored by liujiangnan's avatar liujiangnan

feat: 增加课前导读的配置

parent 83198a13
......@@ -25,6 +25,7 @@
</div>
<div class="border" style="width: 1000px;">
<span>课前导读</span>
<div *ngFor="let page of item.pages; let i = index">
<div class="border" style="width: 950px;">
<div>
......@@ -48,11 +49,30 @@
<textarea rows="4" nz-input [(ngModel)]="page.text" (blur)="save()"></textarea>
</div>
<br>
<button style="width: 900px; height: 30px; color: red;" (click)="removePage(i)">删除页面</button>
<button style="width: 900px; height: 30px; color: red;" (click)="removePage(i)">删除</button>
</div>
</div>
<div class="border" style="width: 950px;">
<button style="width: 900px; height: 100px;" (click)="addPage()">增加页面</button>
<button style="width: 900px; height: 100px;" (click)="addPage()">增加导读</button>
</div>
</div>
<div class="border" style="width: 1000px;">
<span>课程简介</span>
<div *ngFor="let page of item.introduces; let i = index">
<div class="border" style="width: 950px;">
<span>图片:</span>
<div style="width: 300px;">
<app-upload-image-with-preview [picUrl]="page.image"
(imageUploaded)="onAssetUploadSuccess($event, 'introduces', i, 'image')">
</app-upload-image-with-preview>
</div>
<br>
<button style="width: 900px; height: 30px; color: red;" (click)="removeIntroduce(i)">删除</button>
</div>
</div>
<div class="border" style="width: 950px;">
<button style="width: 900px; height: 100px;" (click)="addIntroduce()">增加简介</button>
</div>
</div>
</div>
......
......@@ -20,6 +20,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
sentence: '',
store: '',
pages: [],
introduces: [],
};
addPage() {
......@@ -37,6 +38,18 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this.save();
}
addIntroduce() {
this.item.introduces.push({
image: ''
});
this.save();
}
removeIntroduce(idx) {
this.item.introduces.splice(idx, 1);
this.save();
}
handle_dragover(e) {
e.preventDefault();
}
......
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