Commit 8cb78db7 authored by Master Q's avatar Master Q

0905

parent e9a9bef4
......@@ -38,7 +38,7 @@
"upload": "node scripts/upload",
"build": "npm run handleRes && node scripts/mergeJson && npm run upload && npm run buildTS",
"watch": "webpack --watch",
"dev": "node scripts/devServer -p 8099",
"dev": "node scripts/devServer -p 9011",
"dev1": "webpack-dev-server --open --config webpack.dev.js --host 0.0.0.0",
"buildTS": "webpack --config webpack.prod.js && node scripts/mergeJs",
"copyJs": "node scripts/copyJs",
......
This diff is collapsed.
......@@ -120,6 +120,15 @@ export class GameOverPanel extends Panel {
this.drawBtn.startAniRange(110, this.drawBtn.totalFrames, 1)
await sleep(2000)
if (!this.data.isWinPrize) {
this.hidePanel()
// @ts-ignore
my && my.showToast({
content: '很遗憾,您未中奖'
})
changeScene(GameOverScene, this.data)
return
}
const {data, success} = await sendTbNet(TbNetName.drawLotteryPrize, {
id: Tools.globalData.startId
})
......@@ -138,6 +147,14 @@ export class GameOverPanel extends Panel {
})
changeScene(GameOverScene, this.data)
}
} else {
// 默认错误就 很遗憾吧
this.hidePanel()
// @ts-ignore
my && my.showToast({
content: '很遗憾,您未中奖'
})
changeScene(GameOverScene, this.data)
}
}, 1), this)
}
......
......@@ -24,10 +24,10 @@ export class PrizeShowPanel extends Panel {
preview.width = 300
preview.height = 300
preview.position.set(150, 236)
// preview.mask = panelCtn.addChild(new FYGE.Graphics())
// .beginFill()
// .drawRoundedRect(150, 236, 300, 300, 20)
// .endFill()
preview.mask = panelCtn.addChild(new FYGE.Graphics())
.beginFill()
.drawRoundedRect(150, 236, 300, 300, 20)
.endFill()
UI.Btn(panelCtn, 'confirm-btn.png', function() {
this.btnDelay(this)
......
......@@ -78,6 +78,7 @@ export class GameOverScene extends Scene {
}, this)
_s.anchorTexture.set(0.5, 0.5)
if (this.data.productLink) {
var bottomCont = UI.Ctn(this)
bottomCont.position.set(0, layers.stageOffsetY + layers.stageHeight - 130 + layers.stageOffsetY - 90)
var isJordan = Tools.globalData.shopId == 10003
......@@ -96,6 +97,9 @@ export class GameOverScene extends Scene {
}, this)
}
}
showNumberUp() {
var o = { _score: 0}
var bitmapTextCount = this.bitmapTextCount
......
......@@ -36,6 +36,7 @@ class DeviceMotion {
if (my) {
const { platform } = await getSystemInfo()
this.platform = platform.toLowerCase()
this._tmdremoveEvents()
//@ts-ignore
my.onDeviceMotionChange((res) => {
// 通过 platform 进行判断当前是 弧度制还是 角度值
......@@ -73,7 +74,6 @@ class DeviceMotion {
}
destory() {
this._tmdremoveEvents()
this.subs = []
DeviceMotion._instance = null
}
......
......@@ -102,10 +102,11 @@ class RandomArray {
}
getRandomValue() {
if (this.len == 0) {
this.arr = this.iarr
if (!this.arr.length) {
this.arr = [...this.iarr]
}
var i = Math.floor(Math.random() * this.len)
var len = this.arr.length
var i = Math.floor(Math.random() * len)
var value = this.arr[i]
this.arr.splice(i, 1)
return value
......@@ -214,8 +215,8 @@ export class GameScene extends MotionInitScene {
async onSubmit(params) {
const {data, success, message} = await sendTbNet(TbNetName.submitGame, params)
if (success) {
const {score, isNewRecord, productLink, isWinPrize,} = data
if (isWinPrize) {
const {score, isNewRecord, productLink, isWinPrize, level} = data
if (level != 0) {
//@ts-ignore
my && my.vibrateShort()
......@@ -225,10 +226,17 @@ export class GameScene extends MotionInitScene {
}
} else {
//@ts-ignore
my && my.showToast({
content: message
});
sendTbNet(TbNetName.navigateBack)
var fakeData = {
score: this.score,
level: [10, 20, 30].findIndex(i => this.score >= i),
fake: true,
isWinPrize: false
}
if (fakeData.level != -1) {
showPanel(GameOverPanel, fakeData)
return
}
changeScene(GameOverScene, fakeData)
}
}
......
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