|
- define(function(require){
- var $ = require("jquery");
- var justep = require("$UI/system/lib/justep");
- var ShellImpl = require('$UI/system/lib/portal/shellImpl');
- require("cordova!cordova-plugin-network-information");
- require("cordova!cordova-plugin-statusbar");
-
- var Model = function(){
- this.callParent();
- var shellImpl = new ShellImpl(this, {
- "contentsXid" : "pages",
- "pageMappings" : {
- "main":{
- url : require.toUrl('./index_main.w')
- },
- "list":{
- url : require.toUrl('./list.w')
- },
- "detail":{
- url : require.toUrl('./detail.w')
- },
- "cdetail":{
- url : require.toUrl('./cdetail.w')
- },
- "muser":{
- url : require.toUrl('./muser.w')
- },
- "post":{
- url : require.toUrl('./post.w')
- },
- "submission":{
- url : require.toUrl('./submission.w')
- },
- "mytopic":{
- url : require.toUrl('./mytopic.w')
- },
- "pview":{
- url : require.toUrl('./pview.w')
- }
-
- }
- });
- };
- Model.prototype.modelLoad = function(event){
- try{
- StatusBar.hide();
- }catch(err){
- //隐藏状态栏出错
- }
- //检测网络状态
- try{
- var networkState = navigator.connection.type;
- if(networkState==Connection.NONE){
- alert("无法访问网络,请检查您的网络!");
- navigator.app.exitApp();
- }
- }catch(e){
- //检测网络状态出错了
- }
- justep.Shell.showPage("main");
- };
- return Model;
- });
复制代码 首页代码如上
|
|