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.

47 lines
1.2 KiB

  1. -- 未满18岁拒绝进入
  2. local ShiMingRejectView = class("ShiMingRejectView", cc.UIView)
  3. function ShiMingRejectView:ctor()
  4. ShiMingRejectView.super.ctor(self);
  5. local ui = loadUI("res/ui/ui_dating/ui_shiming_reject.ui")
  6. self.ui = ui
  7. self:addChild(ui)
  8. end
  9. function ShiMingRejectView:onEnter()
  10. ShiMingRejectView.super.onEnter(self)
  11. self.ui.Items.Button_Exit:registerClick(handler(self , self.onClickExit))
  12. self.ui.Items.Button_KeFu:registerClick(handler(self , self.onButtonClickKeFu));
  13. end
  14. function ShiMingRejectView:onButtonClickKeFu()
  15. playBtnEffect()
  16. local tt =
  17. {
  18. action = "collecturl.getDataByUid";
  19. app_id = getAppId(); --应用id
  20. };
  21. local phpUrl = getGlobalPhpUrl()
  22. httpPost(phpUrl, tt, function(status, response)
  23. if status == "successed" then
  24. local data = json.decode(response)
  25. if data.code == 200 and data.result ~= null then
  26. app.plugin:callUrl(data.result.kefuurl)
  27. end
  28. else
  29. local url = "http://cs.zxtycest.com/addons/kefu?gameid=47"
  30. app.plugin:callUrl(url)
  31. end
  32. end)
  33. end
  34. -- 退出游戏
  35. function ShiMingRejectView:onClickExit()
  36. app.plugin:logout();
  37. end
  38. return ShiMingRejectView;