Commit 1c5772e1 authored by Master Q's avatar Master Q

方连点

parent 58a746b7
This diff is collapsed.
......@@ -97,4 +97,12 @@ export default class CountDownComp extends Module {
}
destory() {
this.stop()
this.timeoutFn.length = 0
super.destroy()
}
}
\ No newline at end of file
......@@ -36,6 +36,7 @@ export class GameOverPanel extends Panel {
var icon = UI.Sp(panelCtn, 'prize-icon1.png', panelCtn.width / 2, 580)
icon.anchorTexture.set(0.5, 0.5)
icon.addEventListener(FYGE.MouseEvent.CLICK, async function() {
this.btnDelay(this)
const {data, success} = await sendTbNet(TbNetName.drawLotteryPrize)
if (success) {
if (data.type != 5) {
......
......@@ -27,6 +27,7 @@ export class PrizeShowPanel extends Panel {
.endFill()
UI.Btn(panelCtn, 'confirm-btn.png', function() {
this.btnDelay(this)
if (this.data.type == 3) {
this.hidePanel()
changeScene(GameOverScene, this.data)
......
......@@ -36,17 +36,19 @@ export class GameOverScene extends Scene {
}, this, 45, 950)
UI.Btn(this, 'more-btn.png', function() {
this.btnDelay(this)
// @ts-ignore
my.redirectTo({
my.reLaunch({
url: '/pages/mainscene/mainscene'
})
}, this, 45, 1110)
var _s = UI.Sp(this, 'back-home.png', layers.stageCenterX, 1350)
_s.addEventListener(FYGE.MouseEvent.CLICK, function() {
this.btnDelay(this)
// todo
console.log('回到主场')
})
}, this)
_s.anchorTexture.set(0.5, 0.5)
var bottomCont = UI.Ctn(this)
......@@ -57,10 +59,11 @@ export class GameOverScene extends Scene {
UI.Txt(bottomCont, '让你的体态更加健康', 26, '#111111', FYGE.TEXT_ALIGN.LEFT, 500, 160, 75)
UI.Sp(bottomCont, 'jump-icon.png', 600, 40)
.addEventListener(FYGE.MouseEvent.CLICK, function() {
this.btnDelay(this)
// @ts-ignore
// my.
console.log(this.data.productLink)
})
}, this)
}
}
\ No newline at end of file
......@@ -100,8 +100,7 @@ export class GameScene extends MotionInitScene {
var cdp = this.cdp = this.addChild(new CountDownComp(GameCfg.iTime))
this.cdp.addTimeoutFunc(() => {
this.cdp.visible = false
this.cdp.destory()
// 销毁 instance
DeviceMotion.instance.destory()
//@ts-ignore
......@@ -128,7 +127,7 @@ export class GameScene extends MotionInitScene {
}
async onSubmit(params) {
const {data, success} = await sendTbNet(TbNetName.submitGame, params)
const {data, success, message} = await sendTbNet(TbNetName.submitGame, params)
if (success) {
const {score, isNewRecord, productLink, isWinPrize} = data
if (isWinPrize) {
......@@ -146,6 +145,12 @@ export class GameScene extends MotionInitScene {
isWinPrize
})
}
} else {
//@ts-ignore
my && my.showToast({
content: message
});
sendTbNet(TbNetName.navigateBack)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment