This commit is contained in:
guoqing.zhu 2022-06-14 17:06:30 +08:00
parent 9548e977ee
commit 35cc8c1f1e
4 changed files with 30 additions and 6 deletions

View File

@ -67,6 +67,7 @@ export default class Academy_block extends cc.Component {
this.addsign.active = false; this.addsign.active = false;
this.title.string = 'TRAINING'; this.title.string = 'TRAINING';
this.timeLabel.node.active = true; this.timeLabel.node.active = true;
this.unscheduleAllCallbacks();
this.schedule(function () { this.schedule(function () {
if (this.leftTime >= 1) { if (this.leftTime >= 1) {
this.timeLabel.string = this.formatSeconds( this.timeLabel.string = this.formatSeconds(

View File

@ -68,15 +68,28 @@ export class ChooseHeroUpQuality extends UIBase {
this.costLabel.string = cfg.gold; this.costLabel.string = cfg.gold;
this.timeLabel.string = cfg.time; this.timeLabel.string = cfg.time;
this.rateLabel.string = cfg.success_rate + '%'; 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) { } else if (data.index == 1) {
this.secHeroChoose.active = false; this.secHeroChoose.active = false;
this.secHero.getComponent('herochoseone').initdata(data.heroInfo); this.secHero.getComponent('herochoseone').initdata(data.heroInfo);
this.secHero.active = true; this.secHero.active = true;
this.secHeroData = data.heroInfo.hero_uniid; 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;
}
);
} }
} }

View File

@ -21,8 +21,6 @@ export class UpdateChoose extends UIBase {
var sc = node.getComponent('herochoseone'); var sc = node.getComponent('herochoseone');
sc.initdata(element); sc.initdata(element);
console.log(element.quality);
// //
if ( if (
this.qualityIndex && this.qualityIndex &&

View File

@ -733,4 +733,16 @@ module.exports = {
.addKV('hero_uniid', hero_uuid); .addKV('hero_uniid', hero_uuid);
this.getResponce(cb, this.urlbd); 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);
},
}; };