Commit cb912a43 authored by Master Q's avatar Master Q

测试用例评审修改问题

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