future 1 سال پیش
والد
کامیت
9aa94d2b38

+ 1 - 0
assets/script/config.ts

@@ -152,6 +152,7 @@ export class config  {
         UPDATE_USER_INFO:"update_user_info",
         UPDATE_RED_DOT_STATUS:"update_red_dot_status",
         UPDATE_GAME_FREE_COUNT:"update_game_free_count",
+        HIDE_HOME_MORE_VIEW:"hide_home_more_view",
     }
     
     public static EVENT_TYPE = {

+ 10 - 1
assets/script/ui/car_lib/car_lib_bottom.ts

@@ -90,6 +90,15 @@ export class car_lib_bottom extends base_ui {
     }
 
     private onClickListItem(page_item:car_lib_page_item,list_item:car_lib_list_item) {
+        let car_item_data = list_item.getData()
+        let cur_count = car_item_data.temp_bag_list_item_data.quantity
+        if(cur_count-car_item_data.unlock_points>=0) {
+            // 直接显示兑换车辆视图
+            GameManager.showExchangeCarView(car_item_data.id,car_item_data.temp_bag_list_item_data.icon,car_item_data.temp_bag_list_item_data.quantity, ()=>{
+                list_item.setJiesuoSelectedStatus()
+            })
+            return
+        }
         uiManager.Instance().showUi(config.UI.ui_car_info,this.game_status_parent!=null?this.game_status_parent:null, (node:Node)=>{
             let car_info_component = node.getComponent(car_info)
             car_info_component.initView(list_item.getData(),list_item.getIsJiesuo())
@@ -105,7 +114,7 @@ export class car_lib_bottom extends base_ui {
                     this.m_click_item_cb(list_item)
                 }
             },(v:car_info)=>{
-                // 兑换
+                // 兑换(废弃,更改为直接弹出兑换视图,代码见上方👆🏻)
                 let data = v.getData()
                 if(data.temp_bag_list_item_data) {
                     GameManager.showExchangeCarView(data.id,data.temp_bag_list_item_data.icon,data.temp_bag_list_item_data.quantity, ()=>{

+ 5 - 0
assets/script/ui/home/home.ts

@@ -33,6 +33,7 @@ export class home extends Component {
         ClientEvent.on(config.UI_EVENT.UPDATE_GAME_FREE_COUNT,this.onUpdateGameFreeCount.bind(this),this)
         ClientEvent.on(config.UI_EVENT.GAME_OVER_SETTLE_ACCOUNT,this.onGameOverSettleAccount.bind(this),this)
         ClientEvent.on(config.UI_EVENT.GET_NEW_CAR,this.onGetNewCar.bind(this),this)
+        ClientEvent.on(config.UI_EVENT.HIDE_HOME_MORE_VIEW,this.onHideHomeMoreView.bind(this),this)
         ClientEvent.on(config.UI_EVENT.UPDATE_USER_DEFAULT_CAR,this.onUpdateUserDefaultCar.bind(this),this)
         ClientEvent.on(config.UI_EVENT.UPDATE_USER_INFO,this.onUpdateUserInfo.bind(this),this)
         ClientEvent.on(config.UI_EVENT.UPDATE_RED_DOT_STATUS,this.onUpdateRedDotStatus.bind(this),this)
@@ -72,6 +73,10 @@ export class home extends Component {
         this.bottom.getComponent(home_bottom).checkIsMineCountryRank()
     }
 
+    onHideHomeMoreView() {
+        this.modules.getComponent(home_modules).hideGengduoView()
+    }
+
     onUpdateUserDefaultCar() {
         // 更新首页车
         this.home_car.getComponent(home_car).updateCar()

+ 1 - 0
assets/script/ui/home/home_bottom.ts

@@ -45,6 +45,7 @@ export class home_bottom extends Component {
                     this.reloadCountryRankData(d_content)
                 })
                 this.node.parent.active = true
+                ClientEvent.dispatchEvent(config.UI_EVENT.HIDE_HOME_MORE_VIEW)
             })
         })
         uiManager.Instance().onButtonListen(this.btn_wuxiancishu, ()=>{

+ 12 - 1
assets/script/ui/home/home_modules.ts

@@ -31,10 +31,15 @@ export class home_modules extends base_ui {
             this.node.parent.active = false
             uiManager.Instance().showUi(config.UI.car_lib, null, ()=>{
                 this.node.parent.active = true
+                this.hideGengduoView()
             })
         })
         this.onButtonListen(this.btn_beibao, ()=>{
-            uiManager.Instance().showUi(config.UI.bag)
+            this.node.parent.active = false
+            uiManager.Instance().showUi(config.UI.bag, null, ()=>{
+                this.node.parent.active = true
+                this.hideGengduoView()
+            })
         })
         this.node_gengduo.active = false
 
@@ -82,5 +87,11 @@ export class home_modules extends base_ui {
        let is_show = this.node_gengduo.getComponent(home_modules_more).getDotAllShow()
        this.img_dot_gengduo.active = is_show
     }
+
+    public hideGengduoView() {
+        if(this.node_gengduo.active==true) {
+            this.node_gengduo.active = false
+        }
+    }
 }