Skip to content

遊戲大廳

最後更新:2026-04-09


功能說明

遊戲 Tab 是娛樂遊戲入口,提供電子遊藝(老虎機/捕魚/電子)、彩票(PK拾/大樂透/六合彩等)、真人荷官、電競、棋牌等多種遊戲類型。頁面頂部有廣告 Banner 和大轉盤活動入口,遊戲以卡片形式展示分類。

使用者流程

  1. 點擊「遊戲」Tab → BBHomeViewController
  2. 頂部 Banner 輪播廣告(SDCycleScrollView
  3. 大轉盤浮動入口(依後台活動設定顯示)
  4. 遊戲卡片區域(HomeAllGameModel 陣列)
  5. 點擊遊戲卡片 → 跳轉對應遊戲(依遊戲類型路由)
  6. 搜索按鈕 → BBSearchSubGameViewController(子遊戲搜索)
  7. 彩票入口 → MLLobbyMainViewController(彩票大廳)
  8. 子遊戲列表 → BBSubGameViewController

頁面跳轉

  • 點擊「遊戲」Tab → BBHomeViewController
  • 彩票入口 → MLLobbyMainViewController
  • 遊戲卡片點擊 → 對應遊戲頁(依遊戲類型)
  • 搜索按鈕 → BBSearchSubGameViewController
  • 大轉盤 → 依活動 jumpUrl 動態跳轉

遊戲啟動完整流程

使用者點擊遊戲卡片

  ├─ recommendType == 1 → 提示「遊戲暫未開放,敬請期待」→ 結束

  ├─ isMaintenance == true → 顯示維護彈窗(維護時間 + 客服入口)→ 結束

  ├─ 未登入 → 彈出登入提示 → 導向登入頁 → 結束

  └─ 已登入 → 呼叫 GameJumpPreCheckRequest(檢查首次充值)

       ├─ transferAvailable == false → 彈窗「尚未完成首次充值,體驗金不能在體育之外投注」
       │    ├─ 點「先去看看」→ 繼續進入遊戲
       │    └─ 點「立即充值」→ 開啟充值頁

       └─ transferAvailable == true → 繼續

            ├─ subGameNum > 1 → ExperCashHelper 彈窗 → push BBSubGameViewController

            ├─ gameId == 28(彩票)→ MGJRouter 開啟彩票模組

            └─ 其他遊戲 → ExperCashHelper 彈窗 → JumpGameUrlRequest 取得 URL

                 └─ TransferInfoRequest 取得錢包資訊

                      └─ BBWalletService.finishedOnceTranser(一鍵轉帳)

                           ├─ URL 是 http 開頭 → 外部瀏覽器開啟
                           ├─ URL 是 HTML 字串 → WKWebView 載入(PG 電子)
                           └─ 一般遊戲 → push IFNewStaticWebViewController(內嵌 WebView)

遊戲維護處理

  • 維護資料來源STAPI.ProductConfigRequest 取得所有平台維護狀態;Socket 推送即時維護通知(STNotify.maintainID
  • 維護判斷BBHomeOtherHandler.requestProductConfig() 解析 BBUserProductConfigModel,比對 maintenId 更新每張遊戲卡片的維護狀態
  • 維護顯示:卡片上顯示維護標記(refreshMaintainStatu);點擊維護中的遊戲 → 彈窗顯示維護時間和客服入口
  • 全域維護管理GameMaintenanceManager.shared 管理 app / fb / db / up 四個平台的維護狀態
  • IP 限制:全域 IP 限制(ipLimit)和遊戲 IP 限制(gameIpLimit)分開處理

未登入使用者行為

場景行為
點擊遊戲卡片PushGameService 檢查 isLoginThisPlatform,未登入 → STNormalAlertView.showLoginAlertViewSTLoginManager.commonLogin()
遊戲首頁 viewWillAppear未登入時不呼叫 getMoneyData()getAllUnReadCount()getUserUnReadCountHander()
跳轉體育 App 按鈕BBGotoSportAPPView 檢查 isLoginThisPlatform,未登入 → 登入彈窗
導航列餘額/訊息BBUserHomeNavView 依登入狀態決定是否顯示餘額和訊息數
新人轉盤HomeNewUserSpinHandle 檢查 isLoginThisPlatform == true 才觸發

技術視角(開發看這裡)

相關檔案

類型檔案路徑
ViewController(遊戲首頁)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/controller/BBHomeViewController.swift
ViewController(子遊戲)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/controller/BBSubGameViewController.swift
ViewController(搜索子遊戲)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/controller/BBSearchSubGameViewController.swift
遊戲跳轉服務/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/PushGameService.swift
維護狀態處理/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/controller/BBHomeOtherHandler.swift
Model(OC - 遊戲分類)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/model/HomeAllGameModel.h/.m
Model(OC - 遊戲項目)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/model/GameItemModel.h/.m
View(遊戲卡片)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/HomeCardView.swift
維護管理器/Users/user/Work/bbsport-new/BBSport/Tools/MaintenanceManager/GameMaintenanceManager.swift
維護狀態 Model/Users/user/Work/bbsport-new/BBSport/Tools/MaintenanceManager/GameMaintenanceStatusModel.swift
ViewController(彩票大廳)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/综合大厅/C/MLLobbyMainViewController.swift
ViewController(彩票主頁)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/C/MLLotteryMainViewController.swift
ViewController(快速投注)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/C/LFastBetViewController.swift
ViewController(開獎詳情)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/开奖/C/MLRunLotteryDetailViewController.swift
ViewController(投注記錄)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/投注记录/C/MLBetHistoryMainViewController.swift
ViewController(彩票管理)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票管理/C/MLLotteryManageMainViewController.swift
彩票網路層/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/Networking/MLLTHttpService.swift
彩票 API Action 定義/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/Networking/MLLotteryPlatformRequestAction.swift
彩票 Request Info/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/Networking/MLLotteryPlatformRequestInfo.swift
API(轉盤)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/API/STAPI+WheelList.swift
API(轉盤獲取)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/API/STAPI+WheelGet.swift
API(轉盤資訊)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/API/STAPI+WheelInfo.swift
API(轉盤用戶資訊)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/API/STAPI+WheelUserInfo.swift
Model(Banner)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/BBUserBannerModelItem.swift
Helper(轉帳工具)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/BBZhuanZhangTool.swift
Handler(大轉盤)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/controller/BBHomeDaZhuanPanHander.swift
Handler(登入登出)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/controller/BBHomeLoginOrLogoutHander.swift
Handler(公告顯示)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/controller/BBHomeNoticeShower.swift
Handler(滾動處理)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/controller/BBHomeScrollHaner.swift
Handler(主題樣式)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/controller/BBHomeThemeStyleHandle.swift
Handler(網路請求)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/controller/BBNetworkHander.swift
Handler(新人轉盤)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/controller/HomeNewUserSpinHandle.swift
ViewController(靜態 WebView,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/controller/IFNewStaticWebViewController.m
Model(對話框)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/model/BBUserDialogModel.swift
Model(基礎 Model,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/model/BBUserGLBaseModel.m
Model(首頁 TableView,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/model/BBUserIndexTableViewModel.m
Model(訊息,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/model/BBUserMessageVmodel.m
Model(金額明細,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/model/BBUserMoneyDetailModel.m
Model(公告)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/model/BBUserNoticeModel.swift
Model(產品設定,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/model/BBUserProductConfigModel.m
Model(系統訊息,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/model/BBUserSystemMessageModel.m
Model(AG 遊戲)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/model/IFAGGameModel.swift
Model(主菜單項,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/model/MainItemModel.m
Model(獎品,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/model/PrizeModel.m
Model(系統公告列表,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/model/SystemNoticeListModel.m
Cell(AG 遊戲)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/BBAGGameCell.swift
Cell(代理公告)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/BBAgentNoticeCell.swift
Model(代理公告)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/BBAgentNoticeModel.swift
View(跳轉體育 APP)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/BBGotoSportAPPView.swift
View(體育 Banner)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/BBHomeSportBanner.swift
View(下拉刷新動畫)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/BBRefreshGifHeader.swift
View(子遊戲選擇欄)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/BBSubGameChooseBar.swift
View(子遊戲導航)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/BBSubGameVCNav.swift
Cell(直播)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/BBUserCustomLiveCell.swift
Cell(賽事)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/BBUserCustomMatchCell.swift
Cell(公告)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/BBUserCustomNoticeCell.swift
View(每日公告)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/BBUserEverydayNoticeView.swift
View(首頁導航)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/BBUserHomeNavView.swift
View(金額標籤)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/BBUserMonyLabel.swift
Helper(Swift-OC 橋接,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/BBUserSwiftOCAdapter.m
View(遊戲卡片項目)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/CarItemView.swift
View(跑馬燈,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/HornLabel.m
View(跑馬燈容器,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/HornView.m
View(新人轉盤遮罩)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/NewUserSpinOverlay.swift
View(新人轉盤)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/NewUserSpinView.swift
View(頁面指示器)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/SCPageControl/Classes/SCPageControlView.swift
View(自動滾動標籤,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/view/SKAutoScrollLabel/SKAutoScrollLabel.m
View(新公告)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/公告控件/BBNewNoticeView.swift
ViewController(彩票基底 Playing)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/C/MLBasePlayingViewController.swift
ViewController(K3 玩法)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/C/MLK3PlayingViewController.swift
ViewController(六合彩投注)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/C/MLLHCBetViewController.swift
ViewController(普通玩法)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/C/MLNormalPlayingViewController.swift
ViewController(PCDD 玩法)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/C/MLPCDDPlayingViewController.swift
ViewController(投注單)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/投注/投注单/C/MLBetOrderViewController.swift
ViewController(智能追號)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/投注/智能追号/C/MLIntelligenTrackViewController.swift
ViewController(投注記錄詳情)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/投注记录/C/MLBetHistoryDetailViewController.swift
ViewController(盈虧記錄)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票管理/C/MLProfitAndLossRecord.swift
ViewController(設定中心)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票管理/C/MLSettingCenterViewController.swift
ViewController(彩票 WebView)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票管理/C/MLWebViewController.swift
ViewController(走勢圖)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/LotteryChart/VC/LotteryChartViewController.swift
ViewController(錯誤頁面)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/错误页面/MLErrorViewController.swift
ViewController(彩票導航)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/Main/LTNavigationViewController.swift
ViewController(彩票 TabBar)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/Main/LTTabbarController.swift
ViewController(彩票基底)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/Base/MLBaseViewController.swift
ViewModel(走勢圖資料)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/LotteryChart/VM/LotteryChartDataViewModel.swift
ViewModel(走勢圖)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/LotteryChart/VM/LotteryChartViewModel.swift
ViewModel(走勢遊戲模型)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/LotteryChart/VM/LotteryGameModelViewModel.swift
ViewModel(六合彩)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/普彩奖期/VM/MLLHCViewModel.swift
ViewModel(彩票獎期)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/普彩奖期/M/MLLotteryDrawPeriodViewModel.swift
ViewModel(盈虧列表)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票管理/M/MLProfitListViewModel.swift
Model(走勢圖資料)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/LotteryChart/M/MLChartDataModel.swift
Model(快速投注可選列表)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/M/FastBetOptionalListModel.swift
Model(百家樂投注)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/M/LotteryBJLBetInModel.swift
Model(百家樂投注模型)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/M/LotteryBaccaratBetModel.swift
Model(彩票首頁 Banner)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/M/LotteryHomeBannerModel.swift
Model(彩票群組)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/M/MLLotteryGroupModel.swift
Model(彩票玩法方式)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/M/MLLotteryPlayingMethodModel.swift
Model(PCDD 本地)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/M/MLPCDDLocalModel.swift
Helper(選號拼接)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/M/MLSelectNumbersJointer.swift
Helper(玩法選擇器建構)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/M/MLPlayingPickerModelCreater.swift
Helper(快樂彩選擇器建構)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票/M/MLHanppyPlayingPickerModelCreater.swift
Model(六合彩號碼)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/开奖/M/HK6CJNumberModel.swift
Model(開獎結果)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/开奖/M/RunLotteryModel.swift
Model(投注模型)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/投注/投注单/M/MLBetModel.swift
Model(投注單模型)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/投注/投注单/M/MLBetOrderModel.swift
Model(購物車)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/投注/投注单/M/MLLTShoppingCart.swift
Model(追號)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/投注/智能追号/M/MLChaseModel.swift
Model(投注記錄)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/投注记录/M/MLBetHistoryModel.swift
Model(追號號碼)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/投注记录/M/MLChaseNumberModel.swift
Model(彩票用戶)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票管理/M/MLLTUser.swift
Model(盈虧)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/彩票管理/M/MLProfitModel.swift
Model(單期開獎)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/普彩奖期/M/MLLotterySingleDrawModel.swift
Model(六合彩玩法多碼)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/普彩奖期/M/六合彩/MLPlayMultiModel.swift
Model(六合彩賠率碼)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/普彩奖期/M/六合彩/MLPriceCodeModel.swift
Service(彩票跳轉管理)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/Networking/MLLTJumpManager.swift
Config(HTTP 錯誤碼)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/Networking/MLLTHttpErrorCode.swift
Manager(六合彩投注)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/MLLHCBetManager.swift
Manager(Socket)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/MLSocketManager.swift
Helper(投注算法)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/Algorithm/MLAlgorithmObject.swift
Helper(注數計算)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/Algorithm/MLBetCountAlgorithObject.swift
Helper(K3 算法)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/Algorithm/MLK3AlgorithObject.swift
Helper(單式篩號)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/Algorithm/MLSimplexBetScreenNumberObject.swift
Helper(頁面路由)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/MLPageRouter.swift
Helper(規則說明)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/MLLTCommonRuleHelper.swift
Helper(群組碼)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/MLLTGroupCode.swift
Helper(彩票資訊)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/MLLTLotteryInfomation.swift
Helper(冷熱碼)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/MLLostColdCode.swift
Helper(狀態碼)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/MLStatusCode.swift
Helper(生肖)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/MLZodiacHelper.swift
Helper(輸入標題)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/MLInputCaptionHelper.swift
Protocol(投注協議)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/Protocol/MLLTBetProtocol.swift
Config(走勢圖設定)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Config/LotteryChartSetingConfig.swift
Config(常數)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Config/LotteryCommonConstant.swift
Config(設定管理器)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Config/LotteryConfigManager.swift
Config(投注參數映射)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Config/MLBetParamMap.swift
Config(六合彩設定)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Config/MLLHCConfig.swift
Config(PCDD 設定)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Config/MLPCDDConfig.swift
View(遊戲引導)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/游戏引导/LTGameGuideView.swift
View(投注底部)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/投注/投注单/V/MLBetBottomView.swift
View(投注視圖)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/投注/投注单/V/MLBetView.swift
View(投注單彈窗)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/投注/投注视图/MLBetOrderAlert.swift
View(單注投注條)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Features/投注/投注视图/MLSingleBetSlipView.swift
View(分段選擇)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/MLSegementView.swift
View(倒計時)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Utility/CountDownView.swift
View(數字鍵盤)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Utility/LTNumPadKeyboard.swift
View(Toast/HUD)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Utility/LTToastHud.swift
View(Tab 切換)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Utility/MLTabView.swift
Helper(Base Object)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/Base/MLBaseObject.swift
View(Base TableView)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/Base/MLBaseTableView.swift
Cell(Base TableViewCell)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/Base/MLBaseTableViewCell.swift
View(Base View)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/Base/MLBaseView.swift
Helper(自訂彈窗工廠)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/CustomAlert/Base/MLCustomAlertFactory.swift
Helper(圖片快取)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Utility/ImageLoader/LTImageCache.swift
Helper(圖片載入器)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Utility/ImageLoader/LTImageLoader.swift
Helper(音效管理)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Utility/Common/MLSoundManager.swift
Helper(通用工具,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Utility/Common/MLCommonTools.m
Helper(通用 UI)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Utility/Common/MLCommonUI.swift
Helper(Websocket STOMP,OC)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Utility/Common/WebsocketStompKit.m
Extension(開獎號碼顏色)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/UIColor+OpenNumber.swift
Extension(TableView)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Helpers/MLTbaleViewExtension.swift
Extension(Dictionary)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Categories/Dictionary+KeyFroValue.swift
Extension(Double 小數)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Categories/Double+DecimalControl.swift
Extension(String MD5)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Categories/String+MD5.swift
Extension(Double)/Users/user/Work/bbsport-new/BBSport/Tab/游戏/Amuse/Lottery/Classes/Utility/Common/MLDouble-Extension.swift
API(遊戲跳轉預檢)/Users/user/Work/bbsport-new/BBSport/API/STAPI/Game/STAPI+GameJumpPreCheckRequest.swift
API(遊戲跳轉)/Users/user/Work/bbsport-new/BBSport/API/STAPI/Game/STAPI+GameJumpRequest.swift
API(遊戲獎品列表)/Users/user/Work/bbsport-new/BBSport/API/STAPI/Game/STAPI+GamePrizeListRequest.swift
API(遊戲投注設定查詢)/Users/user/Work/bbsport-new/BBSport/API/STAPI/Game/STAPI+GamebetConfigQueryRequest.swift
API(首頁遊戲列表)/Users/user/Work/bbsport-new/BBSport/API/STAPI/Game/STAPI+HomeGameListRequest.swift
API(遊戲 URL 跳轉)/Users/user/Work/bbsport-new/BBSport/API/STAPI/Game/STAPI+JumpGameUrlRequest.swift
API(子遊戲列表)/Users/user/Work/bbsport-new/BBSport/API/STAPI/Game/STAPI+ListSubGamesRequest.swift

API

遊戲大廳核心 API

功能說明Request 類別EndpointMethod主要參數
首頁遊戲列表HomeGameListRequestapi/forehead/gamebet/game/show/allPOST urlFormshowClient=2
子遊戲列表ListSubGamesRequestapi/forehead/gamebet/game/listSubGamesPOST urlFormchannelId, subType, lineNum, gameType=3
遊戲跳轉(取 URL)JumpGameUrlRequestapi/forehead/gamebet/game/jumpPOST urlFormgameId, mobileDisplayOrientation?, type=0
遊戲跳轉(小金登入)GameJumpRequestapi/forehead/gamebet/game/jumpPOST urlFormgameId, type=0
遊戲跳轉前置檢查GameJumpPreCheckRequestapi/forehead/gamebet/game/jump/preCheckPOST urlFormgameId
遊戲圖示設定GamebetConfigQueryRequestapi/forehead/gamebet/config/queryPOST urlFormshowClient=2
中獎名單GamePrizeListRequestapi/forehead/gamebet/game/list/prizePOST urlFormgamePlatformId
產品維護設定ProductConfigRequestapi/forehead/gamebet/product/productConfigPOST urlFormisGame
大轉盤活動列表WheelListRequestapi/forehead/activity/wheel/listPOST urlForm

錢包轉帳相關 API

功能說明Request 類別EndpointMethod主要參數
錢包餘額資訊TransferInfoRequestapi/forehead/gamebet/transfer/infoPOST urlForm
提交轉帳TransferSubmitRequestapi/forehead/gamebet/transfer/submitsyncPOST urlFormfromChannelId, toChannelId, amount, type
各渠道餘額刷新RefreshByChannelRequestapi/forehead/gamebet/balance/refreshByChannelPOST urlForm

彩票模組 API(Moya,獨立 baseURL)

彩票模組使用獨立的網路層 MLLotteryPlatformRequestInfo(基於 Moya),baseURL 由 MLLTJumpManager.shared.baseUrl 動態設定。

功能說明ActionTypeEndpointMethod
遊戲菜單get_game_menuwps/api/game-menuGET
熱門彩種get_hotLotterywps/api/game-hotGET
玩法菜單get_play_menuwps/api/play-menuGET
多玩法明細get_play_multiwps/api/play-multiGET
單玩法明細get_play_singlewps/api/play-singleGET
彩票規則get_common_rulewps/api/common-ruleGET
開獎歷史get_newest_resultwps/api/newest-resultGET
單一開獎歷史get_single_newest_resultwps/api/single-newest-resultGET
歷史記錄get_historywps/api/historyGET
投注betwps/api/betPOST
投注撤單bet_cancelwps/api/bet-cancelPOST
投注記錄get_bet_historywps/api/bet-historyGET
投注記錄詳情get_bet_history_orderwps/api/bet-history-orderGET
追號投注chase_betwps/api/better-chase-betPOST
追號撤單chase_revokewps/api/chase-revokePOST
追號記錄get_chase_historywps/api/chase-historyGET
追號詳情get_chase_bet_historywps/api/chase-bet-historyGET
追號期號列表get_chase_resultwps/api/chase-resultGET
追號起始期號get_chase_start_resultwps/api/chase-start-resultGET
用戶餘額get_account_getwps/api/account-getGET
設定中心config_centerwps/api/config-centerGET
保存設定save_config_centerwps/api/save-config-centerPOST
多語言字段mul_lng_all_codewps/api/game-i18nGET
六合彩生肖get_6cj_animalwps/api/6cj/animalGET
日期盈虧統計get_report_datawps/api/report/dateGET
長龍分析get_analysis_longwps/api/analysis/longGET
當期冷熱get_analysis_coldwps/api/analysis/coldGET
走勢圖get_analysis_runwps/api/analysis/runGET
當期遺漏get_analysis_losewps/api/analysis/loseGET
問路圖get_awDrawingwps/api/down5GET
快捷投注long_batch_betwps/api/long-batch-betPOST
首頁 Bannerget_ad_listwps/api/ad-listGET
自選彩種設定get_optional_play_configwps/api/optional-play-configGET
自選彩種列表get_optional_play_getwps/api/optional-play-getGET
更新自選彩種get_optional_play_updatewps/api/optional-play-updatePOST
Token 續期get_token_refreshwps/api/token-refreshGET
全域設定merchant_configwps/api/merchant-configGET
彩種說明get_game_descwps/api/game-descGET
百家樂動畫baccaratwps/api/baccarat-aniGET

資料模型

HomeAllGameModel(OC,支援 NSSecureCoding)

欄位類型說明
titleNameNSString分類標題(真人/電子/電競/彩票/棋牌)
typeNSString分類類型鍵值(real/digital/gaming/lottery/poker
gameList[GameItemModel]該分類下的遊戲項目陣列
imageKeyDayNSString日間模式圖片 key
imagesDayNSString日間模式圖片
imageKeyNightNSString夜間模式圖片 key
imagesDayNightNSString夜間模式圖片
actionContentNSString動作內容
actionTitleNSString動作標題

初始化時會過濾原生支援的 DB 體育(gameId != DBSportChannelID)。

GameItemModel(OC,支援 NSSecureCoding)

欄位類型說明
areaNSString顯示區域(1=導航欄 / 2=推薦位 / 3=轉帳錢包入口 / 4=首頁入口 / 5=平台商 logo)
channelIdNSInteger渠道 ID
descriptNSString描述
gameIdNSInteger遊戲 ID
gameTypeNSInteger遊戲類型(0=彩票 / 1=真人 / 2=體育 / 3=老虎機 / 4=捕魚 / 5=電競 / 6=棋牌)
isCenterWalletBOOL是否中心錢包(0=非 / 1=是)
singleWalletBOOL是否單一錢包
maintenIdNSInteger維護 ID(對應 ProductConfig 的 itemList)
maintainTypeMaintainType維護狀態枚舉(isMaintain / willMaintain / noMaintain / unknowMaintain
maintainStartDateNSString維護開始時間
maintainEndDateNSString維護結束時間
nameNSString遊戲名稱
navGroupNSString導航分類
picUrlNSString日間圖片 URL
picUrlNNSString夜間圖片 URL
recommendTypeNSInteger推薦角標類型(0=無 / 1=敬請期待 / 2=新上線 / 3=推薦)
positionNSString顯示位置
subGameNumNSInteger子遊戲數量
walletNameNSString錢包名稱
gamePlatformNSInteger遊戲平台 ID
popularityNSString熱度值
toSafariBOOL是否跳轉外部瀏覽器

HomeGameListRequest.Response(Swift,新版 API 回應)

欄位類型說明
nav[HomeGame]導航列遊戲分類
recommend[HomeGame]推薦遊戲分類
HomeGame
欄位類型說明
typeString分類類型
gameList[HomeGameItem]遊戲列表
HomeGameItem
欄位類型說明
areaString顯示區域
channelIdInt渠道 ID
descriptString描述
nameString遊戲名稱
gameIdInt遊戲 ID
gameTypeInt遊戲類型
isCenterWalletInt是否中心錢包
singleWalletBool是否單一錢包
maintenIdInt維護 ID
navGroupString導航分類
picUrlString圖片 URL
positionInt位置
recommendTypeInt推薦類型
walletNameString錢包名稱
subGameNumInt子遊戲數量
popularityString熱度值

GameJumpPreCheckRequest.Response

欄位類型說明
awardAmountInt體驗金金額
transferAvailableBoolfalse 時彈窗提示首次充值(預設 true
userHasAwardAmountBool使用者是否有體驗金
userHasRechargeBool使用者是否已充值

GameMaintenanceStatusModel

欄位類型說明
isGameMaintenanceBool(KVO)是否維護中
isShowH5Bool是否顯示 H5 地址
isShowBackBtnBool是否顯示返回按鈕
titleString維護標題
timeString維護時間文字
detailString維護詳情文字
startDateString維護開始時間
endDateString維護結束時間

WheelListRequest.ResponseModel

欄位類型說明
idInt活動 ID
wheelIdInt轉盤 ID
statusInt狀態(1=上架)
startTime / endTimeDate?活動時間
mobilePicString行動裝置圖片 URL
floatPicString浮動圖示 URL
configString活動設定 JSON 字串

實作重點

  1. BBHomeViewController 佈局SDCycleScrollView 廣告 Banner(寬度取整數避免自動滾動 Bug);HomeCardView 遊戲卡片陣列;大轉盤跳轉 URL(jumpUrl)動態取得

  2. PushGameService 跳轉核心:整合 recommendType、維護狀態、登入狀態、GameJumpPreCheckRequest(首次充值檢查)四道關卡;ExperCashHelper.showAlertIfNeeded 處理體驗金未綁定提示;subGameNum > 1 時 push BBSubGameViewControllergameId == 28 時透過 MGJRouter 進入彩票模組

  3. 錢包轉帳流程:進入遊戲前先 TransferInfoRequest 取得錢包資訊 → BBWalletService.finishedOnceTranser 一鍵轉帳 → 轉帳完成後才開啟遊戲頁;轉帳超時 3 秒後強制進入遊戲(DispatchQueue.main.asyncAfter

  4. 遊戲頁載體:一般遊戲使用 IFNewStaticWebViewController(內嵌 WKWebView);PG 電子返回 HTML 字串直接 loadHTMLString;MW 捕魚使用外部瀏覽器(IFCommonUtil.openUrlStr);特殊 gameId(142/143)先選橫豎屏再打 game jump

  5. 維護狀態同步BBHomeOtherHandler.requestProductConfig()viewWillAppear 時呼叫;解析 BBUserProductConfigModel 比對每張卡片的 maintenId → 更新卡片維護 UI(refreshMaintainStatu

  6. GameMaintenanceManager 全域維護:管理 app / fb / db / up 四平台維護狀態;支援 Socket 即時推送(STNotify.maintainID)和主動 API 查詢;APP 級維護時替換 window.rootViewControllerBBMaintainViewController

  7. 彩票模組獨立性:彩票功能由 ML 前綴類管理,使用 Moya 獨立網路層;MLBaseViewController 為彩票模組基底 VC;LTNavigationViewController 為彩票模組導航 VC;baseURL 由 MLLTJumpManager.shared.baseUrl 動態設定

  8. 轉盤活動顯示邏輯status == 1 且在 startTime ~ endTime 範圍內 → 顯示浮動轉盤入口

  9. 遊戲啟動記錄:進入遊戲後 GameStatusManager.shared.updateSavedGameType(.bbAmuse),下次啟動 App 預設選中「遊戲」Tab

  10. 彩票遊戲類型:PK拾 → MLNormalPlayingViewController;K3 → MLK3PlayingViewController;六合彩 → MLLHCBetViewController;PCDD → MLPCDDPlayingViewController

  11. 本地快取:遊戲列表使用 NSKeyedArchiver 存入 UserDefaults(key: GAME_ARRAY_LIST),下次啟動時先載入本地資料再請求 API 更新


API 呼叫流程

進入遊戲大廳 Tab (BBHomeViewController)

viewDidLoad
  ├─ [API 1] POST api/forehead/gamebet/game/show/all
  │  → 遊戲分類 + 推薦列表 (快取至 GAME_ARRAY_LIST)

  ├─ [並行] POST api/forehead/system/config/images
  │  → 分類圖片 (含深色/淺色主題)

  ├─ [並行] POST api/forehead/system/config/images {categoryId:"20108"}
  │  → Banner 圖片

  └─ [並行] POST api/forehead/gamebet/product/productConfig
     → 各遊戲維護狀態

點擊遊戲啟動

CarItemView.didTap → PushGameService.pushToGame()
  ├─ 前置檢查:
  │  ├─ 維護中? → 顯示維護提示
  │  ├─ 已登入?
  │  └─ [API] POST api/forehead/gamebet/game/jump/preCheck
  │     → 首儲要求、紅利資格檢查

  ├─ 路徑 A: 有子遊戲 (subGameNum > 1)
  │  └─ 推入 BBSubGameViewController
  │     └─ [API] POST api/forehead/gamebet/game/listSubGames

  ├─ 路徑 B: 彩票 (gameId == 28)
  │  └─ [API] POST api/forehead/gamebet/game/jump → 取得彩票平台 URL + token
  │     └─ MLLTJumpManager.getMerchantConfig() → 彩票設定
  │     └─ 轉帳 → 推入 LTTabbarController

  └─ 路徑 C: 一般遊戲
     ├─ [API 1] POST api/forehead/gamebet/game/jump → 遊戲 URL
     ├─ [並行] POST api/forehead/gamebet/transfer/info → 錢包餘額
     └─ [API 2] 自動轉帳 → 推入 WebView 載入遊戲

錢包餘額轉帳 (BBWalletService)

BBWalletService.finishedOnceTranser()
  ├─ [API 1] POST api/forehead/gamebet/transfer/info → 所有錢包餘額

  ├─ [並行, 每個非中心錢包] POST api/forehead/gamebet/transfer/submitsync
  │  {from: 遊戲錢包, to: 0(中心)} → 全部回收至中心

  └─ [API 2] POST api/forehead/gamebet/transfer/submitsync
     {from: 0(中心), to: 目標遊戲錢包} → 轉入目標遊戲
     (3 秒逾時: 超時仍繼續啟動遊戲)