源战役客户端
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

60 linhas
1.6 KiB

4 semanas atrás
  1. FuliCDKView = FuliCDKView or BaseClass(BaseItem)
  2. local FuliCDKView = FuliCDKView
  3. function FuliCDKView:__init()
  4. self.base_file = "fuli"
  5. self.layout_file = "FuliCDKView"
  6. self.model = FuliModel:GetInstance()
  7. self:Load()
  8. end
  9. function FuliCDKView:Load_callback()
  10. self.nodes = {
  11. "girl:raw","dot2","text3:tmp","text2:tmp","dot1","dot3","btn/btn_text:tmp","btn:obj","text1:tmp",
  12. "TextInput:tmpInput","TextInput/Text Area/Placeholder:tmp", "TextInput/Text Area/input_text:tmp",
  13. }
  14. self:GetChildren(self.nodes)
  15. lua_resM:setOutsideRawImage(self, self.girl_raw, GameResPath.GetRoleBg("fuli_cdk_508_715"), false)
  16. self.Placeholder_tmp.text = "请输入激活码"
  17. self.text1_tmp.text = "激活码由<color=#fdffc2>“数字”</color>和<color=#fdffc2>“英文”</color>组成"
  18. self.text2_tmp.text = "输入激活码后点击领取奖励即可获得大礼包"
  19. self.text3_tmp.text = "请注意每个激活码<color=#fdffc2>只能使用一次</color>"
  20. self:AddEvents()
  21. if self.need_refreshData then
  22. self:UpdateView()
  23. end
  24. end
  25. function FuliCDKView:AddEvents( )
  26. local on_click = function ( click_obj )
  27. if self.btn_obj == click_obj then
  28. local content = self.TextInput_tmpInput.text
  29. if(content:match("%W")) then
  30. Message.show("输入格式错误!","fault")
  31. else
  32. self.model:Fire(FuliConst.REQ_FULI_SCMD, 16009, content)
  33. end
  34. end
  35. end
  36. AddClickEvent(self.btn_obj, on_click)
  37. end
  38. function FuliCDKView:UpdateView( )
  39. end
  40. function FuliCDKView:SetData( data )
  41. self.data = data
  42. if self.is_loaded then
  43. self.need_refreshData = false
  44. self:UpdateView()
  45. else
  46. self.need_refreshData = true
  47. end
  48. end
  49. function FuliCDKView:__delete( )
  50. end