diff --git a/assets/scripts/UI/Academy/Academy_block.ts b/assets/scripts/UI/Academy/Academy_block.ts index a908187f..483ea222 100644 --- a/assets/scripts/UI/Academy/Academy_block.ts +++ b/assets/scripts/UI/Academy/Academy_block.ts @@ -67,6 +67,7 @@ export default class Academy_block extends cc.Component { this.addsign.active = false; this.title.string = 'TRAINING'; this.timeLabel.node.active = true; + this.unscheduleAllCallbacks(); this.schedule(function () { if (this.leftTime >= 1) { this.timeLabel.string = this.formatSeconds( diff --git a/assets/scripts/UI/Academy/ChooseHeroUpQuality.ts b/assets/scripts/UI/Academy/ChooseHeroUpQuality.ts index 8963e06c..ce3b8dca 100644 --- a/assets/scripts/UI/Academy/ChooseHeroUpQuality.ts +++ b/assets/scripts/UI/Academy/ChooseHeroUpQuality.ts @@ -68,15 +68,28 @@ export class ChooseHeroUpQuality extends UIBase { this.costLabel.string = cfg.gold; this.timeLabel.string = cfg.time; this.rateLabel.string = cfg.success_rate + '%'; - - this.oldHp.string = data.heroInfo.hp; - this.oldAtk.string = data.heroInfo.atk; - this.oldDef.string = data.heroInfo.def; } else if (data.index == 1) { this.secHeroChoose.active = false; this.secHero.getComponent('herochoseone').initdata(data.heroInfo); this.secHero.active = true; this.secHeroData = data.heroInfo.hero_uniid; + console.log(JSON.stringify(data)); + } + + if (this.mainHeroData && this.secHeroData) { + NetManage.upgradeQualityPreview( + this.mainHeroData, + this.secHeroData, + (res) => { + this.oldHp.string = res.old_hero.hp; + this.oldAtk.string = res.old_hero.atk; + this.oldDef.string = res.old_hero.def; + + this.newHp.string = res.new_hero.hp; + this.newAtk.string = res.new_hero.atk; + this.newDef.string = res.new_hero.def; + } + ); } } diff --git a/assets/scripts/UI/Academy/updatechoose.ts b/assets/scripts/UI/Academy/updatechoose.ts index 1bf1eb46..8d9ac5d5 100644 --- a/assets/scripts/UI/Academy/updatechoose.ts +++ b/assets/scripts/UI/Academy/updatechoose.ts @@ -21,8 +21,6 @@ export class UpdateChoose extends UIBase { var sc = node.getComponent('herochoseone'); sc.initdata(element); - console.log(element.quality); - // if ( this.qualityIndex && diff --git a/assets/scripts/manages/NetManage.js b/assets/scripts/manages/NetManage.js index df3c1258..be94ea6b 100644 --- a/assets/scripts/manages/NetManage.js +++ b/assets/scripts/manages/NetManage.js @@ -733,4 +733,16 @@ module.exports = { .addKV('hero_uniid', hero_uuid); this.getResponce(cb, this.urlbd); }, + + upgradeQualityPreview(hero_uuid, cost_hero_uuid, cb) { + this.urlbd.clear(); + this.urlbd + .addKV('c', 'Hero') + .addKV('a', 'upgradeQualityPreview') + .addKV('account_id', this.account_id) + .addKV('session_id', this.session_id) + .addKV('hero_uniid', hero_uuid) + .addKV('cost_hero_uniid', cost_hero_uuid); + this.getResponce(cb, this.urlbd); + }, };