|
@@ -45,6 +45,7 @@ export class rank_list_top extends base_ui {
|
|
|
}
|
|
|
|
|
|
initView(data_list:rankData[]) {
|
|
|
+ this.clearAll()
|
|
|
if(data_list.length>0) {
|
|
|
this.m_one_data = data_list[0]
|
|
|
this.setLabName(this.one_lab_name, this.m_one_data)
|
|
@@ -68,6 +69,23 @@ export class rank_list_top extends base_ui {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private clearAll() {
|
|
|
+ this.one_lab_name.getComponent(Label).string = ''
|
|
|
+ this.one_img_avatar.getComponent(Sprite).spriteFrame = null
|
|
|
+ this.one_lab_score.getComponent(Label).string = ''
|
|
|
+ this.one_img_car.getComponent(Sprite).spriteFrame = null
|
|
|
+
|
|
|
+ this.two_lab_name.getComponent(Label).string = ''
|
|
|
+ this.two_img_avatar.getComponent(Sprite).spriteFrame = null
|
|
|
+ this.two_lab_score.getComponent(Label).string = ''
|
|
|
+ this.two_img_car.getComponent(Sprite).spriteFrame = null
|
|
|
+
|
|
|
+ this.three_lab_name.getComponent(Label).string = ''
|
|
|
+ this.three_img_avatar.getComponent(Sprite).spriteFrame = null
|
|
|
+ this.three_lab_score.getComponent(Label).string = ''
|
|
|
+ this.three_img_car.getComponent(Sprite).spriteFrame = null
|
|
|
+ }
|
|
|
+
|
|
|
private setLabName(node:Node, data:rankData) {
|
|
|
let lab_component = node.getComponent(Label)
|
|
|
if(data.nickName.length>5) {
|