码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2020-09-21 12:05:55      阅读:111      评论:0      收藏:0      [点我收藏+]

标签:elf   script   syn   err   table   abs   search   ble   function   

打开的页面为一个页签

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;

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

标签:elf   script   syn   err   table   abs   search   ble   function   

原文地址:https://www.cnblogs.com/jianquan100/p/13694635.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!