add upfailed

This commit is contained in:
guoqing.zhu 2022-06-15 11:04:13 +08:00
parent 4c3bc991e2
commit f862d42b13
2 changed files with 11 additions and 5 deletions

View File

@ -1,4 +1,5 @@
const NetManage = require('../../manages/NetManage');
import { UpFail } from '../../tips/UpFail';
import { UpSuccess } from '../../tips/UpSuccess';
import { uimanger } from '../UIManger';
import { ChooseHeroUpdate } from './ChooseHeroUpdate';
@ -147,8 +148,14 @@ export default class Academy_block extends cc.Component {
type,
this.currentData.info.hero_uniid,
(res) => {
// wait...
uimanger.showUI(UpSuccess.prefabPath, res);
if (res.state == 0) {
// failed
uimanger.showUI(UpFail.prefabPath, res);
} else {
//success
uimanger.showUI(UpSuccess.prefabPath, res);
}
var node = cc
.find('Canvas')
.getComponentInChildren(UIUpdateHero).node;

View File

@ -20,9 +20,8 @@ export class UpFail extends UIBase {
@property(QualityStar) newStar: QualityStar = null;
init(data: any) {
console.log(JSON.stringify(data));
this.beforeNode.getComponent('herochoseone').initdata();
this.beforeNode.getComponent('herochoseone').initdata(data.old_hero);
this.lb_lv.string = data.old_hero.hero_lv;
this.lb_hp.string = data.old_hero.hp;
this.lb_atk.string = data.old_hero.atk;
this.lb_def.string = data.old_hero.def;