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
2f587822
Commit
2f587822
authored
Jun 15, 2023
by
raca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: PK接受挑战
parent
f28a156b
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
327 additions
and
0 deletions
+327
-0
app.config.ts.tpl
scripts/app.config.ts.tpl
+1
-0
arrow.png
src/pages/accept/assets/arrow.png
+0
-0
avatar.png
src/pages/accept/assets/avatar.png
+0
-0
click.png
src/pages/accept/assets/click.png
+0
-0
lightning-1.png
src/pages/accept/assets/lightning-1.png
+0
-0
lightning-2.png
src/pages/accept/assets/lightning-2.png
+0
-0
main-bg.png
src/pages/accept/assets/main-bg.png
+0
-0
pk.png
src/pages/accept/assets/pk.png
+0
-0
slogan.png
src/pages/accept/assets/slogan.png
+0
-0
top-bg.png
src/pages/accept/assets/top-bg.png
+0
-0
modal-name.module.scss
src/pages/accept/components/modal-name.module.scss
+0
-0
modal-name.tsx
src/pages/accept/components/modal-name.tsx
+75
-0
top-header.module.scss
src/pages/accept/components/top-header.module.scss
+19
-0
top-header.tsx
src/pages/accept/components/top-header.tsx
+27
-0
index.config.ts
src/pages/accept/index.config.ts
+6
-0
index.module.scss
src/pages/accept/index.module.scss
+121
-0
index.tsx
src/pages/accept/index.tsx
+78
-0
No files found.
scripts/app.config.ts.tpl
View file @
2f587822
...
...
@@ -6,6 +6,7 @@
export default {
pages: [
'pages/accept/index',
'pages/main/main',
'pages/battles/index',
'pages/prepare/index',
...
...
src/pages/accept/assets/arrow.png
0 → 100644
View file @
2f587822
1 KB
src/pages/accept/assets/avatar.png
0 → 100644
View file @
2f587822
24.4 KB
src/pages/accept/assets/click.png
0 → 100644
View file @
2f587822
10.3 KB
src/pages/accept/assets/lightning-1.png
0 → 100644
View file @
2f587822
7.8 KB
src/pages/accept/assets/lightning-2.png
0 → 100644
View file @
2f587822
7.92 KB
src/pages/accept/assets/main-bg.png
0 → 100644
View file @
2f587822
76.1 KB
src/pages/accept/assets/pk.png
0 → 100644
View file @
2f587822
37.5 KB
src/pages/accept/assets/slogan.png
0 → 100644
View file @
2f587822
30.2 KB
src/pages/accept/assets/top-bg.png
0 → 100644
View file @
2f587822
30.7 KB
src/pages/accept/components/modal-name.module.scss
0 → 100644
View file @
2f587822
src/pages/accept/components/modal-name.tsx
0 → 100644
View file @
2f587822
import
{
View
,
RootPortal
,
Image
,
Text
}
from
'@tarojs/components'
import
{
useCallback
,
useEffect
,
useRef
}
from
'react'
import
classNames
from
'classnames'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
assets
from
'@/assets/oss/assets-complete'
import
{
EyeProtectionView
}
from
'@/components'
import
styles
from
'./modal-name.module.scss'
const
canGoNext
=
true
const
ModalName
=
()
=>
{
const
modalContinueVisible
=
useStoreState
(
state
=>
state
.
gameModel
.
modalContinueVisible
)
const
cardNum
=
useStoreState
(
state
=>
state
.
userModel
.
cardNum
)
const
bornTimes
=
useStoreState
(
state
=>
state
.
gameModel
.
bornTimes
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
submit
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
submit
)
const
reborn
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
reborn
)
const
isClickRef
=
useRef
(
false
)
useEffect
(()
=>
{
if
(
modalContinueVisible
)
{
fetchAccount
()
}
},
[
fetchAccount
,
modalContinueVisible
])
const
handleReborn
=
useCallback
(
async
()
=>
{
if
(
isClickRef
.
current
)
return
isClickRef
.
current
=
true
try
{
await
reborn
()
}
finally
{
isClickRef
.
current
=
false
}
},
[
reborn
])
return
(
<
RootPortal
>
<
View
className=
{
classNames
(
styles
.
mask
,
modalContinueVisible
&&
styles
.
is_show
)
}
>
</
View
>
<
EyeProtectionView
className=
{
classNames
(
styles
.
modal
,
modalContinueVisible
&&
styles
.
is_show
)
}
>
{
modalContinueVisible
&&
(
<
Image
src=
{
assets
[
'fail-ip.png'
].
u
}
className=
{
styles
.
fail_icon
}
/>
)
}
<
View
className=
{
styles
.
title
}
>
是否继续闯关?
</
View
>
<
View
className=
{
styles
.
tips
}
>
消耗
<
Text
className=
{
styles
.
em
}
>
1
</
Text
>
张答题卡,复活继续闯关
</
View
>
<
View
className=
{
styles
.
tips
}
>
还剩
<
Text
className=
{
styles
.
em
}
>
{
bornTimes
}
</
Text
>
次复活机会
</
View
>
<
View
className=
{
styles
.
footer
}
>
<
View
className=
{
styles
.
btn_left
}
hoverClass=
{
styles
.
is_active
}
onClick=
{
()
=>
submit
()
}
id=
"fail_game_give_up"
>
放弃
</
View
>
<
View
className=
{
classNames
(
styles
.
btn_right
,
!
canGoNext
&&
styles
.
disabled
)
}
hoverClass=
{
canGoNext
?
styles
.
is_active
:
null
}
onClick=
{
handleReborn
}
id=
"fail_game_reborn"
>
<
Image
src=
{
require
(
'@/pages/main/assets/ph.png'
)
}
className=
{
styles
.
icon
}
></
Image
>
<
Text
>
-1 继续
</
Text
>
<
View
className=
{
styles
.
account_left
}
>
剩余
<
Text
className=
{
styles
.
account_num
}
>
{
cardNum
}
</
Text
>
张
</
View
>
</
View
>
</
View
>
</
EyeProtectionView
>
</
RootPortal
>
)
}
export
default
ModalName
src/pages/accept/components/top-header.module.scss
0 → 100644
View file @
2f587822
.header
{
background-size
:
100%
;
background-image
:
url(../assets/top-bg.png)
;
}
.inner
{
position
:
relative
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
text-align
:
center
;
}
.arrow
{
position
:
absolute
;
left
:
10
PX
;
width
:
30
PX
;
height
:
30
PX
;
}
src/pages/accept/components/top-header.tsx
0 → 100644
View file @
2f587822
import
{
View
,
Image
,
Text
}
from
'@tarojs/components'
import
{
getMenuButtonBoundingClientRect
,
navigateBack
}
from
'@tarojs/taro'
import
{
useState
,
}
from
'react'
import
classNames
from
'classnames'
import
styles
from
'./top-header.module.scss'
const
TopHeader
=
()
=>
{
const
[
nav
]
=
useState
(
getMenuButtonBoundingClientRect
())
return
(
<
View
className=
{
classNames
(
styles
.
header
)
}
>
<
View
style=
{
{
height
:
`${nav.height + 10}px`
,
paddingTop
:
`${nav.top - 5}px`
}
}
>
<
View
className=
{
styles
.
inner
}
style=
{
{
height
:
`${nav.height + 10}px`
}
}
>
<
Image
src=
{
require
(
'../assets/arrow.png'
)
}
className=
{
styles
.
arrow
}
onClick=
{
()
=>
navigateBack
()
}
></
Image
>
</
View
>
</
View
>
</
View
>
)
}
export
default
TopHeader
src/pages/accept/index.config.ts
0 → 100644
View file @
2f587822
export
default
definePageConfig
({
navigationBarTitleText
:
'pk-math'
,
navigationStyle
:
'custom'
,
navigationBarTextStyle
:
'black'
,
enableShareAppMessage
:
true
,
})
src/pages/accept/index.module.scss
0 → 100644
View file @
2f587822
.container
{
position
:
relative
;
color
:
#fff
;
display
:
flex
;
flex-direction
:
column
;
height
:
100vh
;
.wrapper
{
position
:
relative
;
z-index
:
10
;
height
:
100%
;
background-size
:
100%
;
background-image
:
url(./assets/main-bg.png)
;
background-repeat
:
no-repeat
;
.pkLightning
{
position
:
relative
;
display
:
flex
;
justify-content
:
center
;
.lightning
{
position
:
absolute
;
width
:
360px
;
height
:
200px
;
}
.pk
{
position
:
relative
;
z-index
:
10
;
width
:
310px
;
height
:
200px
;
}
}
.slogan
{
text-align
:
center
;
margin-bottom
:
60px
;
.sloganImage
{
width
:
520px
;
height
:
80px
;
}
}
.inner
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
.userSection
{
display
:
flex
;
gap
:
12px
;
font-weight
:
600
;
margin-bottom
:
12px
;
align-items
:
flex-end
;
.userName
{
font-size
:
48px
;
}
.challenge
{
font-size
:
40px
;
}
}
}
.avatar
{
width
:
248px
;
height
:
248px
;
margin
:
48px
0
30px
;
}
.record
{
width
:
440px
;
background
:
linear-gradient
(
270deg
,
rgba
(
83
,
55
,
170
,
0
)
0%
,
#5134A9
46%
,
rgba
(
82
,
53
,
169
,
0
)
100%
);
font-size
:
28px
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
gap
:
8px
;
letter-spacing
:
2px
;
padding
:
12px
0
;
.rank
{
display
:
flex
;
align-items
:
center
;
gap
:
6px
;
.badgeIcon
{
width
:
60px
;
height
:
60px
;
}
}
}
.bottom
{
bottom
:
24px
;
position
:
fixed
;
left
:
50%
;
transform
:
translateX
(
-50%
);
.clickImage
{
width
:
532px
;
height
:
112px
;
margin-bottom
:
50px
;
}
.line
{
margin
:
0
auto
;
width
:
238px
;
height
:
12px
;
background
:
#FFFFFF
;
border-radius
:
6px
;
}
}
}
}
\ No newline at end of file
src/pages/accept/index.tsx
0 → 100644
View file @
2f587822
import
{
View
,
Image
,
Text
}
from
'@tarojs/components'
import
assets
from
'@/assets/oss/assets-pk'
import
{
badgeImages
}
from
'../battles/const'
import
styles
from
'./index.module.scss'
import
TopHeader
from
'./components/top-header'
import
ModalName
from
'./components/modal-name'
const
Accept
=
()
=>
{
return
(
<
View
className=
{
styles
.
container
}
>
<
TopHeader
/>
<
View
className=
{
styles
.
wrapper
}
>
<
View
style=
{
{
position
:
'relative'
,
top
:
-
20
}
}
>
<
View
className=
{
styles
.
pkLightning
}
>
<
Image
className=
{
styles
.
lightning
}
style=
{
{
left
:
0
}
}
src=
{
require
(
'./assets/lightning-1.png'
)
}
/>
<
Image
className=
{
styles
.
pk
}
src=
{
require
(
'./assets/pk.png'
)
}
/>
<
Image
className=
{
styles
.
lightning
}
style=
{
{
right
:
0
}
}
src=
{
require
(
'./assets/lightning-2.png'
)
}
/>
</
View
>
<
View
className=
{
styles
.
slogan
}
>
<
Image
className=
{
styles
.
sloganImage
}
src=
{
require
(
'./assets/slogan.png'
)
}
/>
</
View
>
<
View
className=
{
styles
.
inner
}
>
<
View
className=
{
styles
.
userSection
}
>
<
Text
className=
{
styles
.
userName
}
>
用户名称用户名
</
Text
>
<
Text
className=
{
styles
.
challenge
}
>
向你发起挑战
</
Text
>
</
View
>
<
Text
>
关卡-连加连减
</
Text
>
<
Image
className=
{
styles
.
avatar
}
src=
{
require
(
'./assets/avatar.png'
)
}
/>
<
View
className=
{
styles
.
record
}
>
<
View
className=
{
styles
.
rank
}
>
<
Image
src=
{
assets
[
badgeImages
.
bronze
.
default
].
u
}
className=
{
styles
.
badgeIcon
}
/>
<
Text
className=
{
styles
.
rankText
}
>
青铜
</
Text
>
</
View
>
<
Text
>
当前战绩:胜 2 负 3
</
Text
>
<
Text
>
最佳表现:全对 | 29.3s
</
Text
>
</
View
>
</
View
>
</
View
>
<
View
className=
{
styles
.
bottom
}
>
<
Image
className=
{
styles
.
clickImage
}
onClick=
{
()
=>
{}
}
src=
{
require
(
'./assets/click.png'
)
}
/>
<
View
className=
{
styles
.
line
}
/>
</
View
>
</
View
>
<
ModalName
/>
</
View
>
)
}
export
default
Accept
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