Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
new_taobao
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
wildfirecode13
new_taobao
Commits
7d3a7955
Commit
7d3a7955
authored
Dec 09, 2020
by
Edwise
🍷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
领取精力与刷新三文鱼自测第一版,修正刷新三文鱼显示不对的问题
parent
9047e0a9
Changes
15
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
294 additions
and
88 deletions
+294
-88
tmallCat.getUserInfo.json
...ect/src/canvas/game/mock/miniTb/tmallCat.getUserInfo.json
+4
-2
output.js
project/src/canvas/game/output.js
+68
-16
output.js.map
project/src/canvas/game/output.js.map
+1
-1
output.js
project/src/canvas/game/released/output.js
+68
-16
resCanvasList.js
project/src/canvas/game/resCanvasList.js
+3
-3
Ins.ts
project/src/canvas/game/src/Ins.ts
+31
-2
Main.ts
project/src/canvas/game/src/Main.ts
+1
-0
Salmon.ts
project/src/canvas/game/src/cat/Salmon.ts
+2
-1
MainScene.ts
project/src/canvas/game/src/scenes/MainScene.ts
+23
-13
StartScene.ts
project/src/canvas/game/src/scenes/StartScene.ts
+2
-2
app.js
taobao_mini/client/app.js
+4
-4
prizeModal.acss
taobao_mini/client/components/prizeModal/prizeModal.acss
+2
-2
output.js
taobao_mini/client/pages/pagecanvas/output.js
+68
-16
pagecanvas.js
taobao_mini/client/pages/pagecanvas/pagecanvas.js
+6
-6
pageshop.acss
taobao_mini/client/pages/pageshop/pageshop.acss
+11
-4
No files found.
project/src/canvas/game/mock/miniTb/tmallCat.getUserInfo.json
View file @
7d3a7955
...
...
@@ -14,6 +14,8 @@
"senceTips"
:[
"1说话说话说话说话说话说话说话说话说话说话说话"
,
"2说话说话说话说话说话说话说话说话说话说话说话说话"
,
"3说话说话说话说话说话说话说话说话说话说话说话说话"
],
"energyMax"
:
50
,
"experienceMax"
:
1000
,
"senceGuide"
:
true
"senceGuide"
:
true
,
"updateTime"
:
1607507495319
,
"lastEnergyTime"
:
1607507395319
}
}
project/src/canvas/game/output.js
View file @
7d3a7955
This diff is collapsed.
Click to expand it.
project/src/canvas/game/output.js.map
View file @
7d3a7955
This diff is collapsed.
Click to expand it.
project/src/canvas/game/released/output.js
View file @
7d3a7955
This diff is collapsed.
Click to expand it.
project/src/canvas/game/resCanvasList.js
View file @
7d3a7955
...
...
@@ -903,19 +903,19 @@ const resCanvasList = {
'69435791-11ee-4c7f-9036-c4c3e28e1750'
:
{
name
:
'经验条背景'
,
ext
:
'.png'
,
url
:
'//yun.duiba.com.cn/spark/assets/37804e762d5d95f33fbc8aaf74e15a7f80914696.png'
,
url
:
'
https:
//yun.duiba.com.cn/spark/assets/37804e762d5d95f33fbc8aaf74e15a7f80914696.png'
,
uuid
:
'69435791-11ee-4c7f-9036-c4c3e28e1750'
},
'6ecc2b1c-52bf-471a-b03e-3f3f5f9fc572'
:
{
name
:
'经验条图片'
,
ext
:
'.png'
,
url
:
'//yun.duiba.com.cn/spark/assets/b6ec2760d1cefdff179e9b9cfdaa6d7505b69102.png'
,
url
:
'
https:
//yun.duiba.com.cn/spark/assets/b6ec2760d1cefdff179e9b9cfdaa6d7505b69102.png'
,
uuid
:
'6ecc2b1c-52bf-471a-b03e-3f3f5f9fc572'
},
'5cc07d1e-00f8-4178-8112-44fda9c15481'
:
{
name
:
'bedroomguide3final'
,
ext
:
'.png'
,
url
:
'//yun.duiba.com.cn/spark/assets/e468a8228ec70023b4f395ac880e840ce8875250.png'
,
url
:
'
https:
//yun.duiba.com.cn/spark/assets/e468a8228ec70023b4f395ac880e840ce8875250.png'
,
uuid
:
'5cc07d1e-00f8-4178-8112-44fda9c15481'
}
};
...
...
project/src/canvas/game/src/Ins.ts
View file @
7d3a7955
...
...
@@ -11,6 +11,7 @@ export class Ins {
/**舞台宽高 */
public
static
stageW
:
number
;
public
static
stageH
:
number
;
public
static
stage
:
FYGE
.
Stage
;
/**猫咪是否出寝了 */
public
static
catIsOut
:
boolean
;
...
...
@@ -40,8 +41,8 @@ export class Ins {
"energyMax"
:
number
,
"experienceMax"
:
number
,
"senceGuide"
:
boolean
,
"lastEnergyTime"
:
number
"lastEnergyTime"
:
number
,
"updateTime"
:
number
}
public
static
senceInfo
:
{
...
...
@@ -72,11 +73,17 @@ export class Ins {
public
static
showLoading
(){
console
.
log
(
"canvas请求加载loading"
)
GDispatcher
.
dispatchEvent
({
type
:
"loading"
});
if
(
this
.
stage
){
this
.
stage
.
mouseEnable
=
this
.
stage
.
mouseChildren
=
false
;
}
}
public
static
hideLoading
(){
console
.
log
(
"canvas请求隐藏loading"
)
GDispatcher
.
dispatchEvent
({
type
:
"hideloading"
});
if
(
this
.
stage
){
this
.
stage
.
mouseEnable
=
this
.
stage
.
mouseChildren
=
true
;
}
}
/**删除一个lottie的所有tween,停止动效 */
...
...
@@ -141,4 +148,26 @@ export class Ins {
// (1-t)^2 P0 + 2(1-t)tP1+ t^2P2
return
Math
.
pow
(
1
-
t
,
2
)
*
p0
+
2
*
(
1
-
t
)
*
t
*
p1
+
Math
.
pow
(
t
,
2
)
*
p2
;
}
//计算两个时间之间的时间差 多少天时分秒
public
static
intervalTime
(
time
)
{
var
date3
=
time
;
//时间差的毫秒数
//计算出相差天数
var
days
=
Math
.
floor
(
date3
/
(
24
*
3600
*
1000
));
//计算出小时数
var
leave1
=
date3
%
(
24
*
3600
*
1000
);
//计算天数后剩余的毫秒数
var
hours
=
Math
.
floor
(
leave1
/
(
3600
*
1000
));
//计算相差分钟数
var
leave2
=
leave1
%
(
3600
*
1000
);
//计算小时数后剩余的毫秒数
var
minutes
=
Math
.
floor
(
leave2
/
(
60
*
1000
));
//计算相差秒数
var
leave3
=
leave2
%
(
60
*
1000
);
//计算分钟数后剩余的毫秒数
var
seconds
=
Math
.
round
(
leave3
/
1000
);
// console.log(days + "天 " + hours + "小时 ")
// return days + "天 " + hours + "小时 " + minutes + " 分钟" + seconds + " 秒"
return
minutes
+
"分"
+
seconds
+
"秒"
}
}
\ No newline at end of file
project/src/canvas/game/src/Main.ts
View file @
7d3a7955
...
...
@@ -82,6 +82,7 @@ export class Main {
// await RES.loadGroup("common");
Ins
.
stageW
=
this
.
stage
.
viewRect
.
width
;
Ins
.
stageH
=
this
.
stage
.
viewRect
.
height
;
Ins
.
stage
=
this
.
stage
;
console
.
log
(
"舞台宽高:"
,
Ins
.
stageW
,
Ins
.
stageH
)
await
RES
.
loadSparkAssets
(
resloadingList
);
console
.
log
(
'resloadingList 加载完毕'
)
...
...
project/src/canvas/game/src/cat/Salmon.ts
View file @
7d3a7955
...
...
@@ -80,8 +80,9 @@ export class Salmon extends Module{
id
:
that
.
_id
,
energy
:
that
.
salmonCnt
}
sendTbNet
(
TbNetName
.
takeEnergy
,{
params
},(
s
,
r
)
=>
{
sendTbNet
(
TbNetName
.
takeEnergy
,{
id
:
that
.
_id
,
energy
:
that
.
salmonCnt
},(
s
,
r
)
=>
{
if
(
s
){
that
.
mouseEnable
=
true
;
FYGE
.
GDispatcher
.
dispatchEvent
(
MSG
.
UPDATE_ENERGY
,{
call
:()
=>
{
that
.
getSalmonAnim
()}});
}
else
{
that
.
mouseEnable
=
true
;
...
...
project/src/canvas/game/src/scenes/MainScene.ts
View file @
7d3a7955
...
...
@@ -361,8 +361,8 @@ export class MainScene extends Scene {
var
that
=
this
;
if
(
that
.
recoverEnergyHandler
)
clearInterval
(
that
.
recoverEnergyHandler
);
console
.
log
(
"上一次恢复精力的时间"
,
new
Date
(
Ins
.
userInfo
.
lastEnergyTime
).
getMinutes
())
let
time
=
new
Date
().
getTime
()
-
Ins
.
userInfo
.
lastEnergyTime
;
console
.
log
(
"相差的时间"
,
Math
.
floor
(
time
%
3600
/
60
))
let
time
=
Ins
.
userInfo
.
updateTime
-
Ins
.
userInfo
.
lastEnergyTime
;
console
.
log
(
"相差的时间"
,
Ins
.
intervalTime
(
time
))
if
(
time
<=
Ins
.
recoverEnergy
)
{
that
.
recoverEnergyTime
=
Ins
.
recoverEnergy
-
time
;
}
else
{
...
...
@@ -559,6 +559,7 @@ export class MainScene extends Scene {
}
that
.
isShow
=
false
;
that
.
energyUp1
();
that
.
updateEnergy
();
}
that
.
setEnergy
();
that
.
mainUi
.
updateUserInfo
();
...
...
@@ -594,11 +595,7 @@ export class MainScene extends Scene {
let
diffCnt
=
Math
.
abs
(
list
.
length
-
Ins
.
salmonArr
.
length
);
if
(
list
.
length
>=
Ins
.
salmonArr
.
length
)
{
// let index = 0;
for
(
let
i
=
0
;
i
<
Ins
.
salmonArr
.
length
;
i
++
)
{
if
(
Ins
.
salmonArr
[
i
]
&&
list
[
Ins
.
salmonArr
[
i
].
index
])
Ins
.
salmonArr
[
i
].
setCnt
(
list
[
Ins
.
salmonArr
[
i
].
index
].
energy
);
// index = i;
}
//用来获取空的三文鱼索引的index标示位
let
flagIndex
=
0
;
//可以放置的空的三文鱼索引
...
...
@@ -622,6 +619,25 @@ export class MainScene extends Scene {
Ins
.
salmonArr
.
push
(
salmon
);
setIndex
++
;
}
for
(
let
i
=
1
;
i
<
this
.
salmonArr
.
length
;
i
++
){
for
(
let
j
=
0
;
j
<
this
.
salmonArr
.
length
-
i
;
j
++
){
if
(
this
.
salmonArr
[
i
].
index
>
this
.
salmonArr
[
i
].
index
){
let
temp
=
this
.
salmonArr
[
j
];
this
.
salmonArr
[
j
]
=
this
.
salmonArr
[
j
+
1
];
this
.
salmonArr
[
j
+
1
]
=
temp
;
}
}
}
setTimeout
(()
=>
{
for
(
let
i
=
0
;
i
<
Ins
.
salmonArr
.
length
;
i
++
)
{
if
(
Ins
.
salmonArr
)
// if (Ins.salmonArr[i] && list[Ins.salmonArr[i].index])
Ins
.
salmonArr
[
i
].
setCnt
(
list
[
i
].
energy
);
// index = i;
}
},
100
)
}
}
...
...
@@ -635,12 +651,8 @@ export class MainScene extends Scene {
this
.
salmonFlag
[
index
]
=
false
;
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
let
salmonAnim
=
new
SalmonAnim
(
x
,
y
,
i
);
// salmonAnim.x = x-salmonAnim.width*0.5;
// salmonAnim.y = y-salmonAnim.height*0.7;
salmonAnim
.
setTween
(
100
,
1100
,
i
*
100
);
this
.
salmonGroup
.
addChild
(
salmonAnim
);
// let obj={t:0}
// FYGE.Tween.get(obj,{onChangeObj:obj,onChange:that.salmonMove}).wait(i*300).to({t:1},1000).call(()=>{this.salmonGroup.removeChild(salmonAnim)});
}
}
...
...
@@ -649,8 +661,6 @@ export class MainScene extends Scene {
console
.
log
(
"三文鱼运动"
,
this
,
salmonAnim
)
}
/**召回猫咪 */
recallCat
()
{
console
.
log
(
"找回猫咪,刷新用户信息,刷新出勤状态"
)
...
...
project/src/canvas/game/src/scenes/StartScene.ts
View file @
7d3a7955
...
...
@@ -23,7 +23,7 @@ export class StartScene extends Scene {
if
(
s
)
{
if
(
r
.
data
)
{
Ins
.
userInfo
=
r
.
data
;
/**判断猫咪是否出寝,只在用户进入游戏时判断,
后面要根据接口改写,现在先做测试
*/
/**判断猫咪是否出寝,只在用户进入游戏时判断,
使用接口判断
*/
that
.
judgeCatIsOutAChangeMainScene
();
}
else
{
sceneBg
.
visible
=
true
;
...
...
@@ -46,7 +46,7 @@ export class StartScene extends Scene {
console
.
log
(
"选择完猫咪"
,
r
)
Ins
.
showLoading
();
Ins
.
userInfo
=
r
.
data
.
data
;
/**判断猫咪是否出寝,只在用户进入游戏时判断,
后面要根据接口改写,现在先做测试
*/
/**判断猫咪是否出寝,只在用户进入游戏时判断,
使用接口判断
*/
this
.
judgeCatIsOutAChangeMainScene
();
}
...
...
taobao_mini/client/app.js
View file @
7d3a7955
import
cloud
from
'@tbmp/mp-cloud-sdk'
;
import
tbcc
from
'./tbcc-sdk'
;
const
env
=
'
online
'
// 云函数环境 test 测试环境 online 线上环境
const
env
=
'
test
'
// 云函数环境 test 测试环境 online 线上环境
cloud
.
init
({
env
:
env
});
...
...
@@ -9,7 +9,7 @@ cloud.init({
App
({
env
,
requestType
:
'cloud'
,
// yapi,cloud: 云函数
requestType
:
'local'
,
// yapi,cloud: 云函数
//
requestType: 'local', // yapi,cloud: 云函数
cloudName
:
'tmallCat'
,
// 主云函数项目名 tmallCat
// cloudName: 'bubbleSurviva', // 主云函数项目名 tmallCat
cloud
,
...
...
@@ -29,8 +29,8 @@ App({
const
{
activityId
}
=
query
;
// this.activityId = activityId || '5f81841def5071b132fd5e21'; //赵然
// this.activityId = activityId || '5f8022919da671f3b6d5fb14'; //小婷1
this
.
activityId
=
activityId
||
'5f8d47218e6a0888fc426fad'
;
//小婷2zhengshi
//
this.activityId = activityId || '5f87e8a29897b4e0ce0ada02'; //ceshi
//
this.activityId = activityId || '5f8d47218e6a0888fc426fad'; //小婷2zhengshi
this
.
activityId
=
activityId
||
'5f87e8a29897b4e0ce0ada02'
;
//ceshi
}
...
...
taobao_mini/client/components/prizeModal/prizeModal.acss
View file @
7d3a7955
.my-prize-page {
width:
750rpx
;
height: 1
624rpx
;
width:
100vw
;
height: 1
00vh
;
opacity: 1;
position: absolute;
top: 0;
...
...
taobao_mini/client/pages/pagecanvas/output.js
View file @
7d3a7955
This diff is collapsed.
Click to expand it.
taobao_mini/client/pages/pagecanvas/pagecanvas.js
View file @
7d3a7955
...
...
@@ -101,12 +101,12 @@ Page({
console
.
log
(
'on ready'
)
//授权和登录先搞
await
this
.
getAuth
();
setTimeout
(()
=>
{
my
.
navigateTo
({
url
:
`/pages/myprize/myprize
`
});
},
1000
)
//
await this.getAuth();
//
setTimeout(()=>{
//
my.navigateTo({
// url: `/pages/pageshop/pageshop
`
//
});
//
},1000)
// this.initCanvas();
my
.
__onMessage__
=
(
e
)
=>
{
this
.
onMessage
(
e
)
...
...
taobao_mini/client/pages/pageshop/pageshop.acss
View file @
7d3a7955
.shop-page {
width:
750rpx
;
height: 1
624rpx
;
width:
100vw
;
height: 1
00vh
;
opacity: 1;
position: absolute;
top: 0;
...
...
@@ -17,7 +17,7 @@
bottom: 0;
top: 464rpx;
padding-left: 54rpx;
right:0;
right:
0;
overflow-x: auto;
}
...
...
@@ -70,6 +70,7 @@
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.shop .shopitem .shopitem_avatar {
width: 161rpx;
height: 161rpx;
...
...
@@ -135,12 +136,18 @@
.shop .shop_gold {
opacity: 1;
height: 54rpx;
left: 370rpx;
top: 32
6
rpx;
top: 32
0
rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 23.47394rpx;
color: #7b644e;
vertical-align: middle;
display: flex;
align-items: center;
justify-content: space-around;
flex-direction: column;
}
.shop .shop_backbtn {
...
...
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