Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sun_cocos1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
sun_cocos1
Commits
4141dffc
Commit
4141dffc
authored
Nov 24, 2020
by
tttal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2
/** * 上传文件直接返回TRUE */
parent
b261cae0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
+19
-13
upload-image-with-preview.component.ts
...image-with-preview/upload-image-with-preview.component.ts
+15
-12
form.component.html
form/src/app/form/form.component.html
+3
-0
Scene.js
play/assets/tmpGame/script/Scene.js
+1
-1
No files found.
form/src/app/common/upload-image-with-preview/upload-image-with-preview.component.ts
View file @
4141dffc
...
@@ -91,18 +91,21 @@ export class UploadImageWithPreviewComponent implements OnDestroy, OnChanges {
...
@@ -91,18 +91,21 @@ export class UploadImageWithPreviewComponent implements OnDestroy, OnChanges {
this
.
delete
.
emit
();
this
.
delete
.
emit
();
}
}
checkSelectFile
(
file
)
{
checkSelectFile
(
file
)
{
const
isImg
=
[
'
image/jpeg
'
,
'
image/png
'
,
'
image/jpeg
'
,
'
image/gif
'
,
'
image/bmp
'
].
includes
(
file
.
type
);
/**
if
(
!
isImg
)
{
* 上传文件直接返回TRUE
this
.
nzMessageService
.
error
(
'
You can only upload Image file (jpg|gif|png|bmp)
'
);
*/
return
false
;
// const isImg = ['image/jpeg', 'image/png', 'image/jpeg', 'image/gif', 'image/bmp'].includes(file.type);
}
// if (!isImg) {
const
isGif
=
!
[
'
image/jpeg
'
,
'
image/png
'
,
'
image/jpeg
'
,
'
image/bmp
'
].
includes
(
file
.
type
);
// this.nzMessageService.error('You can only upload Image file (jpg|gif|png|bmp)');
const
delta
=
isGif
?
20
:
5
;
// return false;
const
isOverSize
=
file
.
size
/
1024
/
1024
<
delta
;
// }
if
(
!
isOverSize
)
{
// const isGif = !['image/jpeg', 'image/png', 'image/jpeg', 'image/bmp'].includes(file.type);
this
.
nzMessageService
.
error
(
`
${
isGif
?
'
Gif
'
:
'
Image
'
}
must smaller than
${
delta
}
MB!`
);
// const delta = isGif ? 20 : 5;
return
false
;
// const isOverSize = file.size / 1024 / 1024 < delta;
}
// if (!isOverSize) {
// this.nzMessageService.error(`${isGif ? 'Gif' : 'Image'} must smaller than ${delta}MB!`);
// return false;
// }
return
true
;
return
true
;
}
}
...
...
form/src/app/form/form.component.html
View file @
4141dffc
...
@@ -23,6 +23,9 @@
...
@@ -23,6 +23,9 @@
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
text
"
(
blur
)="
save
()"
>
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
text
"
(
blur
)="
save
()"
>
</div>
</div>
<div
style=
"margin-top: 5px"
>
<div
style=
"margin-top: 5px"
>
<span>
音频:
</span>
<span>
音频:
</span>
<app-audio-recorder
<app-audio-recorder
...
...
play/assets/tmpGame/script/Scene.js
View file @
4141dffc
...
@@ -115,7 +115,7 @@ cc.Class({
...
@@ -115,7 +115,7 @@ cc.Class({
const
preloadArr
=
this
.
_imageResList
.
concat
(
this
.
_audioResList
).
concat
(
this
.
_animaResList
);
const
preloadArr
=
this
.
_imageResList
.
concat
(
this
.
_audioResList
).
concat
(
this
.
_animaResList
);
cc
.
assetManager
.
loadAny
(
preloadArr
,
null
,
null
,
(
err
,
data
)
=>
{
cc
.
assetManager
.
loadAny
(
preloadArr
,
null
,
null
,
(
err
,
data
)
=>
{
this
.
loadEnd
();
this
.
loadEnd
();
if
(
window
&&
window
[
"
air
"
])
{
if
(
window
&&
window
[
"
air
"
])
{
window
[
"
air
"
].
hideAirClassLoading
();
window
[
"
air
"
].
hideAirClassLoading
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment