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
bb78324f
Commit
bb78324f
authored
Apr 14, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加护眼模式
parent
28824dd9
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
90 additions
and
27 deletions
+90
-27
index.module.scss
src/components/EyeProtectionView/index.module.scss
+3
-0
index.tsx
src/components/EyeProtectionView/index.tsx
+18
-0
index.tsx
src/components/Modal/index.tsx
+3
-2
index.ts
src/components/index.ts
+1
-0
index.module.scss
src/custom-tab-bar/index.module.scss
+4
-0
index.tsx
src/custom-tab-bar/index.tsx
+2
-1
index.module.scss
src/native-components/number-keyboard/index.module.scss
+1
-0
complete-achieve.module.scss
...ges/game/complete/components/complete-achieve.module.scss
+4
-0
complete-head.module.scss
src/pages/game/complete/components/complete-head.module.scss
+1
-0
index.module.scss
src/pages/game/complete/index.module.scss
+4
-0
index.tsx
src/pages/game/complete/index.tsx
+4
-3
count-up.module.scss
src/pages/game/play/components/count-up.module.scss
+1
-0
modal-continue.tsx
src/pages/game/play/components/modal-continue.tsx
+3
-2
index.module.scss
src/pages/game/play/index.module.scss
+1
-0
index.tsx
src/pages/game/play/index.tsx
+4
-3
top-header.module.scss
src/pages/group/components/top-header.module.scss
+2
-2
index.module.scss
src/pages/group/index.module.scss
+4
-0
index.tsx
src/pages/group/index.tsx
+3
-2
header.module.scss
src/pages/main/components/header.module.scss
+2
-2
header.tsx
src/pages/main/components/header.tsx
+3
-2
main-component.tsx
src/pages/main/components/main-component.tsx
+3
-2
short-cut.tsx
src/pages/main/components/short-cut.tsx
+3
-2
index.module.scss
src/pages/market/index.module.scss
+5
-0
index.tsx
src/pages/market/index.tsx
+3
-2
index.module.scss
src/pages/prepare/index.module.scss
+3
-0
index.tsx
src/pages/prepare/index.tsx
+3
-2
user.ts
src/store/modules/user.ts
+2
-0
No files found.
src/components/EyeProtectionView/index.module.scss
0 → 100644
View file @
bb78324f
.eye_protection
{
filter
:
brightness
(
60%
)
sepia
(
40%
);
}
src/components/EyeProtectionView/index.tsx
0 → 100644
View file @
bb78324f
import
{
View
,
type
ViewProps
}
from
'@tarojs/components'
import
classNames
from
'classnames'
import
{
useStoreState
}
from
'@/store/hooks'
import
styles
from
'./index.module.scss'
type
EyeProtectionViewProps
=
ViewProps
const
EyeProtectionView
=
(
props
:
EyeProtectionViewProps
)
=>
{
const
{
className
,
children
,
...
rest
}
=
props
const
isEyeProtectionMode
=
useStoreState
(
states
=>
states
.
userModel
.
isEyeProtectionMode
)
return
(
<
View
className=
{
classNames
(
isEyeProtectionMode
&&
styles
.
eye_protection
,
className
)
}
{
...
rest
}
>
{
children
}
</
View
>
)
}
export
default
EyeProtectionView
src/components/Modal/index.tsx
View file @
bb78324f
/** simple modal component */
/** simple modal component */
import
{
View
,
Text
,
RootPortal
,
Image
}
from
'@tarojs/components'
import
{
View
,
Text
,
RootPortal
,
Image
}
from
'@tarojs/components'
import
classNames
from
'classnames'
import
classNames
from
'classnames'
import
EyeProtectionView
from
'../EyeProtectionView'
import
styles
from
'./index.module.scss'
import
styles
from
'./index.module.scss'
interface
ModalProps
{
interface
ModalProps
{
...
@@ -30,7 +31,7 @@ const Modal = ({
...
@@ -30,7 +31,7 @@ const Modal = ({
return
(
return
(
<
RootPortal
enable=
{
enable
}
>
<
RootPortal
enable=
{
enable
}
>
<
View
className=
{
wrapClass
}
onClick=
{
()
=>
maskClosable
&&
onClose
()
}
>
<
EyeProtection
View
className=
{
wrapClass
}
onClick=
{
()
=>
maskClosable
&&
onClose
()
}
>
<
View
className=
{
styles
.
content
}
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
<
View
className=
{
styles
.
content
}
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
<
View
className=
{
styles
.
header
}
>
<
View
className=
{
styles
.
header
}
>
...
@@ -44,7 +45,7 @@ const Modal = ({
...
@@ -44,7 +45,7 @@ const Modal = ({
{
children
}
{
children
}
</
View
>
</
View
>
</
View
>
</
View
>
</
View
>
</
EyeProtection
View
>
</
RootPortal
>
</
RootPortal
>
)
)
}
}
...
...
src/components/index.ts
0 → 100644
View file @
bb78324f
export
{
default
as
EyeProtectionView
}
from
'./EyeProtectionView/index'
src/custom-tab-bar/index.module.scss
View file @
bb78324f
...
@@ -7,6 +7,10 @@
...
@@ -7,6 +7,10 @@
bottom
:
0
;
bottom
:
0
;
}
}
.eye_protection
{
filter
:
brightness
(
60%
)
sepia
(
40%
);
}
@supports
(
padding-bottom
:
constant
(
safe-area-inset-bottom
))
or
(
padding-bottom
:
env
(
safe-area-inset-bottom
))
{
@supports
(
padding-bottom
:
constant
(
safe-area-inset-bottom
))
or
(
padding-bottom
:
env
(
safe-area-inset-bottom
))
{
.wrap
{
.wrap
{
padding-bottom
:
constant
(
safe-area-inset-bottom
);
padding-bottom
:
constant
(
safe-area-inset-bottom
);
...
...
src/custom-tab-bar/index.tsx
View file @
bb78324f
...
@@ -14,6 +14,7 @@ const Tabbar: ForwardRefRenderFunction<TabbarRef, {}> = (_, ref) => {
...
@@ -14,6 +14,7 @@ const Tabbar: ForwardRefRenderFunction<TabbarRef, {}> = (_, ref) => {
const
[
selected
,
setSelected
]
=
useState
(
0
)
const
[
selected
,
setSelected
]
=
useState
(
0
)
const
hasPoint
=
useStoreState
(
state
=>
state
.
groupModel
.
hasPoint
)
const
hasPoint
=
useStoreState
(
state
=>
state
.
groupModel
.
hasPoint
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
isEyeProtectionMode
=
useStoreState
(
states
=>
states
.
userModel
.
isEyeProtectionMode
)
const
_switchTab
=
useCallback
((
index
:
number
,
url
:
string
)
=>
{
const
_switchTab
=
useCallback
((
index
:
number
,
url
:
string
)
=>
{
setSelected
(
index
)
setSelected
(
index
)
...
@@ -32,7 +33,7 @@ const Tabbar: ForwardRefRenderFunction<TabbarRef, {}> = (_, ref) => {
...
@@ -32,7 +33,7 @@ const Tabbar: ForwardRefRenderFunction<TabbarRef, {}> = (_, ref) => {
}
}
return
(
return
(
<
View
className=
{
styles
.
wrap
}
>
<
View
className=
{
classNames
(
styles
.
wrap
,
isEyeProtectionMode
&&
styles
.
eye_protection
)
}
>
<
View
className=
{
styles
.
inner
}
>
<
View
className=
{
styles
.
inner
}
>
<
View
className=
{
styles
.
left
}
onClick=
{
()
=>
_switchTab
(
0
,
'/pages/main/main'
)
}
>
<
View
className=
{
styles
.
left
}
onClick=
{
()
=>
_switchTab
(
0
,
'/pages/main/main'
)
}
>
{
selected
===
0
&&
(
{
selected
===
0
&&
(
...
...
src/native-components/number-keyboard/index.module.scss
View file @
bb78324f
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
margin
:
-16px
-10px
;
margin
:
-16px
-10px
;
display
:
flex
;
display
:
flex
;
flex-wrap
:
wrap
;
flex-wrap
:
wrap
;
background-color
:
#ffffff
;
}
}
.keyboard_item_wrap
{
.keyboard_item_wrap
{
...
...
src/pages/game/complete/components/complete-achieve.module.scss
View file @
bb78324f
...
@@ -164,6 +164,10 @@
...
@@ -164,6 +164,10 @@
}
}
}
}
.wrap
{
background-color
:
#ffffff
;
}
.fail_icon
{
.fail_icon
{
width
:
686px
;
width
:
686px
;
height
:
320px
;
height
:
320px
;
...
...
src/pages/game/complete/components/complete-head.module.scss
View file @
bb78324f
.head
{
.head
{
padding-bottom
:
64px
;
padding-bottom
:
64px
;
position
:
relative
;
position
:
relative
;
background-color
:
#ffffff
;
&
.S
{
&
.S
{
background-image
:
linear-gradient
(
to
bottom
,
#FFE4A1
0%
,
#FFFEF3
87
.0301573%
,
#FFFFFF
100%
);
background-image
:
linear-gradient
(
to
bottom
,
#FFE4A1
0%
,
#FFFEF3
87
.0301573%
,
#FFFFFF
100%
);
}
}
...
...
src/pages/game/complete/index.module.scss
View file @
bb78324f
.container
{
min-height
:
100vh
;
background-color
:
#fff
;
}
src/pages/game/complete/index.tsx
View file @
bb78324f
import
{
EyeProtectionView
}
from
'@/components'
import
GameCompleteHead
from
'./components/complete-head'
import
GameCompleteHead
from
'./components/complete-head'
import
GameCompleteAchieve
from
'./components/complete-achieve'
import
GameCompleteAchieve
from
'./components/complete-achieve'
//
import styles from './index.module.scss'
import
styles
from
'./index.module.scss'
const
GameComplete
=
()
=>
{
const
GameComplete
=
()
=>
{
return
(
return
(
<>
<
EyeProtectionView
className=
{
styles
.
container
}
>
<
GameCompleteHead
/>
<
GameCompleteHead
/>
<
GameCompleteAchieve
/>
<
GameCompleteAchieve
/>
</>
</
EyeProtectionView
>
)
)
}
}
...
...
src/pages/game/play/components/count-up.module.scss
View file @
bb78324f
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
padding
:
40px
32px
100px
32px
;
padding
:
40px
32px
100px
32px
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
background-color
:
#fff
;
&
.is_stop
{
&
.is_stop
{
padding-bottom
:
50px
;
padding-bottom
:
50px
;
...
...
src/pages/game/play/components/modal-continue.tsx
View file @
bb78324f
...
@@ -3,6 +3,7 @@ import { useCallback, useEffect, useRef } from 'react'
...
@@ -3,6 +3,7 @@ import { useCallback, useEffect, useRef } from 'react'
import
classNames
from
'classnames'
import
classNames
from
'classnames'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
assets
from
'@/assets/oss/assets-complete'
import
assets
from
'@/assets/oss/assets-complete'
import
{
EyeProtectionView
}
from
'@/components'
import
styles
from
'./modal-continue.module.scss'
import
styles
from
'./modal-continue.module.scss'
...
@@ -38,7 +39,7 @@ const ModalContinue = () => {
...
@@ -38,7 +39,7 @@ const ModalContinue = () => {
<
RootPortal
>
<
RootPortal
>
<
View
className=
{
classNames
(
styles
.
mask
,
modalContinueVisible
&&
styles
.
is_show
)
}
>
<
View
className=
{
classNames
(
styles
.
mask
,
modalContinueVisible
&&
styles
.
is_show
)
}
>
</
View
>
</
View
>
<
View
className=
{
classNames
(
styles
.
modal
,
modalContinueVisible
&&
styles
.
is_show
)
}
>
<
EyeProtection
View
className=
{
classNames
(
styles
.
modal
,
modalContinueVisible
&&
styles
.
is_show
)
}
>
{
modalContinueVisible
&&
(
{
modalContinueVisible
&&
(
<
Image
src=
{
assets
[
'fail-ip.png'
].
u
}
className=
{
styles
.
fail_icon
}
/>
<
Image
src=
{
assets
[
'fail-ip.png'
].
u
}
className=
{
styles
.
fail_icon
}
/>
)
}
)
}
...
@@ -64,7 +65,7 @@ const ModalContinue = () => {
...
@@ -64,7 +65,7 @@ const ModalContinue = () => {
<
View
className=
{
styles
.
account_left
}
>
剩余
<
Text
className=
{
styles
.
account_num
}
>
{
cardNum
}
</
Text
>
张
</
View
>
<
View
className=
{
styles
.
account_left
}
>
剩余
<
Text
className=
{
styles
.
account_num
}
>
{
cardNum
}
</
Text
>
张
</
View
>
</
View
>
</
View
>
</
View
>
</
View
>
</
View
>
</
EyeProtection
View
>
</
RootPortal
>
</
RootPortal
>
)
)
}
}
...
...
src/pages/game/play/index.module.scss
View file @
bb78324f
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
flex
:
1
;
flex
:
1
;
position
:
relative
;
position
:
relative
;
min-height
:
0
;
min-height
:
0
;
background-color
:
#fff
;
}
}
.body_inner
{
.body_inner
{
...
...
src/pages/game/play/index.tsx
View file @
bb78324f
import
{
View
,
ScrollView
,
Image
}
from
'@tarojs/components'
import
{
ScrollView
,
Image
}
from
'@tarojs/components'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
preloadImage
}
from
'@/utils/preload-image'
import
{
preloadImage
}
from
'@/utils/preload-image'
import
{
useEffect
,
useMemo
}
from
'react'
import
{
useEffect
,
useMemo
}
from
'react'
import
{
useDidShow
}
from
'@tarojs/taro'
import
{
useDidShow
}
from
'@tarojs/taro'
import
assets
from
'@/assets/oss/assets-complete'
import
assets
from
'@/assets/oss/assets-complete'
import
{
EyeProtectionView
}
from
'@/components'
import
ModalContinue
from
'./components/modal-continue'
import
ModalContinue
from
'./components/modal-continue'
import
PageHead
from
'./components/page-head'
import
PageHead
from
'./components/page-head'
...
@@ -51,7 +52,7 @@ const GamePlay = () => {
...
@@ -51,7 +52,7 @@ const GamePlay = () => {
return
(
return
(
<>
<>
<
View
className=
{
styles
.
viewport
}
>
<
EyeProtection
View
className=
{
styles
.
viewport
}
>
<
PageHead
/>
<
PageHead
/>
{
currentQuestion
&&
stageDetail
&&
(
{
currentQuestion
&&
stageDetail
&&
(
<>
<>
...
@@ -79,7 +80,7 @@ const GamePlay = () => {
...
@@ -79,7 +80,7 @@ const GamePlay = () => {
/>
/>
</>
</>
)
}
)
}
</
View
>
</
EyeProtection
View
>
<
ModalContinue
/>
<
ModalContinue
/>
</>
</>
)
)
...
...
src/pages/group/components/top-header.module.scss
View file @
bb78324f
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
white-space
:
nowrap
;
white-space
:
nowrap
;
font-size
:
14
PX
;
font-size
:
14
PX
;
font-weight
:
500
;
font-weight
:
500
;
margin-left
:
1
6
PX
;
margin-left
:
1
2
PX
;
color
:
#FFFFFF
;
color
:
#FFFFFF
;
}
}
}
}
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
.score
{
.score
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
margin-right
:
1
8
PX
;
margin-right
:
1
2
PX
;
.icon
{
.icon
{
width
:
32
PX
;
width
:
32
PX
;
...
...
src/pages/group/index.module.scss
View file @
bb78324f
@import
'@/styles/mixins.scss'
;
@import
'@/styles/mixins.scss'
;
.container
{
min-height
:
100vh
;
background-color
:
#ffffff
;
}
.modal
{
.modal
{
padding
:
32px
32px
0
;
padding
:
32px
32px
0
;
...
...
src/pages/group/index.tsx
View file @
bb78324f
...
@@ -9,6 +9,7 @@ import { createTribe } from '@/api/group'
...
@@ -9,6 +9,7 @@ import { createTribe } from '@/api/group'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
type
{
TabbarRef
}
from
'@/custom-tab-bar/index'
import
type
{
TabbarRef
}
from
'@/custom-tab-bar/index'
import
{
getNickNameWords
,
type
NickNameWord
}
from
'@/api'
import
{
getNickNameWords
,
type
NickNameWord
}
from
'@/api'
import
{
EyeProtectionView
}
from
'@/components'
import
assets
from
'@/assets/oss/assets-group'
import
assets
from
'@/assets/oss/assets-group'
...
@@ -125,7 +126,7 @@ const Group = () => {
...
@@ -125,7 +126,7 @@ const Group = () => {
}
}
return
(
return
(
<
View
>
<
EyeProtectionView
className=
{
styles
.
container
}
>
<
TopHeader
/>
<
TopHeader
/>
<
ScrollView
<
ScrollView
refresherEnabled=
{
!!
tribeInfo
?.
id
}
refresherEnabled=
{
!!
tribeInfo
?.
id
}
...
@@ -159,7 +160,7 @@ const Group = () => {
...
@@ -159,7 +160,7 @@ const Group = () => {
</
View
>
</
View
>
</
View
>
</
View
>
</
Modal
>
</
Modal
>
</
View
>
</
EyeProtection
View
>
)
)
}
}
...
...
src/pages/main/components/header.module.scss
View file @
bb78324f
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
white-space
:
nowrap
;
white-space
:
nowrap
;
font-size
:
14
PX
;
font-size
:
14
PX
;
font-weight
:
500
;
font-weight
:
500
;
margin-left
:
1
6
PX
;
margin-left
:
1
2
PX
;
color
:
#FFFFFF
;
color
:
#FFFFFF
;
}
}
}
}
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
.score
{
.score
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
margin-right
:
1
8
PX
;
margin-right
:
1
2
PX
;
.icon
{
.icon
{
width
:
32
PX
;
width
:
32
PX
;
...
...
src/pages/main/components/header.tsx
View file @
bb78324f
...
@@ -2,6 +2,7 @@ import { View, Text, Image } from '@tarojs/components'
...
@@ -2,6 +2,7 @@ import { View, Text, Image } from '@tarojs/components'
import
{
getMenuButtonBoundingClientRect
,
getSystemInfoSync
,
navigateTo
}
from
'@tarojs/taro'
import
{
getMenuButtonBoundingClientRect
,
getSystemInfoSync
,
navigateTo
}
from
'@tarojs/taro'
import
{
useMemo
}
from
'react'
import
{
useMemo
}
from
'react'
import
classNames
from
'classnames'
import
classNames
from
'classnames'
import
{
EyeProtectionView
}
from
'@/components'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
cs
}
from
'@/styles'
import
{
cs
}
from
'@/styles'
...
@@ -29,7 +30,7 @@ const MainHeader = () => {
...
@@ -29,7 +30,7 @@ const MainHeader = () => {
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
return
(
return
(
<
View
className=
{
styles
.
header
}
>
<
EyeProtection
View
className=
{
styles
.
header
}
>
<
Image
src=
{
require
(
'../assets/head-bg.png'
)
}
className=
{
styles
.
bg
}
mode=
"widthFix"
></
Image
>
<
Image
src=
{
require
(
'../assets/head-bg.png'
)
}
className=
{
styles
.
bg
}
mode=
"widthFix"
></
Image
>
<
View
<
View
className=
{
styles
.
headerContent
}
className=
{
styles
.
headerContent
}
...
@@ -52,7 +53,7 @@ const MainHeader = () => {
...
@@ -52,7 +53,7 @@ const MainHeader = () => {
</
View
>
</
View
>
</
View
>
</
View
>
</
View
>
</
View
>
</
View
>
</
EyeProtection
View
>
)
)
}
}
...
...
src/pages/main/components/main-component.tsx
View file @
bb78324f
...
@@ -8,6 +8,7 @@ import {
...
@@ -8,6 +8,7 @@ import {
import
{
useMemo
,
useCallback
,
useEffect
}
from
'react'
import
{
useMemo
,
useCallback
,
useEffect
}
from
'react'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
{
useStoreActions
,
useStoreState
}
from
'@/store/hooks'
import
{
useFocus
}
from
'@/hooks/use-focus'
import
{
useFocus
}
from
'@/hooks/use-focus'
import
{
EyeProtectionView
}
from
'@/components'
import
type
{
TabbarRef
}
from
'../../../custom-tab-bar/index'
import
type
{
TabbarRef
}
from
'../../../custom-tab-bar/index'
import
{
CurrentRoundId
,
StageStatus
}
from
'./scene/constants'
import
{
CurrentRoundId
,
StageStatus
}
from
'./scene/constants'
...
@@ -80,11 +81,11 @@ const MainPage = () => {
...
@@ -80,11 +81,11 @@ const MainPage = () => {
return
(
return
(
<>
<>
<
MainHeader
/>
<
MainHeader
/>
<
View
className=
{
styles
.
body
}
style=
{
{
paddingTop
:
`${nav.height + nav.top + 5}px`
}
}
>
<
EyeProtection
View
className=
{
styles
.
body
}
style=
{
{
paddingTop
:
`${nav.height + nav.top + 5}px`
}
}
>
<
MainChapter
/>
<
MainChapter
/>
<
MainScene
stageList=
{
stageList
}
/>
<
MainScene
stageList=
{
stageList
}
/>
<
View
className=
{
styles
.
gap
}
></
View
>
<
View
className=
{
styles
.
gap
}
></
View
>
</
View
>
</
EyeProtection
View
>
{
isReady
&&
(
{
isReady
&&
(
<
MainShortCut
onClick=
{
()
=>
scrollToCurrent
()
}
/>
<
MainShortCut
onClick=
{
()
=>
scrollToCurrent
()
}
/>
)
}
)
}
...
...
src/pages/main/components/short-cut.tsx
View file @
bb78324f
...
@@ -4,6 +4,7 @@ import { useEffect, useState, useRef } from 'react'
...
@@ -4,6 +4,7 @@ import { useEffect, useState, useRef } from 'react'
import
{
usePageScroll
,
createIntersectionObserver
}
from
'@tarojs/taro'
import
{
usePageScroll
,
createIntersectionObserver
}
from
'@tarojs/taro'
import
classNames
from
'classnames'
import
classNames
from
'classnames'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
EyeProtectionView
}
from
'@/components'
import
{
CurrentRoundId
,
StageStatus
}
from
'./scene/constants'
import
{
CurrentRoundId
,
StageStatus
}
from
'./scene/constants'
import
styles
from
'./short-cut.module.scss'
import
styles
from
'./short-cut.module.scss'
...
@@ -47,12 +48,12 @@ const ShortCut = (props: ShortCutProps) => {
...
@@ -47,12 +48,12 @@ const ShortCut = (props: ShortCutProps) => {
},
[
stageList
])
},
[
stageList
])
return
(
return
(
<
View
className=
{
styles
.
shortcut
}
>
<
EyeProtection
View
className=
{
styles
.
shortcut
}
>
<
View
className=
{
classNames
(
styles
.
shortcutInner
,
isHide
&&
styles
.
is_hide
)
}
onClick=
{
props
.
onClick
}
>
<
View
className=
{
classNames
(
styles
.
shortcutInner
,
isHide
&&
styles
.
is_hide
)
}
onClick=
{
props
.
onClick
}
>
<
Image
src=
{
assets
[
'short-cut-bg.png'
].
u
}
className=
{
styles
.
bg
}
></
Image
>
<
Image
src=
{
assets
[
'short-cut-bg.png'
].
u
}
className=
{
styles
.
bg
}
></
Image
>
<
Image
src=
{
assets
[
'short-cut-arrow.png'
].
u
}
className=
{
classNames
(
styles
.
arrow
,
((
!
isHide
&&
isDown
)
||
(
isHide
&&
!
isDown
))
&&
styles
.
isDown
)
}
></
Image
>
<
Image
src=
{
assets
[
'short-cut-arrow.png'
].
u
}
className=
{
classNames
(
styles
.
arrow
,
((
!
isHide
&&
isDown
)
||
(
isHide
&&
!
isDown
))
&&
styles
.
isDown
)
}
></
Image
>
</
View
>
</
View
>
</
View
>
</
EyeProtection
View
>
)
)
}
}
...
...
src/pages/market/index.module.scss
View file @
bb78324f
@import
'../../styles/mixins.scss'
;
@import
'../../styles/mixins.scss'
;
.container
{
min-height
:
100vh
;
background-color
:
#FFFFFF
;
}
.card-body
{
.card-body
{
display
:
flex
;
display
:
flex
;
padding
:
32px
28px
;
padding
:
32px
28px
;
...
...
src/pages/market/index.tsx
View file @
bb78324f
...
@@ -6,6 +6,7 @@ import { useDidShow } from '@tarojs/taro'
...
@@ -6,6 +6,7 @@ import { useDidShow } from '@tarojs/taro'
import
{
useBoolean
}
from
'@/hooks'
import
{
useBoolean
}
from
'@/hooks'
import
Modal
from
'@/components/Modal'
import
Modal
from
'@/components/Modal'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
EyeProtectionView
}
from
'@/components'
import
ExchangeItem
from
'./components/exchange-item'
import
ExchangeItem
from
'./components/exchange-item'
import
Card
from
'./components/card'
import
Card
from
'./components/card'
import
CardMain
from
'./components/card-main'
import
CardMain
from
'./components/card-main'
...
@@ -61,7 +62,7 @@ const StudyMarket = () => {
...
@@ -61,7 +62,7 @@ const StudyMarket = () => {
},
[
setTrue
])
},
[
setTrue
])
return
(
return
(
<>
<
EyeProtectionView
className=
{
styles
.
container
}
>
<
View
className=
{
styles
.
head
}
>
<
View
className=
{
styles
.
head
}
>
<
View
className=
{
styles
.
score_text
}
>
{
point
}
<
Text
className=
{
styles
.
unit
}
>
水晶
</
Text
></
View
>
<
View
className=
{
styles
.
score_text
}
>
{
point
}
<
Text
className=
{
styles
.
unit
}
>
水晶
</
Text
></
View
>
<
Image
src=
{
require
(
'./assets/score.png'
)
}
className=
{
styles
.
score_icon
}
></
Image
>
<
Image
src=
{
require
(
'./assets/score.png'
)
}
className=
{
styles
.
score_icon
}
></
Image
>
...
@@ -108,7 +109,7 @@ const StudyMarket = () => {
...
@@ -108,7 +109,7 @@ const StudyMarket = () => {
onCancel=
{
setFalse
}
onCancel=
{
setFalse
}
/>
/>
</
Modal
>
</
Modal
>
</>
</
EyeProtectionView
>
)
)
}
}
...
...
src/pages/prepare/index.module.scss
View file @
bb78324f
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
.wrapper
{
.wrapper
{
padding-bottom
:
105px
;
padding-bottom
:
105px
;
min-height
:
100vh
;
box-sizing
:
border-box
;
background-color
:
#fff
;
.inner
{
.inner
{
position
:
relative
;
position
:
relative
;
...
...
src/pages/prepare/index.tsx
View file @
bb78324f
...
@@ -13,6 +13,7 @@ import assets from '@/assets/oss/assets-prepare'
...
@@ -13,6 +13,7 @@ import assets from '@/assets/oss/assets-prepare'
import
assetsGroup
from
'@/assets/oss/assets-group'
import
assetsGroup
from
'@/assets/oss/assets-group'
import
{
palyAudio
}
from
'@/utils/play-audio'
import
{
palyAudio
}
from
'@/utils/play-audio'
import
audio
from
'@/assets/oss/assets-audio'
import
audio
from
'@/assets/oss/assets-audio'
import
{
EyeProtectionView
}
from
'@/components'
import
Tabs
,
{
type
TabItem
}
from
'./components/tabs'
import
Tabs
,
{
type
TabItem
}
from
'./components/tabs'
import
TopBar
from
'./components/top-bar'
import
TopBar
from
'./components/top-bar'
...
@@ -178,7 +179,7 @@ const Prepare = () => {
...
@@ -178,7 +179,7 @@ const Prepare = () => {
}
}
return (
return (
<View className={styles.wrapper}>
<
EyeProtection
View className={styles.wrapper}>
<TopBar />
<TopBar />
<View className={styles.inner} style={innerStyle}>
<View className={styles.inner} style={innerStyle}>
...
@@ -218,7 +219,7 @@ const Prepare = () => {
...
@@ -218,7 +219,7 @@ const Prepare = () => {
</View>
</View>
</View>
</View>
</AnswerCardModal>
</AnswerCardModal>
</View>
</
EyeProtection
View>
)
)
}
}
...
...
src/store/modules/user.ts
View file @
bb78324f
...
@@ -12,6 +12,7 @@ export interface UserModel {
...
@@ -12,6 +12,7 @@ export interface UserModel {
userInfo
:
UserInfo
;
userInfo
:
UserInfo
;
cardNum
:
number
;
cardNum
:
number
;
point
:
number
;
point
:
number
;
isEyeProtectionMode
:
boolean
;
updateState
:
Action
<
UserModel
,
Partial
<
State
<
UserModel
>>>
;
updateState
:
Action
<
UserModel
,
Partial
<
State
<
UserModel
>>>
;
fetchAccount
:
Thunk
<
UserModel
,
void
,
void
,
AppStoreModel
>
;
fetchAccount
:
Thunk
<
UserModel
,
void
,
void
,
AppStoreModel
>
;
setting
:
SettintType
;
setting
:
SettintType
;
...
@@ -25,6 +26,7 @@ export interface UserModel {
...
@@ -25,6 +26,7 @@ export interface UserModel {
const
userModel
:
UserModel
=
{
const
userModel
:
UserModel
=
{
userInfo
:
getStorage
(
StorageKeys
.
userInfo
)
!
,
userInfo
:
getStorage
(
StorageKeys
.
userInfo
)
!
,
isEyeProtectionMode
:
false
,
cardNum
:
0
,
cardNum
:
0
,
point
:
0
,
point
:
0
,
setting
:
{
pointToCard
:
Infinity
,
aPoint
:
0
,
bPoint
:
0
,
sPoint
:
0
},
setting
:
{
pointToCard
:
Infinity
,
aPoint
:
0
,
bPoint
:
0
,
sPoint
:
0
},
...
...
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