123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- /** @format */
- import {Data, Mgr} from '../GameControl'
- import {EVENT, LANGUAGE_TYPE} from '../enums/Enum'
- import {msgCmd} from '../proto/msg_cmd'
- import {rechargeResult} from '../proto/game'
- window['SDKUtils'] = {
- adSuccessCB: Function,
- adFailCB: Function,
- onConfigurationChanged() {
- Mgr.platform.getSafeTop()
- Mgr.event.trigger(EVENT.screenChange)
- },
- onFaceBookLoginSuccess(data) {
- Mgr.event.trigger(EVENT.facebookLoginSuccess, data)
- },
- facebookLoginFail(data) {
- Mgr.event.trigger(EVENT.facebookLoginFail, data)
- },
- onGoogleLoginSuccess(data) {
- Mgr.event.trigger(EVENT.googleLoginSuccess, data)
- },
- googleLoginFail(data) {
- Mgr.event.trigger(EVENT.googleLoginFail, data)
- },
- payFail() {
- Mgr.ui.hideLoading()
- Mgr.ui.tip(LANGUAGE_TYPE.payFailed)
- },
- payCancel() {
- Mgr.ui.hideLoading()
- Mgr.ui.tip(LANGUAGE_TYPE.payCancel)
- },
- googlePaySuccess(data) {
- //等待断线重连
- Mgr.ui.hideLoading()
- data.payType = 1
- if (Mgr.net.webSocket.readyState == WebSocket.OPEN) {
- Mgr.net.send(msgCmd.cmd_recharge_result, data)
- } else {
- Data.main.payData.push(data)
- }
- },
- showADSuccess() {
- this.adSuccessCB && this.adSuccessCB()
- },
- showADFail(errCode) {
- this.adFailCB && this.adFailCB(errCode)
- },
- }
|