Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
湖
湖南口味王-520猜数游戏-20250409
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
湖南口味王-520猜数游戏-20250409
Commits
dc94f44e
Commit
dc94f44e
authored
Apr 10, 2025
by
wangzhujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ba'rbar
parent
084ec15e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
6 deletions
+47
-6
homeInfo.js
mock/project/homeInfo.js
+1
-1
barItem.jsx
src/components/barItem/barItem.jsx
+36
-3
barItem.less
src/components/barItem/barItem.less
+8
-1
index.js
src/store/index.js
+2
-1
No files found.
mock/project/homeInfo.js
View file @
dc94f44e
...
...
@@ -31,7 +31,7 @@ module.exports = {
"sendCount"
:
400
}
],
"historyMaxScore"
:
2259892.7346440405
,
"historyMaxScore"
:
1900
,
"currentTimestamp"
:
46409094.17754674
,
"actEndTimestamp"
:
43535651.10143122
}
...
...
src/components/barItem/barItem.jsx
View file @
dc94f44e
...
...
@@ -7,13 +7,42 @@ import modalStore from '@src/store/modal';
import
store
from
'@src/store'
;
import
{
Button
}
from
'../Button'
;
const
barPoint
=
[
-
451
,
-
290
,
-
126
]
@
observer
class
BarItem
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
left
:
-
486
}
}
componentDidUpdate
()
{
console
.
log
(
this
.
props
,
"!@!@!@!@!@!@"
)
console
.
log
(
this
.
props
,
"!@!@!@!@!@!@"
)
}
updateLength
()
{
const
{
barInfo
,
nowScore
}
=
this
.
props
;
let
left
=
0
;
if
(
barInfo
&&
barInfo
.
length
>
0
)
{
if
(
nowScore
<=
barInfo
[
0
].
score
)
{
left
=
-
486
}
else
if
(
barInfo
[
3
].
score
<=
nowScore
)
{
left
=
0
}
else
{
for
(
let
i
=
0
;
i
<
barInfo
.
length
;
i
++
)
{
if
(
nowScore
<=
barInfo
[
i
].
score
)
{
let
num
=
nowScore
-
barInfo
[
i
-
1
].
score
let
length
=
barInfo
[
i
].
score
-
barInfo
[
i
-
1
].
score
console
.
log
(
i
,
barInfo
[
i
-
1
].
score
,
num
,
length
,
"left"
,
"num,length"
)
left
=
barPoint
[
i
-
1
]
+
num
/
length
*
(
i
==
3
?
100
:
113
)
break
}
}
}
console
.
log
(
left
,
"left"
)
return
left
}
}
render
()
{
...
...
@@ -21,7 +50,11 @@ class BarItem extends React.Component {
return
(
<
div
className=
"gamebar"
>
<
span
className=
"bardown"
></
span
>
<
span
className=
"baron"
></
span
>
<
div
className=
'barbox'
>
<
span
className=
"baron"
style=
{
{
left
:
this
.
updateLength
()
/
100
+
"rem"
}
}
></
span
>
</
div
>
{
barInfo
?.
map
((
item
,
index
)
=>
{
return
(
...
...
@@ -32,7 +65,7 @@ class BarItem extends React.Component {
item
.
receive
&&
<
span
className=
"prizebg"
></
span
>
}
<
span
className=
"prize"
>
{
item
.
sendCount
}
青果
</
span
>
</
div
>
</
div
>
)
})
}
...
...
src/components/barItem/barItem.less
View file @
dc94f44e
...
...
@@ -13,12 +13,19 @@
position: absolute;
.sparkBg("homePahe/bardown.png");
}
.bar
on
{
.bar
box
{
width: 486px;
height: 10px;
left: 36px;
top: 69px;
position: absolute;
}
.baron {
width: 486px;
height: 10px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("homePahe/baron.png");
}
.boxitem {
...
...
src/store/index.js
View file @
dc94f44e
...
...
@@ -2,6 +2,7 @@ import { PAGE_MAP } from '@src/utils/constants';
import
{
makeAutoObservable
}
from
'mobx'
;
import
API
from
'../api/index'
;
import
{
GetCurrSkinId
,
getCustomShareId
}
from
"@src/utils/utils"
;
import
{
Toast
}
from
'@spark/ui'
;
const
skinId
=
GetCurrSkinId
()
||
getCustomShareId
();
...
...
@@ -55,7 +56,7 @@ const store = makeAutoObservable({
},
checkTime
(
checkEnd
=
true
)
{
if
(
store
.
homeInfo
?.
actStartTimestamp
>
store
.
timeStamp
)
{
Toast
(
"活动未开始"
)
Toast
s
(
"活动未开始"
)
return
false
}
if
(
checkEnd
&&
store
.
homeInfo
?.
actEndTimestamp
<
store
.
timeStamp
)
{
...
...
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