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
c6523e1b
Commit
c6523e1b
authored
Jun 20, 2023
by
raca
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/2023-06-12-v1.1' of…
Merge branch 'feature/2023-06-12-v1.1' of
https://118.24.71.244/hewenhao/GeekLearnMathWeapp
into feature/2023-06-12-v1.1
parents
80507fe6
a5e4db02
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
78 additions
and
86 deletions
+78
-86
global.d.ts
global.d.ts
+2
-4
game.ts
src/api/game.ts
+3
-0
index.module.scss
src/native-components/pk-record/index.module.scss
+3
-4
index.ts
src/native-components/pk-record/index.ts
+28
-39
index.wxml
src/native-components/pk-record/index.wxml
+7
-7
index.tsx
src/pages/battles/index.tsx
+3
-13
battle-complete.tsx
src/pages/game/play/components/battle-complete.tsx
+20
-7
pk.tsx
src/pages/main/components/tutorial/pk.tsx
+1
-1
create-pk.tsx
src/pages/main/main-underground/create-pk.tsx
+3
-3
pk.tsx
src/pages/main/main-underground/pk-guide/pk.tsx
+1
-1
constants.ts
src/pages/main/main-underground/scene/constants.ts
+1
-1
stage.tsx
src/pages/main/main-underground/scene/stage.tsx
+3
-4
guide.ts
src/store/modules/guide.ts
+3
-2
No files found.
global.d.ts
View file @
c6523e1b
...
@@ -41,10 +41,8 @@ declare namespace JSX {
...
@@ -41,10 +41,8 @@ declare namespace JSX {
>
,
>
,
'pk-record'
:
React
.
DetailedHTMLProps
<
'pk-record'
:
React
.
DetailedHTMLProps
<
React
.
HTMLAttributes
<
HTMLElement
>
&
{
React
.
HTMLAttributes
<
HTMLElement
>
&
{
list
:
any
[],
list
:
any
[];
userId
:
number
,
config
:
any
;
winPoint
:
number
,
losePoint
:
number
},
},
HTMLElement
HTMLElement
>
,
>
,
...
...
src/api/game.ts
View file @
c6523e1b
...
@@ -72,6 +72,9 @@ export interface Stage {
...
@@ -72,6 +72,9 @@ export interface Stage {
/** 星星限制数量 */
/** 星星限制数量 */
limitStar
:
number
;
limitStar
:
number
;
/** 拥有星星数量 */
holdStar
:
number
;
/** pk负 */
/** pk负 */
pkLoseNum
:
number
|
null
;
pkLoseNum
:
number
|
null
;
/** pk胜场 */
/** pk胜场 */
...
...
src/native-components/pk-record/index.module.scss
View file @
c6523e1b
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
.userName
{
.userName
{
font-weight
:
600
;
font-weight
:
600
;
max-width
:
2
2
0px
;
max-width
:
2
4
0px
;
height
:
44px
;
height
:
44px
;
line-height
:
44px
;
line-height
:
44px
;
@include
ellipsis
();
@include
ellipsis
();
...
@@ -117,7 +117,7 @@
...
@@ -117,7 +117,7 @@
transform
:
translateX
(
-50%
);
transform
:
translateX
(
-50%
);
text-align
:
center
;
text-align
:
center
;
width
:
112px
;
width
:
112px
;
.value
{
.value
{
font-size
:
24px
;
font-size
:
24px
;
color
:
#fff
;
color
:
#fff
;
...
@@ -184,4 +184,4 @@
...
@@ -184,4 +184,4 @@
100
%
{
100
%
{
transform
:
rotate
(
360deg
);
transform
:
rotate
(
360deg
);
}
}
}
}
\ No newline at end of file
src/native-components/pk-record/index.ts
View file @
c6523e1b
...
@@ -3,22 +3,29 @@
...
@@ -3,22 +3,29 @@
import
{
rankTranslate
,
getImageForRank
}
from
'@/pages/battles/utils'
import
{
rankTranslate
,
getImageForRank
}
from
'@/pages/battles/utils'
import
assets
from
'@/assets/oss/assets-pk'
import
assets
from
'@/assets/oss/assets-pk'
import
assets2
from
'@/assets/oss/assets-prepare'
import
assets2
from
'@/assets/oss/assets-prepare'
import
{
getStorage
,
StorageKeys
}
from
'@/utils/storage'
import
styles
from
'./index.module.scss'
import
styles
from
'./index.module.scss'
const
PageSize
=
10
const
PageSize
=
10
const
determineStyle
=
(
isPlayer
:
boolean
,
isWin
:
boolean
)
=>
{
return
(
isWin
&&
isPlayer
)
||
(
!
isWin
&&
!
isPlayer
)
?
styles
.
statsWin
:
styles
.
statsLose
}
// @ts-ignore
// @ts-ignore
Component
({
Component
({
properties
:
{
properties
:
{
userId
:
Number
,
winPoint
:
Number
,
losePoint
:
Number
,
list
:
{
list
:
{
type
:
Array
,
type
:
Array
,
value
:
[],
value
:
[],
},
},
config
:
{
type
:
Object
,
value
:
{}
}
},
},
observers
:
{
observers
:
{
list
(
val
)
{
'list'
(
)
{
this
.
reset
()
this
.
reset
()
},
},
},
},
...
@@ -34,6 +41,7 @@ Component({
...
@@ -34,6 +41,7 @@ Component({
this
.
_loading
=
false
this
.
_loading
=
false
this
.
_currentPage
=
0
this
.
_currentPage
=
0
this
.
loadMore
()
this
.
loadMore
()
this
.
_userInfo
=
getStorage
(
StorageKeys
.
userInfo
)
},
},
methods
:
{
methods
:
{
reset
()
{
reset
()
{
...
@@ -63,50 +71,31 @@ Component({
...
@@ -63,50 +71,31 @@ Component({
hasNextPage
=
false
hasNextPage
=
false
}
}
const
start
=
currentPage
*
PageSize
const
userInfo
=
this
.
_userInfo
const
determineStyle
=
(
isPlayer
:
boolean
,
isWin
:
boolean
)
=>
{
return
(
isWin
&&
isPlayer
)
||
(
!
isWin
&&
!
isPlayer
)
?
styles
.
statsWin
:
styles
.
statsLose
}
const
determinePoint
=
(
isPlayer
:
boolean
,
isWin
:
boolean
)
=>
{
const
isWin
=
item
=>
{
return
(
isWin
&&
isPlayer
)
||
(
!
isWin
&&
!
isPlayer
)
if
(
item
.
initiator
===
userInfo
?.
userId
)
{
?
this
.
data
.
winPoint
return
item
.
result
===
'WIN'
:
this
.
data
.
losePoint
}
return
item
.
result
===
'LOSE'
}
}
const
start
=
currentPage
*
PageSize
const
newList
=
list
.
slice
(
start
,
max
).
map
((
item
)
=>
{
const
newList
=
list
.
slice
(
start
,
max
).
map
((
item
)
=>
{
const
isInitiator
=
item
.
initiator
===
this
.
data
.
userId
const
isInitiator
=
item
.
initiator
===
userInfo
?.
userId
const
isRecipient
=
item
.
recipient
===
this
.
data
.
userId
const
isRecipient
=
item
.
recipient
===
userInfo
?.
userId
const
isWin
=
const
initiatorStyle
=
determineStyle
(
isInitiator
,
isWin
(
item
))
(
item
.
result
===
'WIN'
&&
isInitiator
)
||
const
recipientStyle
=
determineStyle
(
isRecipient
,
isWin
(
item
))
(
item
.
result
===
'LOSE'
&&
isRecipient
)
const
initiatorStyle
=
determineStyle
(
isInitiator
,
isWin
)
const
recipientStyle
=
determineStyle
(
isRecipient
,
isWin
)
const
initiatorPoint
=
determinePoint
(
isInitiator
,
isWin
)
const
recipientPoint
=
determinePoint
(
isRecipient
,
isWin
)
const
initiatorLevel
=
rankTranslate
(
item
.
initiatorLevel
)
const
recipientLevel
=
rankTranslate
(
item
.
recipientLevel
)
const
initiatorBadge
=
getImageForRank
(
item
.
initiatorLevel
)
const
recipientBadge
=
getImageForRank
(
item
.
recipientLevel
)
return
{
return
{
...
item
,
...
item
,
isWin
,
wined
:
isWin
(
item
)
,
initiatorStyle
,
initiatorStyle
,
initiatorPoint
,
initiatorBadge
,
initiatorLevel
,
recipientPoint
,
recipientStyle
,
recipientStyle
,
recipientLevel
,
initiatorLevel
:
rankTranslate
(
item
.
initiatorLevel
),
recipientBadge
,
recipientLevel
:
rankTranslate
(
item
.
recipientLevel
),
initiatorBadge
:
getImageForRank
(
item
.
initiatorLevel
),
recipientBadge
:
getImageForRank
(
item
.
recipientLevel
),
}
}
})
})
const
opts
=
{}
as
any
const
opts
=
{}
as
any
...
...
src/native-components/pk-record/index.wxml
View file @
c6523e1b
<template name="pkItem">
<template name="pkItem">
<view class="{{styles.gameResult}}">
<view class="{{styles.gameResult}}">
<!-- levelInfo -->
<!-- levelInfo -->
<view class="{{styles.levelInfo}} {{item.
isWin
? styles.win : styles.lose}}">
<view class="{{styles.levelInfo}} {{item.
wined
? styles.win : styles.lose}}">
<text class="{{styles.levelName}}">{{item.stageName}}</text>
<text class="{{styles.levelName}}">{{item.stageName}}</text>
<image mode="widthFix" src="{{assets[item.
isWin
? 'win.png' : 'lose.png'].u}}" class="{{styles.levelResult}}"></image>
<image mode="widthFix" src="{{assets[item.
wined
? 'win.png' : 'lose.png'].u}}" class="{{styles.levelResult}}"></image>
<text class="{{styles.levelDate}}">{{item.createTime}}</text>
<text class="{{styles.levelDate}}">{{item.createTime}}</text>
</view>
</view>
<!-- gameBody -->
<!-- gameBody -->
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<view class="{{styles.playerSection}}">
<view class="{{styles.playerSection}}">
<!-- userInfo -->
<!-- userInfo -->
<view class="{{styles.userInfo}}">
<view class="{{styles.userInfo}}">
<text class="{{styles.userName}}">{{item.initiatorName
|| '-'
}}</text>
<text class="{{styles.userName}}">{{item.initiatorName}}</text>
<view class="{{styles.userBadge}}">
<view class="{{styles.userBadge}}">
<image
<image
class="{{styles.userIcon}}"
class="{{styles.userIcon}}"
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<image class="{{styles.vs}}" src="{{assets['vs.png'].u}}" />
<image class="{{styles.vs}}" src="{{assets['vs.png'].u}}" />
<!-- userInfo 2 -->
<!-- userInfo 2 -->
<view class="{{styles.userInfo}}">
<view class="{{styles.userInfo}}">
<text class="{{styles.userName}}" style="text-align: right">{{item.recipientName
|| '-'
}}</text>
<text class="{{styles.userName}}" style="text-align: right">{{item.recipientName}}</text>
<view class="{{styles.userBadge}}">
<view class="{{styles.userBadge}}">
<image
<image
class="{{styles.userIcon}}"
class="{{styles.userIcon}}"
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
<text class="{{styles.value}}">{{item.initiatorResultTime}}s</text>
<text class="{{styles.value}}">{{item.initiatorResultTime}}s</text>
<view class="{{styles.value}}">
<view class="{{styles.value}}">
<image class="{{styles.diamond}}" src="{{assets2['diamond.png'].u}}" />
<image class="{{styles.diamond}}" src="{{assets2['diamond.png'].u}}" />
<text>+{{
item.initiatorPoint
}}</text>
<text>+{{
item.result === 'WIN' ? config.personalPkWinPoint : config.personalPkLosePoint
}}</text>
</view>
</view>
</view>
</view>
<!-- stats -->
<!-- stats -->
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
<text class="{{styles.value}}">{{item.recipientResultTime}}s</text>
<text class="{{styles.value}}">{{item.recipientResultTime}}s</text>
<view class="{{styles.value}}">
<view class="{{styles.value}}">
<image class="{{styles.diamond}}" src="{{assets2['diamond.png'].u}}" />
<image class="{{styles.diamond}}" src="{{assets2['diamond.png'].u}}" />
<text>+{{
item.recipientPoint
}}</text>
<text>+{{
item.result === 'WIN' ? config.personalPkLosePoint : config.personalPkWinPoint
}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
</view>
</view>
</template>
</template>
<block wx:for="{{ realList }}" wx:key="userId">
<block wx:for="{{ realList }}" wx:key="userId">
<template is="pkItem" data="{{ styles, item, assets, assets2, rankTranslate }}" />
<template is="pkItem" data="{{ styles, item, assets, assets2, rankTranslate
, config
}}" />
</block>
</block>
<view class="{{styles.spinWrap}}" wx:if="{{loading}}">
<view class="{{styles.spinWrap}}" wx:if="{{loading}}">
<view class="{{styles.spin}}">
<view class="{{styles.spin}}">
...
...
src/pages/battles/index.tsx
View file @
c6523e1b
...
@@ -18,13 +18,9 @@ import styles from './index.module.scss'
...
@@ -18,13 +18,9 @@ import styles from './index.module.scss'
const
Battles
=
()
=>
{
const
Battles
=
()
=>
{
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[])
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[])
const
summary
=
useStoreState
((
state
)
=>
state
.
battlesModel
.
summary
)
const
summary
=
useStoreState
((
state
)
=>
state
.
battlesModel
.
summary
)
const
addPkGuideTimes
=
useStoreActions
((
state
)
=>
state
.
guideModel
.
addPkGuideTimes
)
const
getSetting
=
useStoreActions
((
state
)
=>
state
.
userModel
.
getSetting
)
const
setting
=
useStoreState
((
state
)
=>
state
.
userModel
.
setting
)
const
setting
=
useStoreState
((
state
)
=>
state
.
userModel
.
setting
)
const
userInfo
=
useStoreState
((
state
)
=>
state
.
userModel
.
userInfo
)
const
addPkGuideTimes
=
useStoreActions
(
(
state
)
=>
state
.
guideModel
.
addPkGuideTimes
)
const
getSetting
=
useStoreActions
((
actions
)
=>
actions
.
userModel
.
getSetting
)
const
fetchUserSummary
=
useStoreActions
(
const
fetchUserSummary
=
useStoreActions
(
(
actions
)
=>
actions
.
battlesModel
.
fetchUserSummary
(
actions
)
=>
actions
.
battlesModel
.
fetchUserSummary
...
@@ -76,13 +72,7 @@ const Battles = () => {
...
@@ -76,13 +72,7 @@ const Battles = () => {
</
View
>
</
View
>
<
View
className=
{
styles
.
gameResult
}
>
<
View
className=
{
styles
.
gameResult
}
>
<
pk
-
record
<
pk
-
record
list=
{
summary
?.
records
||
[]
}
config=
{
setting
}
ref=
{
pkRecords
}
/>
userId=
{
userInfo
.
userId
!
}
winPoint=
{
setting
.
personalPkWinPoint
||
0
}
losePoint=
{
setting
.
personalPkLosePoint
||
0
}
list=
{
summary
?.
records
||
[]
}
ref=
{
pkRecords
}
/>
</
View
>
</
View
>
</
View
>
</
View
>
<
View
className=
{
styles
.
bottom
}
>
<
View
className=
{
styles
.
bottom
}
>
...
...
src/pages/game/play/components/battle-complete.tsx
View file @
c6523e1b
...
@@ -19,6 +19,7 @@ const BattleComplete = ({ pkResult }: BattleCompleteProps) => {
...
@@ -19,6 +19,7 @@ const BattleComplete = ({ pkResult }: BattleCompleteProps) => {
const
updateState
=
useStoreActions
(
actions
=>
actions
.
mainModel
.
updateState
)
const
updateState
=
useStoreActions
(
actions
=>
actions
.
mainModel
.
updateState
)
const
setting
=
useStoreState
(
state
=>
state
.
userModel
.
setting
)
const
setting
=
useStoreState
(
state
=>
state
.
userModel
.
setting
)
const
getSetting
=
useStoreActions
(
actions
=>
actions
.
userModel
.
getSetting
)
const
getSetting
=
useStoreActions
(
actions
=>
actions
.
userModel
.
getSetting
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
upSelf
=
()
=>
{
const
upSelf
=
()
=>
{
updateState
({
isCreatePkShow
:
false
,
currentPkStage
:
null
})
updateState
({
isCreatePkShow
:
false
,
currentPkStage
:
null
})
...
@@ -35,11 +36,23 @@ const BattleComplete = ({ pkResult }: BattleCompleteProps) => {
...
@@ -35,11 +36,23 @@ const BattleComplete = ({ pkResult }: BattleCompleteProps) => {
return
getUserRank
(
pkResult
?.
recipientLevel
??
''
)
return
getUserRank
(
pkResult
?.
recipientLevel
??
''
)
},
[
pkResult
])
},
[
pkResult
])
const
isWin
=
useMemo
(()
=>
{
const
isMySelf
=
useMemo
(()
=>
{
/** 从发起者角度算 */
return
userInfo
.
userId
&&
userInfo
.
userId
===
pkResult
?.
initiator
},
[
userInfo
,
pkResult
])
/** 发起者输了 */
const
isInitiatorFail
=
useMemo
(()
=>
{
return
pkResult
?.
result
===
'LOSE'
return
pkResult
?.
result
===
'LOSE'
},
[
pkResult
])
},
[
pkResult
])
const
headerWin
=
useMemo
(()
=>
{
if
(
isMySelf
)
{
return
pkResult
?.
result
===
'WIN'
}
/** 从发起者角度算 */
return
isInitiatorFail
},
[
pkResult
,
isMySelf
,
isInitiatorFail
])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
pkResult
)
{
if
(
pkResult
)
{
getSetting
()
getSetting
()
...
@@ -47,11 +60,11 @@ const BattleComplete = ({ pkResult }: BattleCompleteProps) => {
...
@@ -47,11 +60,11 @@ const BattleComplete = ({ pkResult }: BattleCompleteProps) => {
},
[
getSetting
,
pkResult
])
},
[
getSetting
,
pkResult
])
const
score
=
useMemo
(()
=>
{
const
score
=
useMemo
(()
=>
{
if
(
is
Win
)
{
if
(
header
Win
)
{
return
setting
?.
personalPkWinPoint
??
0
return
setting
?.
personalPkWinPoint
??
0
}
}
return
setting
?.
personalPkLosePoint
??
0
return
setting
?.
personalPkLosePoint
??
0
},
[
setting
,
is
Win
])
},
[
setting
,
header
Win
])
if
(
!
pkResult
)
{
if
(
!
pkResult
)
{
return
null
return
null
...
@@ -60,14 +73,14 @@ const BattleComplete = ({ pkResult }: BattleCompleteProps) => {
...
@@ -60,14 +73,14 @@ const BattleComplete = ({ pkResult }: BattleCompleteProps) => {
return
(
return
(
<
View
className=
{
styles
.
wrap
}
>
<
View
className=
{
styles
.
wrap
}
>
<
View
className=
{
styles
.
gap_1
}
></
View
>
<
View
className=
{
styles
.
gap_1
}
></
View
>
<
Image
src=
{
is
Win
?
assetsGame
[
'pk-success.png'
].
u
:
assetsGame
[
'pk-fail.png'
].
u
}
className=
{
styles
.
pk_result
}
mode=
"heightFix"
></
Image
>
<
Image
src=
{
header
Win
?
assetsGame
[
'pk-success.png'
].
u
:
assetsGame
[
'pk-fail.png'
].
u
}
className=
{
styles
.
pk_result
}
mode=
"heightFix"
></
Image
>
<
View
className=
{
styles
.
game_bonus
}
>
<
View
className=
{
styles
.
game_bonus
}
>
<
Image
src=
{
assetsPrepare
[
'diamond.png'
].
u
}
className=
{
styles
.
diamond
}
></
Image
>
<
Image
src=
{
assetsPrepare
[
'diamond.png'
].
u
}
className=
{
styles
.
diamond
}
></
Image
>
水晶 +
{
score
}
水晶 +
{
score
}
</
View
>
</
View
>
<
View
className=
{
styles
.
game_role
}
>
<
View
className=
{
styles
.
game_role
}
>
<
View
className=
{
classNames
(
styles
.
game_role_left
,
!
is
Win
&&
styles
.
is_fail
)
}
>
<
View
className=
{
classNames
(
styles
.
game_role_left
,
!
is
InitiatorFail
&&
styles
.
is_fail
)
}
>
<
View
className=
{
styles
.
user_name
}
>
{
pkResult
.
recipientName
}
</
View
>
<
View
className=
{
styles
.
user_name
}
>
{
pkResult
.
recipientName
}
</
View
>
<
View
className=
{
styles
.
user_level
}
>
<
View
className=
{
styles
.
user_level
}
>
<
Image
src=
{
getUserLevelIcon
(
recipientLevel
.
level
)
}
className=
{
styles
.
level_icon
}
/>
<
Image
src=
{
getUserLevelIcon
(
recipientLevel
.
level
)
}
className=
{
styles
.
level_icon
}
/>
...
@@ -79,7 +92,7 @@ const BattleComplete = ({ pkResult }: BattleCompleteProps) => {
...
@@ -79,7 +92,7 @@ const BattleComplete = ({ pkResult }: BattleCompleteProps) => {
<
View
className=
{
classNames
(
styles
.
info
,
styles
.
is_info_2
)
}
>
答题用时:
{
pkResult
.
recipientResultTime
}
s
</
View
>
<
View
className=
{
classNames
(
styles
.
info
,
styles
.
is_info_2
)
}
>
答题用时:
{
pkResult
.
recipientResultTime
}
s
</
View
>
</
View
>
</
View
>
<
View
className=
{
classNames
(
styles
.
game_role_right
,
is
Win
&&
styles
.
is_fail
)
}
>
<
View
className=
{
classNames
(
styles
.
game_role_right
,
is
InitiatorFail
&&
styles
.
is_fail
)
}
>
<
View
className=
{
styles
.
user_name
}
>
{
pkResult
.
initiatorName
}
</
View
>
<
View
className=
{
styles
.
user_name
}
>
{
pkResult
.
initiatorName
}
</
View
>
<
View
className=
{
styles
.
user_level
}
>
<
View
className=
{
styles
.
user_level
}
>
<
Image
src=
{
getUserLevelIcon
(
initiatorLevel
.
level
)
}
className=
{
styles
.
level_icon
}
/>
<
Image
src=
{
getUserLevelIcon
(
initiatorLevel
.
level
)
}
className=
{
styles
.
level_icon
}
/>
...
...
src/pages/main/components/tutorial/pk.tsx
View file @
c6523e1b
...
@@ -18,7 +18,7 @@ const Scene = () => {
...
@@ -18,7 +18,7 @@ const Scene = () => {
}
}
return
(
return
(
<
View
className=
{
styles
.
wrap
}
>
<
View
className=
{
styles
.
wrap
}
catchMove
>
<
Image
src=
{
assetsGuide
[
'cat-2.png'
].
u
}
className=
{
styles
.
cat
}
/>
<
Image
src=
{
assetsGuide
[
'cat-2.png'
].
u
}
className=
{
styles
.
cat
}
/>
<
View
className=
{
styles
.
dialog
}
>
<
View
className=
{
styles
.
dialog
}
>
<
View
>
<
View
>
...
...
src/pages/main/main-underground/create-pk.tsx
View file @
c6523e1b
...
@@ -91,13 +91,13 @@ const CreatePk = (props: CreatePkProps) => {
...
@@ -91,13 +91,13 @@ const CreatePk = (props: CreatePkProps) => {
return
(
return
(
<>
<>
{
visible
&&
(<
PkGuide
/>)
}
{
visible
&&
(<
PkGuide
/>)
}
<
View
className=
{
classNames
(
styles
.
close_wrap
,
visible
&&
styles
.
is_show
)
}
style=
{
closeStyle
}
>
<
View
className=
{
classNames
(
styles
.
close_wrap
,
visible
&&
styles
.
is_show
)
}
style=
{
closeStyle
}
catchMove
>
<
View
className=
{
styles
.
close
}
onTouchStart=
{
closeModal
}
data
-
name=
"关闭发起PK"
>
<
View
className=
{
styles
.
close
}
onTouchStart=
{
closeModal
}
data
-
name=
"关闭发起PK"
>
<
Image
src=
{
assetsMainNext
[
'pk-close.png'
].
u
}
className=
{
styles
.
close_icon
}
></
Image
>
<
Image
src=
{
assetsMainNext
[
'pk-close.png'
].
u
}
className=
{
styles
.
close_icon
}
></
Image
>
</
View
>
</
View
>
</
View
>
</
View
>
<
View
className=
{
classNames
(
styles
.
top
,
visible
&&
styles
.
is_show
)
}
>
<
View
className=
{
classNames
(
styles
.
top
,
visible
&&
styles
.
is_show
)
}
catchMove
>
<
Image
src=
{
assetsMainNext
[
'pk-top.png'
].
u
}
className=
{
styles
.
bg_top
}
mode=
"widthFix"
></
Image
>
<
Image
src=
{
assetsMainNext
[
'pk-top.png'
].
u
}
className=
{
styles
.
bg_top
}
mode=
"widthFix"
></
Image
>
<
View
className=
{
styles
.
top_content
}
>
<
View
className=
{
styles
.
top_content
}
>
<
View
className=
{
styles
.
pk_history
}
style=
{
historyStyle
}
onClick=
{
()
=>
navigateTo
({
url
:
'/pages/battles/index'
})
}
>
<
View
className=
{
styles
.
pk_history
}
style=
{
historyStyle
}
onClick=
{
()
=>
navigateTo
({
url
:
'/pages/battles/index'
})
}
>
...
@@ -115,7 +115,7 @@ const CreatePk = (props: CreatePkProps) => {
...
@@ -115,7 +115,7 @@ const CreatePk = (props: CreatePkProps) => {
</
View
>
</
View
>
</
View
>
</
View
>
<
View
className=
{
classNames
(
styles
.
bottom
,
visible
&&
styles
.
is_show
)
}
>
<
View
className=
{
classNames
(
styles
.
bottom
,
visible
&&
styles
.
is_show
)
}
catchMove
>
<
Image
src=
{
assetsMainNext
[
'pk-slogen.png'
].
u
}
className=
{
styles
.
pk_slogan
}
></
Image
>
<
Image
src=
{
assetsMainNext
[
'pk-slogen.png'
].
u
}
className=
{
styles
.
pk_slogan
}
></
Image
>
<
Image
src=
{
assetsMainNext
[
'pk-bottom.png'
].
u
}
className=
{
styles
.
bg_bottom
}
mode=
"widthFix"
></
Image
>
<
Image
src=
{
assetsMainNext
[
'pk-bottom.png'
].
u
}
className=
{
styles
.
bg_bottom
}
mode=
"widthFix"
></
Image
>
<
View
className=
{
styles
.
bottom_content
}
>
<
View
className=
{
styles
.
bottom_content
}
>
...
...
src/pages/main/main-underground/pk-guide/pk.tsx
View file @
c6523e1b
...
@@ -18,7 +18,7 @@ const Scene = () => {
...
@@ -18,7 +18,7 @@ const Scene = () => {
}
}
return
(
return
(
<
View
className=
{
styles
.
wrap
}
>
<
View
className=
{
styles
.
wrap
}
catchMove
>
<
Image
src=
{
assetsGuide
[
'cat-2.png'
].
u
}
className=
{
styles
.
cat
}
/>
<
Image
src=
{
assetsGuide
[
'cat-2.png'
].
u
}
className=
{
styles
.
cat
}
/>
<
View
className=
{
styles
.
dialog
}
>
<
View
className=
{
styles
.
dialog
}
>
<
View
>
<
View
>
...
...
src/pages/main/main-underground/scene/constants.ts
View file @
c6523e1b
...
@@ -60,7 +60,7 @@ function stageToStageNext (stageList: Stage[]): {nextList: StageNext[]; showList
...
@@ -60,7 +60,7 @@ function stageToStageNext (stageList: Stage[]): {nextList: StageNext[]; showList
/** 设置pk历史页面返回后引导 */
/** 设置pk历史页面返回后引导 */
if
(
currentIndex
!==
-
1
)
{
if
(
currentIndex
!==
-
1
)
{
let
current
=
currentIndex
let
current
=
currentIndex
while
(
current
)
{
while
(
current
>=
0
)
{
const
currentItem
=
showList
[
current
]
const
currentItem
=
showList
[
current
]
if
(
currentItem
&&
currentItem
.
status
===
StageStatus
.
PASSED
&&
currentItem
.
type
!==
StageType
.
Special
)
{
if
(
currentItem
&&
currentItem
.
status
===
StageStatus
.
PASSED
&&
currentItem
.
type
!==
StageType
.
Special
)
{
currentItem
.
$lastPassedStage
=
true
currentItem
.
$lastPassedStage
=
true
...
...
src/pages/main/main-underground/scene/stage.tsx
View file @
c6523e1b
...
@@ -153,7 +153,6 @@ const StageComp = (props: StageProps) => {
...
@@ -153,7 +153,6 @@ const StageComp = (props: StageProps) => {
const
nextPkGuide
=
useStoreActions
(
state
=>
state
.
guideModel
.
nextPkGuide
)
const
nextPkGuide
=
useStoreActions
(
state
=>
state
.
guideModel
.
nextPkGuide
)
const
showPkGuideFromHis
=
useStoreState
(
state
=>
state
.
guideModel
.
showPkGuideFromHis
)
const
showPkGuideFromHis
=
useStoreState
(
state
=>
state
.
guideModel
.
showPkGuideFromHis
)
const
updateGuideState
=
useStoreActions
(
state
=>
state
.
guideModel
.
updateState
)
const
updateGuideState
=
useStoreActions
(
state
=>
state
.
guideModel
.
updateState
)
const
pkDetails
=
useStoreState
(
state
=>
state
.
userModel
.
pkDetails
)
const
isSpecialRound
=
useMemo
(()
=>
{
const
isSpecialRound
=
useMemo
(()
=>
{
return
stage
.
type
===
StageType
.
Special
return
stage
.
type
===
StageType
.
Special
...
@@ -174,7 +173,7 @@ const StageComp = (props: StageProps) => {
...
@@ -174,7 +173,7 @@ const StageComp = (props: StageProps) => {
const
handleClick
=
()
=>
{
const
handleClick
=
()
=>
{
if
(
stage
.
status
!==
StageStatus
.
DISABLED
||
!
isProduction
)
{
if
(
stage
.
status
!==
StageStatus
.
DISABLED
||
!
isProduction
)
{
if
(
isSpecialRound
)
{
if
(
isSpecialRound
)
{
if
((
pkDetails
?.
stars
??
0
)
<
stage
.
limitStar
)
{
if
((
stage
.
holdStar
??
0
)
<
stage
.
limitStar
)
{
showToast
({
title
:
'星星数量不够,快去收集吧~'
,
icon
:
'none'
})
showToast
({
title
:
'星星数量不够,快去收集吧~'
,
icon
:
'none'
})
return
return
}
}
...
@@ -218,7 +217,7 @@ const StageComp = (props: StageProps) => {
...
@@ -218,7 +217,7 @@ const StageComp = (props: StageProps) => {
}
}
case
StageStatus
.
CURRENT
:
{
case
StageStatus
.
CURRENT
:
{
if
(
isSpecialRound
&&
(
pkDetails
?.
stars
??
0
)
<
stage
.
limitStar
)
{
if
(
isSpecialRound
&&
(
stage
.
holdStar
??
0
)
<
stage
.
limitStar
)
{
return
(
return
(
<
Image
src=
{
getLockedIcon
(
stage
.
type
).
u
}
className=
{
getIconClassNames
(
stage
.
type
)
}
/>
<
Image
src=
{
getLockedIcon
(
stage
.
type
).
u
}
className=
{
getIconClassNames
(
stage
.
type
)
}
/>
)
)
...
@@ -301,7 +300,7 @@ const StageComp = (props: StageProps) => {
...
@@ -301,7 +300,7 @@ const StageComp = (props: StageProps) => {
{
isSpecialRound
?
(
{
isSpecialRound
?
(
<
View
className=
{
styles
.
special_name
}
>
<
View
className=
{
styles
.
special_name
}
>
<
Image
src=
{
assetsMainNext
[
'star.png'
].
u
}
className=
{
styles
.
special_star
}
/>
<
Image
src=
{
assetsMainNext
[
'star.png'
].
u
}
className=
{
styles
.
special_star
}
/>
星星
{
pkDetails
?.
stars
??
0
}
/
{
stage
.
limitStar
}
星星
{
stage
.
holdStar
??
0
}
/
{
stage
.
limitStar
}
</
View
>
</
View
>
)
:
(
)
:
(
<
View
>
{
!
isProduction
?
`${stage.id}.`
:
''
}{
stage
.
name
}
</
View
>
<
View
>
{
!
isProduction
?
`${stage.id}.`
:
''
}{
stage
.
name
}
</
View
>
...
...
src/store/modules/guide.ts
View file @
c6523e1b
...
@@ -83,11 +83,12 @@ const guideModel: GuideModel = {
...
@@ -83,11 +83,12 @@ const guideModel: GuideModel = {
addPkGuideTimes
:
action
((
state
)
=>
{
addPkGuideTimes
:
action
((
state
)
=>
{
let
next
let
next
if
(
state
.
pkGuideTimes
!==
null
)
{
if
(
state
.
pkGuideTimes
)
{
/** 只显示3次pk历史pk引导 */
if
(
state
.
pkGuideTimes
>=
3
)
{
if
(
state
.
pkGuideTimes
>=
3
)
{
return
return
}
}
next
=
state
.
pkGuideTimes
+
1
next
=
(
+
state
.
pkGuideTimes
)
+
1
}
else
{
}
else
{
next
=
1
next
=
1
}
}
...
...
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