|
@@ -7,27 +7,19 @@ import { userDataManager } from '../../manager/userDataManager';
|
|
|
import { GameManager } from '../../GameManager';
|
|
|
import { ClientEvent } from '../../lib/clientEvent';
|
|
|
import { config } from '../../config';
|
|
|
+import { rank_classify } from './rank_classify';
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('rank')
|
|
|
export class rank extends Component {
|
|
|
@property(Node) btn_back:Node = null;
|
|
|
- @property(Node) btn_country:Node = null;
|
|
|
- @property(Node) btn_province:Node = null;
|
|
|
- @property(Node) btn_city:Node = null;
|
|
|
+ @property(Node) classify_node:Node = null;
|
|
|
@property(Node) list:Node = null;
|
|
|
@property(Node) list_top:Node = null;
|
|
|
@property(Node) list_content:Node = null;
|
|
|
@property(Prefab) rank_list_item:Prefab = null;
|
|
|
@property(Node) my_info_node:Node = null;
|
|
|
|
|
|
- @property(SpriteFrame) sf_country_selected:SpriteFrame = null;
|
|
|
- @property(SpriteFrame) sf_country_unselected:SpriteFrame = null;
|
|
|
- @property(SpriteFrame) sf_province_selected:SpriteFrame = null;
|
|
|
- @property(SpriteFrame) sf_province_unselected:SpriteFrame = null;
|
|
|
- @property(SpriteFrame) sf_city_selected:SpriteFrame = null;
|
|
|
- @property(SpriteFrame) sf_city_unselected:SpriteFrame = null;
|
|
|
-
|
|
|
private m_onReloadCountryDataCallback = null;
|
|
|
|
|
|
onReloadCountryDataCallback(cb) {
|
|
@@ -38,37 +30,13 @@ export class rank extends Component {
|
|
|
uiManager.Instance().onButtonListen(this.btn_back, ()=>{
|
|
|
this.close()
|
|
|
})
|
|
|
- uiManager.Instance().onButtonListen(this.btn_country, ()=>{
|
|
|
- this.onClassifyItem(1)
|
|
|
- })
|
|
|
- uiManager.Instance().onButtonListen(this.btn_province, ()=>{
|
|
|
- this.onClassifyItem(2)
|
|
|
- })
|
|
|
- uiManager.Instance().onButtonListen(this.btn_city, ()=>{
|
|
|
- this.onClassifyItem(3)
|
|
|
- })
|
|
|
|
|
|
- this.onClassifyItem(1)
|
|
|
+ let type = 1
|
|
|
+ this.classify_node.getComponent(rank_classify).init(type,this.onClassifyItem.bind(this))
|
|
|
+ this.loadView(type)
|
|
|
}
|
|
|
|
|
|
onClassifyItem(type:number) {
|
|
|
- this.btn_country.getComponent(Sprite).spriteFrame = this.sf_country_unselected
|
|
|
- this.btn_province.getComponent(Sprite).spriteFrame = this.sf_province_unselected
|
|
|
- this.btn_city.getComponent(Sprite).spriteFrame = this.sf_city_unselected
|
|
|
- switch (type) {
|
|
|
- case 1:
|
|
|
- this.btn_country.getComponent(Sprite).spriteFrame = this.sf_country_selected
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- this.btn_province.getComponent(Sprite).spriteFrame = this.sf_province_selected
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- this.btn_city.getComponent(Sprite).spriteFrame = this.sf_city_selected
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
this.loadView(type)
|
|
|
}
|
|
|
|