Commit a5277e31 authored by hewenhao's avatar hewenhao

Merge branch 'feature/2023-04-19-iter' of…

Merge branch 'feature/2023-04-19-iter' of dev.jiuaoedu.com:hewenhao/GeekLearnMathWeapp into feature/2023-04-19-iter
parents d2c8d408 a963aa99
import { View, Image, Text } from '@tarojs/components'
import { useEffect, useMemo } from 'react'
import { useCallback, useEffect, useMemo } from 'react'
import UserGuideView from '@/components/UserGuideView'
import classNames from 'classnames'
import { useStoreState, useStoreActions } from '@/store/hooks'
......@@ -25,6 +25,14 @@ export const Scene = ({ children }: { children: React.ReactNode }) => {
}
}, [guideComplete, updateState])
const handleContinue = useCallback(() => {
if (stageDetail?.nextSteps && stageDetail.nextSteps.length > 0) {
updateState({ passStep: passStep + 1 })
} else {
updateState({ passStep: -1 })
}
}, [stageDetail?.nextSteps, passStep, updateState])
return (
<UserGuideView
wrapClass={styles.wrapper}
......@@ -34,7 +42,7 @@ export const Scene = ({ children }: { children: React.ReactNode }) => {
<View className={styles.guide}>
<Image className={styles.guideCat} src={tutorialAssets['cat-4.png'].u} />
<View className={styles.guideMain}>
<View className={styles.inner} onClick={() => updateState({ passStep: passStep + 1 })}>
<View className={styles.inner} onClick={handleContinue}>
<Text>
哇,你通关了,表现不错哦;你的熟练度,
<Text className={styles.strong}>打败了{stageDetail?.gear || 0}%的同学</Text>
......
......@@ -179,18 +179,22 @@ const Prepare = () => {
const failGuideComplete = useStoreState(state => state.prepareModel.failGuideComplete)
const showFail = useMemo(() => {
return !failGuideComplete && isSubmit && !stageDetail?.level && !stageDetail?.firstTime
}, [failGuideComplete, isSubmit, stageDetail?.level, stageDetail?.firstTime])
useEffect(() => {
// 首次失败引导
if (!failGuideComplete && isSubmit && !stageDetail?.level && !stageDetail?.firstTime) {
if (showFail) {
updateGuideState({
guideActive: true
})
}
}, [isSubmit, failGuideComplete, stageDetail?.level, stageDetail?.firstTime, updateGuideState])
}, [showFail, updateGuideState])
const showFailMask = useMemo(() => {
return guideActive && !failGuideComplete && isSubmit && !hasNextBtn
}, [guideActive, failGuideComplete, hasNextBtn, isSubmit])
return guideActive && showFail
}, [guideActive, showFail])
const renderAgainActions = () => (
<View>
......
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