|
@@ -11,19 +11,11 @@ export class car_lib_bottom extends base_ui {
|
|
|
@property(Node) btn_num_left:Node = null
|
|
|
@property(Node) btn_num_right:Node = null
|
|
|
@property(Node) lab_num:Node = null
|
|
|
- @property(Node) btn_score_sort:Node = null
|
|
|
- @property(SpriteFrame) sf_score_up:SpriteFrame = null
|
|
|
- @property(SpriteFrame) sf_score_down:SpriteFrame = null
|
|
|
- @property(Node) btn_jiesuo:Node = null
|
|
|
- @property(SpriteFrame) sf_jiesuo_select:SpriteFrame = null
|
|
|
- @property(SpriteFrame) sf_jiesuo_unselect:SpriteFrame = null
|
|
|
@property(Node) list:Node = null
|
|
|
@property(Node) list_content:Node = null
|
|
|
@property(Prefab) list_item:Prefab = null
|
|
|
|
|
|
private data_list:car_item_data[] = []
|
|
|
- private is_sort_up_status:boolean = true
|
|
|
- private is_jiesuo_status:boolean = false
|
|
|
private num_current_count:number = 1
|
|
|
private num_total_count:number = 1
|
|
|
private current_select_list_item:car_lib_list_item = null
|
|
@@ -44,15 +36,7 @@ export class car_lib_bottom extends base_ui {
|
|
|
}
|
|
|
this.num_current_count +=1
|
|
|
this.updateNumStatus(true)
|
|
|
- })
|
|
|
- this.onButtonListen(this.btn_score_sort, ()=>{
|
|
|
- this.is_sort_up_status = !this.is_sort_up_status
|
|
|
- this.updateSortStatus(true)
|
|
|
- })
|
|
|
- this.onButtonListen(this.btn_jiesuo, ()=>{
|
|
|
- this.is_jiesuo_status = !this.is_jiesuo_status
|
|
|
- this.updateJiesuoStatus(true)
|
|
|
- })
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
public init(click_item_cb) {
|
|
@@ -61,8 +45,7 @@ export class car_lib_bottom extends base_ui {
|
|
|
|
|
|
// this.data_list = JSON.parse(JSON.stringify(tools.all_car_list))
|
|
|
this.data_list = tools.all_car_page_list[this.getNumCurrentIndex()]
|
|
|
- this.updateSortStatus()
|
|
|
- this.updateJiesuoStatus()
|
|
|
+ console.log('this.data_list=',this.data_list)
|
|
|
this.updateNumStatus()
|
|
|
this.reloadListContentData()
|
|
|
|
|
@@ -84,29 +67,6 @@ export class car_lib_bottom extends base_ui {
|
|
|
return index
|
|
|
}
|
|
|
|
|
|
- updateSortStatus(is_load_data:boolean=false) {
|
|
|
- if(this.is_sort_up_status) {
|
|
|
- this.btn_score_sort.getComponent(Sprite).spriteFrame = this.sf_score_down
|
|
|
- } else {
|
|
|
- this.btn_score_sort.getComponent(Sprite).spriteFrame = this.sf_score_up
|
|
|
- }
|
|
|
- if(is_load_data) {
|
|
|
- this.data_list = this.data_list.reverse()
|
|
|
- this.reloadListContentData()
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- updateJiesuoStatus(is_load_data:boolean=false) {
|
|
|
- if(this.is_jiesuo_status) {
|
|
|
- this.btn_jiesuo.getComponent(Sprite).spriteFrame = this.sf_jiesuo_select
|
|
|
- } else {
|
|
|
- this.btn_jiesuo.getComponent(Sprite).spriteFrame = this.sf_jiesuo_unselect
|
|
|
- }
|
|
|
- if(is_load_data) {
|
|
|
- this.reloadListContentData()
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
updateNumStatus(is_reload_data:boolean=false) {
|
|
|
this.lab_num.getComponent(Label).string = this.num_current_count + '/' + this.num_total_count
|
|
|
if(is_reload_data) {
|
|
@@ -122,14 +82,7 @@ export class car_lib_bottom extends base_ui {
|
|
|
for (let index = 0; index < this.data_list.length; index++) {
|
|
|
const element = this.data_list[index];
|
|
|
let is_jiesuo = userDataManager.user_car_list.car_list.some(obj => obj === element.id)
|
|
|
- let item = null
|
|
|
- if(this.is_jiesuo_status) {
|
|
|
- if(is_jiesuo) {
|
|
|
- item = instantiate(this.list_item)
|
|
|
- }
|
|
|
- } else {
|
|
|
- item = instantiate(this.list_item)
|
|
|
- }
|
|
|
+ let item = instantiate(this.list_item)
|
|
|
if(item!=null) {
|
|
|
item.parent = this.list_content
|
|
|
let item_component = item.getComponent(car_lib_list_item)
|
|
@@ -157,7 +110,7 @@ export class car_lib_bottom extends base_ui {
|
|
|
}
|
|
|
|
|
|
if(item.getIsJiesuo()==false) {
|
|
|
- console.log('解锁 解锁 解锁')
|
|
|
+ console.log('未解锁 未解锁 未解锁')
|
|
|
return
|
|
|
}
|
|
|
|