Commit 94e14cc5 authored by limingzhe's avatar limingzhe

fix: debug

parent 5047d496
...@@ -385,6 +385,8 @@ cc.Class({ ...@@ -385,6 +385,8 @@ cc.Class({
]; ];
this.canTouch = true;
this.routeArr = []; this.routeArr = [];
this.pageIDHistroy = []; // 用于存储各级ID 用于前进、后退、上次学习 this.pageIDHistroy = []; // 用于存储各级ID 用于前进、后退、上次学习
...@@ -631,6 +633,10 @@ cc.Class({ ...@@ -631,6 +633,10 @@ cc.Class({
backBtn.y = this.canvas.height / 2 - this.canvas.width / 16; backBtn.y = this.canvas.height / 2 - this.canvas.width / 16;
backBtn.addComponent(cc.Button); backBtn.addComponent(cc.Button);
backBtn.on("click", () => { backBtn.on("click", () => {
if (!this.canTouch) {
return;
}
this.enterLastMenu(); this.enterLastMenu();
}) })
}, },
...@@ -1902,6 +1908,9 @@ cc.Class({ ...@@ -1902,6 +1908,9 @@ cc.Class({
// 返回上一级页面 // 返回上一级页面
enterLastMenu() { enterLastMenu() {
const pageData = this.popRouteHistory(); const pageData = this.popRouteHistory();
this.loadViewByID(pageData.id, pageData.pid) this.loadViewByID(pageData.id, pageData.pid)
...@@ -1933,6 +1942,9 @@ cc.Class({ ...@@ -1933,6 +1942,9 @@ cc.Class({
return return
} }
this.canTouch = false;
// 找到当前页面父节点信息 获取标题信息 // 找到当前页面父节点信息 获取标题信息
const pData = await this.getDataByPid(pid); const pData = await this.getDataByPid(pid);
let pName = ""; let pName = "";
...@@ -1955,10 +1967,19 @@ cc.Class({ ...@@ -1955,10 +1967,19 @@ cc.Class({
// 菜单加载菜单页面 // 菜单加载菜单页面
this.showMenuView(resData.rows, pName); this.showMenuView(resData.rows, pName);
} }
this.canTouch = true;
}, },
// 跳转下一级菜单 // 跳转下一级菜单
enterNextMenu(data=null) { enterNextMenu(data=null) {
if (!this.canTouch) {
return;
}
this.canTouch = false;
console.log("data.id: ", data.id); console.log("data.id: ", data.id);
this.getDataByPid(data.id, (resData) => { this.getDataByPid(data.id, (resData) => {
if (!resData) { if (!resData) {
...@@ -1981,6 +2002,10 @@ cc.Class({ ...@@ -1981,6 +2002,10 @@ cc.Class({
} else { } else {
this.showMenuView(resData.rows, data.text_en); this.showMenuView(resData.rows, data.text_en);
} }
this.canTouch = true;
}) })
// this.showMenuView(data); // this.showMenuView(data);
// this.levelView.active = true; // this.levelView.active = true;
......
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