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
010b1d56
Commit
010b1d56
authored
May 22, 2025
by
cc
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab2.dui88.com/sparkprojects/rb_strongestbrain_250520
parents
d6112d33
a94342d9
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
287 additions
and
31 deletions
+287
-31
capsule.ts
mock/capsule.ts
+81
-0
main.ts
mock/main.ts
+2
-2
pnpm-lock.yaml
pnpm-lock.yaml
+2
-2
index.ts
src/api/index.ts
+4
-4
cloud1.png
src/assets/Game/level18/cloud1.png
+0
-0
cloud2.png
src/assets/Game/level18/cloud2.png
+0
-0
ice.png
src/assets/Game/level18/ice.png
+0
-0
ice2.png
src/assets/Game/level18/ice2.png
+0
-0
qs.png
src/assets/Game/level18/qs.png
+0
-0
right.png
src/assets/Game/level18/right.png
+0
-0
sun.png
src/assets/Game/level18/sun.png
+0
-0
title18.png
src/assets/GamePage/title/title18.png
+0
-0
CapsulePage.jsx
src/pages/CapsulePage/CapsulePage.jsx
+34
-14
CapsulePage.less
src/pages/CapsulePage/CapsulePage.less
+14
-3
Game.ts
src/pages/GamePage/Game.ts
+2
-1
Level10.ts
src/pages/GamePage/Level/Level10.ts
+5
-0
Level13.ts
src/pages/GamePage/Level/Level13.ts
+5
-0
Level14.ts
src/pages/GamePage/Level/Level14.ts
+5
-0
Level18.ts
src/pages/GamePage/Level/Level18.ts
+108
-0
Level5.ts
src/pages/GamePage/Level/Level5.ts
+5
-0
Level7.ts
src/pages/GamePage/Level/Level7.ts
+11
-2
Level9.ts
src/pages/GamePage/Level/Level9.ts
+5
-0
LevelConfig.ts
src/pages/GamePage/Level/LevelConfig.ts
+2
-1
sensors.js
src/utils/sensors.js
+2
-2
No files found.
mock/
draw
.ts
→
mock/
capsule
.ts
View file @
010b1d56
export
default
[
export
default
[
{
{
url
:
'/
draw
/index.do'
,
url
:
'/
ndj
/index.do'
,
method
:
'get'
,
method
:
'get'
,
response
:
({
query
})
=>
{
response
:
({
query
})
=>
{
return
{
return
{
"success"
:
true
,
"success"
:
true
,
"message"
:
"报错了~"
,
"message"
:
"信息"
,
"code"
:
null
,
"code"
:
"123"
,
timeStamp
:
Date
.
now
(),
"data"
:
{
"data"
:
{
"remainDrawTimes"
:
3
,
// 抽奖次数
"remainDrawTimes"
:
157
,
// 抽奖次数
"prize
VOs
"
:
[
"prize
Info
"
:
[
{
{
prizeName
:
`奖品1`
,
"prizeName"
:
`奖品1`
,
prizeImg
:
`//yun.duiba.com.cn/polaris/jinmoqiang.9e5bbc004f69ab6a3f34d93daeda028616a9f00d.png`
,
"prizeImg"
:
`//yun.duiba.com.cn/polaris/jinmoqiang.9e5bbc004f69ab6a3f34d93daeda028616a9f00d.png`
,
prizeId
:
`1`
,
//
prizeId: `1`,
},
},
{
{
prizeName
:
`奖品名称
2`
,
"prizeName"
:
`奖品
2`
,
prizeImg
:
`//yun.duiba.com.cn/polaris/kouzhao.dc55dac6db1ff94c4666c2602d6cb0ac84139982
.png`
,
"prizeImg"
:
`//yun.duiba.com.cn/polaris/jinmoqiang.9e5bbc004f69ab6a3f34d93daeda028616a9f00d
.png`
,
prizeId
:
`2`
,
//
prizeId: `2`,
},
},
{
{
prizeName
:
`奖品名称3`
,
"prizeName"
:
`奖品名称3`
,
prizeImg
:
`//yun.duiba.com.cn/polaris/mac.fe55aa43e5a231d568973dcdd0b91e0263d5a12c.png`
,
"prizeImg"
:
`//yun.duiba.com.cn/polaris/mac.fe55aa43e5a231d568973dcdd0b91e0263d5a12c.png`
,
prizeId
:
`3`
,
//
prizeId: `3`,
},
},
{
{
prizeName
:
`奖品名称4`
,
"prizeName"
:
`奖品名称4`
,
prizeImg
:
`//yun.duiba.com.cn/polaris/mgtv.e5f0709a2a4083bc57ce52ff200a50a2e56b2658.png`
,
"prizeImg"
:
`//yun.duiba.com.cn/polaris/mgtv.e5f0709a2a4083bc57ce52ff200a50a2e56b2658.png`
,
prizeId
:
`4`
,
//
prizeId: `4`,
},
},
{
{
prizeName
:
`奖品名称5`
,
"prizeName"
:
`奖品名称5`
,
prizeImg
:
`//yun.duiba.com.cn/polaris/qq.73ad13cd0c6fd705327d12957c12e9d5b2e77baa.png`
,
"prizeImg"
:
`//yun.duiba.com.cn/polaris/qq.73ad13cd0c6fd705327d12957c12e9d5b2e77baa.png`
,
prizeId
:
`5`
,
//
prizeId: `5`,
},
},
{
{
prizeName
:
`谢谢参与`
,
"prizeName"
:
`谢谢参与`
,
prizeImg
:
`https://yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg`
,
"prizeImg"
:
`https://yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg`
,
prizeId
:
`thanks`
,
//
prizeId: `thanks`,
},
},
]
]
}
}
...
@@ -48,17 +47,15 @@ export default [
...
@@ -48,17 +47,15 @@ export default [
},
},
{
{
url
:
'/
draw/doD
raw.do'
,
url
:
'/
ndj/d
raw.do'
,
method
:
'get'
,
method
:
'get'
,
response
:
({
query
})
=>
{
response
:
({
query
})
=>
{
return
{
return
{
"code"
:
""
,
"code"
:
"
123
"
,
"message"
:
null
,
"message"
:
"信息xxx"
,
"success"
:
true
,
"success"
:
true
,
"data"
:
{
"data"
:
{
"prizeName"
:
""
,
"boolPrize"
:
true
,
// true-中奖,取prizeInfo信息,false-为中奖,取productInfo
"prizeId"
:
"1"
,
"prizeImg"
:
""
,
"productInfos"
:
[
"productInfos"
:
[
{
{
"productImg"
:
"//yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg"
,
"productImg"
:
"//yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg"
,
...
@@ -72,9 +69,12 @@ export default [
...
@@ -72,9 +69,12 @@ export default [
"productImg"
:
"//yun.duiba.com.cn/polaris/mgtv.e5f0709a2a4083bc57ce52ff200a50a2e56b2658.png"
,
"productImg"
:
"//yun.duiba.com.cn/polaris/mgtv.e5f0709a2a4083bc57ce52ff200a50a2e56b2658.png"
,
"productText"
:
"介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3"
"productText"
:
"介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3"
}
}
]
],
},
"prizeInfo"
:
{
"timeStamp"
:
1739176246085
"prizeName"
:
"reprehenderit tempor non"
,
"prizeImg"
:
"Duis veniam ipsum voluptate eiusmod"
}
}
}
}
},
},
}
}
...
...
mock/main.ts
View file @
010b1d56
...
@@ -21,8 +21,8 @@ export default [
...
@@ -21,8 +21,8 @@ export default [
},
},
"rulePop"
:
false
,
"rulePop"
:
false
,
"userId"
:
"qui id deserunt"
,
"userId"
:
"qui id deserunt"
,
"validUid"
:
"Lorem labore occaecat sed quis"
,
"validUid"
:
true
,
"isAgent"
:
"true"
,
"isAgent"
:
true
,
"boundYkCode"
:
"eiusmod in dolor"
,
"boundYkCode"
:
"eiusmod in dolor"
,
"minim_0"
:
93293912
"minim_0"
:
93293912
}
}
...
...
pnpm-lock.yaml
View file @
010b1d56
...
@@ -4177,7 +4177,7 @@ packages:
...
@@ -4177,7 +4177,7 @@ packages:
resolution
:
{
integrity
:
sha1-ZtE2jae9+SHrnZW9GpIp5/IaQ+4=
}
resolution
:
{
integrity
:
sha1-ZtE2jae9+SHrnZW9GpIp5/IaQ+4=
}
sa-sdk-javascript@1.27.4
:
sa-sdk-javascript@1.27.4
:
resolution
:
{
integrity
:
sha512-w0Kv237KHDjH1amgchECzzC9c1aruC0LMgqgYC/ISTfijRroJAEQrVPDvHJqJpD8uD1+spN7q6hgfT3x+EncmQ==
,
tarball
:
http
:
//npm.dui88.com
:
80/sa-sdk-javascript/-/sa-sdk-javascript-1.27.4.tgz
}
resolution
:
{
integrity
:
sha512-w0Kv237KHDjH1amgchECzzC9c1aruC0LMgqgYC/ISTfijRroJAEQrVPDvHJqJpD8uD1+spN7q6hgfT3x+EncmQ==
}
safe-buffer@5.1.2
:
safe-buffer@5.1.2
:
resolution
:
{
integrity
:
sha1-mR7GnSluAxN0fVm9/St0XDX4go0=
}
resolution
:
{
integrity
:
sha1-mR7GnSluAxN0fVm9/St0XDX4go0=
}
...
@@ -4460,7 +4460,7 @@ packages:
...
@@ -4460,7 +4460,7 @@ packages:
typescript
:
'
>=4.8.4'
typescript
:
'
>=4.8.4'
tslib@2.8.1
:
tslib@2.8.1
:
resolution
:
{
integrity
:
sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==
,
tarball
:
http
:
//npm.dui88.com
:
80/tslib/-/tslib-2.8.1.tgz
}
resolution
:
{
integrity
:
sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==
}
tweedle.js@2.1.0
:
tweedle.js@2.1.0
:
resolution
:
{
integrity
:
sha512-0ReQgVjepoZkE6t0upWNgCRbplHkQJQYk1LStXugwSR728GLFmGDRuaQJlxeC/iBlxud6+P1RdODjaO25vHAqw==
}
resolution
:
{
integrity
:
sha512-0ReQgVjepoZkE6t0upWNgCRbplHkQJQYk1LStXugwSR728GLFmGDRuaQJlxeC/iBlxud6+P1RdODjaO25vHAqw==
}
...
...
src/api/index.ts
View file @
010b1d56
...
@@ -125,11 +125,11 @@ const API = generateAPI({
...
@@ -125,11 +125,11 @@ const API = generateAPI({
},
},
/**
抽奖
首页 */
/**
扭蛋机
首页 */
drawIndex
:
"
draw
/index.do"
,
drawIndex
:
"
ndj
/index.do"
,
/** 抽奖 */
/**
扭蛋机
抽奖 */
drawJoin
:
{
drawJoin
:
{
uri
:
"
draw/doD
raw.do"
,
uri
:
"
ndj/d
raw.do"
,
withToken
:
true
,
withToken
:
true
,
},
},
...
...
src/assets/Game/level18/cloud1.png
0 → 100644
View file @
010b1d56
26.5 KB
src/assets/Game/level18/cloud2.png
0 → 100644
View file @
010b1d56
26.5 KB
src/assets/Game/level18/ice.png
0 → 100644
View file @
010b1d56
29.9 KB
src/assets/Game/level18/ice2.png
0 → 100644
View file @
010b1d56
18.6 KB
src/assets/Game/level18/qs.png
0 → 100644
View file @
010b1d56
3.26 KB
src/assets/Game/level18/right.png
0 → 100644
View file @
010b1d56
2.26 KB
src/assets/Game/level18/sun.png
0 → 100644
View file @
010b1d56
37.3 KB
src/assets/GamePage/title/title18.png
0 → 100644
View file @
010b1d56
5.08 KB
src/pages/CapsulePage/CapsulePage.jsx
View file @
010b1d56
...
@@ -18,10 +18,11 @@ import Homepage from "../HomePage/HomePage.tsx";
...
@@ -18,10 +18,11 @@ import Homepage from "../HomePage/HomePage.tsx";
import
machineSvga
from
"../../assets/svga/1输出扭蛋机常态.svga"
;
import
machineSvga
from
"../../assets/svga/1输出扭蛋机常态.svga"
;
import
normalSvga
from
"../../assets/svga/2输出待机啊.svga"
;
import
normalSvga
from
"../../assets/svga/2输出待机啊.svga"
;
import
dynamicSvga
from
"../../assets/svga/3输出出奖啊.svga"
;
import
dynamicSvga
from
"../../assets/svga/3输出出奖啊.svga"
;
import
output1Svga
from
"../../assets/svga/4中奖扭蛋.svga"
;
import
output2Svga
from
"../../assets/svga/5中奖弹窗.svga"
;
// import { LOG_KEY, pageView, sensorLog } from '@src/utils/sensors';
// import { LOG_KEY, pageView, sensorLog } from '@src/utils/sensors';
@
observer
@
observer
class
Capsulepage
extends
React
.
Component
{
class
Capsulepage
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -29,10 +30,11 @@ class Capsulepage extends React.Component {
...
@@ -29,10 +30,11 @@ class Capsulepage extends React.Component {
this
.
state
=
{
this
.
state
=
{
drawInfo
:
{},
drawInfo
:
{},
btnDynamic
:
false
,
// 抽奖机是否动态中
btnDynamic
:
false
,
// 抽奖机是否动态中
btnOutput
:
false
,
// 开扭蛋效果是否启动
};
};
this
.
btnStarting
=
false
;
// 抽奖机是否启动
this
.
btnStarting
=
false
;
// 抽奖机是否启动
// this.turntableRef = null; // 大转盘
// this.turntableRef = null; // 大转盘
this
.
drawResultInfo
=
{};
//
this.drawResultInfo = {};
}
}
componentDidMount
()
{
componentDidMount
()
{
...
@@ -86,25 +88,30 @@ class Capsulepage extends React.Component {
...
@@ -86,25 +88,30 @@ class Capsulepage extends React.Component {
// 抽奖次数为0
// 抽奖次数为0
if
(
!
remainDrawTimes
)
{
if
(
!
remainDrawTimes
)
{
return
Toast
.
show
(
"抽奖次数不足,快去
做任务
赚次数吧~"
);
return
Toast
.
show
(
"抽奖次数不足,快去
猜谜
赚次数吧~"
);
}
}
if
(
this
.
btnStarting
)
return
false
;
if
(
this
.
btnStarting
)
return
false
;
this
.
btnStarting
=
true
;
this
.
btnStarting
=
true
;
const
{
success
,
data
}
=
await
API
.
drawJoin
();
const
{
success
,
data
}
=
await
API
.
drawJoin
();
if
(
success
&&
data
)
{
if
(
success
&&
data
)
{
//
抽奖
机转动开始抽奖
//
扭蛋
机转动开始抽奖
// this.turntableRef.launch();
// this.turntableRef.launch();
this
.
setState
({
btnDynamic
:
true
});
this
.
setState
({
btnDynamic
:
true
});
this
.
drawResultInfo
=
data
||
{};
// this.drawResultInfo = data || {};
const
{
boolPrzie
,
prizeInfo
=
{},
productInfo
=
[]
}
=
data
||
{};
const
{
prizeName
=
""
,
prizeImg
=
""
}
=
prizeInfo
||
{};
// const index = prizeVOs?.findIndex(
// (item) => item.prizeId === (this.drawResultInfo.prizeId || "thanks")
// );
// console.info("index", index);
const
index
=
prizeVOs
?.
findIndex
(
(
item
)
=>
item
.
prizeId
===
(
this
.
drawResultInfo
.
prizeId
||
"thanks"
)
);
console
.
info
(
"index"
,
index
);
// 抽奖机停止转动
// 抽奖机停止转动
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
btnDynamic
:
false
});
this
.
setState
({
btnDynamic
:
false
});
this
.
btnOutput
=
true
;
this
.
stopOkHandle
();
this
.
stopOkHandle
();
},
2000
);
},
2000
);
// this.turntableRef.braking(index);
// this.turntableRef.braking(index);
...
@@ -117,12 +124,19 @@ class Capsulepage extends React.Component {
...
@@ -117,12 +124,19 @@ class Capsulepage extends React.Component {
// 抽奖停止处理
// 抽奖停止处理
stopOkHandle
=
()
=>
{
stopOkHandle
=
()
=>
{
this
.
btnStarting
=
false
;
this
.
btnStarting
=
false
;
setTimeout
(()
=>
{
if
(
!
this
.
drawResultInfo
?.
prizeId
)
{
this
.
setState
({
btnOutput
:
false
});
// modalStore.pushPop("NoPrizeCard", { data: this.drawResultInfo })
},
2000
);
// 此时判断是否中奖 true-中奖,取prizeInfo信息,false-为中奖,取productInfo
if
(
boolPrzie
)
{
// 中奖
ModalCtrl
.
pushPop
(
"Pop_winprize"
,
{
prizeName
,
prizeImg
});
}
else
{
}
else
{
// modalStore.pushPop("Pop_winprize", { data: this.drawResultInfo })
// 没中奖
ModalCtrl
.
pushPop
(
"NoPrizeCard"
,
productInfo
||
[]);
}
}
this
.
getDrawInfo
();
this
.
getDrawInfo
();
};
};
...
@@ -148,7 +162,7 @@ class Capsulepage extends React.Component {
...
@@ -148,7 +162,7 @@ class Capsulepage extends React.Component {
});
});
render
()
{
render
()
{
const
{
btnDynamic
}
=
this
.
state
;
const
{
btnDynamic
,
btnOutput
}
=
this
.
state
;
const
{
prizeVOs
,
remainDrawTimes
}
=
this
.
state
.
drawInfo
;
const
{
prizeVOs
,
remainDrawTimes
}
=
this
.
state
.
drawInfo
;
return
(
return
(
<
div
className=
"capsule modal_center"
>
<
div
className=
"capsule modal_center"
>
...
@@ -166,6 +180,12 @@ class Capsulepage extends React.Component {
...
@@ -166,6 +180,12 @@ class Capsulepage extends React.Component {
<
SvgaPlayer
className=
"normal"
src=
{
normalSvga
}
/>
<
SvgaPlayer
className=
"normal"
src=
{
normalSvga
}
/>
)
}
)
}
<
SvgaPlayer
className=
"machine"
src=
{
machineSvga
}
/>
<
SvgaPlayer
className=
"machine"
src=
{
machineSvga
}
/>
{
btnOutput
&&
(
<>
<
SvgaPlayer
className=
"output1"
src=
{
output1Svga
}
/>
<
SvgaPlayer
className=
"output2"
src=
{
output2Svga
}
/>
</>
)
}
{
/* <div className="turantable">
{
/* <div className="turantable">
<CircleTurntable
<CircleTurntable
className="turantable_box"
className="turantable_box"
...
...
src/pages/CapsulePage/CapsulePage.less
View file @
010b1d56
...
@@ -57,9 +57,20 @@
...
@@ -57,9 +57,20 @@
left: 114px;
left: 114px;
}
}
.fade-out {
.output1 {
transition: opacity 0.3s ease-out;
position: absolute;
opacity: 0;
width: 750px;
height: 830px;
top: 427px;
// left: 114px;
}
.output2 {
position: absolute;
width: 750px;
height: 830px;
top: 427px;
// left: 114px;
}
}
// .task_btn {
// .task_btn {
...
...
src/pages/GamePage/Game.ts
View file @
010b1d56
...
@@ -14,6 +14,7 @@ import { Level9 } from "@/pages/GamePage/Level/Level9.ts";
...
@@ -14,6 +14,7 @@ import { Level9 } from "@/pages/GamePage/Level/Level9.ts";
import
{
Level10
}
from
"@/pages/GamePage/Level/Level10.ts"
;
import
{
Level10
}
from
"@/pages/GamePage/Level/Level10.ts"
;
import
{
Level13
}
from
"@/pages/GamePage/Level/Level13.ts"
;
import
{
Level13
}
from
"@/pages/GamePage/Level/Level13.ts"
;
import
{
Level14
}
from
"@/pages/GamePage/Level/Level14.ts"
;
import
{
Level14
}
from
"@/pages/GamePage/Level/Level14.ts"
;
import
{
Level18
}
from
"@/pages/GamePage/Level/Level18.ts"
;
import
{
Level23
}
from
"@/pages/GamePage/Level/Level23.ts"
;
import
{
Level23
}
from
"@/pages/GamePage/Level/Level23.ts"
;
import
gameStore
from
"@/store/gameStore.ts"
;
import
gameStore
from
"@/store/gameStore.ts"
;
import
{
LevelArr
}
from
"@/pages/GamePage/Level/LevelConfig.ts"
;
import
{
LevelArr
}
from
"@/pages/GamePage/Level/LevelConfig.ts"
;
...
@@ -28,7 +29,7 @@ export class Game extends Base {
...
@@ -28,7 +29,7 @@ export class Game extends Base {
const
qsBg
=
this
.
addChild
(
new
Sprite
(
Assets
.
get
(
"问题.png"
)));
const
qsBg
=
this
.
addChild
(
new
Sprite
(
Assets
.
get
(
"问题.png"
)));
qsBg
.
position
.
set
(
49
,
316
);
qsBg
.
position
.
set
(
49
,
316
);
this
.
level
=
this
.
addChild
(
new
Level1
3
());
this
.
level
=
this
.
addChild
(
new
Level1
8
());
gameStore
.
start
();
gameStore
.
start
();
...
...
src/pages/GamePage/Level/Level10.ts
View file @
010b1d56
...
@@ -36,11 +36,16 @@ export class Level10 extends LevelBase {
...
@@ -36,11 +36,16 @@ export class Level10 extends LevelBase {
this
.
right
.
eventMode
=
"none"
;
this
.
right
.
eventMode
=
"none"
;
this
.
A
.
on
(
"pointerdown"
,
this
.
onAPointerDown
,
this
);
this
.
A
.
on
(
"pointerdown"
,
this
.
onAPointerDown
,
this
);
this
.
A
.
on
(
"pointerup"
,
this
.
onAPointerUp
,
this
);
this
.
A
.
on
(
"globalpointermove"
,
this
.
onAPointerMove
,
this
);
this
.
A
.
on
(
"globalpointermove"
,
this
.
onAPointerMove
,
this
);
}
}
pos
=
null
;
pos
=
null
;
onAPointerUp
(
e
)
{
this
.
pos
=
null
;
}
onAPointerDown
(
e
)
{
onAPointerDown
(
e
)
{
const
{
x
,
y
}
=
e
.
data
.
global
;
const
{
x
,
y
}
=
e
.
data
.
global
;
this
.
pos
=
{
this
.
pos
=
{
...
...
src/pages/GamePage/Level/Level13.ts
View file @
010b1d56
...
@@ -36,11 +36,16 @@ export class Level13 extends LevelBase {
...
@@ -36,11 +36,16 @@ export class Level13 extends LevelBase {
this
.
right
.
eventMode
=
"none"
;
this
.
right
.
eventMode
=
"none"
;
this
.
C
.
on
(
"pointerdown"
,
this
.
onAPointerDown
,
this
);
this
.
C
.
on
(
"pointerdown"
,
this
.
onAPointerDown
,
this
);
this
.
C
.
on
(
"pointerup"
,
this
.
onAPointerUp
,
this
);
this
.
C
.
on
(
"globalpointermove"
,
this
.
onAPointerMove
,
this
);
this
.
C
.
on
(
"globalpointermove"
,
this
.
onAPointerMove
,
this
);
}
}
pos
=
null
;
pos
=
null
;
onAPointerUp
(
e
)
{
this
.
pos
=
null
;
}
onAPointerDown
(
e
)
{
onAPointerDown
(
e
)
{
const
{
x
,
y
}
=
e
.
data
.
global
;
const
{
x
,
y
}
=
e
.
data
.
global
;
this
.
pos
=
{
this
.
pos
=
{
...
...
src/pages/GamePage/Level/Level14.ts
View file @
010b1d56
...
@@ -41,6 +41,7 @@ export class Level14 extends LevelBase {
...
@@ -41,6 +41,7 @@ export class Level14 extends LevelBase {
});
});
this
.
A
.
on
(
"pointerdown"
,
this
.
onAPointerDown
,
this
);
this
.
A
.
on
(
"pointerdown"
,
this
.
onAPointerDown
,
this
);
this
.
A
.
on
(
"pointerup"
,
this
.
onAPointerUp
,
this
);
this
.
A
.
on
(
"globalpointermove"
,
this
.
onAPointerMove
,
this
);
this
.
A
.
on
(
"globalpointermove"
,
this
.
onAPointerMove
,
this
);
}
}
...
@@ -69,6 +70,10 @@ export class Level14 extends LevelBase {
...
@@ -69,6 +70,10 @@ export class Level14 extends LevelBase {
pos
=
null
;
pos
=
null
;
onAPointerUp
(
e
)
{
this
.
pos
=
null
;
}
onAPointerDown
(
e
)
{
onAPointerDown
(
e
)
{
const
{
x
,
y
}
=
e
.
data
.
global
;
const
{
x
,
y
}
=
e
.
data
.
global
;
this
.
pos
=
{
this
.
pos
=
{
...
...
src/pages/GamePage/Level/Level18.ts
0 → 100644
View file @
010b1d56
import
{
LevelBase
}
from
"@/pages/GamePage/Components/LevelBase.ts"
;
import
{
Assets
,
Sprite
}
from
"pixi.js"
;
import
{
Ease
,
Tween
}
from
"@/core/tween"
;
import
{
GameEvent
,
globalEvent
}
from
"@/pages/GamePage/GameEvent.ts"
;
export
class
Level18
extends
LevelBase
{
level
:
number
=
18
;
cloud1
:
Sprite
;
cloud2
:
Sprite
;
ice
:
Sprite
;
ice2
:
Sprite
;
right
:
Sprite
;
onLoad
()
{
super
.
onLoad
();
this
.
addChild
(
new
Sprite
(
Assets
.
get
(
`level18/sun.png`
)))
.
position
.
set
(
267
,
703
);
this
.
cloud2
=
this
.
addChild
(
new
Sprite
(
Assets
.
get
(
`level18/cloud2.png`
)));
this
.
cloud2
.
position
.
set
(
45
,
743
);
this
.
cloud1
=
this
.
addChild
(
new
Sprite
(
Assets
.
get
(
`level18/cloud1.png`
)));
this
.
cloud1
.
position
.
set
(
176
,
664
);
this
.
ice
=
this
.
addChild
(
new
Sprite
(
Assets
.
get
(
`level18/ice.png`
)));
this
.
ice
.
position
.
set
(
259
,
1031
);
this
.
ice2
=
this
.
addChild
(
new
Sprite
(
Assets
.
get
(
`level18/ice2.png`
)));
this
.
ice2
.
position
.
set
(
148
,
1100
);
this
.
right
=
this
.
addChild
(
new
Sprite
(
Assets
.
get
(
`level18/right.png`
)));
this
.
right
.
position
.
set
(
433
,
1173
);
this
.
right
.
alpha
=
0
;
this
.
right
.
interactive
=
false
;
this
.
right
.
eventMode
=
"none"
;
this
.
cloud1
.
on
(
"pointerdown"
,
this
.
onAPointerDown
,
this
);
this
.
cloud1
.
on
(
"pointerup"
,
this
.
onAPointerUp
,
this
);
this
.
cloud1
.
on
(
"globalpointermove"
,
this
.
onAPointerMove
,
this
);
this
.
cloud2
.
on
(
"pointerdown"
,
this
.
onAPointerDown
,
this
);
this
.
cloud2
.
on
(
"pointerup"
,
this
.
onAPointerUp
,
this
);
this
.
cloud2
.
on
(
"globalpointermove"
,
this
.
onAPointerMove
,
this
);
}
target
=
null
;
pos
=
null
;
onAPointerUp
(
e
)
{
this
.
pos
=
null
;
}
onAPointerDown
(
e
)
{
this
.
target
=
e
.
target
;
const
{
x
,
y
}
=
e
.
data
.
global
;
this
.
pos
=
{
x
:
x
-
e
.
target
.
x
,
y
:
y
-
e
.
target
.
y
}
}
onAPointerMove
(
e
)
{
if
(
!
this
.
pos
)
return
;
const
{
x
,
y
}
=
e
.
data
.
global
;
const
nx
=
x
-
this
.
pos
.
x
;
const
ny
=
y
-
this
.
pos
.
y
;
this
.
target
.
position
.
set
(
nx
,
ny
);
this
.
check
();
}
check
()
{
const
{
x
:
c1x
,
y
:
c1y
}
=
this
.
cloud1
;
const
{
x
:
c2x
,
y
:
c2y
}
=
this
.
cloud2
;
if
(
(
c1x
<
-
125
||
c1x
>
350
||
c1y
<
595
||
c1y
>
820
)
&&
(
c2x
<
-
125
||
c2x
>
350
||
c2y
<
595
||
c2y
>
820
)
)
{
this
.
setTouchEnable
(
false
);
Tween
.
get
(
this
.
ice
).
to
({
alpha
:
0
},
666
,
Ease
.
quadInOut
);
Tween
.
get
(
this
.
ice2
).
wait
(
444
).
to
({
alpha
:
1
},
666
,
Ease
.
quadInOut
);
Tween
.
get
(
this
.
right
)
.
wait
(
666
)
.
to
({
alpha
:
1
},
666
,
Ease
.
quadInOut
)
.
wait
(
2000
)
.
call
(()
=>
{
globalEvent
.
emit
(
GameEvent
.
NextLevel
);
});
}
}
onDestroy
()
{
super
.
onDestroy
();
Tween
.
removeTweens
(
this
.
ice
);
Tween
.
removeTweens
(
this
.
ice2
);
Tween
.
removeTweens
(
this
.
right
);
this
.
cloud1
.
off
(
"globalpointermove"
,
this
.
onAPointerMove
,
this
);
this
.
cloud2
.
off
(
"globalpointermove"
,
this
.
onAPointerMove
,
this
);
}
}
src/pages/GamePage/Level/Level5.ts
View file @
010b1d56
...
@@ -45,6 +45,7 @@ export class Level5 extends LevelBase {
...
@@ -45,6 +45,7 @@ export class Level5 extends LevelBase {
});
});
this
.
A
.
on
(
"pointerdown"
,
this
.
onAPointerDown
,
this
);
this
.
A
.
on
(
"pointerdown"
,
this
.
onAPointerDown
,
this
);
this
.
A
.
on
(
"pointerup"
,
this
.
onAPointerUp
,
this
);
this
.
A
.
on
(
"globalpointermove"
,
this
.
onAPointerMove
,
this
);
this
.
A
.
on
(
"globalpointermove"
,
this
.
onAPointerMove
,
this
);
}
}
...
@@ -73,6 +74,10 @@ export class Level5 extends LevelBase {
...
@@ -73,6 +74,10 @@ export class Level5 extends LevelBase {
pos
=
null
;
pos
=
null
;
onAPointerUp
(
e
)
{
this
.
pos
=
null
;
}
onAPointerDown
(
e
)
{
onAPointerDown
(
e
)
{
const
{
x
,
y
}
=
e
.
data
.
global
;
const
{
x
,
y
}
=
e
.
data
.
global
;
this
.
pos
=
{
this
.
pos
=
{
...
...
src/pages/GamePage/Level/Level7.ts
View file @
010b1d56
...
@@ -27,6 +27,7 @@ export class Level7 extends LevelBase {
...
@@ -27,6 +27,7 @@ export class Level7 extends LevelBase {
.
position
.
set
(
-
203
,
-
108
);
.
position
.
set
(
-
203
,
-
108
);
getApp
().
stage
.
on
(
"pointerdown"
,
this
.
onPointerDown
,
this
);
getApp
().
stage
.
on
(
"pointerdown"
,
this
.
onPointerDown
,
this
);
getApp
().
stage
.
on
(
"pointerup"
,
this
.
onPointerUp
,
this
);
getApp
().
stage
.
on
(
"pointermove"
,
this
.
onPointerMove
,
this
);
getApp
().
stage
.
on
(
"pointermove"
,
this
.
onPointerMove
,
this
);
}
}
...
@@ -34,6 +35,7 @@ export class Level7 extends LevelBase {
...
@@ -34,6 +35,7 @@ export class Level7 extends LevelBase {
passLevel
()
{
passLevel
()
{
this
.
setTouchEnable
(
false
);
this
.
setTouchEnable
(
false
);
getApp
().
stage
.
off
(
"pointerdown"
,
this
.
onPointerDown
,
this
);
getApp
().
stage
.
off
(
"pointerdown"
,
this
.
onPointerDown
,
this
);
getApp
().
stage
.
off
(
"pointerup"
,
this
.
onPointerUp
,
this
);
getApp
().
stage
.
off
(
"pointermove"
,
this
.
onPointerMove
,
this
);
getApp
().
stage
.
off
(
"pointermove"
,
this
.
onPointerMove
,
this
);
Tween
.
get
(
this
.
pig
)
Tween
.
get
(
this
.
pig
)
.
to
({
angle
:
-
180
,
},
222
)
.
to
({
angle
:
-
180
,
},
222
)
...
@@ -55,8 +57,14 @@ export class Level7 extends LevelBase {
...
@@ -55,8 +57,14 @@ export class Level7 extends LevelBase {
return
Math
.
atan2
(
dy
,
dx
)
*
(
180
/
Math
.
PI
);
return
Math
.
atan2
(
dy
,
dx
)
*
(
180
/
Math
.
PI
);
}
}
sAngle
=
0
;
sAngle
=
null
;
onPointerUp
(
e
)
{
this
.
sAngle
=
null
;
}
onPointerMove
=
(
e
:
any
)
=>
{
onPointerMove
=
(
e
:
any
)
=>
{
if
(
this
.
sAngle
===
null
)
return
;
const
{
x
,
y
}
=
e
.
data
.
global
;
const
{
x
,
y
}
=
e
.
data
.
global
;
const
angle
=
this
.
calcAngle
(
x
,
y
);
const
angle
=
this
.
calcAngle
(
x
,
y
);
this
.
pig
.
angle
=
angle
-
this
.
sAngle
;
this
.
pig
.
angle
=
angle
-
this
.
sAngle
;
...
@@ -68,7 +76,7 @@ export class Level7 extends LevelBase {
...
@@ -68,7 +76,7 @@ export class Level7 extends LevelBase {
onPointerDown
(
e
)
{
onPointerDown
(
e
)
{
const
{
x
:
sx
,
y
:
sy
}
=
e
.
data
.
global
;
const
{
x
:
sx
,
y
:
sy
}
=
e
.
data
.
global
;
this
.
sAngle
=
this
.
calcAngle
(
sx
,
sy
);
this
.
sAngle
=
this
.
calcAngle
(
sx
,
sy
)
-
this
.
pig
.
angle
;
}
}
onDestroy
()
{
onDestroy
()
{
...
@@ -76,6 +84,7 @@ export class Level7 extends LevelBase {
...
@@ -76,6 +84,7 @@ export class Level7 extends LevelBase {
Tween
.
removeTweens
(
this
.
pig
);
Tween
.
removeTweens
(
this
.
pig
);
Tween
.
removeTweens
(
this
.
coin
);
Tween
.
removeTweens
(
this
.
coin
);
getApp
().
stage
.
off
(
"pointerdown"
,
this
.
onPointerDown
,
this
);
getApp
().
stage
.
off
(
"pointerdown"
,
this
.
onPointerDown
,
this
);
getApp
().
stage
.
off
(
"pointerup"
,
this
.
onPointerUp
,
this
);
getApp
().
stage
.
off
(
"pointermove"
,
this
.
onPointerMove
,
this
);
getApp
().
stage
.
off
(
"pointermove"
,
this
.
onPointerMove
,
this
);
}
}
...
...
src/pages/GamePage/Level/Level9.ts
View file @
010b1d56
...
@@ -28,11 +28,16 @@ export class Level9 extends LevelBase {
...
@@ -28,11 +28,16 @@ export class Level9 extends LevelBase {
this
.
right
.
eventMode
=
"none"
;
this
.
right
.
eventMode
=
"none"
;
this
.
A
.
on
(
"pointerdown"
,
this
.
onAPointerDown
,
this
);
this
.
A
.
on
(
"pointerdown"
,
this
.
onAPointerDown
,
this
);
this
.
A
.
on
(
"pointerup"
,
this
.
onAPointerUp
,
this
);
this
.
A
.
on
(
"globalpointermove"
,
this
.
onAPointerMove
,
this
);
this
.
A
.
on
(
"globalpointermove"
,
this
.
onAPointerMove
,
this
);
}
}
pos
=
null
;
pos
=
null
;
onAPointerUp
(
e
)
{
this
.
pos
=
null
;
}
onAPointerDown
(
e
)
{
onAPointerDown
(
e
)
{
const
{
x
,
y
}
=
e
.
data
.
global
;
const
{
x
,
y
}
=
e
.
data
.
global
;
this
.
pos
=
{
this
.
pos
=
{
...
...
src/pages/GamePage/Level/LevelConfig.ts
View file @
010b1d56
...
@@ -9,6 +9,7 @@ import { Level9 } from "@/pages/GamePage/Level/Level9.ts";
...
@@ -9,6 +9,7 @@ import { Level9 } from "@/pages/GamePage/Level/Level9.ts";
import
{
Level10
}
from
"@/pages/GamePage/Level/Level10.ts"
;
import
{
Level10
}
from
"@/pages/GamePage/Level/Level10.ts"
;
import
{
Level13
}
from
"@/pages/GamePage/Level/Level13.ts"
;
import
{
Level13
}
from
"@/pages/GamePage/Level/Level13.ts"
;
import
{
Level14
}
from
"@/pages/GamePage/Level/Level14.ts"
;
import
{
Level14
}
from
"@/pages/GamePage/Level/Level14.ts"
;
import
{
Level18
}
from
"@/pages/GamePage/Level/Level18.ts"
;
import
{
Level23
}
from
"@/pages/GamePage/Level/Level23.ts"
;
import
{
Level23
}
from
"@/pages/GamePage/Level/Level23.ts"
;
...
@@ -30,7 +31,7 @@ export const LevelArr = [
...
@@ -30,7 +31,7 @@ export const LevelArr = [
{
cls
:
Level14
,
tip
:
`猫吃老鼠`
},
// 15
{
cls
:
Level14
,
tip
:
`猫吃老鼠`
},
// 15
{
cls
:
Level14
,
tip
:
`移动笼子罩住小鸭子`
},
// 16
{
cls
:
Level14
,
tip
:
`移动笼子罩住小鸭子`
},
// 16
{
cls
:
Level14
,
tip
:
`别忘了,人是高等动物哦`
},
// 17
{
cls
:
Level14
,
tip
:
`别忘了,人是高等动物哦`
},
// 17
{
cls
:
Level1
4
,
tip
:
`移开乌云露出太阳<br/>让冰块融化`
},
// 18
{
cls
:
Level1
8
,
tip
:
`移开乌云露出太阳<br/>让冰块融化`
},
// 18
{
cls
:
Level14
,
tip
:
`将冰箱放大至能够装下长颈鹿`
},
// 19
{
cls
:
Level14
,
tip
:
`将冰箱放大至能够装下长颈鹿`
},
// 19
{
cls
:
Level14
,
tip
:
`别忘了把题目也装进箱子里`
},
// 20
{
cls
:
Level14
,
tip
:
`别忘了把题目也装进箱子里`
},
// 20
{
cls
:
Level14
,
tip
:
`移动鸡蛋,碰一碰便知`
},
// 21
{
cls
:
Level14
,
tip
:
`移动鸡蛋,碰一碰便知`
},
// 21
...
...
src/utils/sensors.js
View file @
010b1d56
import
sensors
from
"sa-sdk-javascript/dist/web/sensorsdata.es6"
;
import
sensors
from
"sa-sdk-javascript/dist/web/sensorsdata.es6
.js
"
;
import
SMEncryption
from
"sa-sdk-javascript/dist/web/plugin/sm-encryption/index.es6"
;
import
SMEncryption
from
"sa-sdk-javascript/dist/web/plugin/sm-encryption/index.es6
.js
"
;
import
{
extranceName
,
platFormName
,
platformType
}
from
"./constants.ts"
;
import
{
extranceName
,
platFormName
,
platformType
}
from
"./constants.ts"
;
import
{
GetCurrSkinId
}
from
"./utils"
;
import
{
GetCurrSkinId
}
from
"./utils"
;
import
store
from
"@/store/store.ts"
;
import
store
from
"@/store/store.ts"
;
...
...
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