32 lines
667 B
TypeScript
32 lines
667 B
TypeScript
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');
|
|
}
|
|
}
|