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.
......@@ -2,624 +2,36 @@ export const ResJson = {
"groups": [
{
"keys": "bucket_GE.png,countDown.svga,mountain.svga,normalGamer.svga,powerBall.svga,scene-back.jpg,speedShow.svga,speedUpGamer.svga,tree.svga",
"name": "GameRes",
"atlas": {
"bucket_GE.png": {
"x": 2,
"y": 2,
"w": 128,
"h": 137,
"ox": 0,
"oy": 0,
"sw": 128,
"sh": 137,
"ro": false
}
}
"name": "GameRes"
},
{
"keys": "0.png,1.png,2.png,3.png,4.png,5.png,6.png,7.png,8.png,9.png,Guide1.png,GuideBack.jpg,back.png,countdownback.png,fkingCar.png,next-step.png,obstack1.png,obstack2.png,obstack3.png,s.png,scoreboardback.png,倒计时.svga,护盾.png,背景移动元素.svga,跑道.svga,路架子.svga",
"name": "GameScene",
"atlas": {
"back.png": {
"x": 2,
"y": 2,
"w": 750,
"h": 1624,
"ox": 0,
"oy": 0,
"sw": 750,
"sh": 1624,
"ro": false
},
"Guide1.png": {
"x": 754,
"y": 2,
"w": 487,
"h": 43,
"ox": 0,
"oy": 0,
"sw": 487,
"sh": 43,
"ro": true
},
"护盾.png": {
"x": 799,
"y": 2,
"w": 401,
"h": 396,
"ox": 0,
"oy": 0,
"sw": 401,
"sh": 396,
"ro": true
},
"fkingCar.png": {
"x": 799,
"y": 405,
"w": 211,
"h": 309,
"ox": 0,
"oy": 0,
"sw": 211,
"sh": 309,
"ro": true
},
"countdownback.png": {
"x": 754,
"y": 618,
"w": 171,
"h": 94,
"ox": 0,
"oy": 0,
"sw": 171,
"sh": 94,
"ro": false
},
"scoreboardback.png": {
"x": 1110,
"y": 405,
"w": 152,
"h": 58,
"ox": 0,
"oy": 0,
"sw": 152,
"sh": 58,
"ro": true
},
"obstack3.png": {
"x": 927,
"y": 618,
"w": 86,
"h": 104,
"ox": 0,
"oy": 0,
"sw": 86,
"sh": 104,
"ro": true
},
"obstack2.png": {
"x": 1110,
"y": 559,
"w": 77,
"h": 101,
"ox": 0,
"oy": 0,
"sw": 77,
"sh": 101,
"ro": false
},
"next-step.png": {
"x": 754,
"y": 491,
"w": 100,
"h": 39,
"ox": 0,
"oy": 0,
"sw": 100,
"sh": 39,
"ro": true
},
"obstack1.png": {
"x": 1033,
"y": 618,
"w": 73,
"h": 92,
"ox": 0,
"oy": 0,
"sw": 73,
"sh": 92,
"ro": false
},
"0.png": {
"x": 1108,
"y": 662,
"w": 29,
"h": 37,
"ox": 0,
"oy": 0,
"sw": 29,
"sh": 37,
"ro": true
},
"1.png": {
"x": 754,
"y": 593,
"w": 23,
"h": 37,
"ox": 0,
"oy": 0,
"sw": 23,
"sh": 37,
"ro": true
},
"2.png": {
"x": 1147,
"y": 662,
"w": 33,
"h": 37,
"ox": 0,
"oy": 0,
"sw": 33,
"sh": 37,
"ro": true
},
"3.png": {
"x": 1108,
"y": 693,
"w": 30,
"h": 37,
"ox": 0,
"oy": 0,
"sw": 30,
"sh": 37,
"ro": true
},
"4.png": {
"x": 1147,
"y": 697,
"w": 30,
"h": 37,
"ox": 0,
"oy": 0,
"sw": 30,
"sh": 37,
"ro": true
},
"5.png": {
"x": 927,
"y": 706,
"w": 32,
"h": 37,
"ox": 0,
"oy": 0,
"sw": 32,
"sh": 37,
"ro": true
},
"6.png": {
"x": 966,
"y": 706,
"w": 30,
"h": 37,
"ox": 0,
"oy": 0,
"sw": 30,
"sh": 37,
"ro": true
},
"7.png": {
"x": 1005,
"y": 712,
"w": 29,
"h": 37,
"ox": 0,
"oy": 0,
"sw": 29,
"sh": 37,
"ro": true
},
"8.png": {
"x": 966,
"y": 738,
"w": 30,
"h": 37,
"ox": 0,
"oy": 0,
"sw": 30,
"sh": 37,
"ro": true
},
"9.png": {
"x": 1044,
"y": 712,
"w": 30,
"h": 37,
"ox": 0,
"oy": 0,
"sw": 30,
"sh": 37,
"ro": true
},
"s.png": {
"x": 1005,
"y": 743,
"w": 30,
"h": 29,
"ox": 0,
"oy": 0,
"sw": 30,
"sh": 29,
"ro": false
}
}
"name": "GameScene"
},
{
"keys": "awardBtn.png,indexSceneBack.jpg,indexSceneLogo.png,ruleBtn.png,startBtn.png,首页氛围.svga",
"name": "IndexScene",
"atlas": {
"indexSceneLogo.png": {
"x": 2,
"y": 2,
"w": 746,
"h": 354,
"ox": 0,
"oy": 0,
"sw": 746,
"sh": 354,
"ro": false
},
"startBtn.png": {
"x": 2,
"y": 358,
"w": 374,
"h": 126,
"ox": 0,
"oy": 0,
"sw": 374,
"sh": 126,
"ro": false
},
"ruleBtn.png": {
"x": 378,
"y": 358,
"w": 137,
"h": 51,
"ox": 0,
"oy": 0,
"sw": 137,
"sh": 51,
"ro": false
},
"awardBtn.png": {
"x": 378,
"y": 411,
"w": 136,
"h": 51,
"ox": 0,
"oy": 0,
"sw": 136,
"sh": 51,
"ro": false
}
}
"name": "IndexScene"
},
{
"keys": "cancelBtn.png,oneMoreTime.png,resultModalback.png",
"name": "ResultModal",
"atlas": {
"resultModalback.png": {
"x": 2,
"y": 2,
"w": 667,
"h": 944,
"ox": 0,
"oy": 0,
"sw": 667,
"sh": 944,
"ro": false
},
"cancelBtn.png": {
"x": 671,
"y": 2,
"w": 265,
"h": 95,
"ox": 0,
"oy": 0,
"sw": 265,
"sh": 95,
"ro": true
},
"oneMoreTime.png": {
"x": 671,
"y": 269,
"w": 265,
"h": 95,
"ox": 0,
"oy": 0,
"sw": 265,
"sh": 95,
"ro": true
}
}
"name": "ResultModal"
},
{
"keys": "ruleModalBack.png",
"name": "RuleModal",
"atlas": {
"ruleModalBack.png": {
"x": 2,
"y": 2,
"w": 547,
"h": 697,
"ox": 0,
"oy": 0,
"sw": 547,
"sh": 697,
"ro": false
}
}
"name": "RuleModal"
},
{
"keys": "close-btn.png,comCloseBtn.png,com_bg.jpg,toastBg.png,waitingBg.png,waitingRot.png",
"name": "common",
"atlas": {
"toastBg.png": {
"x": 2,
"y": 2,
"w": 460,
"h": 130,
"ox": 0,
"oy": 0,
"sw": 460,
"sh": 130,
"ro": false
},
"waitingBg.png": {
"x": 2,
"y": 134,
"w": 160,
"h": 180,
"ox": 0,
"oy": 0,
"sw": 160,
"sh": 180,
"ro": true
},
"comCloseBtn.png": {
"x": 184,
"y": 134,
"w": 58,
"h": 58,
"ox": 0,
"oy": 0,
"sw": 58,
"sh": 58,
"ro": false
},
"waitingRot.png": {
"x": 184,
"y": 194,
"w": 56,
"h": 56,
"ox": 0,
"oy": 0,
"sw": 56,
"sh": 56,
"ro": false
},
"close-btn.png": {
"x": 242,
"y": 194,
"w": 50,
"h": 51,
"ox": 0,
"oy": 0,
"sw": 50,
"sh": 51,
"ro": false
}
}
"name": "common"
},
{
"keys": "l+.png,l0.png,l1.png,l2.png,l3.png,l4.png,l5.png,l6.png,l7.png,l8.png,l9.png,loadBack.jpg,progress-back.png,progress-icon.png,progress-track.png",
"name": "loading",
"atlas": {
"progress-track.png": {
"x": 2,
"y": 2,
"w": 278,
"h": 29,
"ox": 0,
"oy": 0,
"sw": 278,
"sh": 29,
"ro": false
},
"progress-back.png": {
"x": 2,
"y": 33,
"w": 277,
"h": 29,
"ox": 0,
"oy": 0,
"sw": 277,
"sh": 29,
"ro": false
},
"progress-icon.png": {
"x": 2,
"y": 64,
"w": 92,
"h": 59,
"ox": 0,
"oy": 0,
"sw": 92,
"sh": 59,
"ro": false
},
"l0.png": {
"x": 96,
"y": 64,
"w": 19,
"h": 26,
"ox": 0,
"oy": 0,
"sw": 19,
"sh": 26,
"ro": false
},
"l1.png": {
"x": 96,
"y": 92,
"w": 15,
"h": 26,
"ox": 0,
"oy": 0,
"sw": 15,
"sh": 26,
"ro": false
},
"l2.png": {
"x": 113,
"y": 92,
"w": 21,
"h": 26,
"ox": 0,
"oy": 0,
"sw": 21,
"sh": 26,
"ro": false
},
"l3.png": {
"x": 117,
"y": 64,
"w": 20,
"h": 26,
"ox": 0,
"oy": 0,
"sw": 20,
"sh": 26,
"ro": false
},
"l4.png": {
"x": 136,
"y": 92,
"w": 20,
"h": 26,
"ox": 0,
"oy": 0,
"sw": 20,
"sh": 26,
"ro": false
},
"l5.png": {
"x": 139,
"y": 64,
"w": 20,
"h": 26,
"ox": 0,
"oy": 0,
"sw": 20,
"sh": 26,
"ro": false
},
"l6.png": {
"x": 158,
"y": 92,
"w": 20,
"h": 26,
"ox": 0,
"oy": 0,
"sw": 20,
"sh": 26,
"ro": false
},
"l7.png": {
"x": 161,
"y": 64,
"w": 19,
"h": 26,
"ox": 0,
"oy": 0,
"sw": 19,
"sh": 26,
"ro": false
},
"l8.png": {
"x": 180,
"y": 92,
"w": 20,
"h": 26,
"ox": 0,
"oy": 0,
"sw": 20,
"sh": 26,
"ro": false
},
"l9.png": {
"x": 182,
"y": 64,
"w": 20,
"h": 26,
"ox": 0,
"oy": 0,
"sw": 20,
"sh": 26,
"ro": false
},
"l+.png": {
"x": 202,
"y": 92,
"w": 17,
"h": 16,
"ox": 0,
"oy": 0,
"sw": 17,
"sh": 16,
"ro": true
}
}
"name": "loading"
},
{
"keys": "fkBtn.png,lookBtn.png,rescurrectionModalBack.png",
"name": "rescurrectionModal",
"atlas": {
"rescurrectionModalBack.png": {
"x": 2,
"y": 2,
"w": 547,
"h": 389,
"ox": 0,
"oy": 0,
"sw": 547,
"sh": 389,
"ro": false
},
"fkBtn.png": {
"x": 2,
"y": 393,
"w": 265,
"h": 95,
"ox": 0,
"oy": 0,
"sw": 265,
"sh": 95,
"ro": false
},
"lookBtn.png": {
"x": 269,
"y": 393,
"w": 265,
"h": 95,
"ox": 0,
"oy": 0,
"sw": 265,
"sh": 95,
"ro": false
}
}
"name": "rescurrectionModal"
}
],
"path": "https://yun.duiba.com.cn/db_games/activity/template/1655707644/resource/"
"path": location.origin + "/resource/"
}
\ No newline at end of file
......@@ -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