add update tips

This commit is contained in:
zhuguoqing 2022-06-09 11:27:32 +08:00
parent e452bbff63
commit 6bb128f74c
6 changed files with 71 additions and 33 deletions

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "pb_wallet", "_name": "pb_update",
"_objFlags": 0, "_objFlags": 0,
"_parent": null, "_parent": null,
"_children": [ "_children": [
@ -58,8 +58,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 1137.7777777777778, "width": 1024,
"height": 568.8888888888889 "height": 512
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@ -74,8 +74,8 @@
}, },
"_scale": { "_scale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0.9, "x": 1,
"y": 0.9, "y": 1,
"z": 1 "z": 1
}, },
"_rotationX": 0, "_rotationX": 0,
@ -126,8 +126,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 1137.7777777777778, "width": 1024,
"height": 568.8888888888889 "height": 512
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@ -1257,8 +1257,8 @@
"__id__": 1 "__id__": 1
}, },
"component": "", "component": "",
"_componentId": "cdb9fNV769Ch4o38n1EqOk+", "_componentId": "7b85fzYz7BLt6ea4QrLrhha",
"handler": "onok", "handler": "onClickOK",
"customEventData": "" "customEventData": ""
}, },
{ {
@ -1328,15 +1328,13 @@
"_id": "" "_id": ""
}, },
{ {
"__type__": "cdb9fNV769Ch4o38n1EqOk+", "__type__": "7b85fzYz7BLt6ea4QrLrhha",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 1 "__id__": 1
}, },
"_enabled": true, "_enabled": true,
"lb_count": null,
"editbox": null,
"_id": "" "_id": ""
}, },
{ {

View File

@ -14,6 +14,7 @@ const { operation, OperationType } = require('./Operation/Operation');
const jcgamelog = require('./jcfw/service/jcgamelog'); const jcgamelog = require('./jcfw/service/jcgamelog');
const { uimanger } = require('./UI/UIManger'); const { uimanger } = require('./UI/UIManger');
const { default: ChainErrTip } = require('./tips/ChainErrTip'); const { default: ChainErrTip } = require('./tips/ChainErrTip');
const { UpdateTips } = require('./tips/UpdateTips');
window.connectOK = (account) => { window.connectOK = (account) => {
jcgamelog.addOperation( jcgamelog.addOperation(
@ -31,8 +32,8 @@ window.connectOK = (account) => {
}; };
window.chainErr = () => { window.chainErr = () => {
console.log("打开提示框") console.log('打开提示框');
cc.Notifier.emit("chainerr"); cc.Notifier.emit('chainerr');
}; };
window.signApp = (sign) => { window.signApp = (sign) => {
@ -133,7 +134,6 @@ cc.Class({
// LIFE-CYCLE CALLBACKS: // LIFE-CYCLE CALLBACKS:
onLoad() { onLoad() {
this.allCountry = ['Japan', 'Singapore', 'Turkey', 'USA']; this.allCountry = ['Japan', 'Singapore', 'Turkey', 'USA'];
this.cpa_icon = []; this.cpa_icon = [];
@ -147,8 +147,7 @@ cc.Class({
cc.Notifier.on('autologinsuccess', this, this.loadMain.bind(this)); cc.Notifier.on('autologinsuccess', this, this.loadMain.bind(this));
cc.Notifier.on("chainerr",this,this.showchainErrTip.bind(this)); cc.Notifier.on('chainerr', this, this.showchainErrTip.bind(this));
cc.debug.setDisplayStats(false); cc.debug.setDisplayStats(false);
@ -200,7 +199,7 @@ cc.Class({
cc.Notifier.off('sdkloginfail', this); cc.Notifier.off('sdkloginfail', this);
cc.Notifier.off('sdkLoginSuccess', this); cc.Notifier.off('sdkLoginSuccess', this);
cc.Notifier.off('autologinsuccess', this); cc.Notifier.off('autologinsuccess', this);
cc.Notifier.off("chainerr",this,this.showchainErrTip.bind(this)); cc.Notifier.off('chainerr', this, this.showchainErrTip.bind(this));
cc.loader.onProgress = null; cc.loader.onProgress = null;
SDKManage.logEvent('login_success', 'loginmain'); SDKManage.logEvent('login_success', 'loginmain');
}, },
@ -251,17 +250,16 @@ cc.Class({
// //
SDKManage.init('6516'); SDKManage.init('6516');
jcgamelog.addOperation(OperationType.LOGIN, 'gamestart');
console.log(`current packageid ` + Config.mainConfig.packageid);
console.log(`current version ` + Config.mainConfig.version);
jcgamelog.addOperation( jcgamelog.addOperation(
OperationType.LOGIN, OperationType.Login,
'gamestart', Config.mainConfig.packageid
); );
console.log(`current packageid `+ Config.mainConfig.packageid)
console.log(`current version `+ Config.mainConfig.version)
jcgamelog.addOperation(OperationType.Login,Config.mainConfig.packageid)
if (!localStorage.getItem('currentNet')) { if (!localStorage.getItem('currentNet')) {
localStorage.setItem('currentNet', allBaseNet.japan); localStorage.setItem('currentNet', allBaseNet.japan);
} else { } else {
@ -289,6 +287,8 @@ cc.Class({
this.allCountry[data]; this.allCountry[data];
} }
uimanger.showUI(UpdateTips.prefabPath);
return;
// if (cc.sys.isBrowser) { // if (cc.sys.isBrowser) {
// localStorage.setItem('currentNet', allBaseNet.test); // localStorage.setItem('currentNet', allBaseNet.test);
// } // }

View File

@ -0,0 +1,31 @@
const { ccclass, property } = cc._decorator;
@ccclass
export class UpdateTips extends cc.Component {
public static prefabPath = 'prefabs/tips/pb_update';
init(data: any) {
// throw new Error('Method not implemented.');
}
openUrlinNative(url) {
if (cc.sys.os == cc.sys.OS_ANDROID) {
jsb.reflection.callStaticMethod(
'org/cocos2dx/javascript/AppActivity',
'openSocialUrl',
'(Ljava/lang/String;)V',
url
);
} else if (cc.sys.os == cc.sys.OS_IOS) {
jsb.reflection.callStaticMethod(
'AppController',
'openSocialUrl:',
url
);
}
}
onClickOK() {
this.openUrlinNative('https://www.cebg.games/release/cebg.apk');
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "7b85fcd8-cfb0-4bb7-a79a-e10acbae185a",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@ -30,13 +30,13 @@
"group-list": [ "group-list": [
"default" "default"
], ],
"last-module-event-record-time": 1653628500757, "last-module-event-record-time": 1654744899243,
"simulator-orientation": false, "simulator-orientation": false,
"simulator-resolution": { "simulator-resolution": {
"height": 640, "height": 640,
"width": 960 "width": 960
}, },
"start-scene": "current",
"use-customize-simulator": true, "use-customize-simulator": true,
"use-project-simulator-setting": false, "use-project-simulator-setting": false
"start-scene": "current"
} }