Commit ca6f353d authored by marsandheart's avatar marsandheart

删掉一些无用的代码

parent 889a8ae0
...@@ -315,36 +315,11 @@ export default function(props) { ...@@ -315,36 +315,11 @@ export default function(props) {
// console.log('need you check'); // console.log('need you check');
return; return;
} else { } else {
// console.log('auto check');
// setPlayStatus(questionId,'3');
// checkCurrentQuestion();
setPlayStatusAndChecked(questionId, '3', true); setPlayStatusAndChecked(questionId, '3', true);
goNextQuestion(); goNextQuestion();
} }
}; };
// 当前问题设置为已确认
// const checkCurrentQuestion = () => {
// const newSteps = steps.map((stp) => ({
// ...stp,
// questions: stp.questions.map((qst) => ({
// ...qst
// }))
// }));
// const stepIdx = newSteps.findIndex((s) => s.id === stepId);
// const questionIdx = currentStep.questions.findIndex((q) => q.questionId === questionId);
// if (stepIdx === -1 || questionIdx === -1 ) {
// console.log('error question');
// return;
// }
// newSteps[stepIdx].questions[questionIdx].checked = true;
// updateSteps(newSteps);
// console.log('checked');
// }
// 下一个问题 // 下一个问题
const goNextQuestion = () => { const goNextQuestion = () => {
const newSteps = steps.map((stp) => ({ const newSteps = steps.map((stp) => ({
...@@ -373,7 +348,6 @@ export default function(props) { ...@@ -373,7 +348,6 @@ export default function(props) {
// 调用app的语音播报,监听语音结束,在刚进入页面时自动调用一次,每一个问题结束后判断是否自动调用 // 调用app的语音播报,监听语音结束,在刚进入页面时自动调用一次,每一个问题结束后判断是否自动调用
const voiceStart = (voiceContent) => { const voiceStart = (voiceContent) => {
// alert(`播放: ${voiceContent}`);
console.log(`播放: ${voiceContent}`); console.log(`播放: ${voiceContent}`);
// setTimeout(() => { // setTimeout(() => {
...@@ -395,7 +369,6 @@ export default function(props) { ...@@ -395,7 +369,6 @@ export default function(props) {
// 调用app的语音暂停,点击问题的暂停按钮时候调用 // 调用app的语音暂停,点击问题的暂停按钮时候调用
const voicePause = () => { const voicePause = () => {
// alert('暂停播放');
console.log('暂停播放'); console.log('暂停播放');
if (!window.webkit) { if (!window.webkit) {
alert('window.webkit 未定义'); alert('window.webkit 未定义');
...@@ -406,7 +379,6 @@ export default function(props) { ...@@ -406,7 +379,6 @@ export default function(props) {
// 调用app的暂停后继续播放方法 // 调用app的暂停后继续播放方法
const voiceContinue = () => { const voiceContinue = () => {
// alert('继续播放');
console.log('继续播放'); console.log('继续播放');
if (!window.webkit) { if (!window.webkit) {
alert('window.webkit 未定义'); alert('window.webkit 未定义');
...@@ -417,7 +389,6 @@ export default function(props) { ...@@ -417,7 +389,6 @@ export default function(props) {
// 调用app的语音停止,在跳转、翻页的时候调用,避免翻页后继续播放 // 调用app的语音停止,在跳转、翻页的时候调用,避免翻页后继续播放
const voiceStop = () => { const voiceStop = () => {
// alert('停止播放');
console.log('停止播放'); console.log('停止播放');
if (!window.webkit) { if (!window.webkit) {
alert('window.webkit 未定义'); alert('window.webkit 未定义');
...@@ -434,7 +405,6 @@ export default function(props) { ...@@ -434,7 +405,6 @@ export default function(props) {
} }
window.webkit.messageHandlers.aiaShowSignView.postMessage({}); window.webkit.messageHandlers.aiaShowSignView.postMessage({});
// window.aiaShowSignView();
window.aiaGetSignImage = (base64Data) => { window.aiaGetSignImage = (base64Data) => {
const decodeBase64 = decodeURIComponent(base64Data); const decodeBase64 = decodeURIComponent(base64Data);
const base64Src = 'data:image/png;base64,' + decodeBase64; const base64Src = 'data:image/png;base64,' + decodeBase64;
...@@ -453,6 +423,8 @@ export default function(props) { ...@@ -453,6 +423,8 @@ export default function(props) {
// 上一个节点,如果是第一节点则回到上一页 // 上一个节点,如果是第一节点则回到上一页
const lastStep = () => { const lastStep = () => {
setPlayStatus(questionId, '3');
voiceStop();
if (stepId === 1) { if (stepId === 1) {
window.history.go(-1); window.history.go(-1);
} else { } else {
...@@ -483,19 +455,6 @@ export default function(props) { ...@@ -483,19 +455,6 @@ export default function(props) {
<img src={IconHome} alt="logo"></img> <img src={IconHome} alt="logo"></img>
</div> </div>
</div> </div>
{/* <div className={styles.main}>
<TouchOpacity className={styles.btn} onClick={showPDF}>
PDF预览
</TouchOpacity>
<TouchOpacity className={styles.btn} onClick={showSign}>
呼出签名视图
</TouchOpacity>
<div style={{ clear: 'both' }}></div>
<div>签名图片展示:</div>
<div onClick={showImgSrc}>
<img alt="签名图片" src={imgSrc}></img>
</div>
</div> */}
<div className={styles.main}> <div className={styles.main}>
<div className={styles.stepArea}> <div className={styles.stepArea}>
{steps.map((item) => ( {steps.map((item) => (
...@@ -528,19 +487,6 @@ export default function(props) { ...@@ -528,19 +487,6 @@ export default function(props) {
voiceContinue={voiceContinue} voiceContinue={voiceContinue}
/> />
))} ))}
{/* {currentStep.questions.map(q=>(
<div className={styles.stepQuestionItem}>
<TouchOpacity>
<img src={IconPosition} alt="play" className={styles.leftIcon}></img>
</TouchOpacity>
<div className={styles.itemText}>
{q.text}
</div>
<TouchOpacity>
<img src={IconPosition} alt="check" className={styles.rightIcon}></img>
</TouchOpacity>
</div>
))} */}
{stepId === 7 && ( {stepId === 7 && (
<> <>
<TouchOpacity className={styles.btn} onClick={showSign}> <TouchOpacity className={styles.btn} onClick={showSign}>
......
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