c***@163.com
c***@163.com
  • 发布:2019-05-29 15:02
  • 更新:2019-05-30 08:57
  • 阅读:2004

登录之后,tabBar页面加载不出来 报错

分类:uni-app

uni-app 程序,所有的页面在浏览器中显示正常,在打包APP的过程发生各种问题。

登录页面跳转,用的是这种方式
uni.reLaunch({
url:"/pages/index"
})
跳转到主页

主页内容显示不出来,只显示一个框架,如图所示:

控制台显示如下:
15:01:01.030 On app route: pages/index
15:01:01.051 pages/login/login: onUnload have been invoked
15:01:01.071 Page[pages/index] not found. May be caused by: 1. Forgot to add page route in pages.json. 2. Invoking Page() in async task.
15:01:01.092 Page is not constructed because it is not found.

点击选项卡 控制台显示如下:
15:01:47.147 On app route: pages/tongxunlu/index
15:01:47.167 switchTab before pages are registered.

page.json 代码如下:

{
"pages": [
{
"path": "pages/login/login",
"style": {
"navigationBarBackgroundColor": "#00a1e9",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "登录"
}
},
// pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "欢迎您",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "\ue534",
"fontSrc": "/static/uni.ttf",
"fontSize": "22px",
"color": "#999999"
}]
}
}
}
},

    {  
        "path": "pages/user/user",  
        "style": {  
            "navigationStyle": "custom",  
            "navigationBarTitleText": "我的",  
            "app-plus": {  
                "titleNView": {  
                    "buttons": [{  
                        "text": "\ue534",  
                        "fontSrc": "/static/uni.ttf",  
                        "fontSize": "22px",  
                        "color": "#999999"  
                    }]  
                }  
            }  
        }  
    },  
    {  
        "path": "pages/tongxunlu/index",  
        "style": {  
            "navigationStyle": "custom",  
            "navigationBarBackgroundColor": "#00a1e9",  
            "navigationBarTextStyle": "white",  
            "navigationBarTitleText": "通讯录",  
            "app-plus": {  
                "titleNView": {  
                    "buttons": [{  
                        "text": "\ue534",  
                        "fontSrc": "/static/uni.ttf",  
                        "fontSize": "22px",  
                        "color": "#999999"  
                    }]  
                }  
            }  
        }  
    },  

    {  
        "path": "pages/tongxunlu/person",  
        "style": {  
            "navigationBarBackgroundColor": "#00a1e9",  
            "navigationBarTextStyle": "white",  
            "navigationBarTitleText": "通讯录",  
            "app-plus": {  
                "titleNView": {  
                    "buttons": [{  
                        "text": "\ue534",  
                        "fontSrc": "/static/uni.ttf",  
                        "fontSize": "22px",  
                        "color": "#999999"  
                    }]  
                }  
            }  
        }  
    },  
    {  
        "path": "pages/tongzhigonggao/index",  
        "style": {  
            "navigationStyle": "custom",  
            "navigationBarTitleText": "公告",  
            "app-plus": {  
                "titleNView": {  
                    "buttons": [{  
                        "text": "\ue534",  
                        "fontSrc": "/static/uni.ttf",  
                        "fontSize": "22px",  
                        "color": "#999999"  
                    }]  
                }  
            }  
        }  
    },  
    {  
        "path": "pages/baoxiu_fuwu/index",  
        "style": {  
            "navigationBarTitleText": "报修服务"  
        }  
    }, {  
        "path": "pages/wxcharts",  
        "style": {  
            "navigationBarTitleText": "注册"  
        }  
    },   
    {  
        "path": "pages/chaxun/chaxun",  
        "style": {  
            "navigationBarTitleText": "查询"  
        }  
    },  
    {  
        "path": "pages/baojingxinxi/index",  
        "style": {  
            "navigationBarTitleText": "报警信息"  
        }  
    },  
    {  
        "path": "pages/tongji/index",  
        "style": {  
            "navigationStyle": "custom",  
            "navigationBarBackgroundColor": "#00a1e9",  
            "navigationBarTextStyle": "white",  
            "navigationBarTitleText": "统计"  
        }  
    },  
    {  
        "path": "pages/user/fankui_detail",  
        "style": {  
            "navigationStyle": "custom",  
            "navigationBarBackgroundColor": "#00a1e9",  
            "navigationBarTextStyle": "white",  
            "navigationBarTitleText": "通知公告"  
        }  
    },  
    {  
        "path": "pages/baoxiu/baoxiu",  
        "style": {  
            "navigationBarBackgroundColor": "#00a1e9",  
            "navigationBarTextStyle": "white",  
            "navigationBarTitleText": "报修"  
        }  
    },  
    {  
        "path": "pages/tongzhigonggao/notice",  
        "style": {  
            "navigationStyle": "custom",  
            "navigationBarBackgroundColor": "#00a1e9",  
            "navigationBarTextStyle": "white",  
            "navigationBarTitleText": "公告"  
        }  
    },  
    {  
        "path": "pages/user/lianxiwomen",  
        "style": {  
            "navigationStyle": "custom",  
            "navigationBarBackgroundColor": "#00a1e9",  
            "navigationBarTextStyle": "white",  
            "navigationBarTitleText": "联系我们"  
        }  
    },  
    {  
        "path": "pages/user/fankui_info",  
        "style": {  
            "navigationStyle": "custom",  
            "navigationBarBackgroundColor": "#00a1e9",  
            "navigationBarTextStyle": "white",  
            "navigationBarTitleText": "反馈信息"  
        }  
    },  
    {  
        "path": "pages/fuwudui/fuwudui",  
        "style": {  
            "navigationStyle": "custom",  
            "navigationBarBackgroundColor": "#00a1e9",  
            "navigationBarTextStyle": "white",  
            "navigationBarTitleText": "服务队"  
        }  
    },  
    {  
        "path": "pages/fuwudui/dui_detail",  
        "style": {  
            "navigationStyle": "custom",  
            "navigationBarBackgroundColor": "#00a1e9",  
            "navigationBarTextStyle": "white",  
            "navigationBarTitleText": "服务队详情"  
        }  
    },  
    {  
        "path": "pages/baoxiu/baoxiu_detail",  
        "style": {  
            "navigationStyle": "custom",  
            "navigationBarBackgroundColor": "#00a1e9",  
            "navigationBarTextStyle": "white",  
            "navigationBarTitleText": "报修详情"  
        }  
    },  
    {  
        "path": "pages/baoxiu/index",  
        "style": {  
            "navigationStyle": "custom",  
            "navigationBarBackgroundColor": "#00a1e9",  
            "navigationBarTextStyle": "white",  
            "navigationBarTitleText": "报修"  
        }  
    },  
    {  
        "path": "pages/cheliangguankong/index",  
        "style": {  
            "navigationStyle": "custom",  
            "navigationBarBackgroundColor": "#00a1e9",  
            "navigationBarTextStyle": "white",  
            "navigationBarTitleText": "车辆管控"  
        }  
    },  
    {  
        "path": "pages/fuwudui/village_manyidu_detail",  
        "style": {  
            "navigationStyle": "custom",  
            "navigationBarBackgroundColor": "#00a1e9",  
            "navigationBarTextStyle": "white",  
            "navigationBarTitleText": "服务队评价详情"  
        }  
    }  
],  
"globalStyle": {  
    "navigationStyle": "default",  
    "navigationBarTextStyle": "black",  
    "navigationBarTitleText": "Hello uniapp",  
    "navigationBarBackgroundColor": "#F8F8F8",  
    "backgroundColor": "#F8F8F8",  
    "mp-alipay": {  
        "titleBarColor": "#FFFFFF"  
    }  
},  
"tabBar": {  
    "color": "#7A7E83",  
    "selectedColor": "#007AFF",  
    "borderStyle": "black",  
    "backgroundColor": "#F8F8F8",  
    "list": [{  
            "pagePath": "pages/index",  
            "iconPath": "static/zhuye0.png",  
            "selectedIconPath": "static/shouye.png",  
            "text": "主页"  
        },  
        {  
            "pagePath": "pages/tongxunlu/index",  
            "iconPath": "static/tongxunlu.png",  
            "selectedIconPath": "static/tongxunlu0.png",  
            "text": "通讯录"  
        },  
        {  
            "pagePath": "pages/tongzhigonggao/index",  
            "iconPath": "static/gonggao.png",  
            "selectedIconPath": "static/gonggao0.png",  
            "text": "公告"  
        },  
        {  
            "pagePath": "pages/user/user",  
            "iconPath": "static/wode.png",  
            "selectedIconPath": "static/wode0.png",  
            "text": "我的"  
        }  
    ]  
}  

}

