Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hw_003
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
hw_003
Commits
a0d7069a
Commit
a0d7069a
authored
Dec 20, 2019
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
index loading
parent
1e34b406
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
93 deletions
+81
-93
form.component.html
src/app/form/form.component.html
+57
-15
form.component.ts
src/app/form/form.component.ts
+17
-2
play.component.ts
src/app/play/play.component.ts
+3
-0
index.html
src/index.html
+4
-76
No files found.
src/app/form/form.component.html
View file @
a0d7069a
...
...
@@ -22,10 +22,7 @@
<div
style=
"display: flex; justify-items: center; padding-top: 10px"
>
<!--<app-audio-recorder-->
<!--[audioUrl]="it.audio_url"-->
<!--(audioUploaded)="onAudioUploadSuccessByItem($event, it)">-->
<!--</app-audio-recorder>-->
<button
style=
"margin-left: 10px;"
nz-button
nzType=
"danger"
(
click
)="
deleteItem
(
it
)"
>
...
...
@@ -46,7 +43,18 @@
<input
type=
"text"
nz-input
placeholder=
""
[(
ngModel
)]="
it
.
question
"
(
blur
)="
saveItem
()"
>
</div>
<div
style=
"width: 70%; margin: auto"
>
<div
style=
"display: flex; align-items: center; margin-bottom: 0.5vw"
>
<span
style=
"width: 80px;"
>
题干音频:
</span>
<app-audio-recorder
[
audioUrl
]="
it
.
audio_url
"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
it
)"
>
</app-audio-recorder>
</div>
<div
style=
"width: 70%; margin: auto; padding-top: 0.5vw"
>
<app-upload-image-with-preview
style=
"width: 100%"
...
...
@@ -54,9 +62,19 @@
(
imageUploaded
)="
onImageUploadSuccessByItem
($
event
,
it
,
'
question
')"
></app-upload-image-with-preview>
<div
style=
"display: flex; align-items: center; margin-bottom: 0.5vw; padding-top: 0.5vw"
>
<span
style=
"width: 80px;"
>
图片音频:
</span>
<app-audio-recorder
[
audioUrl
]="
it
.
pic_audio_url
"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
it
,
'
pic
')"
>
</app-audio-recorder>
</div>
</div>
<div
style=
"display: flex; align-items: center; width: 70%; margin: auto;padding-top: 1vw"
>
<span
style=
"margin-right: 2vw"
>
答案类型:
</span>
...
...
@@ -78,9 +96,20 @@
<div
*
ngIf=
"it.answerType == 'A'"
>
<nz-radio-group
style=
"width: 90%;"
[(
ngModel
)]="
it
.
answerId
"
>
<div
style=
"display: flex; align-items: center; margin-top: 1vw"
*
ngFor=
"let ans of it.answerArr; let j = index"
>
<label
nz-radio
nzValue=
"{{j}}"
(
click
)="
saveItem
()"
>
{{ans.id}}
</label>
<input
type=
"text"
nz-input
placeholder=
""
[(
ngModel
)]="
ans
.
text
"
(
blur
)="
saveItem
()"
>
<div
style=
"margin-top: 1vw"
*
ngFor=
"let ans of it.answerArr; let j = index"
>
<div
style=
"display: flex; align-items: center;"
>
<label
nz-radio
nzValue=
"{{j}}"
(
click
)="
saveItem
()"
>
{{ans.id}}
</label>
<input
type=
"text"
nz-input
placeholder=
""
[(
ngModel
)]="
ans
.
text
"
(
blur
)="
saveItem
()"
>
</div>
<div
style=
"width: 200px; margin: auto;"
>
<app-audio-recorder
[
audioUrl
]="
ans
[
j
+
'
_text_audio_url
']"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
ans
,
j
+
'
_text
')"
>
</app-audio-recorder>
</div>
</div>
</nz-radio-group>
</div>
...
...
@@ -90,15 +119,28 @@
<div
*
ngIf=
"it.answerType == 'B'"
>
<nz-radio-group
style=
"width: 90%;"
[(
ngModel
)]="
it
.
answerId
"
>
<div
style=
"
display: flex; align-items: center; margin-top: 1vw
"
*
ngFor=
"let ans of it.answerArr; let j = index"
<div
style=
"
margin-top: 1vw;
"
*
ngFor=
"let ans of it.answerArr; let j = index"
nz-col
nzSpan=
"24"
>
<label
nz-radio
nzValue=
"{{j}}"
(
click
)="
saveItem
()"
>
{{ans.id}}
</label>
<app-upload-image-with-preview
style=
"width: 60%"
[
picUrl
]="
ans
.
pic_url
"
(
imageUploaded
)="
onImageUploadSuccessByItem
($
event
,
ans
)"
></app-upload-image-with-preview>
<div
style=
"display: flex; align-items: center;"
>
<label
nz-radio
nzValue=
"{{j}}"
(
click
)="
saveItem
()"
>
{{ans.id}}
</label>
<app-upload-image-with-preview
style=
"width: 60%"
[
picUrl
]="
ans
.
pic_url
"
(
imageUploaded
)="
onImageUploadSuccessByItem
($
event
,
ans
)"
></app-upload-image-with-preview>
</div>
<div
style=
"width: 100%; padding-left: 20%"
>
<app-audio-recorder
style=
"width: 100%; margin: auto"
[
audioUrl
]="
ans
[
j
+'
_pic_audio_url
']"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
ans
,
j
+
'
_pic
')"
>
</app-audio-recorder>
</div>
</div>
</nz-radio-group>
</div>
...
...
src/app/form/form.component.ts
View file @
a0d7069a
import
{
Component
,
EventEmitter
,
Input
,
OnDestroy
,
OnChanges
,
OnInit
,
Output
,
ApplicationRef
}
from
'
@angular/core
'
;
import
{
Component
,
EventEmitter
,
Input
,
OnDestroy
,
OnChanges
,
OnInit
,
Output
,
ApplicationRef
,
ChangeDetectorRef
}
from
'
@angular/core
'
;
...
...
@@ -35,7 +45,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
constructor
(
private
appRef
:
ApplicationRef
)
{
constructor
(
private
appRef
:
ApplicationRef
,
public
changeDetectorRef
:
ChangeDetectorRef
)
{
}
...
...
@@ -60,6 +71,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
console
.
log
(
'
~data:
'
,
data
);
this
.
init
();
this
.
changeDetectorRef
.
markForCheck
();
this
.
changeDetectorRef
.
detectChanges
();
this
.
refresh
();
},
this
.
KEY
);
...
...
src/app/play/play.component.ts
View file @
a0d7069a
...
...
@@ -497,6 +497,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
loadResources
().
then
(()
=>
{
// this.setfontData();
window
[
'
air
'
].
hideAirClassLoading
(
this
.
KEY
,
this
.
data
);
this
.
init
();
this
.
update
();
});
...
...
src/index.html
100644 → 100755
View file @
a0d7069a
...
...
@@ -7,82 +7,10 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<link
rel=
"icon"
type=
"image/x-icon"
href=
"favicon.ico"
>
<script>
window
.
courseware
=
(
function
(){
if
(
window
.
parent
.
net
){
window
.
net
=
window
.
parent
.
net
;
var
id
=
window
.
frameElement
.
getAttribute
(
"
dataid
"
);
return
{
getData
:
function
(
callback
,
key
=
''
){
net
.
getData
(
"
getCoursewareData
"
,
id
,
function
(
res
){
if
(
res
){
res
=
JSON
.
parse
(
res
);
if
(
res
.
msg
===
"
success
"
){
let
callData
=
null
;
if
(
res
.
data
&&
res
.
data
!=
'
null
'
){
callData
=
JSON
.
parse
(
res
.
data
);
}
callback
&&
callback
(
callData
);
}
else
{
alert
(
'
数据加载失败!
'
);
}
}
else
{
alert
(
'
数据加载失败!
'
);
}
});
},
setData
:
function
(
data
,
callback
,
key
=
''
){
let
str
=
JSON
.
stringify
(
data
);
net
.
getData
(
"
setCoursewareData
"
,{
id
:
id
,
data
:
str
},
function
(
res
){
if
(
res
){
res
=
JSON
.
parse
(
res
);
if
(
res
.
msg
===
"
success
"
){
callback
&&
callback
();
}
else
{
alert
(
'
数据保存失败!
'
);
}
}
else
{
alert
(
'
数据保存失败!
'
);
}
});
},
uploadUrl
:
function
(){
return
net
.
getUploadFileURL
();
},
uploadData
:
function
(){
return
net
.
getAjaxData
(
"
uploadFile
"
,
""
);
}
}
}
else
{
return
{
getData
:
function
(
callback
,
key
=
''
){
let
data
=
localStorage
.
getItem
(
"
courseware_data_
"
+
key
);
if
(
data
){
data
=
JSON
.
parse
(
data
);
}
callback
&&
callback
(
data
);
},
setData
:
function
(
data
,
callback
,
key
=
''
){
console
.
log
(
"
******local********
"
);
localStorage
.
setItem
(
"
courseware_data_
"
+
key
,
JSON
.
stringify
(
data
));
callback
&&
callback
();
},
uploadUrl
:
function
(){
return
'
http://localhost:3000/api/test
'
;
},
uploadData
:
function
(){
return
{};
}
}
}
})();
</script>
<script
type=
"text/javascript"
src=
"http://teach.cdn.ireadabc.com/h5template/h5-static-lib/js/air.js"
></script>
</head>
<body>
<app-root></app-root>
</body>
<app-root></app-root>
</body>
</html>
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