Commit 9d83ea69 authored by rockyl's avatar rockyl

init

parent 8671f224
......@@ -85,29 +85,36 @@ export default class MainController extends ScillaComponent {
this._popup.hideAll();
}
alert(data?, callback?) {
this.showDialog('Alert', data, callback);
alert(data?, callback?, callbackDelay = 500) {
this.showDialog('Alert', data, function (action, data) {
setTimeout(function () {
callback(action, data);
}, callbackDelay);
});
}
showLoginAlert() {
const callUpRegistH5Code = engine.dataCenter.get('CFG', 'callUpRegistH5Code');
const callUpLoginFunc = window['requirelogin'];
const requirelogin = window['requirelogin'];
const inWeiXin = isWeiXin();
this.alert({
title: `啊哦,你还未登录`,
content: `登录后即可参与活动`,
button: (callUpLoginFunc || callUpRegistH5Code) ? '立即登录' : null,
button: (inWeiXin ? (callUpRegistH5Code || requirelogin) : requirelogin) ? '立即登录' : null,
}, (action) => {
if (action === 'confirm') {
if(isWeiXin()){
if(callUpRegistH5Code){
if (inWeiXin) {
if (callUpRegistH5Code) {
location.href = callUpRegistH5Code;
}else{
} if (requirelogin) {
requirelogin();
} else {
console.log('没有登录方案');
}
}else{
if(callUpLoginFunc){
callUpLoginFunc();
}else{
} else {
if (requirelogin) {
requirelogin();
} else {
console.log('没有登录方案');
}
}
......
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