|
- local DEEP_COL1 = cc.c3b(0xff, 0xff, 0xff)
- local WEAK_COL1 = cc.c3b(0xd9, 0xf6, 0xff)
-
- local BG_W = 564
- local BaseLayer = require("luaScript.ModuleEapSdk.BaseLayers.BaseLayer")
- local LayerUserInfo = EapClass("LayerUserInfo", BaseLayer)
-
- function LayerUserInfo.createWithData(__node, __zorder)
- local layer = LayerUserInfo.new()
- layer.m_parent = __node
- __node:addChild(layer, __zorder)
- return layer
- end
-
- function LayerUserInfo:myShow()
- -- self:addListener(true)
- self:initData()
- self:initUI()
- end
-
- function LayerUserInfo:myClose()
-
- end
-
- function LayerUserInfo:initData()
- self.m_needRefresh = true
- end
-
- function LayerUserInfo:initUI()
- self.imgPath = {
- "res/ModuleEapSdk/eapsdk_public_back_bg1.png",
- "res/ModuleEapSdk/eapsdk_public_back_bg6.png",
- "res/ModuleEapSdk/eapsdk_public_back_bg8.png",
- "res/ModuleEapSdk/eapsdk_wj_default_head.png",
- "res/ModuleEapSdk/eapsdk_public_back_bg9.png", --5
- "res/ModuleEapSdk/eapsdk_img_kefu.png",
- "res/ModuleEapSdk/eapsdk_img_mail.png",
- "res/ModuleEapSdk/eapsdk_img_icon.png", --奖章
- "res/ModuleEapSdk/Eap_Team/eapsdk_team_changeAccount.png", --切换账号
-
- }
-
- local fix_x = display.width
- local fix_y = display.cy
- local imgBack2 = G_EapAbbreviation.createImageView(self.imgPath[2], self, cc.p(fix_x-15, fix_y), true, 2, 3101, cc.p(1, 0.5))
- imgBack2:setSize(cc.size(BG_W-30, 580))
- -- local imgBack3 = G_EapAbbreviation.createImageView(self.imgPath[5], imgBack2, cc.p(0, 400), true, 2, 3101, cc.p(0, 1))
- -- imgBack3:setSize(cc.size(BG_W-30, 55))
- -- local imgBack5 = G_EapAbbreviation.createImageView(self.imgPath[5], imgBack2, cc.p(0, 300), true, 2, 3101, cc.p(0, 1))
- -- imgBack5:setSize(cc.size(BG_W-30, 55))
-
- local imgBack4 = G_EapAbbreviation.createImageView(self.imgPath[3], imgBack2, cc.p(0, 580), true, 2, 3101, cc.p(0, 1))
- imgBack4:setSize(cc.size(BG_W-30, 139))
-
- self.imgHead = ccui.ImageView:create(self.imgPath[4])
- self.imgHead:setScale(0.9)
- self.imgHead:setPosition(cc.p(90, 71))
- imgBack4:addChild(self.imgHead)
-
- local deepCol = cc.c3b(0x1e, 0x23, 0x36)
- local normCol = cc.c3b(0x7a, 0x7a, 0x7a)
- local title = G_EapSdkMgr.NickName or "游戏昵称"
- if G_EapLabelTool.GetUTF8StrNums( title ) > 22 then
- title = G_EapLabelTool.GetUTF8StrByIdxNumEx(title, 22)
- title = title..".."
- end
- self.lblName = G_EapAbbreviation.createSystemLabel(imgBack4, cc.p(180, 90), title, 25, WEAK_COL1, true, display.LEFT)
- self.lblName:setAnchorPoint(cc.p(0, 0.5))
- local id = G_EapSdkMgr.UserId and "赛事ID:"..G_EapSdkMgr.UserId or "赛事ID:"
- self.lblID = G_EapAbbreviation.createSystemLabel(imgBack4, cc.p(180, 42), id, 22, DEEP_COL1, true, display.LEFT)
- self.lblID:setAnchorPoint(cc.p(0, 0.5))
-
- --奖章
- local imgJZ = G_EapAbbreviation.createSprite(self.imgPath[8], imgBack4, cc.p(350, 42))
- imgJZ:setScale(0.6)
- local myItem = G_EapSdkMgr:getItem(ITEM_TYPE.INTEGRAL)
- local scoreNum = myItem and myItem.nNum or 0
- local score = scoreNum
-
- self.lblScore = G_EapAbbreviation.createSystemLabel(imgBack4, cc.p(370, 42), score, 22, DEEP_COL1, false, display.LEFT)
- self.lblScore:setAnchorPoint(cc.p(0, 0.5))
-
- if EAP_MATCH_STAGE == EAP_STAGE_TEAM then
- -- --切换账号
- -- local tip1 = "若此赛事ID和第一电竞app账号不一致,请切换账号。"
- -- local lblTips = G_EapAbbreviation.createSystemLabel(imgBack2, cc.p(BG_W/2, 162), tip1, 18, DEEP_COL1)
-
- -- self.btnAccount = ccui.Button:create(self.imgPath[9])
- -- self.btnAccount:setPosition(cc.p(BG_W/2, 120))
- -- self.btnAccount:setScale(0.6)
- -- imgBack2:addChild(self.btnAccount)
- -- addButtonListener(self.btnAccount, function()
- -- G_LayerMain:showLayer(LAYER_ENUM.LAYER_ACNT_CODE)
- -- end)
- end
-
- -- local imgKefu = ccui.ImageView:create(self.imgPath[6])
- -- imgKefu:setScale(0.6)
- -- imgKefu:setPosition(cc.p(50, 25))
- -- imgBack3:addChild(imgKefu)
- -- local qqID = "客服QQ:553016356"
- -- local lblKefu = G_EapAbbreviation.createSystemLabel(imgBack3, cc.p(100, 25), qqID, 22, DEEP_COL1, true, display.LEFT)
- -- lblKefu:setAnchorPoint(cc.p(0, 0.5))
-
- -- local imgMail = ccui.ImageView:create(self.imgPath[7])
- -- imgMail:setScale(0.6)
- -- imgMail:setPosition(cc.p(50, 25))
- -- imgBack5:addChild(imgMail)
- -- local mailID = "邮箱:cscest@microbeam.cn"
- -- local lblMail = G_EapAbbreviation.createSystemLabel(imgBack5, cc.p(100, 25), mailID, 22, DEEP_COL1, true, display.LEFT)
- -- lblMail:setAnchorPoint(cc.p(0, 0.5))
- if G_EapSdkMgr.UserId then
- self.m_needRefresh = false
- getUserImage(G_EapSdkMgr.HeadImgUrl, G_EapSdkMgr.UserId, self.imgHead, cc.size(130, 130), true)
- end
- end
-
- function LayerUserInfo:refreshBattleScore()
- local myItem = G_EapSdkMgr:getItem(ITEM_TYPE.INTEGRAL)
- local scoreNum = myItem and myItem.nNum or 0
- local score = scoreNum
- self.lblScore:setString(score)
- end
-
- function LayerUserInfo:refreshMyInfo(__force)
- if __force or self.m_needRefresh then
- local title = G_EapSdkMgr.NickName or "游戏昵称"
- if G_EapLabelTool.GetUTF8StrNums( title ) > 22 then
- title = G_EapLabelTool.GetUTF8StrByIdxNumEx(title, 22)
- title = title..".."
- end
- self.lblName:setString(title)
-
- local id = G_EapSdkMgr.UserId and "赛事ID:"..G_EapSdkMgr.UserId or "赛事ID:"
- self.lblID:setString(id)
-
- if G_EapSdkMgr.UserId then
- self.m_needRefresh = false
- getUserImage(G_EapSdkMgr.HeadImgUrl, G_EapSdkMgr.UserId, self.imgHead, cc.size(130, 130), true)
- end
- end
- end
-
- return LayerUserInfo
|