Commit 3cb2abd2 authored by 张华挺's avatar 张华挺

降级处理

parent 924d532c
This diff is collapsed.
This diff is collapsed.
...@@ -10,6 +10,7 @@ import { handleVideo } from "../../../src/myVideo/videoCtrl"; ...@@ -10,6 +10,7 @@ import { handleVideo } from "../../../src/myVideo/videoCtrl";
import handleInspireVideo from "../../../src/inspireVideo"; import handleInspireVideo from "../../../src/inspireVideo";
import Loading from "./Loading"; import Loading from "./Loading";
import { showToast } from "../ctrls/toastCtrl"; import { showToast } from "../ctrls/toastCtrl";
export default class PrizePanel extends Panel { export default class PrizePanel extends Panel {
_level; _level;
...@@ -47,6 +48,7 @@ export default class PrizePanel extends Panel { ...@@ -47,6 +48,7 @@ export default class PrizePanel extends Panel {
start(data) { start(data) {
super.start(); super.start();
this.initTTScreen()
this._level = parseInt(data.level + ''); this._level = parseInt(data.level + '');
this['lvTxt'].text = `关卡${this._level}` this['lvTxt'].text = `关卡${this._level}`
...@@ -110,6 +112,24 @@ export default class PrizePanel extends Panel { ...@@ -110,6 +112,24 @@ export default class PrizePanel extends Panel {
}, this) }, this)
} }
initTTScreen() {
// 插屏互动已经调用的次数
const configData = DataManager.ins.getData('getConfig')
const surplusNum = configData.data.num
if (surplusNum && surplusNum <= 3) {
// 每天在通过成功后只出3次插屏互动
NetManager.ins.getUserConfig(() => {})
const signConfigData = configData.data.list.filter(item => item.id === 5)
if (signConfigData.length) {
if (signConfigData[0].index === 0) {
window['bridge'] && window['bridge']["showGamerAd"] && window['bridge']["showGamerAd"](window["TTPauseScreen"], 3)
} else if (signConfigData[0].index === 1) {
window['bridge'] && window['bridge']["showGamerAd"] && window['bridge']["showGamerAd"](window["TAPauseScreen"], 3)
}
}
}
}
async setStar(nums: number) { async setStar(nums: number) {
this['pic1'].visible = this['pic2'].visible = this['pic3'].visible = false; this['pic1'].visible = this['pic2'].visible = this['pic3'].visible = false;
// this['light'].visible = false; // this['light'].visible = false;
......
...@@ -933,17 +933,22 @@ export default class MainScene extends Scene { ...@@ -933,17 +933,22 @@ export default class MainScene extends Scene {
} }
} }
onTap_quitBtn() { onTap_quitBtn() {
// 两个版本的二次判断
const configData = DataManager.ins.getData('getConfig') const configData = DataManager.ins.getData('getConfig')
let signConfigData = configData.data.list.filter(item => item.id === 5) if (!configData.data.list) {
if (signConfigData.length) { let signConfigData = configData.data.filter(item => item.id === 5)
if (signConfigData[0].index === 0) { if (signConfigData.length) {
window['bridge'] && window['bridge']["showGamerAd"] && window['bridge']["showGamerAd"](window["TTPauseScreen"], 3) if (signConfigData[0].index === 0) {
} else if (signConfigData[0].index === 1) { window['bridge'] && window['bridge']["showGamerAd"] && window['bridge']["showGamerAd"](window["TTPauseScreen"], 3)
window['bridge'] && window['bridge']["showGamerAd"] && window['bridge']["showGamerAd"](window["TAPauseScreen"], 3) } else if (signConfigData[0].index === 1) {
} window['bridge'] && window['bridge']["showGamerAd"] && window['bridge']["showGamerAd"](window["TAPauseScreen"], 3)
wait(300).then(() => { }
wait(300).then(() => {
PanelCtrl.instance.show("quit", { level: this.chapter });
})
} else {
PanelCtrl.instance.show("quit", { level: this.chapter }); PanelCtrl.instance.show("quit", { level: this.chapter });
}) }
} else { } else {
PanelCtrl.instance.show("quit", { level: this.chapter }); PanelCtrl.instance.show("quit", { level: this.chapter });
} }
......
...@@ -58,7 +58,8 @@ export default class MapScene extends Scene { ...@@ -58,7 +58,8 @@ export default class MapScene extends Scene {
this["tuiaGroup"].visible = false; this["tuiaGroup"].visible = false;
this["newTuiaGroup"].visible = false; this["newTuiaGroup"].visible = false;
const configData = DataManager.ins.getData('getConfig') const configData = DataManager.ins.getData('getConfig')
let iconConfigData = configData.data.list.filter(item => item.id === 1) const configDetData = configData.data.list ? configData.data.list : configData.data
let iconConfigData = configDetData.filter(item => item.id === 1)
if (iconConfigData.length) { if (iconConfigData.length) {
const index = iconConfigData[0].index const index = iconConfigData[0].index
switch (index) { switch (index) {
...@@ -204,7 +205,7 @@ export default class MapScene extends Scene { ...@@ -204,7 +205,7 @@ export default class MapScene extends Scene {
} else { } else {
target = homeData.levels.length + 1; target = homeData.levels.length + 1;
} }
let startConfigData = configData.data.filter(item => item.id === 2) let startConfigData = configDetData.filter(item => item.id === 2)
let startPanelType = 'StartPanel' let startPanelType = 'StartPanel'
if (startConfigData.length && startConfigData[0].index === 0) startPanelType = 'StartPanelNew' if (startConfigData.length && startConfigData[0].index === 0) startPanelType = 'StartPanelNew'
for (const key in MapScene.iconHash) { for (const key in MapScene.iconHash) {
......
...@@ -51,7 +51,8 @@ export default class FailedPanel extends Panel { ...@@ -51,7 +51,8 @@ export default class FailedPanel extends Panel {
} }
const configData = DataManager.ins.getData('getConfig') const configData = DataManager.ins.getData('getConfig')
let fileConfigData = configData.data.list.filter(item => item.id === 3) const configDetData = configData.data.list ? configData.data.list : configData.data
const fileConfigData = configDetData.filter(item => item.id === 3)
if (fileConfigData.length && fileConfigData[0].index === 0) { if (fileConfigData.length && fileConfigData[0].index === 0) {
// 增加重新闯关倒计时 // 增加重新闯关倒计时
let time = 3 let time = 3
......
...@@ -62,7 +62,8 @@ export default class SignPanel extends Panel { ...@@ -62,7 +62,8 @@ export default class SignPanel extends Panel {
// showToast('签到成功!快去闯关吧~'); // showToast('签到成功!快去闯关吧~');
// PanelCtrl.instance.show('signPrize'); // PanelCtrl.instance.show('signPrize');
const configData = DataManager.ins.getData('getConfig') const configData = DataManager.ins.getData('getConfig')
let signConfigData = configData.data.list.filter(item => item.id === 6) const configDetData = configData.data.list ? configData.data.list : configData.data
let signConfigData = configDetData.filter(item => item.id === 6)
if (signConfigData.length && signConfigData[0].index === 1) { if (signConfigData.length && signConfigData[0].index === 1) {
window['bridge'] && window['bridge']["showGamerAd"] && window['bridge']["showGamerAd"](window["TASignScreen"], 3) window['bridge'] && window['bridge']["showGamerAd"] && window['bridge']["showGamerAd"](window["TASignScreen"], 3)
window["finishScreenShowSignPrize"] = window['bridge']["finishScreenShowSignPrize"] = PanelCtrl.instance.addToShowPanels('signPrize'); window["finishScreenShowSignPrize"] = window['bridge']["finishScreenShowSignPrize"] = PanelCtrl.instance.addToShowPanels('signPrize');
......
...@@ -49,7 +49,8 @@ export default class SignPrizePanel extends Panel { ...@@ -49,7 +49,8 @@ export default class SignPrizePanel extends Panel {
NetManager.ins.showLog(getlogItem(7)) NetManager.ins.showLog(getlogItem(7))
const configData = DataManager.ins.getData('getConfig') const configData = DataManager.ins.getData('getConfig')
let signConfigData = configData.data.list.filter(item => item.id === 6) const configDetData = configData.data.list ? configData.data.list : configData.data
let signConfigData = configDetData.filter(item => item.id === 6)
if (signConfigData.length && signConfigData[0].index === 1) { if (signConfigData.length && signConfigData[0].index === 1) {
// 因为除了插屏了,不需要翻倍 // 因为除了插屏了,不需要翻倍
this['close2Btn'].visible = true; this['close2Btn'].visible = true;
......
...@@ -12,7 +12,8 @@ export const gotoNextLevel = (currentLevel?) => { ...@@ -12,7 +12,8 @@ export const gotoNextLevel = (currentLevel?) => {
    }     }
    const onMapScene = SceneCtrl.instance.currentScene instanceof MapScene;     const onMapScene = SceneCtrl.instance.currentScene instanceof MapScene;
const configData = DataManager.ins.getData('getConfig') const configData = DataManager.ins.getData('getConfig')
let startConfigData = configData.data.list.filter(item => item.id === 2) const configDetData = configData.data.list ? configData.data.list : configData.data
let startConfigData = configDetData.filter(item => item.id === 2)
let startPanelType = 'StartPanel' let startPanelType = 'StartPanel'
if (startConfigData.length && startConfigData[0].index === 0) startPanelType = 'StartPanelNew' if (startConfigData.length && startConfigData[0].index === 0) startPanelType = 'StartPanelNew'
......
...@@ -3,29 +3,26 @@ ...@@ -3,29 +3,26 @@
"code": "0000000000", "code": "0000000000",
"desc": "OK", "desc": "OK",
"timestamp": 1582701970753, "timestamp": 1582701970753,
"data":{ "data":[
"list":[ {
{ "id":1,
"id":1, "index":2
"index":2 },
}, {
{ "id":2,
"id":2, "index":1
"index":1 },
}, {
{ "id":3,
"id":3, "index":1
"index":1 },
}, {
{ "id":5,
"id":5, "index":1
"index":1 },
}, {
{ "id":6,
"id":6, "index":1
"index":1 }
} ]
],
"num":3
}
} }
\ No newline at end of file
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