| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <!doctype html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <!--<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">-->
- <link href="../css/mui.min.css" rel="stylesheet" />
- <link href="../css/common.css" rel="stylesheet" />
- <style type="text/css">
- .mui-content {
- background: #fff;
- }
-
- #popover {
- display: block;
- top: 57px;
- left: 165px;
- }
-
- /*tab*/
-
- .mui-segmented-control {
- border: none;
- }
-
- .mui-segmented-control .mui-control-item {
- border-left: none;
- color: #333;
- }
-
- .mui-segmented-control .mui-control-item.mui-active {
- color: #333;
- background: transparent;
- border-bottom: 2px solid #007AFF;
- }
- .mui-segmented-control .mui-control-item{
- border-bottom: 2px solid #c8c7cc;
-
- }
- .usercontrol{
- display: none;
- }
- </style>
- </head>
- <body>
- <header class="mui-bar mui-bar-nav">
- <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
- <h1 class="mui-title">用户管理</h1>
- <!--<a class="mui-icon mui-icon-plus mui-pull-right" id="addUser">添加</a>-->
- <a href="#popover" id="openPopover" class="mui-icon mui-icon-more mui-pull-right"></a>
- </header>
- <div class="mui-content">
- <!-- <div id="segmentedControl" class="mui-segmented-control usercontrol"> -->
- <!-- <a class="mui-control-item mui-active" data-id='systemmanage_user_list'>用户管理</a> -->
- <!-- <a class="mui-control-item" data-id="systemmanage_usergroup_list">用户组管理</a> -->
- <!-- </div> -->
- </div>
- <script src="../js/mui.min.js"></script>
- <script type="text/javascript">
- mui.init({
- //处理窗口关闭前的业务
- beforeback: function() {
- //... //窗口关闭前处理其他业务详情点击 ↑ "关闭页面"链接查看
- var currentWebview=plus.webview.currentWebview();
- plus.webview.close(currentWebview);
- },
- })
- var floatw = null;
- mui.plusReady(function() {
- //预加载页面
- var subInfos = [{
- url: 'systemmanage_user_list.html',
- id: 'systemmanage_user_list'
- }];
- var pageStyle = {
- top: "55px",
- bottom: "0px"
- }
- //用户判断
- var isuser = plus.storage.getItem('isuser');
- console.log(isuser)
- // if(isuser == 'agency'){
- // document.getElementById('segmentedControl').style.display = 'none';
- // pageStyle = {
- // top: "5px",
- // bottom: "0px"
- // }
- // }else{
- // document.getElementById('segmentedControl').style.display = 'block';
- // }
- //添加列表
- var self = plus.webview.currentWebview();
- var activeTab = '';
- var firstPage = plus.webview.create(subInfos[0].url, subInfos[0].id, pageStyle);
- self.append(firstPage)
- activeTab = subInfos[0].id;
-
- // 根据id查询子页面的信息
- var getSubInfoById = function(infoList, id) {
- var result = null;
- for(var i = 0, len = infoList.length; i < len; i++) {
- var _info = infoList[i];
- if(_info.id === id) {
- result = _info;
- break;
- }
- }
- return result;
- };
-
- mui('#segmentedControl').on('tap', 'a', function() {
- var _self = this;
- var targetTab = _self.getAttribute('data-id');
- if(targetTab === activeTab) {
- return;
- }
- var _subWv = plus.webview.getWebviewById(targetTab);
-
- // 若webview不存在,则创建;
- if(!_subWv) {
- var _subInfo = getSubInfoById(subInfos, targetTab);
- _subWv = plus.webview.create(_subInfo.url, _subInfo.id, pageStyle);
- self.append(_subWv);
- }
- _subWv.show();
-
- // 隐藏之前的webview
- plus.webview.getWebviewById(activeTab).hide('none');
- activeTab = targetTab;
- })
-
- //顶部右上角按钮menu触发弹出菜单
- document.getElementById('openPopover').addEventListener('tap', function() {
- floatWebview()
- })
-
- // 创建悬浮窗口
- function floatWebview() {
- if(floatw) { // 避免快速多次点击创建多个窗口
- floatw.show("fade-in");
- } else {
- floatw = plus.webview.create("systemmanage_user_nav.html", "systemmanage_user_nav", {
- background: 'transparent',
- zindex: 10,
- });
- floatw.show("fade-in");
- }
- }
-
- })
- </script>
- </body>
- </html>
|