You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.7 KiB

  1. -- 战绩界面
  2. local ClubZhanJiTongJiView = class("ClubZhanJiTongJiView", cc.UIView)
  3. function ClubZhanJiTongJiView:ctor(list)
  4. ClubZhanJiTongJiView.super.ctor(self)
  5. self.ui = loadUI("res/ui/ui_club/ui_club_zhanji_tongji.ui")
  6. self:addChild(self.ui)
  7. self.list = list
  8. end
  9. function ClubZhanJiTongJiView:onEnter()
  10. ClubZhanJiTongJiView.super.onEnter(self)
  11. --消息分类
  12. self.ui.Items.Button_close:registerClick(handler(self,self.onClickClose))
  13. -- self.ui.Items.Button_2:registerClick(handler(self,self.onTouchZhanjiClub))
  14. -- self.ui.Items.Button_3:registerClick(handler(self,self.onTouchZhanjiTongji))
  15. self:updateList()
  16. self:initCurrencyTitle()
  17. end
  18. function ClubZhanJiTongJiView:initCurrencyTitle()
  19. local tongjiTitleLayout = self.ui.Items.Layout_tongji_title
  20. local text3 = tongjiTitleLayout:getChildByName("Text_3")
  21. text3:setString("消耗" .. PLN.CURRENCY)
  22. local text4 = tongjiTitleLayout:getChildByName("Text_4")
  23. text4:setString("专属" .. PLN.CURRENCY)
  24. end
  25. function ClubZhanJiTongJiView:onClickClose()
  26. self:removeFromParent()
  27. end
  28. --战绩统计查询成功
  29. function ClubZhanJiTongJiView:updateList()
  30. -- app.waitDialogManager:closeWaitNetworkDialog()
  31. -- self.ui.Items.ScrollView:setVisible(false)
  32. local uiScrollView = self.ui.Items.ScrollView--self.ui.Items.ScrollView_TongJi
  33. uiScrollView:getInnerContainer():setAutoSize(true)
  34. uiScrollView:removeAllChildren();
  35. -- local zhanjiTongjiDataList = app.club_php.zhanjiTongjiDataList[tonumber(self.clubInfo.gid)]
  36. -- if not self.list or table.nums(self.list) <= 0 then
  37. -- --无数据显示
  38. -- self.ui.Items.Layout_no_data:setVisible(true);
  39. -- -- self.ui.Items.Layout_TongJi:setVisible(false)
  40. -- return
  41. -- else
  42. -- self.ui.Items.Layout_no_data:setVisible(false);
  43. -- self.ui.Items.Layout_TongJi:setVisible(true)
  44. -- end
  45. --战绩统计标题
  46. -- local uiItemTitle = self.ui.Items.Layout_tongji_title:getCopied()
  47. -- uiItemTitle.Items = getUIItems(uiItemTitle)
  48. -- uiScrollView:addChild(uiItemTitle)
  49. --战绩统计内容
  50. local uiTemplate = self.ui.Items.Layout_tongji_content;
  51. for k, tongjiInfo in pairsByKeysEx(self.list) do
  52. local uiItem = uiTemplate:getCopied()
  53. uiItem.Items = getUIItems(uiItem)
  54. --名字
  55. local gameName = getSubGameRuleName(tongjiInfo.game_id,tongjiInfo.gamerule)
  56. uiItem.Items.Text_data:setText(gameName)
  57. --开房成局
  58. uiItem.Items.Text_chengju_count:setText(tonumber(tongjiInfo.openhouse_count))
  59. --馆主消耗
  60. uiItem.Items.Text_xiaohao_count:setText(tonumber(tongjiInfo.owner_card_consume_count))
  61. --馆主专属房卡/房卡消耗
  62. uiItem.Items.Text_zhuanshu_xiaohao:setText(tonumber(tongjiInfo.owner_props_card_count))
  63. uiScrollView:addChild(uiItem)
  64. end
  65. uiScrollView:jumpToTopOnSizeChanged()
  66. end
  67. return ClubZhanJiTongJiView