00038-layui 打开新页面,并通过url带参数,在新页面获取url的参数

夙愿已清 提交于 2020-09-23 12:44:19

打开的页面为一个页签

top.layui.index.openTabsPage('business/businessUserShow.jsp#/self=1','个人信息')

businessUserShow.jsp:

<script>
    layui.config({
        base: '${ctxLayui}/layuiadmin/'
    }).extend({
        index: 'lib/index'
    }).use(['index', 'form','dict','laytpl','util','element'], function(){
        var $ = layui.$ ,form = layui.form;
        var dict = layui.dict;
        var laytpl = layui.laytpl;
        var util = layui.util;
        var router = layui.router();
        var admin = layui.admin;
        var formData = window.parent.formData;

        var self = null;
        try{
            self = router.search.self;
            if(self==1){
//                top.layui.index.openTabsPage('business/businessUserShow.jsp#/self=1','个人信息')
                var curUser = layui.data(layui.setter.tableName)[layui.setter.userKey];
                var rtn = admin.syncReq(ctx+'/business/businessUser/queryById',{id:curUser.id})
                if(rtn.code==0){
                    formData = rtn.data;
                }
            }

        }catch (err){
            self = null;
        }

关键代码:

var router = layui.router();
self = router.search.self;
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!