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
ea06387f
Commit
ea06387f
authored
Sep 24, 2020
by
Edwise
🍷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1234
parent
bb292df6
Changes
14
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
249 additions
and
450 deletions
+249
-450
output.js
project/src/canvas/game/output.js
+59
-143
output.js.map
project/src/canvas/game/output.js.map
+1
-1
output.js
project/src/canvas/game/released/output.js
+59
-143
Ins.ts
project/src/canvas/game/src/Ins.ts
+5
-3
ResJson.ts
project/src/canvas/game/src/ResJson.ts
+1
-1
TaoBaoNet.ts
project/src/canvas/game/src/TaoBaoNet.ts
+1
-2
Cat.ts
project/src/canvas/game/src/cat/Cat.ts
+3
-2
MainScene.ts
project/src/canvas/game/src/scenes/MainScene.ts
+34
-7
MainSceneBtnUi.ts
project/src/canvas/game/src/ui/MainSceneBtnUi.ts
+21
-1
comcatrule.acss
taobao_mini/client/components/comcatrule/comcatrule.acss
+1
-1
comcatrule.axml
taobao_mini/client/components/comcatrule/comcatrule.axml
+1
-1
output.js
taobao_mini/client/pages/pagecanvas/output.js
+59
-143
pagecanvas.axml
taobao_mini/client/pages/pagecanvas/pagecanvas.axml
+1
-1
pagecanvas.js
taobao_mini/client/pages/pagecanvas/pagecanvas.js
+3
-1
No files found.
project/src/canvas/game/output.js
View file @
ea06387f
This diff is collapsed.
Click to expand it.
project/src/canvas/game/output.js.map
View file @
ea06387f
This diff is collapsed.
Click to expand it.
project/src/canvas/game/released/output.js
View file @
ea06387f
This diff is collapsed.
Click to expand it.
project/src/canvas/game/src/Ins.ts
View file @
ea06387f
...
...
@@ -2,6 +2,7 @@ import { RES } from "../module/RES";
import
resCanvasList
from
"../resCanvasList"
import
{
SCENETYPE
}
from
"./Enum"
;
import
{
GDispatcher
}
from
"./Main"
;
import
{
sendTbNet
,
TbNetName
}
from
"./TaoBaoNet"
;
/**记录全局信息与全局方法 */
export
class
Ins
{
...
...
@@ -36,15 +37,16 @@ export class Ins {
}
public
static
showToast
(
msg
?:
any
){
FYGE
.
GDispatcher
.
dispatchEvent
(
"toast"
,
msg
);
console
.
log
(
"发出message"
,
msg
)
GDispatcher
.
dispatchEvent
({
type
:
"toast"
},
msg
);
}
public
static
showLoading
(){
FYGE
.
GDispatcher
.
dispatchEvent
(
"loading"
);
GDispatcher
.
dispatchEvent
(
"loading"
);
}
public
static
hideLoading
(){
FYGE
.
GDispatcher
.
dispatchEvent
(
"hideloading"
);
GDispatcher
.
dispatchEvent
(
"hideloading"
);
}
/**删除一个lottie的所有tween,停止动效 */
...
...
project/src/canvas/game/src/ResJson.ts
View file @
ea06387f
...
...
@@ -10,5 +10,5 @@ export const ResJson = {
"name"
:
"startScene"
}
],
"path"
:
"https://yun.duiba.com.cn/db_games/activity/babycare_xiaoxiao/160093
0613
/resource/"
"path"
:
"https://yun.duiba.com.cn/db_games/activity/babycare_xiaoxiao/160093
6371
/resource/"
}
\ No newline at end of file
project/src/canvas/game/src/TaoBaoNet.ts
View file @
ea06387f
...
...
@@ -15,8 +15,7 @@ export enum TbNetName {
/**
* 猫咪互动
*/
interaction
=
"tamllCat.interaction"
,
interaction
=
"tmallCat.interaction"
,
/**
* 埋点统计 到时改名字
* activityId params elemType
...
...
project/src/canvas/game/src/cat/Cat.ts
View file @
ea06387f
...
...
@@ -27,6 +27,7 @@ import { CATTYPE, MSG, CAT_ACTTYPEP } from "../Enum";
import
{
Ins
}
from
"../Ins"
;
import
{
sendTbNet
,
TbNetName
}
from
"../TaoBaoNet"
;
import
{
showToast
}
from
"../../module/ctrls"
;
import
{
GDispatcher
}
from
"../Main"
;
export
class
Cat
extends
Module
{
/**1:蓝猫,2:橘猫,3:三花,4:暹罗 */
...
...
@@ -210,9 +211,9 @@ export class Cat extends Module {
break
;
}
console
.
log
(
actType
);
sendTbNet
(
TbNetName
.
interaction
,
{
type
:
type
,
s
cen
e
:
Ins
.
curScene
},
(
s
,
r
)
=>
{
sendTbNet
(
TbNetName
.
interaction
,
{
type
:
type
,
s
enc
e
:
Ins
.
curScene
},
(
s
,
r
)
=>
{
if
(
s
)
{
FYGE
.
GDispatcher
.
dispatchEvent
(
MSG
.
UPDATE_USERINFO
);
GDispatcher
.
dispatchEvent
(
MSG
.
UPDATE_USERINFO
);
that
.
actRunning
=
true
;
switch
(
actType
)
{
case
CAT_ACTTYPEP
.
SLEEP
:
...
...
project/src/canvas/game/src/scenes/MainScene.ts
View file @
ea06387f
...
...
@@ -92,12 +92,14 @@ export class MainScene extends Scene {
var
that
=
this
;
that
.
cat
=
new
Cat
({
type
:
Ins
.
userInfo
.
catType
});
that
.
addChild
(
that
.
cat
);
if
(
Ins
.
catIsOut
)
{
that
.
cat
.
visible
=
false
;
//当猫出走的时候,隐藏猫咪,创建信封
that
.
letter
=
new
FYGE
.
Lottie
(
letter
);
that
.
addChild
(
that
.
letter
);
that
.
letter
.
play
();
that
.
letter
.
visible
=
false
;
if
(
Ins
.
catIsOut
)
{
that
.
cat
.
visible
=
false
;
//当猫出走的时候,隐藏猫咪,创建信封
that
.
letter
.
visible
=
true
;
}
}
...
...
@@ -165,11 +167,12 @@ export class MainScene extends Scene {
changeMainScene
(
type
:
SCENETYPE
)
{
console
.
log
(
"切换到"
+
type
)
var
that
=
this
;
Ins
.
curScene
=
type
;
Ins
.
curScene
=
type
>
3
?
3
:
type
;
that
.
sceneBg
.
texture
=
RES
.
getRes
(
resCanvasList
[
that
.
bgUUID
[
type
-
1
]].
url
)
//切换场景时判断猫在不在,后面要改成与接口值判断
if
(
Ins
.
catIsOut
)
{
that
.
cat
.
visible
=
false
;
that
.
cat
.
stopCatAct
();
}
else
{
if
((
type
)
==
Ins
.
userInfo
.
sence
)
{
that
.
cat
.
visible
=
true
;
...
...
@@ -201,16 +204,40 @@ export class MainScene extends Scene {
that
.
mainUi
.
changeBtnByUiType
(
type
);
}
/**更新用户信息时更新场景信息 */
updateSceneInfo
(){
}
/**更新用户相关信息 */
updateUserInfo
()
{
console
.
log
(
"刷新用户信息"
)
var
that
=
this
;
sendTbNet
(
TbNetName
.
getUserInfo
,
{},
(
s
,
r
)
=>
{
if
(
s
)
{
Ins
.
userInfo
=
r
.
data
;
if
(
r
.
data
.
sence
>
3
){
Ins
.
catIsOut
=
true
;
that
.
cat
.
visible
=
false
;
that
.
cat
.
stopCatAct
();
that
.
mainUi
.
changeBtnByCatIsOuT
(
Ins
.
curScene
)
if
(
Ins
.
curScene
==
3
){
that
.
letter
.
visible
=
true
;
}
}
else
{
if
(
Ins
.
catIsOut
){
that
.
cat
.
visible
=
true
;
that
.
letter
.
visible
=
false
;
}
Ins
.
catIsOut
=
false
;
}
that
.
setEnergy
();
that
.
mainUi
.
updateUserInfo
();
}
else
{
showToast
(
r
.
message
)
Ins
.
showToast
(
r
.
message
)
}
})
}
...
...
@@ -223,7 +250,7 @@ export class MainScene extends Scene {
that
.
mxqBtn
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
()
=>
{
that
.
changeMainScene
(
SCENETYPE
.
PLAYGROUND
)
},
that
);
that
.
letter
&&
that
.
letter
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
that
.
openLetter
,
that
);
FYGE
.
GDispatcher
.
addEventListener
(
MSG
.
CHANGE_SCENE
,
()
=>
{
that
.
changeMainScene
(
SCENETYPE
.
BEADROOM
)
},
that
);
FYGE
.
GDispatcher
.
addEventListener
(
MSG
.
UPDATE_USERINFO
,
that
.
updateUserInfo
,
that
);
GDispatcher
.
addEventListener
(
MSG
.
UPDATE_USERINFO
,
that
.
updateUserInfo
,
that
);
}
removeEvents
()
{
...
...
@@ -233,6 +260,6 @@ export class MainScene extends Scene {
that
.
mxqBtn
.
removeEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
()
=>
{
that
.
changeMainScene
(
SCENETYPE
.
PLAYGROUND
)
},
that
);
that
.
letter
&&
that
.
letter
.
removeEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
that
.
openLetter
,
that
);
FYGE
.
GDispatcher
.
removeEventListener
(
MSG
.
CHANGE_SCENE
,
()
=>
{
that
.
changeMainScene
(
SCENETYPE
.
BEADROOM
)
},
that
);
FYGE
.
GDispatcher
.
removeEventListener
(
MSG
.
UPDATE_USERINFO
,
that
.
updateUserInfo
,
that
);
GDispatcher
.
removeEventListener
(
MSG
.
UPDATE_USERINFO
,
that
.
updateUserInfo
,
that
);
}
}
\ No newline at end of file
project/src/canvas/game/src/ui/MainSceneBtnUi.ts
View file @
ea06387f
...
...
@@ -199,6 +199,24 @@ export class MainSceneBtnUi extends Module {
}
}
changeBtnByCatIsOuT
(
type
){
var
that
=
this
;
that
.
hideAllActBtn
();
switch
(
type
)
{
case
SCENETYPE
.
BEADROOM
:
that
.
catRecall
.
visible
=
true
;
break
;
case
SCENETYPE
.
CLASSROOM
:
that
.
returnBtn
.
visible
=
true
;
break
;
case
SCENETYPE
.
PLAYGROUND
:
that
.
returnBtn
.
visible
=
true
;
break
;
default
:
console
.
log
(
"改变场景ui时设置uiType错误"
);
break
;
}
}
/**触摸事件 */
touchHandler
(
e
:
FYGE
.
MouseEvent
)
{
console
.
log
(
e
.
target
);
...
...
@@ -248,6 +266,7 @@ export class MainSceneBtnUi extends Module {
/**补充精力 */
getEnergy
()
{
console
.
log
(
"补充精力"
);
Ins
.
showModule
(
"taskModal"
);
}
/**返回到寝室 */
...
...
@@ -283,7 +302,8 @@ export class MainSceneBtnUi extends Module {
/**打开攻略 */
openStrategy
()
{
console
.
log
(
"打开攻略"
);
showPanel
(
RulePanel
);
// showPanel(RulePanel);
Ins
.
showModule
(
"catruleModal"
);
}
/**打开奖品页面 */
...
...
taobao_mini/client/components/comcatrule/comcatrule.acss
View file @
ea06387f
...
...
@@ -5,7 +5,7 @@
left: 18rpx;
top: 392rpx;
position: absolute;
transform-origin:
0rpx 0rpx
0rpx;
transform-origin:
50% 50%
0rpx;
display: block;
}
.catrule .catrulebg {
...
...
taobao_mini/client/components/comcatrule/comcatrule.axml
View file @
ea06387f
<view class="catrule">
<view class="catrule
modal-animate-zoom-in
">
<image class="catrulebg" src={{resList['716ced79-de7f-40ca-ac98-46a5adf13db0'].url}} />
<image class="catrulep" src={{resList['617927a2-2dd6-456a-9d92-1f607a137dbc'].url}} />
<view class="catrulelabel" onTouchMove="touchMove" >
...
...
taobao_mini/client/pages/pagecanvas/output.js
View file @
ea06387f
This diff is collapsed.
Click to expand it.
taobao_mini/client/pages/pagecanvas/pagecanvas.axml
View file @
ea06387f
...
...
@@ -11,6 +11,6 @@
<view class="popcontainer" a:if="{{catnameModalVisible}}" ><catname-modal selectType="{{catType}}" onModalClose="closeCatnameModal" onSelectCatOk="selectCatOk" /></view>
<view class="popcontainer" a:if="{{recallcatModalVisible}}"><recallcat-modal onRecallCat="recallCat" onModalClose="closeRecallcatModal"></recallcat-modal></view>
<view class="popcontainer" a:if="{{getcatModalVisible}}"><getcat-modal selectType="{{catType}}" catName="{{catName}}" onPostSelectCat="postSelectCat" onModalClose="closeGetcatModal"></getcat-modal></view>
<view class="popcontainer" a:if="{{catbackbedModalVisible}}"><catbackbed-modal mydata="{{
get
catModalData}}" recallCatInfo="{{recallCatInfo}}" onUpdateUserInfo="updateUserInfo" onModalClose="closeCatbackModal"></catbackbed-modal></view>
<view class="popcontainer" a:if="{{catbackbedModalVisible}}"><catbackbed-modal mydata="{{
recall
catModalData}}" recallCatInfo="{{recallCatInfo}}" onUpdateUserInfo="updateUserInfo" onModalClose="closeCatbackModal"></catbackbed-modal></view>
<task-modal a:if="{{taskModalVisible}}" onModalClose="closeTaskModal"></task-modal>
<view class="popcontainer" a:if="{{catruleModalVisible}}"><catrule-modal onModalClose="closeCatruleModal"></catrule-modal></view>
taobao_mini/client/pages/pagecanvas/pagecanvas.js
View file @
ea06387f
...
...
@@ -38,6 +38,7 @@ Page({
selectcatModalVisible
:
false
,
catnameModalVisible
:
false
,
recallcatModalVisible
:
false
,
recallcatModalData
:{},
getcatModalVisible
:
false
,
getcatModalData
:
{},
catbackbedModalVisible
:
false
,
...
...
@@ -115,7 +116,7 @@ Page({
app
.
canvasMain
=
this
.
main
;
this
.
main
.
addGlobalEvent
(
"onMessage"
,
self
.
onMessage
,
self
);
this
.
main
.
addGlobalEvent
(
"toast"
,
self
.
showToast
,
self
);
this
.
main
.
addGlobalEvent
(
"toast"
,
self
.
showToast
Handler
,
self
);
this
.
main
.
addGlobalEvent
(
"loading"
,
self
.
showLoadingHandler
,
self
);
this
.
main
.
addGlobalEvent
(
"hideloading"
,
self
.
hideLoadingHandler
,
self
);
}
...
...
@@ -135,6 +136,7 @@ Page({
},
showToastHandler
(
e
)
{
console
.
log
(
"接受到消息展示canvas的toast"
)
my
.
showToast
({
content
:
e
.
data
||
"网络异常,请稍后重试~"
,
duration
:
2000
...
...
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