Commit 5381bb5a authored by hewenhao's avatar hewenhao

feat: update

parent cf7c7825
...@@ -26,7 +26,7 @@ module.exports = function configEnv () { ...@@ -26,7 +26,7 @@ module.exports = function configEnv () {
} }
const hash = crypto.createHash('md5') const hash = crypto.createHash('md5')
hash.update('GEEK-ONLINE-WEAPP-V4') hash.update('GEEK-PK-MATH-WEAPP-V1')
hash.update(`build-${env}`) hash.update(`build-${env}`)
hash.update(`build-${process.env.SERVER_ENDPOINT || ''}`) hash.update(`build-${process.env.SERVER_ENDPOINT || ''}`)
process.env.TARO_STORAGE_KEY = hash.digest('base64').substring(0, 5) process.env.TARO_STORAGE_KEY = hash.digest('base64').substring(0, 5)
......
...@@ -83,7 +83,6 @@ const MainPage = () => { ...@@ -83,7 +83,6 @@ const MainPage = () => {
useEffect(() => { useEffect(() => {
if (isFocus) { if (isFocus) {
player.play() player.play()
tutorialRef.current?.start()
} }
}, [player, isFocus]) }, [player, isFocus])
......
...@@ -2,6 +2,7 @@ import { useState, useImperativeHandle, forwardRef, useCallback, useEffect } fro ...@@ -2,6 +2,7 @@ import { useState, useImperativeHandle, forwardRef, useCallback, useEffect } fro
import { showToast } from '@tarojs/taro' import { showToast } from '@tarojs/taro'
import { getAreaAndGrades, type AreaAndGrades } from '@/api' import { getAreaAndGrades, type AreaAndGrades } from '@/api'
import { useStoreState, useStoreActions } from '@/store/hooks' import { useStoreState, useStoreActions } from '@/store/hooks'
import { useFocus } from '@/hooks'
import ModalArea from './modal-area' import ModalArea from './modal-area'
import ModalGrade from './modal-grade' import ModalGrade from './modal-grade'
import ModalResult from './modal-result' import ModalResult from './modal-result'
...@@ -27,6 +28,7 @@ const Tutorial = forwardRef<TutorialRef, {}>((_, ref) => { ...@@ -27,6 +28,7 @@ const Tutorial = forwardRef<TutorialRef, {}>((_, ref) => {
const [step, setStep] = useState(0) const [step, setStep] = useState(0)
const [selected, setSelected] = useState({ area: '', grade: '' }) const [selected, setSelected] = useState({ area: '', grade: '' })
const [enable, setEnable] = useState(false) const [enable, setEnable] = useState(false)
const isFocus = useFocus()
useEffect(() => { useEffect(() => {
if (!joinDefered) { if (!joinDefered) {
...@@ -81,19 +83,9 @@ const Tutorial = forwardRef<TutorialRef, {}>((_, ref) => { ...@@ -81,19 +83,9 @@ const Tutorial = forwardRef<TutorialRef, {}>((_, ref) => {
}, [updateUserInfo]) }, [updateUserInfo])
useEffect(() => { useEffect(() => {
loadData() if (isFocus) {
}, [loadData])
useImperativeHandle(ref, () => {
return {
start: () => {
if (!data.areas.length) { if (!data.areas.length) {
loadData().catch(() => { loadData()
showToast({
title: '加载数据失败',
icon: 'none'
})
})
} }
// 没选择城市 // 没选择城市
if (!userInfo.city) { if (!userInfo.city) {
...@@ -107,8 +99,7 @@ const Tutorial = forwardRef<TutorialRef, {}>((_, ref) => { ...@@ -107,8 +99,7 @@ const Tutorial = forwardRef<TutorialRef, {}>((_, ref) => {
} }
} }
} }
} }, [isFocus, data.areas, isMainGuideComplete, updateGuideActive, loadData, userInfo.city, userInfo.grade])
})
if (!enable) { if (!enable) {
return null return null
......
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