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

View File

@ -14,6 +14,7 @@ const { operation, OperationType } = require('./Operation/Operation');
const jcgamelog = require('./jcfw/service/jcgamelog');
const { uimanger } = require('./UI/UIManger');
const { default: ChainErrTip } = require('./tips/ChainErrTip');
const { UpdateTips } = require('./tips/UpdateTips');
window.connectOK = (account) => {
jcgamelog.addOperation(
@ -30,9 +31,9 @@ window.connectOK = (account) => {
jclogin.getNonce();
};
window.chainErr = ()=>{
console.log("打开提示框")
cc.Notifier.emit("chainerr");
window.chainErr = () => {
console.log('打开提示框');
cc.Notifier.emit('chainerr');
};
window.signApp = (sign) => {
@ -133,7 +134,6 @@ cc.Class({
// LIFE-CYCLE CALLBACKS:
onLoad() {
this.allCountry = ['Japan', 'Singapore', 'Turkey', 'USA'];
this.cpa_icon = [];
@ -147,8 +147,7 @@ cc.Class({
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);
@ -171,7 +170,7 @@ cc.Class({
}
},
showchainErrTip(){
showchainErrTip() {
uimanger.showUI(ChainErrTip.prefabPath);
},
@ -200,7 +199,7 @@ cc.Class({
cc.Notifier.off('sdkloginfail', this);
cc.Notifier.off('sdkLoginSuccess', 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;
SDKManage.logEvent('login_success', 'loginmain');
},
@ -251,17 +250,16 @@ cc.Class({
//
SDKManage.init('6516');
jcgamelog.addOperation(OperationType.LOGIN, 'gamestart');
console.log(`current packageid ` + Config.mainConfig.packageid);
console.log(`current version ` + Config.mainConfig.version);
jcgamelog.addOperation(
OperationType.LOGIN,
'gamestart',
OperationType.Login,
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')) {
localStorage.setItem('currentNet', allBaseNet.japan);
} else {
@ -289,6 +287,8 @@ cc.Class({
this.allCountry[data];
}
uimanger.showUI(UpdateTips.prefabPath);
return;
// if (cc.sys.isBrowser) {
// 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": [
"default"
],
"last-module-event-record-time": 1653628500757,
"last-module-event-record-time": 1654744899243,
"simulator-orientation": false,
"simulator-resolution": {
"height": 640,
"width": 960
},
"start-scene": "current",
"use-customize-simulator": true,
"use-project-simulator-setting": false,
"start-scene": "current"
"use-project-simulator-setting": false
}