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
c152f698
Commit
c152f698
authored
Apr 11, 2023
by
raca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
7efaa0a2
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
34 additions
and
13 deletions
+34
-13
auth.ts
src/api/auth.ts
+10
-1
creator.tsx
src/pages/group/components/creator.tsx
+3
-1
share-button.tsx
src/pages/group/components/share-button.tsx
+4
-1
index.tsx
src/pages/group/index.tsx
+5
-0
scene-1.tsx
src/pages/main/guide/scene-1.tsx
+2
-2
main-header.tsx
src/pages/prepare/components/main-header.tsx
+4
-3
thead.module.scss
src/pages/prepare/components/thead.module.scss
+1
-0
index.module.scss
src/pages/prepare/index.module.scss
+2
-2
user.ts
src/store/modules/user.ts
+3
-3
No files found.
src/api/auth.ts
View file @
c152f698
...
...
@@ -50,8 +50,17 @@ export function updateUserInfo (nickName: string) {
}))
}
export
type
SettintType
=
{
pointToCard
:
number
,
aPoint
?:
number
,
bPoint
?:
number
,
sPoint
?:
number
,
createGroupPoint
?:
number
joinGroupPoint
?:
number
}
export
function
getSetting
()
{
return
requestAfterSilentLogin
<
{
pointToCard
:
number
}
,
{}
>
(()
=>
({
return
requestAfterSilentLogin
<
SettintType
,
{}
>
(()
=>
({
method
:
'GET'
,
url
:
'/service-idea/inlet/config/getConfig'
,
data
:
{}
...
...
src/pages/group/components/creator.tsx
View file @
c152f698
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
useEffect
}
from
'react'
import
{
useStoreState
}
from
'@/store/hooks'
import
classNames
from
'classnames'
import
Button
from
'@/components/Button'
import
{
useBoolean
}
from
'@/hooks'
...
...
@@ -29,6 +30,7 @@ const renderImage = (url) => <Image className={styles.icon} src={assets[`${url}.
const
Creator
=
({
onClick
}:
{
onClick
:
()
=>
void
})
=>
{
const
[
playAnimation
,
{
setTrue
}]
=
useBoolean
(
false
)
const
setting
=
useStoreState
(
state
=>
state
.
userModel
.
setting
)
useEffect
(()
=>
{
const
triggerAnimation
=
requestAnimationFrame
(()
=>
{
...
...
@@ -61,7 +63,7 @@ const Creator = ({ onClick }: { onClick: () => void }) => {
<
Button
image=
{
styles
.
btn_image
}
hoverImage=
{
styles
.
btn_hover_image
}
size=
"large"
onClick=
{
onClick
}
>
立即创建你的部落
<
Image
className=
{
styles
.
action_icon
}
src=
{
require
(
'@/pages/main/assets/score.png'
)
}
/>
+
20
+
{
setting
.
createGroupPoint
}
</
Button
>
</
View
>
</
View
>
...
...
src/pages/group/components/share-button.tsx
View file @
c152f698
import
{
View
,
Image
,
Text
}
from
'@tarojs/components'
import
{
useStoreState
}
from
'@/store/hooks'
import
assets
from
'@/assets/oss/assets-group'
import
ShareView
from
'./share-view'
import
styles
from
'./members.module.scss'
export
default
()
=>
{
const
setting
=
useStoreState
(
state
=>
state
.
userModel
.
setting
)
return
(
<
ShareView
className=
{
styles
.
members_share
}
>
<
View
className=
{
styles
.
members_tip
}
>
<
Image
className=
{
styles
.
members_tip_icon
}
src=
{
require
(
'@/pages/main/assets/score.png'
)
}
/>
<
Text
className=
{
styles
.
members_tip_text
}
>
+
100
</
Text
>
<
Text
className=
{
styles
.
members_tip_text
}
>
+
{
setting
.
joinGroupPoint
}
</
Text
>
</
View
>
<
Image
className=
{
styles
.
members_icon
}
src=
{
assets
[
'invite-small.png'
].
u
}
/>
<
Text
className=
{
styles
.
members_text
}
>
邀请好友加入学习部落,一起PK math
</
Text
>
...
...
src/pages/group/index.tsx
View file @
c152f698
...
...
@@ -40,6 +40,7 @@ const Group = () => {
const
fetchTribeInfo
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
fetchTribeInfo
)
const
queryTribePoint
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
queryTribePoint
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
getSetting
=
useStoreActions
(
actions
=>
actions
.
userModel
.
getSetting
)
const
tabBarHeight
=
useMemo
(()
=>
{
return
nav
.
height
+
nav
.
top
+
5
...
...
@@ -66,6 +67,10 @@ const Group = () => {
Promise
.
all
([
queryTribePoint
(),
fetchTribeInfo
(),
fetchAccount
()])
})
useEffect
(()
=>
{
getSetting
()
},
[
getSetting
])
const
getShareParams
=
useCallback
(()
=>
{
return
{
pageParams
:
{
groupId
:
tribeInfo
?.
id
??
''
,
shareUserId
:
userInfo
.
userId
},
...
...
src/pages/main/guide/scene-1.tsx
View file @
c152f698
...
...
@@ -9,7 +9,7 @@ import styles from './scene-1.module.scss'
const
Text1
=
[
{
text
:
'嗨,'
},
{
text
:
'你好
,
'
},
{
text
:
'你好
!
'
},
{
text
:
'我是高斯。'
},
]
...
...
@@ -19,7 +19,7 @@ const Text2 = [
]
// text="我已经帮助很多同学,喜欢上数学,提升数学能力了。"
const
Text3
=
[
{
text
:
'我已经帮助很多同学
,
'
},
{
text
:
'我已经帮助很多同学'
},
{
text
:
'喜欢上数学,'
},
{
text
:
'提升数学能力了。'
},
]
...
...
src/pages/prepare/components/main-header.tsx
View file @
c152f698
...
...
@@ -11,6 +11,7 @@ import { formatNextStep, formatLevelAchieve, formatTopAchieve, formatType } from
const
MainHeader
=
()
=>
{
const
stageDetail
=
useStoreState
(
state
=>
state
.
gameModel
.
stageDetail
)
const
stageDetailPre
=
useStoreState
(
state
=>
state
.
gameModel
.
stageDetailPre
)
const
setting
=
useStoreState
(
state
=>
state
.
userModel
.
setting
)
const
isKing
=
useMemo
(()
=>
{
// 王者
return
stageDetail
?.
level
===
StageLevel
.
S
&&
String
(
stageDetail
?.
gear
)
===
StageGear
.
TOP10
...
...
@@ -46,9 +47,9 @@ const MainHeader = () => {
?
null
:
(
<
View
className=
{
styles
.
details
}
>
{
renderItem
({
u
:
assets
[
'level-big-s.png'
].
u
,
v
:
10
,
t
:
stageDetail
.
sTime
})
}
{
renderItem
({
u
:
assets
[
'level-big-a.png'
].
u
,
v
:
5
,
t
:
stageDetail
.
aTime
})
}
{
renderItem
({
u
:
assets
[
'level-big-b.png'
].
u
,
v
:
1
,
t
:
stageDetail
.
bTime
})
}
{
renderItem
({
u
:
assets
[
'level-big-s.png'
].
u
,
v
:
setting
.
sPoint
!
,
t
:
stageDetail
.
sTime
})
}
{
renderItem
({
u
:
assets
[
'level-big-a.png'
].
u
,
v
:
setting
.
aPoint
!
,
t
:
stageDetail
.
aTime
})
}
{
renderItem
({
u
:
assets
[
'level-big-b.png'
].
u
,
v
:
setting
.
bPoint
!
,
t
:
stageDetail
.
bTime
})
}
</
View
>
),
[
stageDetail
,
stageDetail
?.
sTime
,
stageDetail
?.
aTime
,
stageDetail
?.
bTime
])
...
...
src/pages/prepare/components/thead.module.scss
View file @
c152f698
...
...
@@ -9,6 +9,7 @@
&
_index
{
width
:
80px
;
text-align
:
center
;
padding-left
:
3
PX
;
margin-right
:
23
PX
;
}
...
...
src/pages/prepare/index.module.scss
View file @
c152f698
...
...
@@ -63,7 +63,7 @@
}
&
_rank
{
margin-right
:
4
0px
;
margin-right
:
2
0px
;
@include
flexLayout
(
row
,
center
);
&
_icon
{
...
...
@@ -74,7 +74,7 @@
&
_index
{
display
:
block
;
text-align
:
center
;
width
:
6
0px
;
width
:
8
0px
;
font-size
:
36px
;
font-weight
:
500
;
color
:
rgba
(
70
,
81
,
100
,
0
.5
);
...
...
src/store/modules/user.ts
View file @
c152f698
import
{
action
,
Action
,
Thunk
,
thunk
,
State
}
from
'easy-peasy'
import
{
getAccountInfo
,
getSetting
,
updateUserInfo
,
updateUserPhone
}
from
'@/api'
import
{
getAccountInfo
,
getSetting
,
type
SettintType
,
updateUserInfo
,
updateUserPhone
}
from
'@/api'
import
type
{
UserInfo
}
from
'@/types'
import
{
pointToCard
}
from
'@/api/account'
import
{
showModal
,
showToast
,
showLoading
,
hideLoading
}
from
'@tarojs/taro'
...
...
@@ -14,7 +14,7 @@ export interface UserModel {
point
:
number
;
updateState
:
Action
<
UserModel
,
Partial
<
State
<
UserModel
>>>
;
fetchAccount
:
Thunk
<
UserModel
,
void
,
void
,
AppStoreModel
>
;
setting
:
{
pointToCard
:
number
}
;
setting
:
SettintType
;
getSetting
:
Thunk
<
UserModel
,
void
,
void
,
AppStoreModel
>
;
// updateUserInfo: Thunk<UserModel, string, void, AppStoreModel>;
...
...
@@ -27,7 +27,7 @@ const userModel: UserModel = {
userInfo
:
getStorage
(
StorageKeys
.
userInfo
)
!
,
cardNum
:
0
,
point
:
0
,
setting
:
{
pointToCard
:
Infinity
},
setting
:
{
pointToCard
:
Infinity
,
aPoint
:
0
,
bPoint
:
0
,
sPoint
:
0
},
updateNickNameAndPhone
:
thunk
(
async
(
actions
,
payload
,
helpers
)
=>
{
try
{
...
...
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