FuliCDKView = FuliCDKView or BaseClass(BaseItem)
|
|
local FuliCDKView = FuliCDKView
|
|
|
|
function FuliCDKView:__init()
|
|
self.base_file = "fuli"
|
|
self.layout_file = "FuliCDKView"
|
|
self.model = FuliModel:GetInstance()
|
|
|
|
self:Load()
|
|
end
|
|
|
|
function FuliCDKView:Load_callback()
|
|
self.nodes = {
|
|
"girl:raw","dot2","text3:tmp","text2:tmp","dot1","dot3","btn/btn_text:tmp","btn:obj","text1:tmp",
|
|
"TextInput:tmpInput","TextInput/Text Area/Placeholder:tmp", "TextInput/Text Area/input_text:tmp",
|
|
}
|
|
self:GetChildren(self.nodes)
|
|
lua_resM:setOutsideRawImage(self, self.girl_raw, GameResPath.GetRoleBg("fuli_cdk_508_715"), false)
|
|
self.Placeholder_tmp.text = "请输入激活码"
|
|
self.text1_tmp.text = "激活码由<color=#fdffc2>“数字”</color>和<color=#fdffc2>“英文”</color>组成"
|
|
self.text2_tmp.text = "输入激活码后点击领取奖励即可获得大礼包"
|
|
self.text3_tmp.text = "请注意每个激活码<color=#fdffc2>只能使用一次</color>"
|
|
self:AddEvents()
|
|
if self.need_refreshData then
|
|
self:UpdateView()
|
|
end
|
|
end
|
|
|
|
function FuliCDKView:AddEvents( )
|
|
local on_click = function ( click_obj )
|
|
if self.btn_obj == click_obj then
|
|
local content = self.TextInput_tmpInput.text
|
|
if(content:match("%W")) then
|
|
Message.show("输入格式错误!","fault")
|
|
else
|
|
self.model:Fire(FuliConst.REQ_FULI_SCMD, 16009, content)
|
|
end
|
|
end
|
|
end
|
|
AddClickEvent(self.btn_obj, on_click)
|
|
|
|
end
|
|
|
|
function FuliCDKView:UpdateView( )
|
|
|
|
end
|
|
|
|
function FuliCDKView:SetData( data )
|
|
self.data = data
|
|
if self.is_loaded then
|
|
self.need_refreshData = false
|
|
self:UpdateView()
|
|
else
|
|
self.need_refreshData = true
|
|
end
|
|
end
|
|
|
|
function FuliCDKView:__delete( )
|
|
|
|
end
|