Commit 9ca09b25 authored by liujiangnan's avatar liujiangnan

feat: 微信支付1

parent bf051129
......@@ -8,13 +8,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
addPreloadImage() {
// TODO 根据自己的配置预加载图片资源
this._imageResList.push({ url: this.data.pic_url });
this._imageResList.push({ url: this.data.pic_url_2 });
}
addPreloadAudio() {
// TODO 根据自己的配置预加载音频资源
this._audioResList.push({ url: this.data.audio_url });
}
addPreloadAnima() {
......
......@@ -85,17 +85,19 @@ export abstract class middleLayerBase extends cc.Component {
ORG_ID;
DOMAIN;
async getBaseUrl(callback) {
async getBaseUrl(callback = null) {
const engineInfo = await this.getEngineInfo();
const { isDev } = JSON.parse(engineInfo);
if (isDev == 1) {
this.ORG_ID = 513;
this.DOMAIN = "http://staging-teach.cdn.ireadabc.com/";
callback('http://staging-openapi.iteachabc.com');
callback && callback('http://staging-openapi.iteachabc.com');
return 'http://staging-openapi.iteachabc.com';
} else {
this.ORG_ID = 512;
this.DOMAIN = "http://teach.cdn.ireadabc.com/";
callback('http://openapi.iteachabc.com');
callback && callback('http://openapi.iteachabc.com');
return 'http://openapi.iteachabc.com';
}
}
......
......@@ -538,3 +538,11 @@ export function buttonOnClick(button: cc.Node, callback: Function, scale = 1.0)
.start();
});
}
export function guid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment