Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jj_learn_word
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
jj_learn_word
Commits
a19b27ac
Commit
a19b27ac
authored
Jul 24, 2025
by
limingzhe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://vcs.ireadabc.com/template/jj_learn_word
parents
3ebf9844
b68f5171
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
11 deletions
+19
-11
audio-recorder.component.html
...c/app/common/audio-recorder/audio-recorder.component.html
+1
-1
audio-recorder.component.ts
...src/app/common/audio-recorder/audio-recorder.component.ts
+14
-5
form.component.html
form/src/app/form/form.component.html
+2
-2
form.component.ts
form/src/app/form/form.component.ts
+2
-3
No files found.
form/src/app/common/audio-recorder/audio-recorder.component.html
View file @
a19b27ac
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
Record Audio
Record Audio
</div>
</div>
<nz-upload
<nz-upload
[
nzAccept
]
=
"'.
mp3
'"
[
nzAccept
]
=
"'.
mp3
,.
m4a
,.
wav
,.
ogg
'"
[
nzShowUploadList
]="
false
"
[
nzShowUploadList
]="
false
"
[
nzAction
]="
uploadUrl
"
[
nzAction
]="
uploadUrl
"
[
nzData
]="
uploadData
"
[
nzData
]="
uploadData
"
...
...
form/src/app/common/audio-recorder/audio-recorder.component.ts
View file @
a19b27ac
...
@@ -214,7 +214,8 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -214,7 +214,8 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
case
'
success
'
:
case
'
success
'
:
this
.
isUploading
=
false
;
this
.
isUploading
=
false
;
let
url
=
info
.
file
.
response
.
url
;
let
url
=
info
.
file
.
response
.
url
;
url
=
url
.
substring
(
0
,
url
.
lastIndexOf
(
"
.
"
))
+
"
_l.mp3
"
;
// 保留原始文件格式,只添加_l前缀
url
=
this
.
replaceAudioUrl
(
url
);
info
.
file
.
response
.
url
=
url
;
info
.
file
.
response
.
url
=
url
;
this
.
uploadSuccess
(
info
.
file
.
response
);
this
.
uploadSuccess
(
info
.
file
.
response
);
this
.
audioUploaded
.
emit
(
info
.
file
.
response
);
this
.
audioUploaded
.
emit
(
info
.
file
.
response
);
...
@@ -225,13 +226,20 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -225,13 +226,20 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
break
;
break
;
}
}
}
}
replaceAudioUrl
(
url
:
string
)
{
const
ext
=
url
.
substring
(
url
.
lastIndexOf
(
"
.
"
)).
toLowerCase
();
if
(
ext
===
"
.mp3
"
)
{
url
=
url
.
substring
(
0
,
url
.
lastIndexOf
(
"
.
"
))
+
"
_l.mp3
"
;
}
return
url
;
}
checkSelectFile
(
file
:
any
)
{
checkSelectFile
(
file
:
any
)
{
if
(
!
file
)
{
if
(
!
file
)
{
return
;
return
;
}
}
const
isAudio
=
[
'
audio/mp3
'
,
'
audio/wav
'
,
'
audio/ogg
'
].
includes
(
file
.
type
);
const
isAudio
=
[
'
audio/mp3
'
,
'
audio/wav
'
,
'
audio/ogg
'
,
'
audio/m4a
'
,
'
audio/x-m4a
'
].
includes
(
file
.
type
);
if
(
!
isAudio
)
{
if
(
!
isAudio
)
{
this
.
nzMessageService
.
error
(
'
You can only upload Audio file ( mp3 | wav |
ogg
)
'
);
this
.
nzMessageService
.
error
(
'
You can only upload Audio file ( mp3 | wav |
ogg | m4a
)
'
);
return
;
return
;
}
}
const
delta
=
25
;
const
delta
=
25
;
...
@@ -277,7 +285,8 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -277,7 +285,8 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
}
}
linkInputed
(
url
,
name
)
{
linkInputed
(
url
,
name
)
{
url
=
url
.
substring
(
0
,
url
.
lastIndexOf
(
"
.
"
))
+
"
_l.mp3
"
;
url
=
this
.
replaceAudioUrl
(
url
);
this
.
audioUrl
=
url
;
this
.
audioUrl
=
url
;
this
.
audioUploaded
.
emit
({
url
});
this
.
audioUploaded
.
emit
({
url
});
this
.
audioName
.
emit
(
name
);
this
.
audioName
.
emit
(
name
);
...
@@ -298,7 +307,7 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -298,7 +307,7 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
if
(
url
.
indexOf
(
"
teach
"
)
<
0
||
url
.
indexOf
(
"
cdn
"
)
<
0
)
{
if
(
url
.
indexOf
(
"
teach
"
)
<
0
||
url
.
indexOf
(
"
cdn
"
)
<
0
)
{
return
;
return
;
}
}
const
white
=
[
"
.mp3
"
];
const
white
=
[
"
.mp3
"
,
"
.m4a
"
,
"
.wav
"
,
"
.ogg
"
];
if
(
!
white
.
includes
(
url
.
substr
(
url
.
lastIndexOf
(
"
.
"
))))
{
if
(
!
white
.
includes
(
url
.
substr
(
url
.
lastIndexOf
(
"
.
"
))))
{
return
;
return
;
}
}
...
...
form/src/app/form/form.component.html
View file @
a19b27ac
...
@@ -102,10 +102,10 @@
...
@@ -102,10 +102,10 @@
</span>
</span>
<div
style=
"width: auto; display: flex; align-items: center;"
>
<div
style=
"width: auto; display: flex; align-items: center;"
>
<label
style=
"margin-right: 10px; font-size: 14px;"
>
<label
style=
"margin-right: 10px; font-size: 14px;"
>
<input
type=
"radio"
[(
ngModel
)]="
word
.
displayType
"
[
value
]="
1
"
(
change
)="
save
()"
>
词卡单词
<input
type=
"radio"
[(
ngModel
)]="
word
.
displayType
"
[
value
]="
1
"
(
change
)="
save
()"
[
name
]="'
displayType_
'
+
i
"
>
词卡单词
</label>
</label>
<label
style=
"font-size: 14px;"
>
<label
style=
"font-size: 14px;"
>
<input
type=
"radio"
[(
ngModel
)]="
word
.
displayType
"
[
value
]="
3
"
(
change
)="
save
()"
>
核心单词
<input
type=
"radio"
[(
ngModel
)]="
word
.
displayType
"
[
value
]="
3
"
(
change
)="
save
()"
[
name
]="'
displayType_
'
+
i
"
>
核心单词
</label>
</label>
</div>
</div>
</div>
</div>
...
...
form/src/app/form/form.component.ts
View file @
a19b27ac
...
@@ -31,10 +31,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -31,10 +31,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
'
art.
'
,
'
art.
'
,
'
num.
'
,
'
num.
'
,
'
abbr.
'
,
'
abbr.
'
,
'
verb phrase
'
,
'
phrase
'
,
'
noun phrase
'
,
'
prep phrase
'
,
'
ordinal number
'
,
'
ordinal number
'
,
'
det.
'
];
];
// 存储courseId
// 存储courseId
...
...
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