Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RB_StrongestBrain_250520
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
RB_StrongestBrain_250520
Commits
3c39b0ec
Commit
3c39b0ec
authored
May 23, 2025
by
haiyoucuv
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
fe63a110
a582ba58
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
207 additions
and
79 deletions
+207
-79
main.ts
mock/main.ts
+6
-5
App.tsx
src/App.tsx
+5
-1
bgm.mp3
src/assets/audio/bgm.mp3
+0
-0
music_close.png
src/assets/common/music_close.png
+0
-0
music_open.png
src/assets/common/music_open.png
+0
-0
settlechance.jsx
src/components/settlechance/settlechance.jsx
+9
-4
settlechance.less
src/components/settlechance/settlechance.less
+2
-2
settlenochance.jsx
src/components/settlenochance/settlenochance.jsx
+29
-7
settlenochance.less
src/components/settlenochance/settlenochance.less
+58
-18
HomePage.less
src/pages/HomePage/HomePage.less
+28
-14
HomePage.tsx
src/pages/HomePage/HomePage.tsx
+18
-9
store.ts
src/store/store.ts
+52
-19
No files found.
mock/main.ts
View file @
3c39b0ec
...
...
@@ -9,23 +9,24 @@ export default [
"message"
:
"message"
,
"data"
:
{
"actStartTimestamp"
:
-
86961592.20219234
,
"answerChance"
:
6
1684762.582832515
,
"rank"
:
85345186.95448217
,
"uid"
:
"
laboris Lorem sit officia aliqua
"
,
"answerChance"
:
6
66
,
"rank"
:
1
,
"uid"
:
"
123213
"
,
"currentTimestamp"
:
99790918.1204935
,
"actEndTimestamp"
:
42625488.007563084
,
"avatar"
:
"/src/assets/homePage/head.png"
,
"privacyText"
:
'143sjhbkrjgjkfgbjfb fnsjnfdrhgkfngjknfcmgfcm fjkxdngjhrdkghkfxgjfb'
,
"rankPop1"
:
{
"prizeName"
:
null
,
"prizeImg"
:
"//yun.duiba.com.cn/polaris/045CCBB8-F6C7-43DB-9F81-45F52430A878.441c8f13daf61c48b85fe383e764d9089f1d4a66.png"
,
"rank"
:
825844
,
},
"rulePop"
:
fals
e
,
"rulePop"
:
tru
e
,
"userId"
:
"qui id deserunt"
,
"validUid"
:
true
,
"isAgent"
:
true
,
"boundYkCode"
:
"eiusmod in dolor"
,
"
minim_0"
:
93293912
"
agreePrivacy"
:
true
,
}
}
},
...
...
src/App.tsx
View file @
3c39b0ec
...
...
@@ -25,6 +25,8 @@ import { onInitShare } from './utils/share.js';
import
{
domain
,
ensureDomain
}
from
"@spark/dbdomain"
;
import
shareStore
from
'./store/share.js'
;
import
music
from
"../src/assets/audio/bgm.mp3"
;
@
observer
class
App
extends
Component
{
...
...
@@ -35,11 +37,13 @@ class App extends Component {
myPrize
:
MyPrize
,
// TODO 举例子 新宿台奖品页
index
:
HomePage
,
sharepage
:
SharePage
,
}[
skinId
]
||
Ga
mePage
;
}[
skinId
]
||
Ho
mePage
;
PageCtrl
.
changePage
(
defaultPage
);
}
async
componentDidMount
()
{
musicStore
.
playSound
(
music
,
true
);
this
.
showDefaultPage
();
await
store
.
getFrontVariable
();
...
...
src/assets/audio/bgm.mp3
0 → 100644
View file @
3c39b0ec
File added
src/assets/common/music_close.png
View replaced file @
fe63a110
View file @
3c39b0ec
1.75 KB
|
W:
|
H:
2.73 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/assets/common/music_open.png
View replaced file @
fe63a110
View file @
3c39b0ec
1.63 KB
|
W:
|
H:
2.57 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/components/settlechance/settlechance.jsx
View file @
3c39b0ec
...
...
@@ -36,8 +36,10 @@ class Settlechance extends React.Component {
const
{
data
}
=
this
.
props
||
{};
const
{
drawChance
=
0
,
title
=
"银河系脑洞霸主"
,
desc
=
"你的脑洞能凭空造出‘榴莲味wiFi’和‘会蹦迪的沙发’,建议去给科幻片当编剧,拯救全人类!"
,
title
=
""
,
desc
=
""
,
img
=
""
,
score
=
0
,
}
=
data
||
{};
return
(
<
div
className=
"settlechance modal_center"
>
...
...
@@ -45,9 +47,12 @@ class Settlechance extends React.Component {
<
span
className=
"bg"
></
span
>
<
Button
className=
"draw"
onClick=
{
this
.
handleDraw
}
/>
<
Button
className=
"know"
onClick=
{
this
.
handleKnow
}
/>
<
span
className=
"icon"
></
span
>
<
img
className=
"icon"
src
=
{
img
}
alt
=
{
title
}
/>
<
span
className=
"ribbon"
></
span
>
<
span
className=
"title"
>
恭喜您, 答对
{
0
}
题
</
span
>
<
span
className=
"title"
>
恭喜您, 答对
{
score
}
题
</
span
>
<
span
className=
"tip1"
>
获得了「
{
title
}
」称号
</
span
>
<
span
className=
"tip2"
>
{
desc
}
</
span
>
<
span
className=
"tip3"
>
恭喜获得抽奖机会+
{
drawChance
}
</
span
>
...
...
src/components/settlechance/settlechance.less
View file @
3c39b0ec
...
...
@@ -55,7 +55,7 @@
left: 242px;
top: 540px;
position: absolute;
.sparkBg("settleChance/icon.png");
//
.sparkBg("settleChance/icon.png");
}
.title {
...
...
@@ -99,7 +99,7 @@
width: 460px;
height: 84px;
left: 134px;
top: 8
0
7px;
top: 8
1
7px;
text-align: center;
position: absolute;
font-size: 22px;
...
...
src/components/settlenochance/settlenochance.jsx
View file @
3c39b0ec
...
...
@@ -7,6 +7,9 @@ import { Button, Toast } from '@grace/ui';
import
{
_asyncThrottle
}
from
"../../utils/utils"
;
import
{
PageCtrl
}
from
"@/core/ctrls/PageCtrl"
;
import
{
ModalCtrl
}
from
"@/core/ctrls/ModalCtrl"
;
import
{
SvgaPlayer
}
from
"@grace/svgaplayer"
;
import
lightSvga
from
"../../assets/svga/6输出弹窗.svga"
;
import
{
LOG_KEY
,
MatterShareOpt
,
MatterViewDuration
,
MatterViewOpt
,
pageView
,
sensorLog
}
from
"../../utils/sensors.js"
;
@
observer
...
...
@@ -41,17 +44,36 @@ class Settlenochance extends React.Component {
button_name
:
"我知道了按钮"
,
});
}
handleClose
=
_asyncThrottle
(()
=>
{
ModalCtrl
.
closeModal
()
})
handleKnow
=
_asyncThrottle
(()
=>
{
ModalCtrl
.
closeModal
()
})
render
()
{
const
{
data
}
=
this
.
props
||
{};
const
{
title
=
""
,
desc
=
""
,
img
=
""
,
score
=
0
,
}
=
data
||
{};
return
(
<
div
className=
"settlenochance modal_center"
>
<
span
className=
"dongxiao"
></
span
>
<
SvgaPlayer
className=
"light"
src=
{
lightSvga
}
/
>
<
span
className=
"bg"
></
span
>
<
span
className=
"know"
></
span
>
<
span
className=
"icon"
></
span
>
<
span
className=
"title"
></
span
>
<
span
className=
"tip1"
>
获得了「宇宙菜鸟」称号
</
span
>
<
span
className=
"tip2"
>
你的脑洞像刚解冻的冰棍——梆硬且毫无波澜,建议多喝热水重启大脑!
</
span
>
<
span
className=
"close"
></
span
>
<
Button
className=
"know"
onClick=
{
this
.
handleKnow
}
/>
<
img
className=
"icon"
src
=
{
img
}
alt
=
{
title
}
/>
<
span
className=
"ribbon"
></
span
>
<
span
className=
"title"
>
恭喜您, 答对
{
score
}
题
</
span
>
<
span
className=
"tip1"
>
获得了「
{
title
}
」称号
</
span
>
<
span
className=
"tip2"
>
{
desc
}
</
span
>
<
Button
className=
"close"
onClick=
{
this
.
handleClose
}
/>
</
div
>
);
}
...
...
src/components/settlenochance/settlenochance.less
View file @
3c39b0ec
@import "../../res.less";
.settlenochance {
width: 750px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.dongxiao {
@font-face {
font-family: "MaokenAssortedSans";
src: url('/src/assets/font/MaokenAssortedSans.ttf') format('truetype');
// font-display: swap;
}
.light {
width: 750px;
height: 1
008
px;
height: 1
624
px;
left: 0px;
top: 324
px;
// top: 213
px;
position: absolute;
.sparkBg("settleNo
Chance/dongxiao.png");
// .sparkBg("settle
Chance/dongxiao.png");
}
.bg {
width: 606px;
height: 724px;
...
...
@@ -21,6 +30,7 @@
position: absolute;
.sparkBg("settleNoChance/bg.png");
}
.know {
width: 263px;
height: 92px;
...
...
@@ -29,41 +39,71 @@
position: absolute;
.sparkBg("settleNoChance/know.png");
}
.icon {
width: 198px;
height: 198px;
left: 271px;
top: 686px;
position: absolute;
.sparkBg("settleNoChance/icon.png");
//
.sparkBg("settleNoChance/icon.png");
}
.title {
// width: 636px;
width: 750px;
height: 201px;
// left: 138px;
left: -10px;
top: 288+100px;
font-size: 62px;
text-align: center;
position: absolute;
color: rgb(255, 245, 214);
font-family: "MaokenAssortedSans";
}
.ribbon {
width: 636px;
height: 201px;
left: 3
2
px;
top:
325
px;
left: 3
0
px;
top:
214+100
px;
position: absolute;
.sparkBg("settle
NoChance/title
.png");
.sparkBg("settle
Chance/ribbon
.png");
}
.tip1 {
width:
338
px;
height:
29
px;
left:
200
px;
width:
460
px;
height:
33
px;
left:
134
px;
top: 599px;
text-align: center;
position: absolute;
font-size: 30px;
line-height:
29
px;
line-height:
33
px;
color: rgba(153, 57, 27, 1);
font-weight: bold;
.lineClamp1();
}
.tip2 {
width: 429px;
height: 55px;
left: 156px;
top: 935px;
width: 460px;
height: 84px;
left: 134px;
top: 925px;
text-align: center;
position: absolute;
font-size: 21px;
font-size: 22px;
line-height: 38px;
color: rgba(169, 90, 62, 1);
// .lineClamp1();
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.close {
width: 64px;
height: 64px;
...
...
@@ -72,4 +112,4 @@
position: absolute;
.sparkBg("settleNoChance/close.png");
}
}
}
\ No newline at end of file
src/pages/HomePage/HomePage.less
View file @
3c39b0ec
...
...
@@ -103,14 +103,16 @@
.sparkBg("homePage/answer.png");
}
.remain {
width:
125
px;
height: 2
1
px;
left: 161px;
width:
422
px;
height: 2
4
px;
//
left: 161px;
top: 94px;
text-align: center;
position: absolute;
font-size: 21px;
line-height: 2
1
px;
line-height: 2
4
px;
color: rgba(170, 64, 0, 1);
.lineClamp1();
}
}
.rank {
...
...
@@ -128,14 +130,15 @@
.sparkBg("homePage/r_bg.png");
}
.name {
width:
233
px;
height:
29
px;
width:
300
px;
height:
33
px;
left: 145px;
top: 67px;
position: absolute;
font-size: 30px;
line-height:
29
px;
line-height:
33
px;
color: rgba(30, 76, 169, 1);
.lineClamp1();
}
.head {
width: 95px;
...
...
@@ -143,7 +146,8 @@
left: 37px;
top: 34px;
position: absolute;
.sparkBg("homePage/head.png");
// .sparkBg("homePage/head.png");
border-radius: 15px;
}
.myrank {
width: 104px;
...
...
@@ -154,14 +158,16 @@
.sparkBg("homePage/myRank.png");
}
.number {
width: 125px;
height: 52px;
left: 469px;
top: 39px;
width: 180px;
height: 70px;
left: 439px;
top: 32px;
text-align: center;
position: absolute;
font-size: 6
8
px;
line-height:
52
px;
font-size: 6
0
px;
line-height:
70
px;
color: rgba(30, 76, 169, 1);
.lineClamp1();
}
}
.prize {
...
...
@@ -204,4 +210,12 @@
position: absolute;
.sparkBg("homePage/logo.png");
}
.musicBtn {
position: absolute;
left: 20px;
top: 590px;
width: 47px;
height: 47px;
}
}
\ No newline at end of file
src/pages/HomePage/HomePage.tsx
View file @
3c39b0ec
...
...
@@ -9,6 +9,7 @@ import { PageCtrl } from "@/core/ctrls/PageCtrl";
import
{
ModalCtrl
}
from
"@/core/ctrls/ModalCtrl"
;
import
Rulepop
from
"../../components/rulepop/rulepop.jsx"
;
import
CapsulePage
from
"../CapsulePage/CapsulePage.jsx"
;
import
{
isWeiXin
}
from
"../../AppTools.ts"
;
import
store
from
'@/store/store'
;
import
Taskpop
from
'@/panels/taskpop/taskpop.jsx'
;
import
Yinsirulepop
from
'@/panels/yinsirulepop/yinsirulepop.jsx'
;
...
...
@@ -19,8 +20,7 @@ import { LOG_KEY, MatterShareOpt, MatterViewDuration, MatterViewOpt, pageView, s
import
{
CHANNEL_PARAMS
,
extranceName
}
from
'@/utils/constants.js'
;
import
gameStore
from
"@/store/gameStore.ts"
;
import
GamePage
from
"@/pages/GamePage/GamePage.tsx"
;
import
Settlechance
from
"../../components/settlechance/settlechance.jsx"
import
MusicBtn
from
'@/core/components/MusicBtn/MusicBtn.tsx'
;
@
observer
class
Homepage
extends
React
.
Component
{
...
...
@@ -31,6 +31,9 @@ class Homepage extends React.Component {
}
async
componentDidMount
()
{
if
(
isWeiXin
())
{
if
(
!
await
store
.
checkBindStatus
())
return
;
}
await
store
.
updateIndex
();
await
shareStore
.
doAssist
();
this
.
initSensor
();
...
...
@@ -102,7 +105,7 @@ class Homepage extends React.Component {
}
else
{
PageCtrl
.
changePage
(
MyPrize
);
}
break
;
// 5 活动规则
...
...
@@ -111,7 +114,7 @@ class Homepage extends React.Component {
page_name
:
"活动首页"
,
button_name
:
"规则按钮"
,
});
ModalCtrl
.
showModal
(
Settlechance
);
ModalCtrl
.
showModal
(
Rulepop
);
break
;
// 6 拜访清单
...
...
@@ -188,6 +191,7 @@ class Homepage extends React.Component {
});
};
render
()
{
const
{
uid
,
avatar
,
rank
,
answerChance
}
=
store
?.
indexData
||
{}
return
(
<
div
className=
"homepage"
>
<
span
className=
"bg"
></
span
>
...
...
@@ -197,13 +201,16 @@ class Homepage extends React.Component {
<
span
className=
"brain"
></
span
>
<
span
className=
"wenhao"
></
span
>
<
span
className=
"title"
></
span
>
{
/* 按钮
共7个
*/
}
{
/* 按钮 */
}
<
div
className=
"rank"
>
<
span
className=
"r_bg"
></
span
>
<
span
className=
"name"
>
用户uid:132802
</
span
>
<
span
className=
"head"
></
span
>
<
span
className=
"name"
>
用户UID:
{
uid
}
</
span
>
<
img
className=
"head"
src=
{
avatar
}
alt=
''
/>
<
Button
className=
"myrank"
onClick=
{
()
=>
this
.
handleButtonClick
(
0
)
}
/>
<
span
className=
"number"
>
000
</
span
>
<
span
className=
"number"
>
{
rank
===
null
?
'未参与'
:
rank
===
-
1
?
'未上榜'
:
rank
}
</
span
>
</
div
>
<
span
className=
"logo"
></
span
>
<
Button
className=
"draw"
onClick=
{
()
=>
this
.
handleButtonClick
(
1
)
}
/>
...
...
@@ -211,12 +218,14 @@ class Homepage extends React.Component {
<
Button
className=
"matter"
onClick=
{
()
=>
this
.
handleButtonClick
(
3
)
}
>
<
span
className=
"m_bg"
></
span
>
<
span
className=
"answer"
></
span
>
<
span
className=
"remain"
>
剩余次数:
3
</
span
>
<
span
className=
"remain"
>
剩余次数:
{
answerChance
}
</
span
>
</
Button
>
<
Button
className=
"prize"
onClick=
{
()
=>
this
.
handleButtonClick
(
4
)
}
/>
<
Button
className=
"rule"
onClick=
{
()
=>
this
.
handleButtonClick
(
5
)
}
/>
<
Button
className=
"visit"
onClick=
{
()
=>
this
.
handleButtonClick
(
6
)
}
/>
<
Button
className=
"share"
onClick=
{
()
=>
this
.
handleButtonClick
(
7
)
}
/>
<
MusicBtn
className=
"musicBtn"
/>
</
div
>
);
}
...
...
src/store/store.ts
View file @
3c39b0ec
...
...
@@ -2,7 +2,7 @@ import { makeAutoObservable, } from 'mobx';
import
API
from
'../api/index'
;
import
{
Toast
}
from
"@grace/ui"
;
import
{
initWx
,
IWxShareInfo
}
from
"@/built-in/share/weixin/weixin.ts"
;
import
{
_asyncThrottle
,
_debounce
,
getUrlParam
}
from
'@/utils/utils'
;
import
{
_asyncThrottle
,
_debounce
,
getUrlParam
,
waitTime
}
from
'@/utils/utils'
;
// import { IBubbleInfo } from "@/pages/HomePage/Top/Components/Bubble.ts";
// import { IOverflowBubbleInfo } from "@/pages/HomePage/Top/Components/OverflowBubble.ts";
import
{
getDomain
}
from
'@spark/dbdomain'
;
...
...
@@ -10,6 +10,8 @@ import { showShareGuide } from '@spark/share';
import
{
ModalCtrl
}
from
'@/core/ctrls/ModalCtrl'
;
import
RankPrizePop
from
'@/panels/RankPrizePop/RankPrizePop'
;
import
RankNoPrizePop
from
'@/panels/RankNoPrizePop/RankNoPrizePop'
;
import
RulePop
from
"../components/rulepop/rulepop.jsx"
;
import
LoginPop
from
"../components/loginpop/loginpop.jsx"
class
Store
{
...
...
@@ -24,12 +26,12 @@ class Store {
shareInfo
:
any
,
ruleImg
?:
string
,
}
=
{
shareInfo
:
{
title
:
""
,
desc
:
""
,
imgUrl
:
""
,
},
};
shareInfo
:
{
title
:
""
,
desc
:
""
,
imgUrl
:
""
,
},
};
ruleInfo
=
''
;
...
...
@@ -51,6 +53,36 @@ class Store {
console
.
log
(
'前端开发配置'
,
data
)
}
/** 绑定手机号接口返回状态 */
isApiCheckBack
:
false
setIsApiCheckBack
(
status
)
{
this
.
isApiCheckBack
=
status
;
}
/** 校验是否绑定手机号 */
async
checkBindStatus
()
{
const
{
success
,
data
}
=
await
API
.
checkBind
({
appId
:
getUrlParam
(
"appId"
),
dbredirect
:
encodeURIComponent
(
window
.
location
.
href
),
});
console
.
info
(
"%c data"
,
"font-size: 30px"
,
data
);
if
(
success
&&
data
)
{
if
(
data
?.
bind
)
{
if
(
data
?.
url
)
{
location
.
replace
(
data
?.
url
);
}
else
{
// 已经绑定过,跳转完后端返回的免登链接时,展示页面
this
.
setIsApiCheckBack
(
true
);
// 助力
return
true
;
}
}
else
{
this
.
setIsApiCheckBack
(
true
);
ModalCtrl
.
showModal
(
LoginPop
);
}
await
waitTime
(
200
);
}
return
false
;
}
indexData
:
{
actStartTime
?:
number
,
actEndTime
?:
number
,
...
...
@@ -85,10 +117,7 @@ class Store {
isAgent
:
string
,
agreePrivacy
:
boolean
,
}
=
{
isAgent
:
''
,
agreePrivacy
:
false
};
}
=
{};
firstIn
=
true
;
async
updateIndex
()
{
const
{
success
,
data
}
=
await
API
.
index
();
...
...
@@ -113,19 +142,23 @@ class Store {
}
}
if
(
this
.
firstIn
&&
data
.
validUid
)
{
if
(
this
.
firstIn
&&
data
.
validUid
)
{
API
.
visit
()
this
.
firstIn
=
false
}
if
(
data
?.
rankPop
){
if
(
data
?.
rankPop
?.
prizeName
){
ModalCtrl
.
showModal
(
RankPrizePop
,{
prize
:
data
?.
rankPop
if
(
data
.
rulePop
)
{
ModalCtrl
.
showModal
(
RulePop
)
}
if
(
data
?.
rankPop
)
{
if
(
data
?.
rankPop
?.
prizeName
)
{
ModalCtrl
.
showModal
(
RankPrizePop
,
{
prize
:
data
?.
rankPop
})
}
else
{
ModalCtrl
.
showModal
(
RankNoPrizePop
,{
prize
:
data
?.
rankPop
}
else
{
ModalCtrl
.
showModal
(
RankNoPrizePop
,
{
prize
:
data
?.
rankPop
})
}
}
...
...
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