Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GeekLearnMathWeapp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
frontend
GeekLearnMathWeapp
Commits
081fab9a
Commit
081fab9a
authored
Jun 21, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 全通关后pk引导不出现修复
parent
ba9c5ef9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
15 deletions
+37
-15
project.config.json
project.config.json
+1
-1
main-component.tsx
src/pages/main/main-underground/main-component.tsx
+12
-3
constants.ts
src/pages/main/main-underground/scene/constants.ts
+12
-9
stage.tsx
src/pages/main/main-underground/scene/stage.tsx
+12
-2
No files found.
project.config.json
View file @
081fab9a
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"miniprogramRoot"
:
"dist/"
,
"miniprogramRoot"
:
"dist/"
,
"projectname"
:
"GeekLearnMathWeapp"
,
"projectname"
:
"GeekLearnMathWeapp"
,
"description"
:
""
,
"description"
:
""
,
"appid"
:
"wx
8f25def587982a19
"
,
"appid"
:
"wx
693fe3460124d84b
"
,
"setting"
:
{
"setting"
:
{
"urlCheck"
:
false
,
"urlCheck"
:
false
,
"es6"
:
false
,
"es6"
:
false
,
...
...
src/pages/main/main-underground/main-component.tsx
View file @
081fab9a
...
@@ -13,7 +13,7 @@ import BattlesModal from '@/pages/battles/components/battles-modal'
...
@@ -13,7 +13,7 @@ import BattlesModal from '@/pages/battles/components/battles-modal'
import
Tutorial
from
'../components/tutorial'
import
Tutorial
from
'../components/tutorial'
import
type
{
TabbarRef
}
from
'../../../custom-tab-bar/index'
import
type
{
TabbarRef
}
from
'../../../custom-tab-bar/index'
import
{
CurrentRoundId
,
StageStatus
}
from
'../components
/scene/constants'
import
{
CurrentRoundId
,
StageStatus
,
LastPassedStageId
}
from
'.
/scene/constants'
import
MainHeader
from
'./header'
import
MainHeader
from
'./header'
import
MainScene
from
'./scene'
import
MainScene
from
'./scene'
import
MainShortCut
from
'../components/short-cut'
import
MainShortCut
from
'../components/short-cut'
...
@@ -94,11 +94,20 @@ const MainPage = () => {
...
@@ -94,11 +94,20 @@ const MainPage = () => {
}
}
},
[
player
,
isFocus
])
},
[
player
,
isFocus
])
const
scrollToLastPassed
=
useCallback
(()
=>
{
const
height
=
getSystemInfoSync
().
windowHeight
pageScrollTo
({
selector
:
`#
${
LastPassedStageId
}
`
,
offsetTop
:
-
height
/
2
,
complete
:
()
=>
{}
})
},
[])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
showPkGuideFromHis
)
{
if
(
showPkGuideFromHis
)
{
scrollTo
Current
()
scrollTo
LastPassed
()
}
}
},
[
showPkGuideFromHis
,
scrollTo
Current
])
},
[
showPkGuideFromHis
,
scrollTo
LastPassed
])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
isFocus
&&
userInfo
.
city
&&
userInfo
.
grade
)
{
if
(
isFocus
&&
userInfo
.
city
&&
userInfo
.
grade
)
{
...
...
src/pages/main/main-underground/scene/constants.ts
View file @
081fab9a
...
@@ -26,6 +26,7 @@ export { StageStatus, StageLevel, Stage, StageType }
...
@@ -26,6 +26,7 @@ export { StageStatus, StageLevel, Stage, StageType }
const
isProduction
=
process
.
env
.
SERVER_ENDPOINT
===
'https://geek.jkwljy.com'
const
isProduction
=
process
.
env
.
SERVER_ENDPOINT
===
'https://geek.jkwljy.com'
export
const
CurrentRoundId
=
'__current_round__'
export
const
CurrentRoundId
=
'__current_round__'
export
const
LastPassedStageId
=
'__last_pass__'
export
type
PartHead
=
{
export
type
PartHead
=
{
partIndex
:
number
;
partIndex
:
number
;
...
@@ -58,17 +59,19 @@ function stageToStageNext (stageList: Stage[]): {nextList: StageNext[]; showList
...
@@ -58,17 +59,19 @@ function stageToStageNext (stageList: Stage[]): {nextList: StageNext[]; showList
showList
=
newList
.
slice
(
0
,
Math
.
max
(
currentIndex
+
3
,
5
))
showList
=
newList
.
slice
(
0
,
Math
.
max
(
currentIndex
+
3
,
5
))
}
}
/** 设置pk历史页面返回后引导 */
/** 设置pk历史页面返回后引导 */
if
(
currentIndex
!==
-
1
)
{
let
current
=
currentIndex
let
current
=
currentIndex
if
(
currentIndex
===
-
1
)
{
while
(
current
>=
0
)
{
current
=
newList
.
length
-
1
const
currentItem
=
showList
[
current
]
}
if
(
currentItem
&&
currentItem
.
status
===
StageStatus
.
PASSED
&&
currentItem
.
type
!==
StageType
.
Special
)
{
currentItem
.
$lastPassedStage
=
true
break
}
current
-=
1
while
(
current
>=
0
)
{
const
currentItem
=
showList
[
current
]
if
(
currentItem
&&
currentItem
.
status
===
StageStatus
.
PASSED
&&
currentItem
.
type
!==
StageType
.
Special
)
{
currentItem
.
$lastPassedStage
=
true
break
}
}
current
-=
1
}
}
let
currentPart
let
currentPart
...
...
src/pages/main/main-underground/scene/stage.tsx
View file @
081fab9a
...
@@ -11,7 +11,7 @@ import { UserGuideView } from '@/components'
...
@@ -11,7 +11,7 @@ import { UserGuideView } from '@/components'
import
tutorial
from
'@/assets/oss/assets-tutorial'
import
tutorial
from
'@/assets/oss/assets-tutorial'
import
assetsGuide
from
'@/assets/oss/assets-guide'
import
assetsGuide
from
'@/assets/oss/assets-guide'
import
assetsMainNext
from
'@/assets/oss/assets-main-next'
import
assetsMainNext
from
'@/assets/oss/assets-main-next'
import
{
type
Stage
,
StageType
,
StageStatus
,
StageLevel
,
CurrentRoundId
}
from
'./constants'
import
{
type
Stage
,
StageType
,
StageStatus
,
StageLevel
,
CurrentRoundId
,
LastPassedStageId
}
from
'./constants'
import
StageTag
from
'./stage-tag'
import
StageTag
from
'./stage-tag'
import
styles
from
'./stage.module.scss'
import
styles
from
'./stage.module.scss'
...
@@ -286,11 +286,21 @@ const StageComp = (props: StageProps) => {
...
@@ -286,11 +286,21 @@ const StageComp = (props: StageProps) => {
)
)
}
}
const
stageId
=
useMemo
(()
=>
{
if
(
stage
.
status
===
StageStatus
.
CURRENT
)
{
return
CurrentRoundId
}
if
(
stage
.
$lastPassedStage
)
{
return
LastPassedStageId
}
return
undefined
},
[
stage
])
return
(
return
(
<
View
<
View
className=
{
classNames
(
props
.
className
,
cs
.
bounce_btn
)
}
className=
{
classNames
(
props
.
className
,
cs
.
bounce_btn
)
}
hoverClass=
{
cs
.
bounce_btn_hover
}
hoverClass=
{
cs
.
bounce_btn_hover
}
id=
{
stage
.
status
===
StageStatus
.
CURRENT
?
CurrentRoundId
:
undefine
d
}
id=
{
stage
I
d
}
onClick=
{
handleClick
}
onClick=
{
handleClick
}
data
-
name=
{
`关卡-${stage.id}`
}
data
-
name=
{
`关卡-${stage.id}`
}
onLongPress=
{
!
isPkGuideShow
?
handleLongPress
:
undefined
}
onLongPress=
{
!
isPkGuideShow
?
handleLongPress
:
undefined
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment