安装时,Phonegap会显示一次登录页面

时间:2016-04-02 17:59:12

标签: cordova

我目前正致力于一个电话空白项目,该项目要求我在安装应用程序时显示一次登录信息。谁能建议我这个好方法? 您的贡献是赞赏的。 感谢

1 个答案:

答案 0 :(得分:0)

var db ;
var app={
initialize: function() {
        this.bindEvents();
    },

    bindEvents: function() {
        document.addEventListener('deviceready', this.onDeviceReady, false);
        document.addEventListener("pause", function(){ console.log("---    paused ---"); isAppPaused = true;}, false);
    },
    onDeviceReady: function() {
        app.receivedEvent('deviceready');
        this.initializeDB();
        this.checkConfig(db);
    },
    initializeDB:function(){
          if(window.sqlitePlugin !== undefined) {
            console.log('opening sqlite DB ');
            db = window.sqlitePlugin.openDatabase("MyDB");
        } else {
            console.log('opening Web SQL DB ');
            db = window.openDatabase("MyDB", "1.0", "Cordova Demo", 200000);
        }   
    },
    checkConfig:function(db){
    //In here u query your table for user registeration ;
    //if its true, navigate on to menu page.

    }

};
app.initialize();