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
5367faf4
Commit
5367faf4
authored
Jun 16, 2023
by
raca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
100bfa5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
20 deletions
+39
-20
app.config.ts.tpl
scripts/app.config.ts.tpl
+1
-1
exchange-rename-card.tsx
src/pages/market/components/exchange-rename-card.tsx
+38
-19
No files found.
scripts/app.config.ts.tpl
View file @
5367faf4
...
...
@@ -6,8 +6,8 @@
export default {
pages: [
'pages/market/index',
'pages/main/main',
'pages/market/index',
'pages/accept-pk/index',
'pages/battles/index',
'pages/prepare/index',
...
...
src/pages/market/components/exchange-rename-card.tsx
View file @
5367faf4
...
...
@@ -11,10 +11,9 @@ import styles from './exchange-item.module.scss'
import
styles2
from
'./exchange-rename-card.module.scss'
type
ExchangeItemProps
=
{
title
:
string
;
stepValue
:
number
;
// onConfirm: (arg: number) => void;
onCancel
:
()
=>
void
;
title
:
string
stepValue
:
number
onCancel
:
()
=>
void
}
const
randomPick
=
(
arr
:
string
[])
=>
{
...
...
@@ -25,13 +24,17 @@ const randomPick = (arr: string[]) => {
const
ExchangeRenameCard
=
(
props
:
ExchangeItemProps
)
=>
{
const
{
onCancel
,
stepValue
}
=
props
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
userInfo
=
useStoreState
(
(
state
)
=>
state
.
userModel
.
userInfo
)
const
[
name
,
setName
]
=
useState
(
userInfo
.
nickName
)
const
[
generating
,
{
setTrue
,
setFalse
}]
=
useBoolean
(
false
)
const
dataRef
=
useRef
<
NickNameWord
>
({
noun
:
[],
adj
:
[]
})
const
timerRef
=
useRef
<
NodeJS
.
Timer
|
null
>
(
null
)
const
accountExchange
=
useStoreActions
(
actions
=>
actions
.
userModel
.
accountExchange
)
const
changeNickName
=
useStoreActions
(
actions
=>
actions
.
userModel
.
changeNickName
)
const
accountExchange
=
useStoreActions
(
(
actions
)
=>
actions
.
userModel
.
accountExchange
)
const
changeNickName
=
useStoreActions
(
(
actions
)
=>
actions
.
userModel
.
changeNickName
)
const
generateName
=
useCallback
(()
=>
{
const
{
noun
,
adj
}
=
dataRef
.
current
...
...
@@ -73,21 +76,25 @@ const ExchangeRenameCard = (props: ExchangeItemProps) => {
num
:
1
,
accountTo
:
'NAME_CARD'
,
accountFrom
:
'POINT'
,
}).
then
(()
=>
{
changeNickName
(
name
).
then
(()
=>
{
showToast
({
title
:
'操作成功'
,
icon
:
'success'
})
})
}).
catch
(()
=>
{
})
.
then
(()
=>
{
changeNickName
(
name
).
then
(()
=>
{
showToast
({
title
:
'操作成功'
,
icon
:
'success'
})
onCancel
&&
onCancel
()
})
})
.
catch
(()
=>
{})
}
return
(
<>
<
View
className=
{
styles2
.
description
}
>
请输入您的角色名(7字以内)
</
View
>
<
View
className=
{
styles2
.
description
}
>
请输入您的角色名(7字以内)
</
View
>
<
View
className=
{
styles2
.
input
}
>
<
Input
className=
{
styles2
.
inputName
}
value=
{
name
as
string
}
onInput=
{
e
=>
setName
(
e
.
detail
.
value
)
}
/>
<
Input
className=
{
styles2
.
inputName
}
value=
{
name
as
string
}
onInput=
{
(
e
)
=>
setName
(
e
.
detail
.
value
)
}
/>
<
Image
src=
{
assetsGuide
[
'touzi.png'
].
u
}
className=
{
classNames
(
...
...
@@ -97,10 +104,22 @@ const ExchangeRenameCard = (props: ExchangeItemProps) => {
onClick=
{
handleGenerate
}
></
Image
>
</
View
>
<
View
className=
{
styles2
.
tips
}
>
将消耗
<
Text
className=
{
styles2
.
tips_val
}
>
{
stepValue
}
</
Text
>
水晶
</
View
>
<
View
className=
{
styles2
.
tips
}
>
将消耗
<
Text
className=
{
styles2
.
tips_val
}
>
{
stepValue
}
</
Text
>
水晶
</
View
>
<
View
className=
{
styles
.
footer
}
>
<
View
className=
{
styles
.
cancel
}
onClick=
{
()
=>
onCancel
()
}
id=
"market_exchange_cancel"
>
取消
</
View
>
<
View
className=
{
styles
.
confirm
}
onClick=
{
handleConfirm
}
data
-
name=
"兑换改名卡"
>
<
View
className=
{
styles
.
cancel
}
onClick=
{
()
=>
onCancel
()
}
id=
"market_exchange_cancel"
>
取消
</
View
>
<
View
className=
{
styles
.
confirm
}
onClick=
{
handleConfirm
}
data
-
name=
"兑换改名卡"
>
确定
</
View
>
</
View
>
...
...
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