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
e46903f7
Commit
e46903f7
authored
Apr 10, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
cb4c5302
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
36 deletions
+85
-36
index.module.scss
src/pages/main/guide/index.module.scss
+1
-0
scene-1.module.scss
src/pages/main/guide/scene-1.module.scss
+7
-0
scene-1.tsx
src/pages/main/guide/scene-1.tsx
+6
-9
scene-5.module.scss
src/pages/main/guide/scene-5.module.scss
+28
-0
card-main.tsx
src/pages/market/components/card-main.tsx
+4
-2
index.tsx
src/pages/market/index.tsx
+39
-25
No files found.
src/pages/main/guide/index.module.scss
View file @
e46903f7
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
width
:
300px
;
width
:
300px
;
height
:
300px
;
height
:
300px
;
display
:
block
;
display
:
block
;
position
:
relative
;
}
}
...
...
src/pages/main/guide/scene-1.module.scss
View file @
e46903f7
...
@@ -10,6 +10,13 @@
...
@@ -10,6 +10,13 @@
width
:
300px
;
width
:
300px
;
height
:
300px
;
height
:
300px
;
display
:
block
;
display
:
block
;
position
:
absolute
;
opacity
:
0
;
transition
:
opacity
1s
ease
;
&
.is_current
{
opacity
:
1
;
}
}
}
.dialog
{
.dialog
{
...
...
src/pages/main/guide/scene-1.tsx
View file @
e46903f7
...
@@ -56,15 +56,12 @@ const Scene1 = ({ onNext }: Scene1Props) => {
...
@@ -56,15 +56,12 @@ const Scene1 = ({ onNext }: Scene1Props) => {
<
View
className=
{
cs
.
viewport_body
}
>
<
View
className=
{
cs
.
viewport_body
}
>
<
ScrollView
className=
{
cs
.
viewport_body_inner
}
scrollY
>
<
ScrollView
className=
{
cs
.
viewport_body_inner
}
scrollY
>
<
View
className=
{
cs
.
sprite
}
>
<
View
className=
{
cs
.
sprite
}
>
{
current
===
0
&&
(
<
View
className=
{
cs
.
cat
}
>
<
Image
src=
{
assets
[
'cat.png'
].
u
}
className=
{
cs
.
cat
}
/>
<
Image
src=
{
assets
[
'cat.png'
].
u
}
className=
{
classNames
(
styles
.
cat
,
current
===
0
&&
styles
.
is_current
)
}
/>
)
}
<
Image
src=
{
assets
[
'cat-3.png'
].
u
}
className=
{
classNames
(
styles
.
cat
,
current
===
1
&&
styles
.
is_current
)
}
/>
{
current
===
1
&&
(
<
Image
src=
{
assets
[
'cat-2.png'
].
u
}
className=
{
classNames
(
styles
.
cat
,
current
===
2
&&
styles
.
is_current
)
}
/>
<
Image
src=
{
assets
[
'cat-2.png'
].
u
}
className=
{
cs
.
cat
}
/>
<
Image
src=
{
assets
[
'cat-3.png'
].
u
}
className=
{
classNames
(
styles
.
cat
,
current
===
3
&&
styles
.
is_current
)
}
/>
)
}
</
View
>
{
(
current
===
2
||
current
===
3
)
&&
(
<
Image
src=
{
assets
[
'cat-3.png'
].
u
}
className=
{
cs
.
cat
}
/>
)
}
<
View
className=
{
styles
.
dialog
}
>
<
View
className=
{
styles
.
dialog
}
>
{
current
===
0
&&
(
{
current
===
0
&&
(
<
View
className=
{
styles
.
modal_1
}
>
<
View
className=
{
styles
.
modal_1
}
>
...
...
src/pages/main/guide/scene-5.module.scss
View file @
e46903f7
...
@@ -86,12 +86,40 @@
...
@@ -86,12 +86,40 @@
padding
:
28px
0
20px
0
;
padding
:
28px
0
20px
0
;
text-align
:
center
;
text-align
:
center
;
position
:
relative
;
position
:
relative
;
animation-name
:
fadeInUp
;
animation-duration
:
.5s
;
animation-timing-function
:
ease-out
;
animation-fill-mode
:
backwards
;
animation-iteration-count
:
1
;
&
:nth-child
(
1
)
{
animation-delay
:
0
;
}
&
:nth-child
(
2
)
{
animation-delay
:
.3s
;
}
&
:nth-child
(
3
)
{
animation-delay
:
.6s
;
}
&
:last-child
{
&
:last-child
{
margin-right
:
0
;
margin-right
:
0
;
}
}
}
}
@keyframes
fadeInUp
{
0
%
{
opacity
:
0
;
transform
:
translateY
(
82px
)
scale
(
0
.5
,
0
.5
);
}
100
%
{
opacity
:
1
;
transform
:
translateY
(
0
)
scale
(
1
,
1
);
}
}
.right
{
.right
{
position
:
absolute
;
position
:
absolute
;
right
:
0
;
right
:
0
;
...
...
src/pages/market/components/card-main.tsx
View file @
e46903f7
...
@@ -9,6 +9,7 @@ interface CardMainProps {
...
@@ -9,6 +9,7 @@ interface CardMainProps {
subtitle
:
string
;
subtitle
:
string
;
disabled
?:
boolean
;
disabled
?:
boolean
;
extra
?:
React
.
ReactNode
;
extra
?:
React
.
ReactNode
;
disabledText
?:
string
;
price
:
number
;
price
:
number
;
stock
:
number
|
null
;
stock
:
number
|
null
;
}
}
...
@@ -21,7 +22,8 @@ export default ({
...
@@ -21,7 +22,8 @@ export default ({
onClick
,
onClick
,
disabled
,
disabled
,
price
,
price
,
stock
stock
,
disabledText
=
'积分不足'
}:
CardMainProps
)
=>
{
}:
CardMainProps
)
=>
{
const
_onClick
=
()
=>
{
const
_onClick
=
()
=>
{
if
(
!
disabled
)
{
if
(
!
disabled
)
{
...
@@ -54,7 +56,7 @@ export default ({
...
@@ -54,7 +56,7 @@ export default ({
onClick=
{
_onClick
}
onClick=
{
_onClick
}
hoverClass=
{
!
disabled
?
styles
.
btn_on
:
''
}
hoverClass=
{
!
disabled
?
styles
.
btn_on
:
''
}
>
>
兑换
{
disabled
?
disabledText
:
'兑换'
}
</
View
>
</
View
>
</
View
>
</
View
>
</
View
>
</
View
>
...
...
src/pages/market/index.tsx
View file @
e46903f7
/* eslint-disable import/no-commonjs */
/* eslint-disable import/no-commonjs */
import
{
useState
,
useCallback
}
from
'react'
import
{
useState
,
useCallback
,
useMemo
}
from
'react'
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
useDidShow
}
from
'@tarojs/taro'
import
{
useDidShow
}
from
'@tarojs/taro'
...
@@ -21,26 +21,6 @@ type ExchangeGoods = {
...
@@ -21,26 +21,6 @@ type ExchangeGoods = {
img
:
string
;
img
:
string
;
}
}
const
ExchangeItems
:
ExchangeGoods
[]
=
[
{
title
:
'答题卡'
,
subTitle
:
'答题卡'
,
description
:
'答题卡是不断追求更高档位与排名的必备道具'
,
price
:
30
,
stock
:
null
,
img
:
require
(
'./assets/ph.png'
),
},
// {
// title: '月度神秘大礼',
// subTitle: '神秘大礼',
// description: '兑换神秘大礼,线下领取超级大礼',
// price: 30,
// stock: 10,
// img: require('./assets/gift.png'),
// }
]
const
StudyMarket
=
()
=>
{
const
StudyMarket
=
()
=>
{
const
[
isVisible
,
{
setTrue
,
setFalse
}]
=
useBoolean
(
false
)
const
[
isVisible
,
{
setTrue
,
setFalse
}]
=
useBoolean
(
false
)
const
[
currentGoods
,
setCurrentGoods
]
=
useState
<
ExchangeGoods
|
null
>
(
null
)
const
[
currentGoods
,
setCurrentGoods
]
=
useState
<
ExchangeGoods
|
null
>
(
null
)
...
@@ -53,6 +33,27 @@ const StudyMarket = () => {
...
@@ -53,6 +33,27 @@ const StudyMarket = () => {
getSetting
()
getSetting
()
fetchAccount
()
fetchAccount
()
})
})
const
list
:
ExchangeGoods
[]
=
useMemo
(()
=>
{
return
[
{
title
:
'答题卡'
,
subTitle
:
'答题卡'
,
description
:
'答题卡是不断追求更高档位与排名的必备道具'
,
price
:
setting
.
pointToCard
,
stock
:
null
,
img
:
require
(
'./assets/ph.png'
),
},
{
title
:
'月度神秘大礼'
,
subTitle
:
'神秘大礼'
,
description
:
'兑换神秘大礼,线下领取超级大礼'
,
price
:
1000
,
stock
:
null
,
img
:
require
(
'./assets/gift.png'
),
}
]
},
[
setting
])
const
open
=
useCallback
((
goods
:
ExchangeGoods
)
=>
{
const
open
=
useCallback
((
goods
:
ExchangeGoods
)
=>
{
setCurrentGoods
(
goods
)
setCurrentGoods
(
goods
)
...
@@ -66,23 +67,36 @@ const StudyMarket = () => {
...
@@ -66,23 +67,36 @@ const StudyMarket = () => {
<
Image
src=
{
require
(
'./assets/score.png'
)
}
className=
{
styles
.
score_icon
}
></
Image
>
<
Image
src=
{
require
(
'./assets/score.png'
)
}
className=
{
styles
.
score_icon
}
></
Image
>
</
View
>
</
View
>
<
View
className=
{
styles
.
card_list
}
>
<
View
className=
{
styles
.
card_list
}
>
{
ExchangeItems
.
map
(
item
=>
(
{
list
.
map
(
item
=>
{
const
pric
=
item
.
price
let
disabledText
=
'积分不足'
let
disabled
=
point
<
pric
||
(
item
.
stock
!==
null
&&
item
.
stock
<
1
)
if
(
item
.
title
===
'月度神秘大礼'
)
{
disabled
=
true
if
(
point
>=
pric
)
{
disabledText
=
'敬请期待'
}
}
return
(
<
Card
title=
{
item
.
title
}
key=
{
item
.
title
}
>
<
Card
title=
{
item
.
title
}
key=
{
item
.
title
}
>
<
View
className=
{
styles
[
'card-body'
]
}
>
<
View
className=
{
styles
[
'card-body'
]
}
>
<
CardMain
<
CardMain
title=
{
item
.
subTitle
}
title=
{
item
.
subTitle
}
cover=
{
item
.
img
}
cover=
{
item
.
img
}
stock=
{
item
.
stock
}
stock=
{
item
.
stock
}
price=
{
setting
.
pointToCard
}
price=
{
pric
}
disabled=
{
item
.
stock
!==
null
&&
item
.
stock
<
1
}
disabled=
{
disabled
}
subtitle=
{
item
.
description
}
subtitle=
{
item
.
description
}
disabledText=
{
disabledText
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
open
(
item
)
open
(
item
)
}
}
}
}
/>
/>
</
View
>
</
View
>
</
Card
>
</
Card
>
))
}
)
})
}
</
View
>
</
View
>
<
Modal
isVisible=
{
isVisible
}
bodyClassName=
{
styles
.
moal_body
}
onClose=
{
setFalse
}
maskClosable=
{
false
}
tilte=
{
`兑换${currentGoods?.title ?? ''}`
}
>
<
Modal
isVisible=
{
isVisible
}
bodyClassName=
{
styles
.
moal_body
}
onClose=
{
setFalse
}
maskClosable=
{
false
}
tilte=
{
`兑换${currentGoods?.title ?? ''}`
}
>
...
...
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