Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
addInsured-AIA-POC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
liujianghai
addInsured-AIA-POC
Commits
cb5df2e7
Commit
cb5df2e7
authored
Mar 08, 2020
by
marsandheart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issue 1,2
parent
5ddfb0f0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
DoubleRecord.jsx
src/pages/DoubleRecord.jsx
+22
-8
No files found.
src/pages/DoubleRecord.jsx
View file @
cb5df2e7
...
...
@@ -385,13 +385,16 @@ export default function(props) {
const
playQuestion
=
(
questionId
)
=>
{
console
.
log
(
'407'
);
const
targetQuestion
=
currentStep
.
questions
.
find
((
q
)
=>
q
.
questionId
===
questionId
);
if
(
!
targetQuestion
||
targetQuestion
.
playStatus
===
'3'
)
{
if
(
!
targetQuestion
||
targetQuestion
.
playStatus
===
'3'
||
targetQuestion
.
playStatus
===
'2'
)
{
// 找不到问题,已经读完的,已经暂停的问题 不操作
return
;
}
else
if
(
!
targetQuestion
.
needPlay
)
{
// 不需要读的问题,直接置为已读完
setPlayStatus
(
questionId
,
'3'
);
}
else
if
(
targetQuestion
.
playStatus
!==
'2'
){
}
else
{
// 还未开始的问题状态为0的,置为1 开始读
setPlayStatus
(
questionId
,
'1'
);
voiceStart
(
targetQuestion
.
voice
);
voiceStart
(
targetQuestion
);
}
};
...
...
@@ -474,8 +477,8 @@ export default function(props) {
if
(
targetQuestion
.
needCheck
)
{
// stop and wait check
setPlayStatus
(
questionId
,
'3'
);
// console.log('need you check');
setPlayStatus
(
questionId
,
'3'
);
return
;
}
else
{
setPlayStatusAndChecked
(
questionId
,
'3'
,
true
);
...
...
@@ -526,9 +529,9 @@ export default function(props) {
};
// 调用app的语音播报,监听语音结束,在刚进入页面时自动调用一次,每一个问题结束后判断是否自动调用
const
voiceStart
=
(
voiceContent
)
=>
{
const
voiceStart
=
(
targetQuestion
)
=>
{
setIsPlaying
(
'Y'
);
console
.
log
(
`播放:
${
voiceContent
}
`
);
console
.
log
(
`播放:
${
targetQuestion
.
voice
}
`
);
// setTimeout(() => {
// console.log('finish one voice');
...
...
@@ -539,11 +542,18 @@ export default function(props) {
alert
(
'window.webkit 未定义'
);
return
;
}
window
.
webkit
.
messageHandlers
.
aiaVoiceBroadCastContent
.
postMessage
({
content
:
voiceContent
});
window
.
webkit
.
messageHandlers
.
aiaVoiceBroadCastContent
.
postMessage
({
content
:
targetQuestion
.
voice
});
window
.
aiaVoiceFinish
=
()
=>
{
console
.
log
(
'finish one step'
);
// 如果当前问题需要手动勾选,则将isPlaying置为 N ,如果不需要手动勾选,则马上要读下一个问题,故不改变isPlaying
if
(
targetQuestion
.
needCheck
)
{
setIsPlaying
(
'N'
);
}
finishOneVoice
();
};
};
...
...
@@ -642,8 +652,13 @@ export default function(props) {
const
currentStepIdx
=
steps
.
findIndex
((
s
)
=>
s
.
id
===
stepId
);
const
lastStepId
=
steps
[
currentStepIdx
-
1
].
id
;
const
currentQuestion
=
currentStep
.
questions
.
find
((
q
)
=>
q
.
questionId
===
questionId
);
if
(
currentQuestion
.
playStatus
===
'1'
)
{
// 1 正在读的-暂停; 2 已暂停的-不操作;3 已读完的-不操作
voicePause
();
setPlayStatus
(
questionId
,
'2'
);
}
setStepId
(
lastStepId
);
setQuestionId
(
findLastUnreadQuestion
(
lastStepId
));
}
...
...
@@ -715,7 +730,6 @@ export default function(props) {
question=
{
q
}
setPlayStatus=
{
setPlayStatus
}
setChecked=
{
setCheckThenNextQuestion
}
voiceStart=
{
voiceStart
}
voicePause=
{
voicePause
}
voiceContinue=
{
voiceContinue
}
/>
...
...
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