Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
babycare_xiaoxiao
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
翁阳
babycare_xiaoxiao
Commits
ec48955f
Commit
ec48955f
authored
Oct 05, 2020
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
task
parent
d8be2daf
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
383 additions
and
10497 deletions
+383
-10497
workspace.xml
.idea/workspace.xml
+50
-40
aaa.html
aaa.html
+201
-0
popmartXXL2c.receiveTaskRewards.json
mock/miniTb/popmartXXL2c.receiveTaskRewards.json
+1
-1
待领取.png
resource/TaskPanel/待领取.png
+0
-0
res.json
resource/res.json
+1
-1
ResJson.ts
src/ResJson.ts
+28
-10442
TaskPanel.ts
src/panels/TaskPanel.ts
+96
-7
PlayScene.ts
src/scene/PlayScene.ts
+6
-6
No files found.
.idea/workspace.xml
View file @
ec48955f
This diff is collapsed.
Click to expand it.
aaa.html
0 → 100644
View file @
ec48955f
<!DOCTYPE html>
<html
lang=
"zh"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
Chess
</title>
<meta
name=
"author"
content=
"还有醋v"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"
/>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
/>
<meta
name=
"full-screen"
content=
"true"
/>
<meta
name=
"screen-orientation"
content=
"portrait"
/>
<meta
name=
"x5-fullscreen"
content=
"true"
/>
<meta
name=
"360-fullscreen"
content=
"true"
/>
<style>
*
{
margin
:
0
;
padding
:
0
;
}
body
{
background-color
:
#333
;
}
#container
{
text-align
:
center
;
position
:
absolute
;
top
:
50%
;
transform
:
translateY
(
-50%
);
left
:
0
;
right
:
0
;
margin
:
auto
;
}
.lattice
{
vertical-align
:
bottom
;
width
:
50px
;
height
:
50px
;
background-color
:
darkgreen
;
display
:
inline-block
;
border
:
1px
solid
whitesmoke
;
}
.disc
{
width
:
40px
;
height
:
40px
;
border-radius
:
20px
;
margin-top
:
5px
;
margin-left
:
5px
;
/*animation: scale 0.25s 1 ease-in-out;*/
}
@keyframes
scale
{
0
%
{
transform
:
scale
(
0
);
}
100
%
{
transform
:
scale
(
1
);
}
}
/*.disc-black {*/
/* background-color: black;*/
/*}*/
.disc-black
:after
{
content
:
''
;
display
:
block
;
width
:
40px
;
height
:
40px
;
margin-top
:
5px
;
margin-left
:
5px
;
background-color
:
black
;
border-radius
:
20px
;
}
.disc-white
:after
{
content
:
''
;
display
:
block
;
width
:
40px
;
height
:
40px
;
margin-top
:
5px
;
margin-left
:
5px
;
background-color
:
whitesmoke
;
border-radius
:
20px
;
}
</style>
</head>
<body>
<div
id=
"root"
></div>
<script>
let
board
=
[];
const
root
=
document
.
getElementById
(
'root'
);
let
color
=
1
;
// 1 黑 2 白
const
MAX_ROW
=
8
;
const
MAX_COL
=
8
;
function
initBoard
()
{
board
=
[
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
[
0
,
0
,
0
,
1
,
2
,
0
,
0
,
0
],
[
0
,
0
,
0
,
2
,
1
,
0
,
0
,
0
],
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
];
root
.
innerHTML
=
''
;
const
container
=
document
.
createElement
(
'div'
);
container
.
id
=
'container'
;
for
(
let
row
=
0
;
row
<
board
.
length
;
row
++
)
{
const
boardRow
=
board
[
row
];
for
(
let
col
=
0
;
col
<
boardRow
.
length
;
col
++
)
{
const
value
=
boardRow
[
col
];
const
lattice
=
document
.
createElement
(
'div'
);
lattice
.
row
=
row
;
lattice
.
col
=
col
;
lattice
.
classList
.
add
(
'lattice'
);
container
.
appendChild
(
lattice
);
if
(
value
===
1
||
value
===
2
)
{
lattice
.
classList
.
add
(
value
===
1
?
'disc-black'
:
'disc-white'
);
}
}
container
.
appendChild
(
document
.
createElement
(
'br'
));
}
root
.
appendChild
(
container
);
}
initBoard
();
root
.
addEventListener
(
'click'
,
(
e
)
=>
{
const
target
=
e
.
target
;
const
{
row
:
or
,
col
:
oc
}
=
target
;
let
{
row
,
col
}
=
target
;
let
canDrop
=
false
;
if
(
board
[
or
][
oc
]
!==
0
)
{
// 不可落子
console
.
warn
(
'有子了'
);
}
else
{
// 可落子
let
canRemove
=
false
;
while
(
--
row
>=
0
)
{
// 向上
if
(
board
[
row
][
col
]
===
color
)
{
// 同色
canDrop
=
false
;
canRemove
=
false
;
console
.
log
(
'相邻同色子'
)
}
else
if
(
board
[
row
][
col
]
===
3
-
color
)
{
// 不同色
}
}
}
});
// function render() {
// root.innerHTML = '';
// const container = document.createElement('div');
// container.id = 'container';
//
// for (let row = 0; row
<
board
.
length
;
row
++
)
{
// const boardRow = board[row];
// for (let col = 0; col
<
boardRow
.
length
;
col
++
)
{
// const value = boardRow[col];
// const lattice = document.createElement('div');
// lattice.classList.add('lattice');
// container.appendChild(lattice);
// if (value === 1 || value === 2) {
// lattice.classList.add(value === 1 ? 'disc-black' : 'disc-white');
// }
// }
// container.appendChild(document.createElement('br'));
// }
//
// container.addEventListener('click', (e) => {
// console.log(e);
//
//
// // lattice.addEventListener('click', (e) => {
// // console.log(row, col);
// // board[row][col] = color;
// // color = 3 - color;
// // render();
// // });
//
// });
//
// root.appendChild(container);
// }
</script>
</body>
</html>
mock/miniTb/popmartXXL2c.receiveTaskRewards.json
View file @
ec48955f
{
"success"
:
fals
e
,
"success"
:
tru
e
,
"code"
:
"ipsum in"
,
"message"
:
"nulla dolor est eiusmod sunt"
,
"data"
:
{
...
...
resource/TaskPanel/待领取.png
deleted
100644 → 0
View file @
d8be2daf
7.62 KB
resource/res.json
View file @
ec48955f
...
...
@@ -37,7 +37,7 @@
"name"
:
"SuccessPanel"
},
{
"keys"
:
"browserGoods_btn_dis.png,browserGoods_btn_en.png,browserGoods_icon.png,follow_btn_dis.png,follow_btn_en.png,follow_icon.png,invites_btn_dis.png,invites_btn_en.png,invites_icon.png,member_btn_dis.png,member_btn_en.png,member_icon.png,orderGoods_btn_dis.png,orderGoods_btn_en.png,orderGoods_icon.png,task_get_btn.png,task_item_bg.png,任务背景.png,去完成.png,去完成灰.png
,待领取.png
"
,
"keys"
:
"browserGoods_btn_dis.png,browserGoods_btn_en.png,browserGoods_icon.png,follow_btn_dis.png,follow_btn_en.png,follow_icon.png,invites_btn_dis.png,invites_btn_en.png,invites_icon.png,member_btn_dis.png,member_btn_en.png,member_icon.png,orderGoods_btn_dis.png,orderGoods_btn_en.png,orderGoods_icon.png,task_get_btn.png,task_item_bg.png,任务背景.png,去完成.png,去完成灰.png"
,
"name"
:
"TaskPanel"
},
{
...
...
src/ResJson.ts
View file @
ec48955f
This diff is collapsed.
Click to expand it.
src/panels/TaskPanel.ts
View file @
ec48955f
...
...
@@ -6,7 +6,7 @@ import Ease = FYGE.Ease;
import
Button
=
FYGE
.
Button
;
import
{
GDispatcher
}
from
"../Main"
;
import
{
G_EVENT
}
from
"../common/G_EVENT"
;
import
{
showWaiting
,
hideWaiting
}
from
"../../module/ctrls"
;
import
{
showWaiting
,
hideWaiting
,
showToast
}
from
"../../module/ctrls"
;
import
Container
=
FYGE
.
Container
;
import
{
Item
}
from
"../../module/views/Item"
;
import
{
Tools
}
from
"../Tools"
;
...
...
@@ -14,6 +14,7 @@ import ScrollList = FYGE.ScrollList;
import
Sprite
=
FYGE
.
Sprite
;
import
TextField
=
FYGE
.
TextField
;
import
{
RES
}
from
"../../module/RES"
;
import
MouseEvent
=
FYGE
.
MouseEvent
;
// 任务类型(invites 、member、follow、browserGoods、orderGoods)
export
enum
TaskType
{
...
...
@@ -149,6 +150,11 @@ class TaskItem extends Item {
private
title
:
TextField
;
private
desc
:
TextField
;
private
getBtn
:
Button
;
private
taskBtn
:
Button
;
data
:
any
;
constructor
()
{
super
();
}
...
...
@@ -170,17 +176,100 @@ class TaskItem extends Item {
this
.
desc
.
bold
=
true
;
this
.
desc
.
position
.
set
(
145
,
92
);
this
.
getBtn
=
this
.
addChild
(
new
Button
(
RES
.
getRes
(
'task_get_btn.png'
)));
this
.
taskBtn
=
this
.
addChild
(
new
Button
(
RES
.
getRes
(
`去完成.png`
),
RES
.
getRes
(
`去完成.png`
),
RES
.
getRes
(
`去完成灰.png`
)
));
this
.
getBtn
.
position
.
set
(
501
,
43
);
this
.
taskBtn
.
position
.
set
(
501
,
43
);
this
.
getBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
clickGet
,
this
);
this
.
taskBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
clickTask
,
this
);
}
public
initData
(
id
:
number
,
data
:
any
)
{
if
(
id
<
0
||
!
data
)
return
;
this
.
icon
.
texture
=
RES
.
getRes
(
`
${
data
.
taskType
}
_icon.png`
);
this
.
title
.
text
=
taskItemData
[
data
.
taskType
].
title
.
replace
(
'${done}'
,
data
.
todayCompleteTimes
)
.
replace
(
'${total}'
,
data
.
totalTimes
);
this
.
desc
.
text
=
taskItemData
[
data
.
taskType
].
desc
.
replace
(
'${rewards}'
,
data
.
rewards
);
this
.
data
=
data
;
const
{
rewards
,
taskType
,
totalTimes
,
waitReceiveTimes
,
todayCompleteTimes
,
}
=
data
;
this
.
icon
.
texture
=
RES
.
getRes
(
`
${
taskType
}
_icon.png`
);
this
.
title
.
text
=
taskItemData
[
taskType
].
title
.
replace
(
'${done}'
,
todayCompleteTimes
)
.
replace
(
'${total}'
,
totalTimes
);
this
.
desc
.
text
=
taskItemData
[
taskType
].
desc
.
replace
(
'${rewards}'
,
rewards
);
this
.
taskBtn
.
changeTexture
(
RES
.
getRes
(
`
${
taskType
}
_btn_en.png`
),
RES
.
getRes
(
`
${
taskType
}
_btn_en.png`
),
RES
.
getRes
(
`
${
taskType
}
_btn_dis.png`
)
);
if
(
+
waitReceiveTimes
>
0
)
{
this
.
getBtn
.
visible
=
true
;
this
.
taskBtn
.
visible
=
false
;
}
else
if
(
+
todayCompleteTimes
>=
+
totalTimes
)
{
this
.
getBtn
.
visible
=
false
;
this
.
taskBtn
.
visible
=
true
;
this
.
taskBtn
.
enabled
=
false
;
}
else
{
this
.
getBtn
.
visible
=
false
;
this
.
taskBtn
.
visible
=
true
;
this
.
taskBtn
.
enabled
=
true
;
}
}
private
clickGet
()
{
this
.
getBtn
.
mouseEnable
=
false
;
sendTbNet
(
TbNetName
.
receiveTaskRewards
,
{
taskType
:
this
.
data
.
taskType
},
(
success
,
res
)
=>
{
this
.
getBtn
.
mouseEnable
=
true
;
if
(
!
success
)
return
;
showToast
(
`任务完成,体力值+
${
res
.
data
.
power
}
!`
);
}
);
}
private
clickTask
()
{
switch
(
this
.
data
.
taskType
)
{
case
TaskType
.
member
:
sendTbNet
(
TbNetName
.
navigateToOutside
,
{
url
:
this
.
data
.
beMemberUrl
});
break
;
case
TaskType
.
browserGoods
:
/// TODO 去浏览页
console
.
log
(
'去浏览页'
);
break
;
case
TaskType
.
follow
:
sendTbNet
(
TbNetName
.
favorShop
,
{},
(
success
,
res
)
=>
{
if
(
!
success
)
return
;
sendTbNet
(
TbNetName
.
completeTask
,
{
taskType
:
this
.
data
.
taskType
},
(
success1
,
res1
)
=>
GDispatcher
.
dispatchEvent
(
G_EVENT
.
UPDATE_TASK
)
);
}
);
break
;
case
TaskType
.
invites
:
sendTbNet
(
TbNetName
.
showSharePanel
);
break
;
case
TaskType
.
orderGoods
:
/// TODO 去下单页
console
.
log
(
'去下单页'
);
break
;
}
}
}
src/scene/PlayScene.ts
View file @
ec48955f
...
...
@@ -2688,13 +2688,13 @@ export class PlayScene extends Scene {
ani
.
x
=
p
[
0
];
ani
.
y
=
p
[
1
];
ani
.
play
();
if
(
name
==
RecoverName
.
MAGICLION_ANI
)
{
//
具体索引还要改
//
console.log()
this
.
addChildAt
(
ani
,
this
.
getChildIndex
(
this
.
map
)
+
1
);
}
else
{
//
if (name == RecoverName.MAGICLION_ANI) {
//
具体索引还要改
//
console.log()
//
this.addChildAt(ani, this.getChildIndex(this.map) + 1);
//
} else {
this
.
addChild
(
ani
);
}
//
}
return
ani
}
...
...
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