123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- import { _decorator, Component, instantiate, Node, Prefab, Sprite, SpriteFrame } from 'cc';
- import { base_ui } from '../../fw/base_ui';
- import { select_area_item } from './select_area_item';
- const { ccclass, property } = _decorator;
- @ccclass('select_area')
- export class select_area extends base_ui {
- @property(Node) btn_close:Node = null
- @property(Node) img_title:Node = null
- @property(SpriteFrame) sf_province:SpriteFrame = null
- @property(SpriteFrame) sf_city:SpriteFrame = null
- @property(Node) province_btn_node:Node = null
- @property(Node) province_btn_next:Node = null
- @property(Node) city_btn_node:Node = null
- @property(Node) city_btn_up:Node = null
- @property(Node) city_btn_true:Node = null
- @property(Node) list_content:Node = null
- @property(Prefab) list_item:Prefab = null
- protected start(): void {
- this.onButtonListen(this.btn_close, ()=>{
- this.close()
- })
- this.onButtonListen(this.province_btn_next, ()=>{
- this.onClickProviceNext()
- })
- this.onButtonListen(this.city_btn_up, ()=>{
- this.onClickCityUp()
- })
- this.onButtonListen(this.city_btn_true, ()=>{
- this.onClickCityTrue()
- })
- this.reloadProvinceListData()
- }
- private onClickProviceNext() {
- this.img_title.getComponent(Sprite).spriteFrame = this.sf_city
- this.province_btn_node.active = false
- this.city_btn_node.active = true
- }
- private onClickCityUp() {
- this.img_title.getComponent(Sprite).spriteFrame = this.sf_province
- this.province_btn_node.active = true
- this.city_btn_node.active = false
- }
- private onClickCityTrue() {
- this.close()
- }
- private reloadProvinceListData() {
- this.list_content.removeAllChildren()
- for (let index = 0; index < 50; index++) {
- let item = instantiate(this.list_item)
- item.parent = this.list_content;
- item.getComponent(select_area_item).initView(()=>{
- })
- }
- }
- private reloadCityListData() {
- }
- }
|