|
@@ -18,12 +18,10 @@ export class exchange_car_view extends base_ui {
|
|
|
@property(Node) img_car:Node = null
|
|
|
@property(Node) lab_current_count:Node = null
|
|
|
@property(Node) lab_total_count:Node = null
|
|
|
- @property(Node) btn_true:Node = null
|
|
|
- @property(Node) lab_true:Node = null
|
|
|
+ @property(Node) btn_exchange:Node = null
|
|
|
|
|
|
@property(Node) success_view:Node = null
|
|
|
|
|
|
- private is_can_exchange:boolean = false
|
|
|
private m_car_id:number = 0
|
|
|
private m_cb = null
|
|
|
|
|
@@ -31,12 +29,8 @@ export class exchange_car_view extends base_ui {
|
|
|
this.onButtonListen(this.bg_public_bg, ()=>{
|
|
|
this.close()
|
|
|
})
|
|
|
- this.onButtonListen(this.btn_true, ()=>{
|
|
|
- if(this.is_can_exchange) {
|
|
|
- this.requestExchangeCar()
|
|
|
- } else {
|
|
|
- this.close()
|
|
|
- }
|
|
|
+ this.onButtonListen(this.btn_exchange, ()=>{
|
|
|
+ this.requestExchangeCar()
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -56,11 +50,9 @@ export class exchange_car_view extends base_ui {
|
|
|
this.lab_total_count.getComponent(Label).string = `/${car_item.unlock_points}`
|
|
|
|
|
|
if(data.sp_count>=car_item.unlock_points) {
|
|
|
- this.lab_true.getComponent(Label).string = '兑 换'
|
|
|
- this.is_can_exchange = true
|
|
|
+ this.btn_exchange.active = true
|
|
|
} else {
|
|
|
- this.lab_true.getComponent(Label).string = '确 定'
|
|
|
- this.is_can_exchange = false
|
|
|
+ this.btn_exchange.active = false
|
|
|
}
|
|
|
}
|
|
|
|