Commit 83123b6f authored by 666's avatar 666

feat: 优化代码

parent 9ea07dd7
...@@ -94,5 +94,29 @@ ...@@ -94,5 +94,29 @@
"w": 750, "w": 750,
"h": 960, "h": 960,
"ossName": "/pk-math/39zMBKhthpUN8JGaLtJ5e1qmnewc/750x960" "ossName": "/pk-math/39zMBKhthpUN8JGaLtJ5e1qmnewc/750x960"
},
"arror-bottom-left.png": {
"u": "https://cdn.jkwljy.com/pk-math/21nmtfooeLeoKtMNsHqa2AMinWSi/128x128",
"w": 128,
"h": 128,
"ossName": "/pk-math/21nmtfooeLeoKtMNsHqa2AMinWSi/128x128"
},
"arrow-top-left.png": {
"u": "https://cdn.jkwljy.com/pk-math/3VAxvzEMBNyVZMuwf8hRTWDvgtnC/128x128",
"w": 128,
"h": 128,
"ossName": "/pk-math/3VAxvzEMBNyVZMuwf8hRTWDvgtnC/128x128"
},
"cat-4.png": {
"u": "https://cdn.jkwljy.com/pk-math/3tYeViwvJo7vFGEUsNhaCSfx8G55/300x300",
"w": 300,
"h": 300,
"ossName": "/pk-math/3tYeViwvJo7vFGEUsNhaCSfx8G55/300x300"
},
"cat-5.png": {
"u": "https://cdn.jkwljy.com/pk-math/2kSynNrNPPyZCzys49Bs9yVkqCr/200x300",
"w": 200,
"h": 300,
"ossName": "/pk-math/2kSynNrNPPyZCzys49Bs9yVkqCr/200x300"
} }
} }
...@@ -80,5 +80,25 @@ export default { ...@@ -80,5 +80,25 @@ export default {
"u": "https://cdn.jkwljy.com/pk-math/39zMBKhthpUN8JGaLtJ5e1qmnewc/750x960", "u": "https://cdn.jkwljy.com/pk-math/39zMBKhthpUN8JGaLtJ5e1qmnewc/750x960",
"w": 750, "w": 750,
"h": 960 "h": 960
},
"arror-bottom-left.png": {
"u": "https://cdn.jkwljy.com/pk-math/21nmtfooeLeoKtMNsHqa2AMinWSi/128x128",
"w": 128,
"h": 128
},
"arrow-top-left.png": {
"u": "https://cdn.jkwljy.com/pk-math/3VAxvzEMBNyVZMuwf8hRTWDvgtnC/128x128",
"w": 128,
"h": 128
},
"cat-4.png": {
"u": "https://cdn.jkwljy.com/pk-math/3tYeViwvJo7vFGEUsNhaCSfx8G55/300x300",
"w": 300,
"h": 300
},
"cat-5.png": {
"u": "https://cdn.jkwljy.com/pk-math/2kSynNrNPPyZCzys49Bs9yVkqCr/200x300",
"w": 200,
"h": 300
} }
} as const } as const
...@@ -16,35 +16,14 @@ export const Scene = ({ children }: { children: React.ReactNode }) => { ...@@ -16,35 +16,14 @@ export const Scene = ({ children }: { children: React.ReactNode }) => {
const stageDetail = useStoreState(state => state.gameModel.stageDetail) const stageDetail = useStoreState(state => state.gameModel.stageDetail)
const showMask = useMemo(() => { const showMask = useMemo(() => {
return !guideComplete && guideActive return !guideComplete && guideActive && passStep === 1
}, [guideComplete, guideActive]) }, [guideComplete, guideActive, passStep])
useEffect(() => { useEffect(() => {
if (!guideComplete) { if (!guideComplete) {
updateState({ guideActive: true }) updateState({ guideActive: true })
} }
}, [guideComplete]) }, [guideComplete, updateState])
const renderMessage = (step: number) => {
switch (step) {
case 1:
return (
<Text>
哇,你通关了,表现不错哦;你的熟练度,
<Text className={styles.strong}>打败了{stageDetail?.gear || 0}%的同学</Text>
,当然相信你还可以变得更好!
</Text>
)
case 2:
return (
<Text>
想通关,首先要
<Text className={styles.strong}>考验你的准确性</Text>
,粗心大意可是通不了关的哦。
</Text>
)
}
}
return ( return (
<UserGuideView <UserGuideView
...@@ -53,15 +32,15 @@ export const Scene = ({ children }: { children: React.ReactNode }) => { ...@@ -53,15 +32,15 @@ export const Scene = ({ children }: { children: React.ReactNode }) => {
isActive={showMask && passStep < 3} isActive={showMask && passStep < 3}
guideContent={( guideContent={(
<View className={styles.guide}> <View className={styles.guide}>
<Image className={styles.guideCat} src={require('../assets/cat-3.png')} /> <Image className={styles.guideCat} src={tutorialAssets['cat-4.png'].u} />
<View className={styles.guideMain}> <View className={styles.guideMain}>
<View className={styles.inner}> <View className={styles.inner} onClick={() => updateState({ passStep: passStep + 1 })}>
{renderMessage(passStep)} <Text>
<View 哇,你通关了,表现不错哦;你的熟练度,
className={styles.continue} <Text className={styles.strong}>打败了{stageDetail?.gear || 0}%的同学</Text>
onClick={() => updateState({ passStep: passStep + 1 })} ,当然相信你还可以变得更好!
> </Text>
<Text>继续</Text> <View className={styles.continue}>
<Image style={{ width: 14, height: 14 }} src={tutorialAssets['continue-arrow.png'].u} /></View> <Image style={{ width: 14, height: 14 }} src={tutorialAssets['continue-arrow.png'].u} /></View>
</View> </View>
</View> </View>
......
.wrapperScene2 { .wrapperScene {
border-radius: 20px;
}
.bordered {
border-radius: 32px; border-radius: 32px;
// padding: 8PX;
border: 2PX dashed #FFFFFF;
} }
.guide { .guide {
...@@ -44,9 +50,3 @@ ...@@ -44,9 +50,3 @@
} }
} }
} }
\ No newline at end of file
.bordered {
border-radius: 32px;
padding: 8PX;
border: 2PX dashed #FFFFFF;
}
\ No newline at end of file
import { View, Image, Text } from '@tarojs/components' import { View, Image, Text } from '@tarojs/components'
import { useCallback, useEffect, useMemo } from 'react' import { useCallback, useEffect, useMemo } from 'react'
import { pageScrollTo } from '@tarojs/taro'
import tutorialAssets from '@/assets/oss/assets-tutorial' import tutorialAssets from '@/assets/oss/assets-tutorial'
import UserGuideView from '@/components/UserGuideView' import UserGuideView from '@/components/UserGuideView'
import classNames from 'classnames' import classNames from 'classnames'
...@@ -8,139 +9,135 @@ import { useStoreState, useStoreActions } from '@/store/hooks' ...@@ -8,139 +9,135 @@ import { useStoreState, useStoreActions } from '@/store/hooks'
import styles from './scene-2.module.scss' import styles from './scene-2.module.scss'
import wrapStyles from '../../components/main-header.module.scss' import wrapStyles from '../../components/main-header.module.scss'
export const Scene = ({ children, index }: { index: number, children: React.ReactNode }) => { const useStepDetails = (stageDetail, targetSteps) => {
const passStep = useStoreState(state => state.prepareModel.passStep) return useMemo(() => {
const guideActive = useStoreState(state => state.prepareModel.guideActive) const details = targetSteps
const guideComplete = useStoreState(state => state.prepareModel.passGuideComplete) .map(targetStep => {
const updateState = useStoreActions(actions => actions.prepareModel.updateState) const detail = stageDetail?.nextSteps?.find(
const stageDetail = useStoreState(state => state.gameModel.stageDetail) step => step.nextStep === targetStep
)
const gear = useMemo(() => { const index = stageDetail?.nextSteps?.findIndex(
const detail = stageDetail?.nextSteps?.find(step => ['10', '20', '30'].includes(step.nextStep.toString())) step => step.nextStep === targetStep
const index1 = stageDetail?.nextSteps?.findIndex(step => ['10', '20', '30'].includes(step.nextStep.toString())) )
return {
detail,
index: index1
}
}, [stageDetail?.nextSteps])
const level = useMemo(() => {
const detail = stageDetail?.nextSteps?.find(step => ['S', 'A', 'B'].includes(step.nextStep.toString()))
const index1 = stageDetail?.nextSteps?.findIndex(step => ['S', 'A', 'B'].includes(step.nextStep.toString()))
return {
detail,
index: index1
}
}, [stageDetail?.nextSteps])
const upGear = useMemo(() => {
const detail = stageDetail?.nextSteps?.find(step => step.nextStep === 'upGear')
const index1 = stageDetail?.nextSteps?.findIndex(step => step.nextStep === 'upGear')
return { return {
detail, detail,
index: index1 index,
}
}, [stageDetail?.nextSteps])
const showMask = useMemo(() => {
// return !guideComplete && guideActive
return true
}, [guideComplete, guideActive])
useEffect(() => {
if (guideComplete !== undefined && guideComplete === false) {
updateState({ guideActive: true })
} }
}, [guideComplete]) })
.filter(item => item.detail !== undefined && item.index !== -1)
return details
}, [stageDetail?.nextSteps, targetSteps])
}
const MessageRenderer = ({ step, level, gear, upGear }) => {
const renderMessage = useCallback(() => { const renderMessage = useCallback(() => {
if (level && level.index! + 2 === passStep) { const detailIndexMap = { level, gear, upGear }
return ( const targetStep = Object.keys(detailIndexMap).find(
<Text> key => detailIndexMap[key].index + 2 === step
只要你
<Text className={styles.strong}>再提高{level.detail?.nextStepTime}秒</Text>,
就可以达到<Text className={styles.strong}>【{level.detail?.nextStep}级水准】</Text>,了哦,并
<Text className={styles.strong}>获得{level.detail?.nextStepReward}水晶奖励</Text>
。
</Text>
)
}
if (gear && gear.index! + 2 === passStep) {
return (
<Text>
如果你更加熟练,<Text className={styles.strong}>再快{gear.detail?.nextStepTime}秒</Text>
,就说明你到这个技能的顶尖水平了,并
<Text className={styles.strong}>获得象征荣耀的【TOP】(前30%、20%、10%)勋章和水晶奖励</Text>,
。
</Text>
) )
if (!targetStep) {
return null
} }
if (upGear && upGear.index! + 2 === passStep) { const { detail } = detailIndexMap[targetStep]
return ( const textTemplate = {
<Text> upGear: (
你只要<Text className={styles.strong}>再快{upGear.detail?.nextStepTime}秒</Text> <>
你只要
<Text className={styles.strong}>再快{detail.nextStepTime}秒</Text>
,就可以领先更多同学,提升你的档位, ,就可以领先更多同学,提升你的档位,
<Text className={styles.strong}>获得【升档】勋章和{upGear.detail?.nextStepReward}水晶奖励</Text> <Text className={styles.strong}>
获得【升档】勋章和{detail.nextStepReward}水晶奖励
</Text>
,粗心大意可是通不了关的哦。 ,粗心大意可是通不了关的哦。
</>
),
gear: (
<>
如果你更加熟练,
<Text className={styles.strong}>再快{detail.nextStepTime}秒</Text>
,就说明你到这个技能的顶尖水平了,并
<Text className={styles.strong}>
获得象征荣耀的【TOP】(前30%、20%、10%)勋章和水晶奖励
</Text> </Text>
) 。
</>
),
level: (
<>
只要你
<Text className={styles.strong}>再提高{detail.nextStepTime}秒</Text>,
就可以达到
<Text className={styles.strong}>【{detail.nextStep}级水准】</Text>,了哦,并
<Text className={styles.strong}>获得{detail.nextStepReward}水晶奖励</Text>
。
</>
),
} }
return null return <Text>{textTemplate[targetStep]}</Text>
}, [upGear, gear, passStep]) }, [upGear, gear, level, step])
const onClick = () => { return renderMessage()
if (level.detail && gear.detail && upGear.detail) { }
if (passStep === 4) {
updateState({ passStep: 10 }) export const Scene = ({ children, index }: { index: number, children: React.ReactNode }) => {
return const step = useStoreState(state => state.prepareModel.passStep)
} const guideActive = useStoreState(state => state.prepareModel.guideActive)
} else if (level.detail && gear.detail) { const guideComplete = useStoreState(state => state.prepareModel.passGuideComplete)
if (passStep === 3) { const updateState = useStoreActions(actions => actions.prepareModel.updateState)
updateState({ passStep: 10 }) const stageDetail = useStoreState(state => state.gameModel.stageDetail)
return const [level, gear, upGear] = useStepDetails(stageDetail, ['S', 'A', 'B', '10', '20', '30', 'upGear'])
}
} else if (level.detail && upGear.detail) { const scrollToBottom = useCallback((scrollTop?: number) => {
if (passStep === 3) { pageScrollTo({
updateState({ passStep: 10 }) duration: 600,
return selector: '#guideScrollView',
} scrollTop: scrollTop ?? 60,
} else if (gear.detail && upGear.detail) { })
if (passStep === 3) { }, [])
updateState({ passStep: 10 })
return const showMask = useMemo(() => {
} return !guideComplete && guideActive && step === index
} else if (level.detail) { }, [guideComplete, guideActive, step, index])
if (passStep === 2) {
updateState({ passStep: 10 }) useEffect(() => {
return if (!guideComplete) {
} updateState({ guideActive: true })
} else if (gear.detail) {
if (passStep === 2) {
updateState({ passStep: 10 })
return
}
} else if (upGear.detail) {
if (passStep === 2) {
updateState({ passStep: 10 })
return
} }
}, [guideComplete, updateState])
const onClick = () => {
const stepDetails = [level, gear, upGear]
const activeSteps = stepDetails.filter(item => item.detail)
const activeStepIndex = activeSteps.length
if (step === activeStepIndex + 1) {
scrollToBottom(0)
setTimeout(() => {
updateState({ passStep: -1 })
}, 666)
} else {
scrollToBottom()
updateState({ passStep: step + 1 })
} }
updateState({ passStep: passStep + 1 })
} }
return ( return (
<View id="guideScrollView">
<UserGuideView <UserGuideView
wrapClass={styles.wrapperScene2} horizonPadding={0}
className={classNames(wrapStyles.againDetail, showMask && passStep === index ? styles.bordered : null)} verticalPadding={0}
isActive={showMask && passStep === index} wrapClass={styles.wrapperScene}
className={classNames(wrapStyles.againDetail, showMask ? styles.bordered : null)}
isActive={showMask}
guideContent={( guideContent={(
<View className={styles.guide}> <View className={styles.guide}>
<Image className={styles.guideCat} src={require('../assets/cat-4.png')} /> <Image className={styles.guideCat} src={tutorialAssets['cat.png'].u} />
<View className={styles.guideMain}> <View className={styles.guideMain}>
<View className={styles.inner} onClick={onClick}> <View className={styles.inner} onClick={onClick}>
{renderMessage()} <MessageRenderer step={step} level={level} gear={gear} upGear={upGear} />
<View className={styles.continue}> <View className={styles.continue}>
<Text>继续</Text> <Text>继续</Text>
<Image style={{ width: 14, height: 14 }} src={tutorialAssets['continue-arrow.png'].u} /></View> <Image style={{ width: 14, height: 14 }} src={tutorialAssets['continue-arrow.png'].u} /></View>
...@@ -151,6 +148,7 @@ export const Scene = ({ children, index }: { index: number, children: React.Reac ...@@ -151,6 +148,7 @@ export const Scene = ({ children, index }: { index: number, children: React.Reac
> >
{children} {children}
</UserGuideView> </UserGuideView>
</View>
) )
} }
......
...@@ -20,16 +20,31 @@ ...@@ -20,16 +20,31 @@
top: -100px; top: -100px;
left: 20px; left: 20px;
@keyframes arrowAnimation {
0% {
transform: translate(0, 0) rotate(0);
}
50% {
transform: translate(16px, 16px) rotate(0);
}
100% {
transform: translate(0, 0) rotate(0);
}
}
.tutorialArrow { .tutorialArrow {
width: 128px; width: 128px;
height: 128px; height: 128px;
margin-right: 30px; margin-right: 30px;
position: relative; position: relative;
left: 130px; left: 130px;
animation: arrowAnimation 1.6s linear infinite;
} }
.text { .text {
width: 400px; width: 400px;
line-height: 1.6;
margin: 40px 0 0 40px;
} }
} }
} }
......
...@@ -3,19 +3,20 @@ import { useMemo } from 'react' ...@@ -3,19 +3,20 @@ import { useMemo } from 'react'
import UserGuideView from '@/components/UserGuideView' import UserGuideView from '@/components/UserGuideView'
import classNames from 'classnames' import classNames from 'classnames'
import { useStoreState, useStoreActions } from '@/store/hooks' import { useStoreState, useStoreActions } from '@/store/hooks'
import tutorialAssets from '@/assets/oss/assets-tutorial'
import styles from './scene-3.module.scss' import styles from './scene-3.module.scss'
import wrapStyles from '../../components/top-bar.module.scss' import wrapStyles from '../../components/top-bar.module.scss'
export const Scene = ({ children, onClickConent }: { onClickConent: () => void, children: React.ReactNode }) => { export const Scene = ({ children, onClickConent }: { onClickConent: () => void, children: React.ReactNode }) => {
const passStep = useStoreState(state => state.prepareModel.passStep) const step = useStoreState(state => state.prepareModel.passStep)
const guideActive = useStoreState(state => state.prepareModel.guideActive) const guideActive = useStoreState(state => state.prepareModel.guideActive)
const guideComplete = useStoreState(state => state.prepareModel.passGuideComplete) const guideComplete = useStoreState(state => state.prepareModel.passGuideComplete)
const completePassGuide = useStoreActions(actions => actions.prepareModel.completePassGuide) const completePassGuide = useStoreActions(actions => actions.prepareModel.completePassGuide)
const showMask = useMemo(() => { const showMask = useMemo(() => {
return !guideComplete && guideActive && passStep === 10 return !guideComplete && guideActive && step === -1
}, [guideComplete, guideActive]) }, [guideComplete, guideActive, step])
const handleCompleteGuide = async () => { const handleCompleteGuide = async () => {
await completePassGuide() await completePassGuide()
...@@ -30,10 +31,10 @@ export const Scene = ({ children, onClickConent }: { onClickConent: () => void, ...@@ -30,10 +31,10 @@ export const Scene = ({ children, onClickConent }: { onClickConent: () => void,
onClickConent={handleCompleteGuide} onClickConent={handleCompleteGuide}
guideContent={( guideContent={(
<View className={styles.guide}> <View className={styles.guide}>
<Image className={styles.guideCat} src={require('../assets/cat-5.png')} /> <Image className={styles.guideCat} src={tutorialAssets['cat-3.png'].u} />
<View className={styles.guideMain}> <View className={styles.guideMain}>
<View className={styles.tutorialFailInner}> <View className={styles.tutorialFailInner}>
<Image src={require('../assets/arrow-top-left.png')} className={styles.tutorialArrow} /> <Image src={tutorialAssets['arrow-top-left.png'].u} className={styles.tutorialArrow} />
<View className={styles.text}>对了,水晶有什么用呢?我来介绍一下。</View> <View className={styles.text}>对了,水晶有什么用呢?我来介绍一下。</View>
</View> </View>
</View> </View>
......
...@@ -36,32 +36,33 @@ export const Scene = ({ children }: { children: React.ReactNode }) => { ...@@ -36,32 +36,33 @@ export const Scene = ({ children }: { children: React.ReactNode }) => {
const updateState = useStoreActions(actions => actions.prepareModel.updateState) const updateState = useStoreActions(actions => actions.prepareModel.updateState)
const showMask = useMemo(() => { const showMask = useMemo(() => {
return !guideComplete && guideActive return !guideComplete && guideActive && step < 3
}, [guideComplete, guideActive]) }, [guideComplete, guideActive, step])
useEffect(() => { useEffect(() => {
if (guideComplete !== undefined && guideComplete === false) { if (!guideComplete) {
updateState({ guideActive: true }) updateState({ guideActive: true })
} }
}, [guideComplete]) }, [guideComplete, updateState])
return ( return (
<UserGuideView <UserGuideView
wrapClass={styles.wrapper} wrapClass={styles.wrapper}
className={classNames(wrapStyles.againDetails, showMask ? styles.bordered : null)} className={classNames(wrapStyles.againDetails, showMask ? styles.bordered : null)}
isActive={showMask && step < 3} isActive={showMask}
guideContent={( guideContent={(
<View className={styles.top}> <View className={styles.top}>
<Image style={{ width: 100, height: 110 }} src={require('../assets/cat-1.png')} /> <Image style={{ width: 100, height: 110 }} src={tutorialAssets['cat-2.png'].u} />
<View className={styles.content}> <View className={styles.content}>
<View className={styles.inner}>
{renderMessage(step)}
<View <View
className={styles.continue} className={styles.inner}
onClick={() => updateState({ onClick={() => updateState({
step: step + 1 step: step + 1
})} })
}
> >
{renderMessage(step)}
<View className={styles.continue}>
<Text>继续</Text> <Text>继续</Text>
<Image style={{ width: 14, height: 14 }} src={tutorialAssets['continue-arrow.png'].u} /></View> <Image style={{ width: 14, height: 14 }} src={tutorialAssets['continue-arrow.png'].u} /></View>
</View> </View>
......
...@@ -321,11 +321,24 @@ ...@@ -321,11 +321,24 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@keyframes arrowAnimation {
0% {
transform: translate(0, 0) rotate(0);
}
50% {
transform: translate(-16px, 16px) rotate(0);
}
100% {
transform: translate(0, 0) rotate(0);
}
}
&_arrow { &_arrow {
margin-top: 18px; margin-top: 18px;
margin-left: 50px; margin-left: 50px;
width: 128px; width: 128px;
height: 128px; height: 128px;
animation: arrowAnimation 1.6s linear infinite;
} }
} }
......
...@@ -15,6 +15,7 @@ import assetsGroup from '@/assets/oss/assets-group' ...@@ -15,6 +15,7 @@ import assetsGroup from '@/assets/oss/assets-group'
import { palyAudio } from '@/utils/play-audio' import { palyAudio } from '@/utils/play-audio'
import audio from '@/assets/oss/assets-audio' import audio from '@/assets/oss/assets-audio'
import { EyeProtectionView } from '@/components' import { EyeProtectionView } from '@/components'
import tutorialAssets from '@/assets/oss/assets-tutorial'
import Tabs, { type TabItem } from './components/tabs' import Tabs, { type TabItem } from './components/tabs'
import TopBar from './components/top-bar' import TopBar from './components/top-bar'
...@@ -36,6 +37,7 @@ const Prepare = () => { ...@@ -36,6 +37,7 @@ const Prepare = () => {
const cardNum = useStoreState(state => state.userModel.cardNum) const cardNum = useStoreState(state => state.userModel.cardNum)
const point = useStoreState(state => state.userModel.point) const point = useStoreState(state => state.userModel.point)
const userInfo = useStoreState(state => state.userModel.userInfo) const userInfo = useStoreState(state => state.userModel.userInfo)
// const isSubmit = true
const isSubmit = useStoreState(state => state.gameModel.isSubmit) const isSubmit = useStoreState(state => state.gameModel.isSubmit)
const tribeInfo = useStoreState(state => state.groupModel.tribeInfo) const tribeInfo = useStoreState(state => state.groupModel.tribeInfo)
const stageList = useStoreState(state => state.mainModel.stageList) const stageList = useStoreState(state => state.mainModel.stageList)
...@@ -109,7 +111,7 @@ const Prepare = () => { ...@@ -109,7 +111,7 @@ const Prepare = () => {
!guideComplete && await completeGuide() !guideComplete && await completeGuide()
/** 首次闯关失败引导完成 */ /** 首次闯关失败引导完成 */
!failGuideComplete && await completeFailGuide() isSubmit && !failGuideComplete && await completeFailGuide()
if (cardNum < 1 && !stageDetail?.firstTime) { if (cardNum < 1 && !stageDetail?.firstTime) {
setTrue() setTrue()
...@@ -131,6 +133,7 @@ const Prepare = () => { ...@@ -131,6 +133,7 @@ const Prepare = () => {
const guideActive = useStoreState(state => state.prepareModel.guideActive) const guideActive = useStoreState(state => state.prepareModel.guideActive)
const updateGuideState = useStoreActions(actions => actions.prepareModel.updateState) const updateGuideState = useStoreActions(actions => actions.prepareModel.updateState)
/** 显示首次闯关引导开始闯关按钮 */
const showMask = useMemo(() => { const showMask = useMemo(() => {
return step === 3 && guideActive && !guideComplete return step === 3 && guideActive && !guideComplete
}, [step, guideActive, guideComplete]) }, [step, guideActive, guideComplete])
...@@ -140,7 +143,7 @@ const Prepare = () => { ...@@ -140,7 +143,7 @@ const Prepare = () => {
{showMask && <View className={styles.mask}></View>} {showMask && <View className={styles.mask}></View>}
{showMask && <View className={styles.tutorial}> {showMask && <View className={styles.tutorial}>
<Text>让我们开始试试吧!</Text> <Text>让我们开始试试吧!</Text>
<Image src={require('./guide/assets/arrow.png')} className={styles.tutorial_arrow}></Image> <Image src={tutorialAssets['arror-bottom-left.png'].u} className={styles.tutorial_arrow}></Image>
</View>} </View>}
<View className={classNames(styles.challenge, showMask ? styles.maskWrap : null)}> <View className={classNames(styles.challenge, showMask ? styles.maskWrap : null)}>
<Button size="large" onClick={handleClick} image={styles.image} hoverImage={styles.hover_image}> <Button size="large" onClick={handleClick} image={styles.image} hoverImage={styles.hover_image}>
...@@ -183,20 +186,20 @@ const Prepare = () => { ...@@ -183,20 +186,20 @@ const Prepare = () => {
guideActive: true guideActive: true
}) })
} }
}, [guideActive, isSubmit, failGuideComplete, stageDetail?.level, stageDetail?.firstTime]) }, [isSubmit, failGuideComplete, stageDetail?.level, stageDetail?.firstTime, updateGuideState])
const showFailMask = useMemo(() => { const showFailMask = useMemo(() => {
return guideActive && !failGuideComplete && isSubmit && !hasNextBtn return guideActive && !failGuideComplete && isSubmit && !hasNextBtn
}, [guideActive, failGuideComplete, hasNextBtn]) }, [guideActive, failGuideComplete, hasNextBtn, isSubmit])
const renderAgainActions = () => ( const renderAgainActions = () => (
<View> <View>
{showFailMask && <View className={styles.mask}></View>} {showFailMask && <View className={styles.mask}></View>}
{showFailMask && <View className={classNames(styles.tutorial, styles.tutorialFail)}> {showFailMask && <View className={classNames(styles.tutorial, styles.tutorialFail)}>
<Image className={styles.failGuideCat} src={require('./guide/assets/cat-2.png')} /> <Image className={styles.failGuideCat} src={tutorialAssets['cat-5.png'].u} />
<View className={styles.tutorialFailInner}> <View className={styles.tutorialFailInner}>
<Text>嗯,说明这个技能还需要提高哦。我们再来一次吧!</Text> <Text>嗯,说明这个技能还需要提高哦。我们再来一次吧!</Text>
<Image src={require('./guide/assets/arrow.png')} className={styles.tutorial_arrow}></Image> <Image src={tutorialAssets['arror-bottom-left.png'].u} className={styles.tutorial_arrow}></Image>
</View> </View>
</View>} </View>}
......
...@@ -30,7 +30,7 @@ const prepareModel: PrepareModel = { ...@@ -30,7 +30,7 @@ const prepareModel: PrepareModel = {
guideActive: false, guideActive: false,
guideComplete: getStorage(StorageKeys.prepareGuideComplete), guideComplete: getStorage(StorageKeys.prepareGuideComplete),
failGuideComplete: getStorage(StorageKeys.prepareFailGuideComplete), failGuideComplete: getStorage(StorageKeys.prepareFailGuideComplete),
passGuideComplete: getStorage(StorageKeys.prepareFailGuideComplete), passGuideComplete: getStorage(StorageKeys.preparePassGuideComplete),
updateState: action((state, payload) => { updateState: action((state, payload) => {
for (const k in payload) { for (const k in payload) {
......
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