|
@@ -29,6 +29,8 @@ export class home_bottom extends Component {
|
|
|
@property(Node) countdown_node:Node = null
|
|
|
@property(Node) tt_btn_gift:Node = null
|
|
|
@property(Node) tt_sidebar:Node = null
|
|
|
+ private m_d_content = null
|
|
|
+ private rank_item_list:home_bottom_rank_item[] = []
|
|
|
|
|
|
start() {
|
|
|
uiManager.Instance().onButtonListen(this.btn_wenhao, ()=>{
|
|
@@ -54,8 +56,12 @@ export class home_bottom extends Component {
|
|
|
})
|
|
|
})
|
|
|
uiManager.Instance().onButtonListen(this.tt_btn_gift, ()=>{
|
|
|
- this.onClickTTLihe()
|
|
|
+ this.onClickTTGift()
|
|
|
})
|
|
|
+
|
|
|
+ this.rank_item_list.push(this.rank1_node.getComponent(home_bottom_rank_item))
|
|
|
+ this.rank_item_list.push(this.rank2_node.getComponent(home_bottom_rank_item))
|
|
|
+ this.rank_item_list.push(this.rank3_node.getComponent(home_bottom_rank_item))
|
|
|
}
|
|
|
|
|
|
public init() {
|
|
@@ -92,18 +98,36 @@ export class home_bottom extends Component {
|
|
|
}
|
|
|
|
|
|
public reloadCountryRankData(d_content) {
|
|
|
+ this.m_d_content = d_content
|
|
|
if(d_content.length>0) {
|
|
|
let rank_data = d_content[0]
|
|
|
- this.rank1_node.getComponent(home_bottom_rank_item).initView(rank_data, this.onClickRankGotoUserInfo.bind(this))
|
|
|
+ this.loadRankItemData(0,rank_data)
|
|
|
}
|
|
|
if(d_content.length>1) {
|
|
|
let rank_data = d_content[1]
|
|
|
- this.rank2_node.getComponent(home_bottom_rank_item).initView(rank_data, this.onClickRankGotoUserInfo.bind(this))
|
|
|
+ this.loadRankItemData(1,rank_data)
|
|
|
}
|
|
|
if(d_content.length>2) {
|
|
|
let rank_data = d_content[2]
|
|
|
- this.rank3_node.getComponent(home_bottom_rank_item).initView(rank_data, this.onClickRankGotoUserInfo.bind(this))
|
|
|
+ this.loadRankItemData(2,rank_data)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public checkIsMineCountryRank() {
|
|
|
+ if(this.m_d_content==undefined||this.m_d_content==null) {
|
|
|
+ return
|
|
|
}
|
|
|
+ for (let index = 0; index < this.m_d_content.length; index++) {
|
|
|
+ const element = this.m_d_content[index]
|
|
|
+ if(element.user_id==userDataManager.user_data.id) {
|
|
|
+ this.loadRankItemData(index,element)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private loadRankItemData(index:number, rank_data) {
|
|
|
+ this.rank_item_list[index].initView(rank_data, this.onClickRankGotoUserInfo.bind(this))
|
|
|
}
|
|
|
|
|
|
private onClickRankGotoUserInfo(item:home_bottom_rank_item) {
|
|
@@ -125,7 +149,7 @@ export class home_bottom extends Component {
|
|
|
this.tt_btn_gift.getComponent(Animation).play()
|
|
|
}
|
|
|
|
|
|
- private onClickTTLihe() {
|
|
|
+ private onClickTTGift() {
|
|
|
let isToEnterFromSidebar = SdkUtil.ttCheckToEnterFromSidebar()
|
|
|
this.tt_sidebar.getComponent(home_tt_sidebar).show(isToEnterFromSidebar, (r:home_tt_sidebar)=>{
|
|
|
SdkUtil.ttNavToSidebarScene()
|