Commit 9d83ea69 authored by rockyl's avatar rockyl

init

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