Commit cb912a43 authored by Master Q's avatar Master Q

测试用例评审修改问题

parent eebf9c4a
......@@ -5,6 +5,6 @@
"data": {
"activityState": 1,
"needTikectCount": 23,
"gameTimeLimit": 5
"gameTimeLimit": 60
}
}
\ No newline at end of file
......@@ -100,7 +100,7 @@
})
</script>
<!-- 构建的js -->
<script src="//yun.duiba.com.cn/db_games/activity/template/1655707657/output.js" crossorigin="anonymous"></script>
<script src="//yun.duiba.com.cn/db_games/activity/template/1655780465/output.js" crossorigin="anonymous"></script>
</body>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -86,6 +86,7 @@ export class BalalaScene extends Module {
UI.Sp(countDownCont, 'countdownback.png')
this.countDownText = countDownCont.addChild(new FYGE.BitmapText(Tools.getNumTextures('')))
this.countDownText.position.set(120, 53)
this.countDownText.gap = -5
this.countDownNum = ExtraConfig.CountDownTime
this.countDownFactory = new CountDownWithTweenCls(ExtraConfig.CountDownTime * 1000, (t) => {
this.countDownNum = ~~(t / 1000)
......@@ -258,7 +259,7 @@ export class BalalaScene extends Module {
}
async onGameStart() {
this.onResume()
await this.onResume()
this.countDownFactory.start()
GDispatcher.dispatchEvent(ParkourGameEvents.GAME_RESTART)
}
......@@ -269,8 +270,6 @@ export class BalalaScene extends Module {
this.resurrectionTimes = 0
this.countDownNum = ExtraConfig.CountDownTime
GDispatcher.dispatchEvent(ParkourGameEvents.GAME_RESET)
await this.onGameStartBeforeCountdownAni()
console.log('倒计时结束')
this.onGameStart()
}
......@@ -282,7 +281,7 @@ export class BalalaScene extends Module {
startId: getWebData(WebNetName.start).data.startId,
})
this.resurrectionTimes += 1
this.onResume()
await this.onResume()
this.countDownFactory.resume()
GDispatcher.dispatchEvent(ParkourGameEvents.GAME_RESUME)
}
......@@ -350,8 +349,11 @@ export class BalalaScene extends Module {
/**
* 动效开始播放
*/
onResume(resume: boolean = true) {
this.countDownFactory.resume()
async onResume(cb?: Function) {
await this.onGameStartBeforeCountdownAni()
console.log('倒计时结束')
cb && await cb()
// this.countDownFactory.resume()
this.MovieClipList.forEach(item => {
item.play()
})
......
......@@ -6,7 +6,7 @@ import { Tools } from "../../tools/Tools";
import UI from "../../tools/UI";
import { getWebData, LOG_TYPE, sendLog, sendWebNet, WebNetName } from "../../tools/WebNet";
import { ParkourScene } from "../ParkourGameScene";
import { PromiseAwait } from "../utils";
import { CommonActivityDesc, PromiseAwait } from "../utils";
export class IndexScene extends Scene {
get groupNames(): string[] {
......@@ -38,6 +38,7 @@ export class IndexScene extends Scene {
const countDownTimeFromLogo = indexSceneLogo.addChild(new FYGE.BitmapText(textMap))
countDownTimeFromLogo.position.set(395, 103)
countDownTimeFromLogo.text = `${this.IndexSceneData.gameTimeLimit}s`
countDownTimeFromLogo.gap = -5
this.ruleBtn = UI.Sp(this, 'ruleBtn.png', 0, 230)
......@@ -51,6 +52,7 @@ export class IndexScene extends Scene {
sendLog(LOG_TYPE.EXPOSURE, 2)
}
@CommonActivityDesc
@PromiseAwait
async onJump2Scene() {
sendLog(LOG_TYPE.CLICK, 2)
......
import { showToast } from './../../module/ctrls/toastCtrl';
import { getWebData, WebNetName } from "../tools/WebNet"
/**
* 装饰方法 执行完Promise 之后 才可以第二次执行
......@@ -41,6 +43,20 @@ export function promiseAwaitFunc(func: Function) {
}
}
export function CommonActivityDesc(target, property, descriptor: PropertyDescriptor) {
const func: Function = descriptor.value
descriptor.value = async function(...args: any[]) {
const activityState = getWebData(WebNetName.index).data.activityState
if (activityState == 0) {
showToast('活动未开始')
} else if (activityState == 2) {
showToast('活动已结束')
} else {
return func.apply(this, args)
}
}
}
export function CountDownFac(totalCount) {
let count = totalCount;
let intervalId = null
......
......@@ -46,6 +46,13 @@ let dataRecord: {
[name: string]: any
} = {};
const SpecialCodeError = {
600007: '门票数量不足,做任务获取更多',
600009: '游戏次数不足,请明日再来',
600012: '活动为开始',
600013: '活动已结束'
}
/**
* 发送接口
* @param netName
......@@ -112,7 +119,7 @@ export function sendWebNet(
dataRecord[netName] = response;
//统一错误信息提示,
if (!hideMsg && !response.success) {
showToast(response.message || "网络异常")
showToast(SpecialCodeError[response.code] || response.message || "网络开小差了,稍后再试")
}
callback && callback(response.success, response)
resolve(response)
......@@ -130,7 +137,7 @@ export function sendWebNet(
);
},
error: function (status) {
if (!hideMsg) showToast("网络超时");
if (!hideMsg) showToast("网络开小差了,稍后再试");
callback && callback(false)
resolve({ success: false });
console.log("接口" + netName + ":网络超时");
......
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