Commit ca6f353d authored by marsandheart's avatar marsandheart

删掉一些无用的代码

parent 889a8ae0
......@@ -315,36 +315,11 @@ export default function(props) {
// console.log('need you check');
return;
} else {
// console.log('auto check');
// setPlayStatus(questionId,'3');
// checkCurrentQuestion();
setPlayStatusAndChecked(questionId, '3', true);
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 newSteps = steps.map((stp) => ({
......@@ -373,7 +348,6 @@ export default function(props) {
// 调用app的语音播报,监听语音结束,在刚进入页面时自动调用一次,每一个问题结束后判断是否自动调用
const voiceStart = (voiceContent) => {
// alert(`播放: ${voiceContent}`);
console.log(`播放: ${voiceContent}`);
// setTimeout(() => {
......@@ -395,7 +369,6 @@ export default function(props) {
// 调用app的语音暂停,点击问题的暂停按钮时候调用
const voicePause = () => {
// alert('暂停播放');
console.log('暂停播放');
if (!window.webkit) {
alert('window.webkit 未定义');
......@@ -406,7 +379,6 @@ export default function(props) {
// 调用app的暂停后继续播放方法
const voiceContinue = () => {
// alert('继续播放');
console.log('继续播放');
if (!window.webkit) {
alert('window.webkit 未定义');
......@@ -417,7 +389,6 @@ export default function(props) {
// 调用app的语音停止,在跳转、翻页的时候调用,避免翻页后继续播放
const voiceStop = () => {
// alert('停止播放');
console.log('停止播放');
if (!window.webkit) {
alert('window.webkit 未定义');
......@@ -434,7 +405,6 @@ export default function(props) {
}
window.webkit.messageHandlers.aiaShowSignView.postMessage({});
// window.aiaShowSignView();
window.aiaGetSignImage = (base64Data) => {
const decodeBase64 = decodeURIComponent(base64Data);
const base64Src = 'data:image/png;base64,' + decodeBase64;
......@@ -453,6 +423,8 @@ export default function(props) {
// 上一个节点,如果是第一节点则回到上一页
const lastStep = () => {
setPlayStatus(questionId, '3');
voiceStop();
if (stepId === 1) {
window.history.go(-1);
} else {
......@@ -483,19 +455,6 @@ export default function(props) {
<img src={IconHome} alt="logo"></img>
</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.stepArea}>
{steps.map((item) => (
......@@ -528,19 +487,6 @@ export default function(props) {
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 && (
<>
<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