Commit 34cb16d7 authored by liujiangnan's avatar liujiangnan

feat: 详情页

parent 3f662a00
......@@ -65,7 +65,12 @@ export default class NewClass extends cc.Component {
cc.find("Canvas/learnreport/avatar").getComponent(cc.Sprite).spriteFrame = cc.find(`Canvas/avatars/${this.userInfo.avatar_url||1}`).getComponent(cc.Sprite).spriteFrame;
await this.loadSyllabusTree();
await this.drawPage();
if(this.reportType === 'pdtd') {
await this.drawPagePdtd();
}
if(this.reportType === 'ydjyz') {
await this.drawPageYdjyz();
}
this.hideLoading();
}
......@@ -82,7 +87,7 @@ export default class NewClass extends cc.Component {
}
}
async drawPage() {
async drawPagePdtd() {
const node = cc.find("Canvas/learnreport");
cc.find("typeLabel", node).getComponent(cc.Label).string = this.reportObj[this.reportType];
......@@ -101,6 +106,18 @@ export default class NewClass extends cc.Component {
await this.drawPageItems(0);
}
async drawPageYdjyz() {
const node = cc.find("Canvas/learnreport");
cc.find("typeLabel", node).getComponent(cc.Label).string = this.reportObj[this.reportType];
// 设置每个级别激活状态(是否显示锁头)
for (let i = 1; i < 5; i++) {
cc.find(`level${i+1}/lock_1`, node).active = false;
}
// 激活索引为0的Level
await this.drawPageItems(0);
}
clearnContent() {
const node = cc.find("Canvas/learnreport");
const contentNode = cc.find("cardArea/pages/view/content", node);
......@@ -119,7 +136,16 @@ export default class NewClass extends cc.Component {
rows = await this.loadData(levels[this.reportType][index].id);
rows = rows.filter(item => item.name.trim() !=='more games');
}
const unLocks = this.getUnlockSyllabuses();
let unLocks = [];
if (this.reportType === 'pdtd') {
unLocks = this.getUnlockSyllabuses();
}
if (this.reportType === 'ydjyz') {
// 全都解锁(没有解锁逻辑)
unLocks = rows.map(item => item.id);
}
const contentNode = cc.find("cardArea/pages/view/content", node);
const item = cc.find("Canvas/learnreport/cardArea/pages/view/content/item");
......
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