Commit 0a16dc51 authored by hewenhao's avatar hewenhao

feat: 引导优化

parent 51164f53
...@@ -33,6 +33,7 @@ const MainPage = () => { ...@@ -33,6 +33,7 @@ const MainPage = () => {
const isReady = useStoreState(state => state.mainModel.isReady) const isReady = useStoreState(state => state.mainModel.isReady)
const isGroupGuideComplete = useStoreState(state => state.guideModel.isGroupGuideComplete) const isGroupGuideComplete = useStoreState(state => state.guideModel.isGroupGuideComplete)
const isMainGuideComplete = useStoreState(state => state.guideModel.isMainGuideComplete) const isMainGuideComplete = useStoreState(state => state.guideModel.isMainGuideComplete)
const isPkGuideComplete = useStoreState(state => state.guideModel.isPkGuideComplete)
const fetchAccount = useStoreActions(actions => actions.userModel.fetchAccount) const fetchAccount = useStoreActions(actions => actions.userModel.fetchAccount)
const updateGroupGuideActive = useStoreActions(actions => actions.guideModel.updateGroupGuideActive) const updateGroupGuideActive = useStoreActions(actions => actions.guideModel.updateGroupGuideActive)
const fetchTribeInfo = useStoreActions(actions => actions.groupModel.fetchTribeInfo) const fetchTribeInfo = useStoreActions(actions => actions.groupModel.fetchTribeInfo)
...@@ -66,8 +67,12 @@ const MainPage = () => { ...@@ -66,8 +67,12 @@ const MainPage = () => {
} }
const currentIndex = stageList.findIndex(c => c.status === StageStatus.CURRENT) const currentIndex = stageList.findIndex(c => c.status === StageStatus.CURRENT)
const point = await fetchAccount()
if (!isPkGuideComplete && currentIndex <= 2) {
return
}
const point = await fetchAccount()
if (point < 50 || currentIndex >= 3) { if (point < 50 || currentIndex >= 3) {
const res = await fetchTribeInfo() const res = await fetchTribeInfo()
if (!res?.id) { if (!res?.id) {
...@@ -76,7 +81,7 @@ const MainPage = () => { ...@@ -76,7 +81,7 @@ const MainPage = () => {
} }
} }
fn() fn()
}, [fetchAccount, isGroupGuideComplete, stageList, updateGroupGuideActive, userInfo, fetchTribeInfo, isMainGuideComplete, isFocus]) }, [fetchAccount, isPkGuideComplete, isGroupGuideComplete, stageList, updateGroupGuideActive, userInfo, fetchTribeInfo, isMainGuideComplete, isFocus])
onAppHide(() => { onAppHide(() => {
player.pause() player.pause()
......
...@@ -128,12 +128,12 @@ const guideModel: GuideModel = { ...@@ -128,12 +128,12 @@ const guideModel: GuideModel = {
}), }),
completeStoreGuide: thunk(async (actions) => { completeStoreGuide: thunk(async (actions) => {
actions.updateState({ isStoreGuideComplete: true, storeGuideStep: -1 }) actions.updateState({ isStoreGuideComplete: true, storeGuideStep: -1, storeGuideActive: false })
updateStorage(StorageKeys.isStoreGuideComplete, true) updateStorage(StorageKeys.isStoreGuideComplete, true)
}), }),
completeGroupGuide: thunk(async (actions) => { completeGroupGuide: thunk(async (actions) => {
actions.updateState({ isGroupGuideComplete: true, groupGuideStep: -1 }) actions.updateState({ isGroupGuideComplete: true, groupGuideStep: -1, groupGuideActive: false })
updateStorage(StorageKeys.isGroupGuideComplete, true) updateStorage(StorageKeys.isGroupGuideComplete, true)
}), }),
......
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