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
50d67c3b
Commit
50d67c3b
authored
Oct 01, 2020
by
AU-Pro-mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new code --05
parent
5100ac8e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
42 deletions
+79
-42
Root.ts
project/src/canvas/game/src/chuansongdai/Root.ts
+22
-13
homePage.js
taobao_mini/client/pages/homePage/homePage.js
+7
-2
pagecanvas.js
taobao_mini/client/pages/pagecanvas/pagecanvas.js
+50
-27
No files found.
project/src/canvas/game/src/chuansongdai/Root.ts
View file @
50d67c3b
...
...
@@ -9,6 +9,9 @@ import { MatchingPanel } from "../com/MatchingPanel";
import
GoodsContainer
from
'./game/goodsContainer'
import
{
Tools
}
from
"../Tools"
import
{
destroyNetData
,
sendTbNet
,
TbNetName
}
from
"../TaoBaoNet"
;
import
{
FailedPanel
}
from
"../com/FailedPanel"
;
import
{
SuccessNoAwardPanel
}
from
"../com/SuccessNoAwardPanel"
;
import
{
SuccessPanel
}
from
"../com/SuccessPanel"
;
export
default
class
Root
extends
FYGE
.
Container
{
GDispatcher
...
...
@@ -39,8 +42,11 @@ export default class Root extends FYGE.Container {
//引导页
guideRes
=
[
"828f6676-7956-473a-a951-bc2f5f1ba8a3"
,
"bc6aa86d-7cd8-4a11-9bd1-931040af3c6e"
,
"0668f8d0-6fb3-46f9-a5e4-952aef42f05c"
]
guide
time
:
number
=
0
// 游戏时间 倒计时 时长
guideIndex
=
0
// 比拼的用户信息 和 自己的信息
userInfo
...
...
@@ -77,19 +83,9 @@ export default class Root extends FYGE.Container {
console
.
log
(
'CSD-GAME this.userInfo:'
,
userInfoRes
.
data
)
if
(
this
.
userInfo
.
isNewUser
)
{
let
i
=
0
let
guide
=
Ins
.
initSprite
(
this
.
guideRes
[
i
])
guide
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
()
=>
{
i
++
if
(
i
>
this
.
guideRes
.
length
-
1
)
{
guide
.
visible
=
false
setTimeout
(()
=>
{
showPanel
(
MatchingPanel
,
this
.
userInfo
)
},
200
)
}
else
{
guide
.
texture
=
Ins
.
getRes
(
this
.
guideRes
[
i
])
}
},
this
)
this
.
guideIndex
=
0
let
guide
=
Ins
.
initSprite
(
this
.
guideRes
[
this
.
guideIndex
])
guide
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
this
.
guideFunc
,
this
)
this
.
addChild
(
guide
)
}
else
{
showPanel
(
MatchingPanel
,
this
.
userInfo
)
...
...
@@ -194,6 +190,19 @@ export default class Root extends FYGE.Container {
}
}
guideFunc
()
{
let
i
=
this
.
guideIndex
i
++
if
(
i
>
this
.
guideRes
.
length
-
1
)
{
this
.
guide
.
visible
=
false
setTimeout
(()
=>
{
showPanel
(
MatchingPanel
,
this
.
userInfo
)
},
200
)
}
else
{
this
.
guide
.
texture
=
Ins
.
getRes
(
this
.
guideRes
[
i
])
}
}
onAddToStage
()
{
this
.
stageHeight
=
this
.
stage
.
viewRect
.
height
this
.
x
=
0
...
...
taobao_mini/client/pages/homePage/homePage.js
View file @
50d67c3b
...
...
@@ -357,11 +357,16 @@ Page({
},
// 从游戏 返回 到 主页
backToPage
()
{
console
.
log
(
1
)
backToPage
(
msg
=
''
)
{
console
.
log
(
'%c ------------ '
+
msg
+
' ------------'
,
ConsoleStyle
)
this
.
getGameInfo
()
this
.
setData
({
gameShow_timeout
:
false
,
gameType
:
0
})
setTimeout
(()
=>
{
this
.
setData
({
gameShow
:
false
})
},
350
)
if
(
msg
===
'openMyPrize'
)
{
setTimeout
(()
=>
{
this
.
gotoMyPrizePage
()
},
500
)
}
},
// 去转盘
...
...
taobao_mini/client/pages/pagecanvas/pagecanvas.js
View file @
50d67c3b
...
...
@@ -119,6 +119,10 @@ Component({
// 游戏结束开奖 -- 提前
this
.
getGameOverPrize
()
break
;
case
'mine.seePrize'
:
// 游戏结束开奖 -- 提前
this
.
seePrize
()
break
;
default
:
console
.
warn
(
'监听时间名 没有对应处理函数'
)
break
;
...
...
@@ -133,25 +137,20 @@ Component({
this
.
setData
({
gameType
:
0
})
},
// 查看奖品 - 返回而已 没差
seePrize
()
{
console
.
log
(
'%c 接收到 See Prize'
,
ConsoleStyle
)
this
.
props
.
onBackPage
(
'openMyPrize'
)
this
.
gameData
=
null
this
.
gamePrize
=
null
this
.
setData
({
gameType
:
0
})
},
// 游戏开始 获取用户信息
gameStartInfo
()
{
// -- test code --
let
win
=
this
.
countWinRange
(
this
.
data
.
gameType
)
this
.
isWin
=
win
let
fname
=
this
.
getFakeUserName
()
let
favatar
=
this
.
getFakeAvatar
()
this
.
gameData
=
{
win
:
win
,
fakeUserName
:
fname
,
fakeUserImgUrl
:
'//yun.duiba.com.cn/spark/assets/43081f4ee9aed1c4d89d9e0882b2b5210a93ef17.png'
,
userName
:
app
.
nickName
,
userImgUrl
:
app
.
avatar
,
isNewUser
:
this
.
data
.
gameType
===
1
?
app
.
isNewUser_csd
:
app
.
isNewUser_xxl
}
console
.
log
(
'%cgameData:'
,
ConsoleStyle
,
this
.
gameData
)
this
.
postMessage
(
'mine.getUserInfo'
,
{
data
:
this
.
gameData
})
return
// this.gameStartInfo_test()
// return
// -- test code --
API
.
doJoin
({
activityId
:
app
.
activityId
,
type
:
this
.
data
.
gameType
===
1
?
'slide'
:
'timeline'
})
...
...
@@ -185,15 +184,8 @@ Component({
// 游戏结束 获取开奖
getGameOverPrize
()
{
// -- test code --
this
.
gamePrize
=
{
name
:
'一碗热翔'
,
image
:
'//yun.duiba.com.cn/spark/assets/43081f4ee9aed1c4d89d9e0882b2b5210a93ef17.png'
,
type
:
2
}
console
.
log
(
'%cgamePrize:'
,
ConsoleStyle
,
this
.
gamePrize
)
this
.
postMessage
(
'mine.getPrizeInfo'
,
{
data
:
this
.
gamePrize
})
return
// this.getGameOverPrize_test()
// return
// -- test code --
API
.
gameOver
({
activityId
:
app
.
activityId
,
type
:
this
.
data
.
gameType
===
1
?
'slide'
:
'timeline'
,
isWin
:
this
.
isWin
})
...
...
@@ -314,8 +306,39 @@ Component({
sum
(
m
,
n
)
{
var
num
=
Math
.
floor
(
Math
.
random
()
*
(
m
-
n
)
+
n
)
return
num
},
gameStartInfo_test
(){
let
win
=
this
.
countWinRange
(
this
.
data
.
gameType
)
this
.
isWin
=
win
let
fname
=
this
.
getFakeUserName
()
let
favatar
=
this
.
getFakeAvatar
()
this
.
gameData
=
{
win
:
win
,
fakeUserName
:
fname
,
fakeUserImgUrl
:
favatar
,
userName
:
app
.
nickName
,
userImgUrl
:
app
.
avatar
,
isNewUser
:
this
.
data
.
gameType
===
1
?
app
.
isNewUser_csd
:
app
.
isNewUser_xxl
}
console
.
log
(
'%cgameData:'
,
ConsoleStyle
,
this
.
gameData
)
this
.
postMessage
(
'mine.getUserInfo'
,
{
data
:
this
.
gameData
})
return
},
getGameOverPrize_test
(){
this
.
gamePrize
=
{
name
:
'一碗热翔'
,
image
:
'//yun.duiba.com.cn/spark/assets/43081f4ee9aed1c4d89d9e0882b2b5210a93ef17.png'
,
type
:
2
}
console
.
log
(
'%cgamePrize:'
,
ConsoleStyle
,
this
.
gamePrize
)
this
.
postMessage
(
'mine.getPrizeInfo'
,
{
data
:
this
.
gamePrize
})
}
}
});
\ No newline at end of file
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