Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
super-miner
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
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
劳工
super-miner
Commits
ba82ba8f
Commit
ba82ba8f
authored
May 29, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into component-lib
parents
6d0063d8
81f61b87
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
90 additions
and
94 deletions
+90
-94
PKMatching.ts
assets/scripts/dialogs/PKMatching.ts
+3
-2
PKResultAnimSide.ts
assets/scripts/game/PKResultAnimSide.ts
+2
-2
PKResultSide.ts
assets/scripts/game/PKResultSide.ts
+3
-5
utils.ts
assets/scripts/game/utils.ts
+7
-0
Navigator.ts
assets/scripts/navigator/Navigator.ts
+1
-5
StackNavigator.ts
assets/scripts/navigator/StackNavigator.ts
+70
-72
VirtualNavigator.ts
assets/scripts/navigator/VirtualNavigator.ts
+1
-5
index.html
index.html
+1
-1
activityBaseInfo.json
mock/aaw/miningMachine/activityBaseInfo.json
+1
-1
pkFriends.json
mock/aaw/miningMachine/pkFriends.json
+1
-1
No files found.
assets/scripts/dialogs/PKMatching.ts
View file @
ba82ba8f
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
import
DialogContent
from
"../popup/DialogContent"
;
import
DialogContent
from
"../popup/DialogContent"
;
import
{
dynamic
,
Entity
,
resource
}
from
"scilla"
;
import
{
dynamic
,
Entity
,
resource
}
from
"scilla"
;
import
TextRenderer
from
"components/renderer/TextRenderer"
;
import
TextRenderer
from
"components/renderer/TextRenderer"
;
import
{
stringFixed
}
from
"../game/utils"
;
export
default
class
PKMatching
extends
DialogContent
{
export
default
class
PKMatching
extends
DialogContent
{
Title
:
Entity
;
Title
:
Entity
;
...
@@ -36,8 +37,8 @@ export default class PKMatching extends DialogContent {
...
@@ -36,8 +37,8 @@ export default class PKMatching extends DialogContent {
const
{
channel
}
=
data
;
const
{
channel
}
=
data
;
this
.
_titleRenderer
.
text
=
'正在匹配对手…'
;
this
.
_titleRenderer
.
text
=
'正在匹配对手…'
;
this
.
_selfNameRenderer
.
text
=
this
.
userNickname
;
this
.
_selfNameRenderer
.
text
=
stringFixed
(
this
.
userNickname
)
;
this
.
_otherNameRenderer
.
text
=
this
.
otherName
;
this
.
_otherNameRenderer
.
text
=
stringFixed
(
this
.
otherName
)
;
this
.
AvatarOther
.
enabled
=
false
;
this
.
AvatarOther
.
enabled
=
false
;
this
.
AvatarWaiting
.
enabled
=
true
;
this
.
AvatarWaiting
.
enabled
=
true
;
...
...
assets/scripts/game/PKResultAnimSide.ts
View file @
ba82ba8f
...
@@ -10,7 +10,7 @@ import Transform from "components/base/Transform";
...
@@ -10,7 +10,7 @@ import Transform from "components/base/Transform";
import
TextRenderer
from
"components/renderer/TextRenderer"
;
import
TextRenderer
from
"components/renderer/TextRenderer"
;
import
TimesCard
from
"./TimesCard"
;
import
TimesCard
from
"./TimesCard"
;
import
RunNumber
from
"../common/RunNumber"
;
import
RunNumber
from
"../common/RunNumber"
;
import
{
renderRunCredits
}
from
"./utils"
;
import
{
renderRunCredits
,
stringFixed
}
from
"./utils"
;
export
default
class
PKResultAnimSide
extends
ScillaComponent
{
export
default
class
PKResultAnimSide
extends
ScillaComponent
{
LabelName
:
Entity
;
LabelName
:
Entity
;
...
@@ -46,7 +46,7 @@ export default class PKResultAnimSide extends ScillaComponent {
...
@@ -46,7 +46,7 @@ export default class PKResultAnimSide extends ScillaComponent {
const
{
nickname
,
receiveCredits
,
finalCredits
,
multipleCard
}
=
data
;
const
{
nickname
,
receiveCredits
,
finalCredits
,
multipleCard
}
=
data
;
const
showTimesCard
=
multipleCard
>
0
;
const
showTimesCard
=
multipleCard
>
0
;
this
.
_labelName
.
text
=
nickname
;
this
.
_labelName
.
text
=
stringFixed
(
nickname
)
;
this
.
_labelCredits
.
text
=
''
;
this
.
_labelCredits
.
text
=
''
;
this
.
TimesCard
.
enabled
=
false
;
this
.
TimesCard
.
enabled
=
false
;
...
...
assets/scripts/game/PKResultSide.ts
View file @
ba82ba8f
...
@@ -4,14 +4,12 @@
...
@@ -4,14 +4,12 @@
* pk结果一侧
* pk结果一侧
*/
*/
import
{
Entity
,
resource
}
from
"scilla"
;
import
ScillaComponent
from
"components/base/ScillaComponent"
;
import
ScillaComponent
from
"components/base/ScillaComponent"
;
import
{
createTween
,
ease
,
engine
,
Entity
,
Tween
}
from
"scilla"
;
import
{
createTween
,
ease
,
engine
,
Entity
,
resource
}
from
"scilla"
;
import
Transform
from
"components/base/Transform"
;
import
Transform
from
"components/base/Transform"
;
import
TextRenderer
from
"components/renderer/TextRenderer"
;
import
TextRenderer
from
"components/renderer/TextRenderer"
;
import
RunNumber
from
"../common/RunNumber"
;
import
RunNumber
from
"../common/RunNumber"
;
import
{
renderRunCredits
}
from
"./utils"
;
import
{
renderRunCredits
,
stringFixed
}
from
"./utils"
;
import
Zoom
from
"components/animation/Zoom"
;
import
Zoom
from
"components/animation/Zoom"
;
import
TextureRenderer
from
"components/renderer/TextureRenderer"
;
import
TextureRenderer
from
"components/renderer/TextureRenderer"
;
...
@@ -63,7 +61,7 @@ export default class PKResultSide extends ScillaComponent {
...
@@ -63,7 +61,7 @@ export default class PKResultSide extends ScillaComponent {
async
play
(
data
)
{
async
play
(
data
)
{
const
{
nickname
,
finalCredits
,
otherFinalCredits
,
resultState
}
=
data
;
const
{
nickname
,
finalCredits
,
otherFinalCredits
,
resultState
}
=
data
;
this
.
_labelName
.
text
=
nickname
;
this
.
_labelName
.
text
=
stringFixed
(
nickname
)
;
this
.
_labelCredits
.
text
=
renderRunCredits
(
finalCredits
);
this
.
_labelCredits
.
text
=
renderRunCredits
(
finalCredits
);
const
win
=
resultState
===
this
.
side
;
const
win
=
resultState
===
this
.
side
;
...
...
assets/scripts/game/utils.ts
View file @
ba82ba8f
...
@@ -26,3 +26,10 @@ export function isWeiXin() {
...
@@ -26,3 +26,10 @@ export function isWeiXin() {
const
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
();
const
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
();
return
ua
.
includes
(
'micromessenger'
);
return
ua
.
includes
(
'micromessenger'
);
}
}
export
function
stringFixed
(
str
,
limit
=
6
,
mask
=
'…'
){
if
(
str
.
length
>
limit
){
return
str
.
substr
(
0
,
limit
)
+
mask
;
}
return
str
;
}
assets/scripts/navigator/Navigator.ts
View file @
ba82ba8f
...
@@ -5,11 +5,7 @@
...
@@ -5,11 +5,7 @@
*/
*/
import
{
EventEmitter
}
from
'scilla'
import
{
EventEmitter
}
from
'scilla'
import
{
INavigatorDelegate
,
NavigatorAction
,
StackNavigator
}
from
"./StackNavigator"
;
import
{
alien
}
from
"./StackNavigator"
;
import
NavigatorAction
=
alien
.
NavigatorAction
;
import
INavigatorDelegate
=
alien
.
INavigatorDelegate
;
import
StackNavigator
=
alien
.
StackNavigator
;
export
interface
INavigatorViewBase
{
export
interface
INavigatorViewBase
{
onAddView
():
boolean
;
onAddView
():
boolean
;
...
...
assets/scripts/navigator/StackNavigator.ts
View file @
ba82ba8f
...
@@ -4,98 +4,96 @@
...
@@ -4,98 +4,96 @@
* 堆栈导航器
* 堆栈导航器
*/
*/
export
module
alien
{
export
enum
NavigatorAction
{
Push
,
Pop
,
Replace
,
Jump
}
export
enum
NavigatorAction
{
Push
,
Pop
,
Replace
,
Jump
}
export
interface
INavigatorDelegate
{
export
interface
INavigatorDelegate
{
onEnter
(
name
:
string
,
last
:
string
,
action
:
NavigatorAction
,
parameters
:
any
);
onEnter
(
name
:
string
,
last
:
string
,
action
:
NavigatorAction
,
parameters
:
any
);
onLeave
(
name
:
string
,
next
:
string
,
action
:
NavigatorAction
,
parameters
:
any
);
onLeave
(
name
:
string
,
next
:
string
,
action
:
NavigatorAction
,
parameters
:
any
);
onError
(
error
:
Error
);
onError
(
error
:
Error
);
}
}
export
class
StackNavigator
{
private
_stack
:
string
[];
private
_delegate
:
INavigatorDelegate
;
constructor
(
delegate
:
INavigatorDelegate
)
{
export
class
StackNavigator
{
this
.
_stack
=
[];
private
_stack
:
string
[];
this
.
_delegate
=
delegate
;
private
_delegate
:
INavigatorDelegate
;
}
private
catchPromise
(
p
:
Promise
<
any
>
)
{
constructor
(
delegate
:
INavigatorDelegate
)
{
if
(
p
)
{
this
.
_stack
=
[];
p
.
catch
((
e
=>
{
this
.
_delegate
=
delegate
;
this
.
_delegate
.
onError
(
e
);
}
}))
}
}
push
(
name
:
string
,
parameters
:
any
=
null
)
{
private
catchPromise
(
p
:
Promise
<
any
>
)
{
let
last
:
string
=
this
.
getTopSceneName
();
if
(
p
)
{
if
(
last
)
{
p
.
catch
((
e
=>
{
if
(
last
==
name
)
{
this
.
_delegate
.
onError
(
e
);
return
;
}))
}
this
.
catchPromise
(
this
.
_delegate
.
onLeave
(
last
,
name
,
NavigatorAction
.
Push
,
parameters
));
}
this
.
_stack
.
push
(
name
);
this
.
catchPromise
(
this
.
_delegate
.
onEnter
(
name
,
last
,
NavigatorAction
.
Push
,
parameters
));
}
}
}
popTo
(
index
,
name
?:
string
,
parameters
:
any
=
null
)
{
push
(
name
:
string
,
parameters
:
any
=
null
)
{
if
(
this
.
_stack
.
length
>
0
&&
this
.
_stack
.
length
<
(
index
+
1
))
{
let
last
:
string
=
this
.
getTopSceneName
();
if
(
last
)
{
if
(
last
==
name
)
{
return
;
return
;
}
}
this
.
catchPromise
(
this
.
_delegate
.
onLeave
(
last
,
name
,
NavigatorAction
.
Push
,
parameters
));
let
last
:
string
=
this
.
getTopSceneName
();
this
.
_stack
.
splice
(
Math
.
max
(
index
+
1
,
0
));
let
next
:
string
=
this
.
_stack
[
index
];
if
(
!
next
)
{
this
.
_stack
.
push
(
next
=
name
);
}
if
(
last
)
{
this
.
catchPromise
(
this
.
_delegate
.
onLeave
(
last
,
next
,
NavigatorAction
.
Pop
,
parameters
));
}
this
.
catchPromise
(
this
.
_delegate
.
onEnter
(
next
,
last
,
NavigatorAction
.
Pop
,
parameters
));
}
}
this
.
_stack
.
push
(
name
);
this
.
catchPromise
(
this
.
_delegate
.
onEnter
(
name
,
last
,
NavigatorAction
.
Push
,
parameters
));
}
pop
(
parameters
:
any
=
null
)
{
popTo
(
index
,
name
?:
string
,
parameters
:
any
=
null
)
{
this
.
popTo
(
this
.
_stack
.
length
-
2
,
null
,
parameters
);
if
(
this
.
_stack
.
length
>
0
&&
this
.
_stack
.
length
<
(
index
+
1
))
{
return
;
}
}
popAll
(
name
:
string
,
parameters
:
any
=
null
)
{
let
last
:
string
=
this
.
getTopSceneName
();
this
.
popTo
(
-
1
,
name
,
parameters
);
this
.
_stack
.
splice
(
Math
.
max
(
index
+
1
,
0
));
let
next
:
string
=
this
.
_stack
[
index
];
if
(
!
next
)
{
this
.
_stack
.
push
(
next
=
name
);
}
if
(
last
)
{
this
.
catchPromise
(
this
.
_delegate
.
onLeave
(
last
,
next
,
NavigatorAction
.
Pop
,
parameters
));
}
}
this
.
catchPromise
(
this
.
_delegate
.
onEnter
(
next
,
last
,
NavigatorAction
.
Pop
,
parameters
));
}
replace
(
name
:
string
,
parameters
:
any
=
null
)
{
pop
(
parameters
:
any
=
null
)
{
let
last
:
string
=
this
.
_stack
.
pop
(
);
this
.
popTo
(
this
.
_stack
.
length
-
2
,
null
,
parameters
);
this
.
_stack
.
push
(
name
);
}
this
.
catchPromise
(
this
.
_delegate
.
onLeave
(
last
,
name
,
NavigatorAction
.
Replace
,
parameters
));
popAll
(
name
:
string
,
parameters
:
any
=
null
)
{
this
.
catchPromise
(
this
.
_delegate
.
onEnter
(
name
,
last
,
NavigatorAction
.
Replace
,
parameters
)
);
this
.
popTo
(
-
1
,
name
,
parameters
);
}
}
jump
(
name
:
string
,
parameters
:
any
=
null
){
replace
(
name
:
string
,
parameters
:
any
=
null
)
{
if
(
this
.
_stack
.
length
<
2
){
let
last
:
string
=
this
.
_stack
.
pop
();
this
.
push
(
name
,
parameters
);
this
.
_stack
.
push
(
name
);
return
;
}
let
last
:
string
=
this
.
_stack
.
pop
();
this
.
_stack
.
splice
(
1
);
let
next
:
string
=
name
;
this
.
_stack
.
push
(
next
);
this
.
_delegate
.
onLeave
(
last
,
next
,
NavigatorAction
.
Pop
,
parameters
);
this
.
_delegate
.
onEnter
(
next
,
last
,
NavigatorAction
.
Pop
,
parameters
);
}
private
getTopSceneName
():
string
{
this
.
catchPromise
(
this
.
_delegate
.
onLeave
(
last
,
name
,
NavigatorAction
.
Replace
,
parameters
));
return
this
.
_stack
.
length
>
0
?
this
.
_stack
[
this
.
_stack
.
length
-
1
]
:
null
;
this
.
catchPromise
(
this
.
_delegate
.
onEnter
(
name
,
last
,
NavigatorAction
.
Replace
,
parameters
))
;
}
}
private
getBottomSceneName
():
string
{
jump
(
name
:
string
,
parameters
:
any
=
null
)
{
return
this
.
_stack
.
length
>
0
?
this
.
_stack
[
0
]
:
null
;
if
(
this
.
_stack
.
length
<
2
)
{
this
.
push
(
name
,
parameters
);
return
;
}
}
let
last
:
string
=
this
.
_stack
.
pop
();
this
.
_stack
.
splice
(
1
);
let
next
:
string
=
name
;
this
.
_stack
.
push
(
next
);
this
.
_delegate
.
onLeave
(
last
,
next
,
NavigatorAction
.
Pop
,
parameters
);
this
.
_delegate
.
onEnter
(
next
,
last
,
NavigatorAction
.
Pop
,
parameters
);
}
private
getTopSceneName
():
string
{
return
this
.
_stack
.
length
>
0
?
this
.
_stack
[
this
.
_stack
.
length
-
1
]
:
null
;
}
private
getBottomSceneName
():
string
{
return
this
.
_stack
.
length
>
0
?
this
.
_stack
[
0
]
:
null
;
}
}
}
}
assets/scripts/navigator/VirtualNavigator.ts
View file @
ba82ba8f
...
@@ -5,11 +5,7 @@
...
@@ -5,11 +5,7 @@
*/
*/
import
{
Entity
,
EventEmitter
}
from
'scilla'
import
{
Entity
,
EventEmitter
}
from
'scilla'
import
{
INavigatorDelegate
,
NavigatorAction
,
StackNavigator
}
from
"./StackNavigator"
;
import
{
alien
}
from
"./StackNavigator"
;
import
NavigatorAction
=
alien
.
NavigatorAction
;
import
INavigatorDelegate
=
alien
.
INavigatorDelegate
;
import
StackNavigator
=
alien
.
StackNavigator
;
const
showLog
=
false
;
const
showLog
=
false
;
...
...
index.html
View file @
ba82ba8f
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
logined
:
true
,
//是否登录 true是为登录
logined
:
true
,
//是否登录 true是为登录
earnCreditsUrl
:
'http://www.baidu.com'
,
//加积分接口
earnCreditsUrl
:
'http://www.baidu.com'
,
//加积分接口
unitName
:
'贝壳'
,
//积分单位
unitName
:
'贝壳'
,
//积分单位
userNickname
:
'超级登山包'
,
//用户昵称
userNickname
:
'超级登山包
超级登山包超级登山包
'
,
//用户昵称
showCredits
:
1
,
//是否展示积分 1:展示 2:不展示
showCredits
:
1
,
//是否展示积分 1:展示 2:不展示
activityCode
:
''
,
//活动代码
activityCode
:
''
,
//活动代码
configJson
:
'{"background":"//yun.duiba.com.cn/h5/miningMachine/home-bg.jpg","pk_button_normal":"//yun.duiba.com.cn/h5/miningMachine/pk-btn.png","pk_button_disabled":"//yun.duiba.com.cn/h5/miningMachine/pk-filter-btn.png","dig_button_normal":"//yun.duiba.com.cn/h5/miningMachine/mining-btn.png","dig_button_disabled":"//yun.dui88.com/h5/miningMachine/mining-filter-btn.png","dialog_background":"//yun.duiba.com.cn/h5/miningMachine/modal-bg.png","dialog_button":"//yun.duiba.com.cn/h5/miningMachine/modal-btn.png","pk_button_label_normal":"#FFF591","pk_button_label_disabled":"#666666","dig_button_label_normal":"#D12C00","dig_button_label_disabled":"#666666","dialog_text_color":"#AB5400","dialog_button_label":"#FFF591"}'
configJson
:
'{"background":"//yun.duiba.com.cn/h5/miningMachine/home-bg.jpg","pk_button_normal":"//yun.duiba.com.cn/h5/miningMachine/pk-btn.png","pk_button_disabled":"//yun.duiba.com.cn/h5/miningMachine/pk-filter-btn.png","dig_button_normal":"//yun.duiba.com.cn/h5/miningMachine/mining-btn.png","dig_button_disabled":"//yun.dui88.com/h5/miningMachine/mining-filter-btn.png","dialog_background":"//yun.duiba.com.cn/h5/miningMachine/modal-bg.png","dialog_button":"//yun.duiba.com.cn/h5/miningMachine/modal-btn.png","pk_button_label_normal":"#FFF591","pk_button_label_disabled":"#666666","dig_button_label_normal":"#D12C00","dig_button_label_disabled":"#666666","dialog_text_color":"#AB5400","dialog_button_label":"#FFF591"}'
...
...
mock/aaw/miningMachine/activityBaseInfo.json
View file @
ba82ba8f
...
@@ -8,6 +8,6 @@
...
@@ -8,6 +8,6 @@
"heapCredits"
:
400
,
"heapCredits"
:
400
,
"miningExpend"
:
100
,
"miningExpend"
:
100
,
"pkExpend"
:
100
,
"pkExpend"
:
100
,
"machineNickname
1"
:
"机器人昵称
"
"machineNickname
"
:
"超级登山包超级登山包超级登山包
"
}
}
}
}
\ No newline at end of file
mock/aaw/miningMachine/pkFriends.json
View file @
ba82ba8f
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
"machineReceiveCredits"
:
50
,
"machineReceiveCredits"
:
50
,
"machineMultipleCard"
:
2
,
"machineMultipleCard"
:
2
,
"machineFinalCredits"
:
100
,
"machineFinalCredits"
:
100
,
"machineNickname"
:
"simba"
,
"machineNickname"
:
"simba
simbasimbasimbasimba
"
,
"machineAvatar"
:
"Avengers"
,
"machineAvatar"
:
"Avengers"
,
"operationType"
:
1
"operationType"
:
1
}
}
...
...
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