38 lines
905 B
TypeScript
38 lines
905 B
TypeScript
import { UIBase } from "../UI/UIBase";
|
|
|
|
const {ccclass, property} = cc._decorator;
|
|
|
|
@ccclass
|
|
export class ForceUpdateTips extends UIBase {
|
|
public static prefabPath = 'prefabs/tips/pb_enforceupdate';
|
|
|
|
init(data: any) {
|
|
// throw new Error('Method not implemented.');
|
|
}
|
|
|
|
onClickOK() {
|
|
this.openUrlinNative("https://www.cebg.games/release/cebg.apk");
|
|
}
|
|
|
|
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
|
|
);
|
|
}
|
|
}
|
|
|
|
onClose() {
|
|
this.node.destroy();
|
|
}
|
|
}
|