Commit 8314396f authored by marsandheart's avatar marsandheart

注释掉一些console,修改节点二到五的问题格式,更改pdfPath

parent 3f614b3b
...@@ -17,7 +17,7 @@ const showPDF = () => { ...@@ -17,7 +17,7 @@ const showPDF = () => {
return; return;
} }
window.webkit.messageHandlers.aiaPDFPreView.postMessage({ window.webkit.messageHandlers.aiaPDFPreView.postMessage({
pdfPath: 'https://marsandheart.github.io/pdf/frontendKnowledge.pdf', pdfPath: 'https://gitee.com/JYWan/JYWeiBo/raw/master/aia_doc-1.pdf',
pdfName: '免除保险人责任条款' pdfName: '免除保险人责任条款'
}); });
}; };
...@@ -105,6 +105,10 @@ const defaultSteps = [ ...@@ -105,6 +105,10 @@ const defaultSteps = [
questions: [ questions: [
{ {
questionId: '', questionId: '',
needPlay: false,
needCheck: false,
playStatus: '0',
checked: false,
text: '', text: '',
voice: '' voice: ''
} }
...@@ -117,6 +121,10 @@ const defaultSteps = [ ...@@ -117,6 +121,10 @@ const defaultSteps = [
questions: [ questions: [
{ {
questionId: '', questionId: '',
needPlay: false,
needCheck: false,
playStatus: '0',
checked: false,
text: '', text: '',
voice: '' voice: ''
} }
...@@ -129,6 +137,10 @@ const defaultSteps = [ ...@@ -129,6 +137,10 @@ const defaultSteps = [
questions: [ questions: [
{ {
questionId: '', questionId: '',
needPlay: false,
needCheck: false,
playStatus: '0',
checked: false,
text: '', text: '',
voice: '' voice: ''
} }
...@@ -141,6 +153,10 @@ const defaultSteps = [ ...@@ -141,6 +153,10 @@ const defaultSteps = [
questions: [ questions: [
{ {
questionId: '', questionId: '',
needPlay: false,
needCheck: false,
playStatus: '0',
checked: false,
text: '', text: '',
voice: '' voice: ''
} }
...@@ -154,6 +170,10 @@ const defaultSteps = [ ...@@ -154,6 +170,10 @@ const defaultSteps = [
questions: [ questions: [
{ {
questionId: '1', questionId: '1',
needPlay: false,
needCheck: false,
playStatus: '0',
checked: false,
text: ( text: (
<span> <span>
请销售人员点击链接向镜头展示 请销售人员点击链接向镜头展示
...@@ -197,7 +217,7 @@ export default function(props) { ...@@ -197,7 +217,7 @@ export default function(props) {
const currentStep = steps.find((s) => s.id === stepId); const currentStep = steps.find((s) => s.id === stepId);
useEffect(() => { useEffect(() => {
console.log('use effect'); // console.log('use effect');
setTimeout(() => { setTimeout(() => {
playQuestion(questionId); playQuestion(questionId);
}, 1000); }, 1000);
...@@ -206,7 +226,7 @@ export default function(props) { ...@@ -206,7 +226,7 @@ export default function(props) {
// 朗读当前问题 // 朗读当前问题
const playQuestion = (questionId) => { const playQuestion = (questionId) => {
const targetQuestion = currentStep.questions.find((q) => q.questionId === questionId); const targetQuestion = currentStep.questions.find((q) => q.questionId === questionId);
if (!targetQuestion.needPlay) { if (!targetQuestion || !targetQuestion.needPlay) {
return; return;
} }
...@@ -233,7 +253,7 @@ export default function(props) { ...@@ -233,7 +253,7 @@ export default function(props) {
newSteps[stepIdx].questions[questionIdx].playStatus = playStatus; newSteps[stepIdx].questions[questionIdx].playStatus = playStatus;
updateSteps(newSteps); updateSteps(newSteps);
console.log(`设置问题${qId}${playStatus}`); // console.log(`设置问题${qId}为${playStatus}`);
}; };
// 勾选,用于需要勾选的问题 // 勾选,用于需要勾选的问题
...@@ -255,7 +275,7 @@ export default function(props) { ...@@ -255,7 +275,7 @@ export default function(props) {
newSteps[stepIdx].questions[questionIdx].checked = checked; newSteps[stepIdx].questions[questionIdx].checked = checked;
updateSteps(newSteps); updateSteps(newSteps);
console.log(checked); // console.log(checked);
}; };
const setCheckThenNextQuestion = () => { const setCheckThenNextQuestion = () => {
...@@ -282,7 +302,7 @@ export default function(props) { ...@@ -282,7 +302,7 @@ export default function(props) {
newSteps[stepIdx].questions[questionIdx].checked = checked; newSteps[stepIdx].questions[questionIdx].checked = checked;
updateSteps(newSteps); updateSteps(newSteps);
console.log(checked); // console.log(checked);
}; };
// app结束朗读后调用 // app结束朗读后调用
...@@ -292,10 +312,10 @@ export default function(props) { ...@@ -292,10 +312,10 @@ export default function(props) {
if (targetQuestion.needCheck) { if (targetQuestion.needCheck) {
// stop and wait check // stop and wait check
setPlayStatus(questionId, '3'); setPlayStatus(questionId, '3');
console.log('need you check'); // console.log('need you check');
return; return;
} else { } else {
console.log('auto check'); // console.log('auto check');
// setPlayStatus(questionId,'3'); // setPlayStatus(questionId,'3');
// checkCurrentQuestion(); // checkCurrentQuestion();
setPlayStatusAndChecked(questionId, '3', true); setPlayStatusAndChecked(questionId, '3', true);
...@@ -354,6 +374,7 @@ export default function(props) { ...@@ -354,6 +374,7 @@ export default function(props) {
// 调用app的语音播报,监听语音结束,在刚进入页面时自动调用一次,每一个问题结束后判断是否自动调用 // 调用app的语音播报,监听语音结束,在刚进入页面时自动调用一次,每一个问题结束后判断是否自动调用
const voiceStart = (voiceContent) => { const voiceStart = (voiceContent) => {
// alert(`播放: ${voiceContent}`); // alert(`播放: ${voiceContent}`);
console.log(`播放: ${voiceContent}`);
// setTimeout(() => { // setTimeout(() => {
// console.log('finish one voice'); // console.log('finish one voice');
...@@ -375,6 +396,7 @@ export default function(props) { ...@@ -375,6 +396,7 @@ export default function(props) {
// 调用app的语音暂停,点击问题的暂停按钮时候调用 // 调用app的语音暂停,点击问题的暂停按钮时候调用
const voicePause = () => { const voicePause = () => {
// alert('暂停播放'); // alert('暂停播放');
console.log('暂停播放')
if (!window.webkit) { if (!window.webkit) {
alert('window.webkit 未定义'); alert('window.webkit 未定义');
return; return;
...@@ -385,6 +407,7 @@ export default function(props) { ...@@ -385,6 +407,7 @@ export default function(props) {
// 调用app的暂停后继续播放方法 // 调用app的暂停后继续播放方法
const voiceContinue = () => { const voiceContinue = () => {
// alert('继续播放'); // alert('继续播放');
console.log('继续播放')
if (!window.webkit) { if (!window.webkit) {
alert('window.webkit 未定义'); alert('window.webkit 未定义');
return; return;
...@@ -395,6 +418,7 @@ export default function(props) { ...@@ -395,6 +418,7 @@ export default function(props) {
// 调用app的语音停止,在跳转、翻页的时候调用,避免翻页后继续播放 // 调用app的语音停止,在跳转、翻页的时候调用,避免翻页后继续播放
const voiceStop = () => { const voiceStop = () => {
// alert('停止播放'); // alert('停止播放');
console.log('停止播放')
if (!window.webkit) { if (!window.webkit) {
alert('window.webkit 未定义'); alert('window.webkit 未定义');
return; return;
......
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