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
c0cc703f
Commit
c0cc703f
authored
Jun 20, 2023
by
raca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 接受pk 授权
parent
e0aaaa1c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
10 deletions
+52
-10
modal-name.module.scss
src/pages/accept-pk/components/modal-name.module.scss
+22
-4
modal-name.tsx
src/pages/accept-pk/components/modal-name.tsx
+30
-6
No files found.
src/pages/accept-pk/components/modal-name.module.scss
View file @
c0cc703f
...
...
@@ -121,11 +121,28 @@
padding
:
32px
34px
80px
34px
;
}
.footerButton
{
.btn
{
background-image
:
url(https://cdn.jkwljy.com/pk-math/wbVXwYUGCx63qjnAcoCW4mL2pvh/686x112)
;
background-size
:
100%
100%
;
height
:
112px
;
flex
:
1
;
background-image
:
url('https://cdn.jkwljy.com/pk-math/gMAFXFRRH3frGsM2wCpyLUCdiNT/343x56')
;
border-radius
:
56px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
40px
;
font-weight
:
600
;
color
:
#FFFFFF
;
line-height
:
56px
;
background-color
:
#1786F7
;
&
.disabled
{
background-image
:
none
;
background-color
:
#E2E6ED
;
color
:
#C2C8D1
;
}
}
.
footerHoverButton
{
background-image
:
url(
'https://cdn.jkwljy.com/pk-math/3UiwFgrVHVQEcaPdxdf1XinBb64o/343x56'
)
;
.
isHover
{
background-image
:
url(
https://cdn.jkwljy.com/pk-math/hijKKpX1GS7rJoezNKJwDFwMFQC/686x112
)
;
}
\ No newline at end of file
src/pages/accept-pk/components/modal-name.tsx
View file @
c0cc703f
import
{
View
,
RootPortal
,
Image
}
from
'@tarojs/components'
import
{
View
,
RootPortal
,
Image
,
Button
,
ButtonProps
,
CommonEventFunction
}
from
'@tarojs/components'
import
classNames
from
'classnames'
import
{
useCallback
,
useRef
,
useState
}
from
'react'
import
{
EyeProtectionView
}
from
'@/components'
import
Button
from
'@/components/Button'
import
{
useBoolean
}
from
'@/hooks'
import
{
useStoreActions
}
from
'@/store/hooks'
import
{
getNickNameWords
,
type
NickNameWord
}
from
'@/api'
import
assetsPk
from
'@/assets/oss/assets-pk'
import
assetsGuide
from
'@/assets/oss/assets-guide'
import
{
report
,
SkynetEvent
}
from
'@/utils/skynet'
import
styles
from
'./modal-name.module.scss'
...
...
@@ -29,6 +30,7 @@ const ModalName = ({
const
[
generating
,
{
setTrue
,
setFalse
}]
=
useBoolean
(
false
)
const
dataRef
=
useRef
<
NickNameWord
>
({
noun
:
[],
adj
:
[]
})
const
timerRef
=
useRef
<
NodeJS
.
Timer
|
null
>
(
null
)
const
updateNickNameAndPhone
=
useStoreActions
(
actions
=>
actions
.
userModel
.
updateNickNameAndPhone
)
const
generateName
=
useCallback
(()
=>
{
const
{
noun
,
adj
}
=
dataRef
.
current
...
...
@@ -58,6 +60,26 @@ const ModalName = ({
},
1000
)
},
[
generateName
,
setTrue
,
setFalse
,
getNameWords
])
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
handleGetPhone
=
useCallback
<
CommonEventFunction
<
ButtonProps
.
onGetPhoneNumberEventDetail
>>
((
e
)
=>
{
if
(
loading
)
return
setLoading
(
true
)
if
(
!
e
.
detail
.
code
&&
e
.
detail
.
errMsg
)
{
report
(
SkynetEvent
.
BizError
,
{
errMsg
:
e
.
detail
.
errMsg
,
errType
:
'AUTH_PHONE_ERR'
})
}
updateNickNameAndPhone
({
code
:
e
.
detail
.
code
,
name
})
.
then
(()
=>
{
setLoading
(
false
)
onFinish
()
})
.
catch
(
err
=>
{
setLoading
(
false
)
console
.
log
(
err
)
})
},
[
onClose
,
updateNickNameAndPhone
,
onFinish
,
name
,
loading
])
return
(
<
RootPortal
>
<
View
...
...
@@ -88,10 +110,12 @@ const ModalName = ({
</
View
>
<
View
className=
{
styles
.
footer
}
>
<
Button
size=
"large"
image=
{
styles
.
footerButton
}
hoverImage=
{
styles
.
footerHoverButton
}
onClick=
{
onFinish
}
openType=
"getPhoneNumber"
onGetPhoneNumber=
{
handleGetPhone
}
data
-
name=
"接收PK"
className=
{
styles
.
btn
}
hoverClass=
{
styles
.
isHover
}
onClick=
{
onClose
}
>
确定
</
Button
>
...
...
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