|
- -- 实名认证
-
- local ShiMingView = class("ShiMingView", cc.UIView)
-
- function ShiMingView:ctor(ShiMingRenZhengData,parent)
- ShiMingView.super.ctor(self);
-
- local ui = loadUI("res/ui/ui_dating/ui_shiming.ui")
- self.ui = ui
- self:addChild(ui)
- app.php.inShiMingView = true
- end
-
-
- function ShiMingView:onEnter()
- ShiMingView.super.onEnter(self)
-
- self.ui.Items.Button_Close:registerClick(handler(self , self.onClickClose))
- -- self.ui.Items.Button_Done:registerClick(handler(self , self.onClickClose))
- self.ui.Items.Button_Commit:registerClick(handler(self , self.onClickSubmit))
-
- self:bindEvent(app, "onGetShiMingInfoResponse", handler(self, self.updateView))
- self:bindEvent(app, "onBindShiMingResponse", handler(self, self.updateView))
-
- self:updateView();
-
- -- 请求实名认证数据
- app.php:requestGetShiMingInfo()
- end
-
- function ShiMingView:updateView()
-
- local shimingData = app.php.shimingData;
- if not shimingData then
- return
- end
-
- if shimingData.card == "" then
- self.ui.Items.Button_Close:setVisible(app.php.curTimeElapse < app.php.online.fiveHour)
- else
- self.ui.Items.Button_Close:setVisible(true)
- end
-
- --姓名更新
- if shimingData.name and shimingData.name ~= "" then
- self.ui.Items.TextField_Name:setText(tostring(shimingData.name))
- self.ui.Items.TextField_ID:setText(tostring(shimingData.card or ""))
-
- self.ui.Items.TextField_Name:setTouchEnabled(false)
- self.ui.Items.TextField_ID:setTouchEnabled(false)
-
- self.ui.Items.Button_Commit:setVisible(false)
-
- self.ui.Items.Text_Tip:setVisible(true)
- end
- end
-
- -- 提交数据
- function ShiMingView:onClickSubmit()
- playBtnEffect()
- --姓名
- local name = self.ui.Items.TextField_Name:getText()
- --身份证
- local identity = self.ui.Items.TextField_ID:getText()
-
- if name == "" then
- showTooltip("请输入姓名!")
- return
- end
-
- if identity == "" then
- showTooltip("请输入身份证!")
- return
- end
-
- app.php:requestBindShiMing(name, identity)
- end
-
- -- 关闭
- function ShiMingView:onClickClose()
- playBtnCloseEffect()
- app.php.inShiMingView = false
- self:removeFromParent()
- end
-
-
- return ShiMingView;
|