Commit 4141dffc authored by tttal's avatar tttal

2

   /**
     * 上传文件直接返回TRUE
     */
parent b261cae0
......@@ -91,18 +91,21 @@ export class UploadImageWithPreviewComponent implements OnDestroy, OnChanges {
this.delete.emit();
}
checkSelectFile(file) {
const isImg = ['image/jpeg', 'image/png', 'image/jpeg', 'image/gif', 'image/bmp'].includes(file.type);
if (!isImg) {
this.nzMessageService.error('You can only upload Image file (jpg|gif|png|bmp)');
return false;
}
const isGif = !['image/jpeg', 'image/png', 'image/jpeg', 'image/bmp'].includes(file.type);
const delta = isGif ? 20 : 5;
const isOverSize = file.size / 1024 / 1024 < delta;
if (!isOverSize) {
this.nzMessageService.error(`${isGif ? 'Gif' : 'Image'} must smaller than ${delta}MB!`);
return false;
}
/**
* 上传文件直接返回TRUE
*/
// const isImg = ['image/jpeg', 'image/png', 'image/jpeg', 'image/gif', 'image/bmp'].includes(file.type);
// if (!isImg) {
// this.nzMessageService.error('You can only upload Image file (jpg|gif|png|bmp)');
// return false;
// }
// const isGif = !['image/jpeg', 'image/png', 'image/jpeg', 'image/bmp'].includes(file.type);
// const delta = isGif ? 20 : 5;
// const isOverSize = file.size / 1024 / 1024 < delta;
// if (!isOverSize) {
// this.nzMessageService.error(`${isGif ? 'Gif' : 'Image'} must smaller than ${delta}MB!`);
// return false;
// }
return true;
}
......
......@@ -23,6 +23,9 @@
<input type="text" nz-input [(ngModel)]="item.text" (blur)="save()">
</div>
<div style="margin-top: 5px">
<span>音频: </span>
<app-audio-recorder
......
......@@ -115,7 +115,7 @@ cc.Class({
const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList);
cc.assetManager.loadAny(preloadArr, null, null, (err, data) => {
this.loadEnd();
if (window && window["air"]) {
window["air"].hideAirClassLoading();
......
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