实在不知道什么原因了..........................

2019-05-29 15:02 负责人:无 分享
已邀请:
大海pjh

大海pjh

HBuilderX 版本是最新的吗,我上次也是这样,把版本降低就好了

  • c***@163.com (作者)

    一直保持最新的

    2019-05-29 15:25

  • 大海pjh

    回复 c***@163.com: 那就回退到上一个版本再试一下

    2019-05-29 15:31

  • c***@163.com (作者)

    回复 大海pjh: 这个问题有一段时间了,中间Hbuilder 更新过几次了,也不知道最初版是哪一版了

    2019-05-29 15:34

  • DCloud_UNI_CHB

    回复 c***@163.com: 使用最新的HBuilderX Alpha版本验证一下,Alpha版本说明及下载地址参考:https://ask.dcloud.net.cn/article/35765

    2019-05-30 09:37

  • c***@163.com (作者)

    回复 DCloud_UNI_CHB: 下载了,alpha版本 打包成APP直接报错,界面都显示不出来,截图在后面回复中

    2019-05-30 10:15

  • c***@163.com (作者)

    回复 DCloud_UNI_CHB: 10:13:03.843 reportJSException >>>> exception function:createInstance, exception:Exception: TypeError: undefined is not an object (evaluating 'document.getElementsByTagName')

    10:13:03.863 (global function):12586:16399

    10:13:03.884 (global function):12586:17815

    10:13:03.904 E:\厕所改造-微信\lingdao\common\font-alibaba.js@(global function):12587:34

    10:13:03.925 webpack_require@(global function):2800:35

    10:13:03.945 (global function):20256:20

    10:13:03.966 ./node_modules/babel-loader/lib/index.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js?!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/vue-loader/lib/index.js?!E:\厕所改造-微信\lingdao\pages\index.vue?vue&type=script&lang=js&@(global function):20302:34

    10:13:03.986
    webpack_require
    @(global function):2800:35

    10:13:04.008 E:\厕所改造-微信\lingdao\pages\index.vue?vue&type=script&lang=js&@(global function):20389:567

    10:13:04.028 webpack_require@(global function):2800:35

    10:13:04.048 E:\厕所改造-微信\lingdao\pages\index.vue@(global function):20350:112

    10:13:04.070
    webpack_require
    @(global function):2800:35

    10:13:04.089 (global function):15790:56

    10:13:04.112 E:\厕所改造-微信\lingdao\main.js?{"page":"pages%2Findex"}@(global function):15792:34

    10:13:04.130 __webpack_require__@(global function):2800:35

    10:13:04.152 checkDeferredModules@(global function):2757:45

    10:13:04.171 (global function):20037:61

    10:13:04.195 require@(global function):8:663446

    10:13:04.212 (global function):20432:8

    10:13:04.233 anonymous@(global function):26758:7

    10:13:04.253 (weex framework):1:41537

    10:13:04.274 createInstance@(weex framework):1:41548

    10:13:04.294 (weex framework):1:178111

    10:13:04.336 getTemplateInfo== template md5 b38d85e963bb4a108437935463f29555 length 2922238 base64 md5 s42F6WO7ShCEN5NUY/KVVQ== response header {"templateSourceBase64MD5":["s42F6WO7ShCEN5NUY/KVVQ=="],"templateSourceMD5":["b38d85e963bb4a108437935463f29555"]}

    10:14:03.686 request:fail timeout

    2019-05-30 10:16

  • DCloud_UNI_CHB

    回复 c***@163.com: document.getElementsByTagName 这行表示,你用了dom操作的前端库?uni-app在App端、小程序端是没有document对象的,另外,看起来还有目录乱码问题,改一下目录结构,不要有中文、空格等字符

    2019-05-30 13:58

  • c***@163.com (作者)

    回复 DCloud_UNI_CHB: 这个是用了 阿里巴巴的图标库,目录结构我试一下

    2019-05-30 14:16

c***@163.com

c***@163.com (作者) - 80后IT男

这是源码

  • 大海pjh

    const user_hou = app._load_storage('user_hou', true); 这段代码有问题,去掉就好了

    2019-05-29 18:29

  • c***@163.com (作者)

    回复 大海pjh: 刚试了 没用 还是显示不出来

    2019-05-30 08:55

c***@163.com

c***@163.com (作者) - 80后IT男

账号信息:
yanshi
qp123456

该问题目前已经被锁定, 无法添加新回复