代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello MUI</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!--标准mui.css-->
<link rel="stylesheet" href="css/mui.min.css">
<!--App自定义的css-->
<link rel="stylesheet" type="text/css" href="css/app.css" />
<style>
.mui-row.mui-fullscreen>[class*="mui-col-"] {
height: 100%;
}
.mui-col-xs-3,
.mui-control-content {
overflow-y: auto;
height: 100%;
}
.mui-segmented-control .mui-control-item {
line-height: 50px;
width: 100%;
}
.mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active {
background-color: #fff;
}
</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>
<button id="choosed" type="button" class="mui-left mui-btn mui-btn-link mui-btn-nav mui-pull-right">
保存
</button>
</header>
<div class="mui-content mui-row mui-fullscreen">
<div class="mui-col-xs-3">
<div id="segmentedControls" class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-vertical">
</div>
</div>
<div id="segmentedControlContents" class="mui-col-xs-9" style="border-left: 1px solid #c8c7cc;">
<div id="item1" class="mui-control-content mui-active">
</div>
<div id="item2" class="mui-control-content">
</div>
<div id="item3" class="mui-control-content">
</div>
</div>
</div>
<script src="js/mui.min.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/config.js"></script>
<script>
mui.init({
swipeBack: true //启用右滑关闭功能
});
var setids = '';
mui.plusReady(function() {
var self = plus.webview.currentWebview();
var myid = self.mainid;
setids = self.setids;
$.get(dataDomain + "/common/adminuser/bydepartment", function(req) {
var controls = document.getElementById("segmentedControls");
var contents = document.getElementById("segmentedControlContents");
var html = [];
var i = 1,
j = 1,
m = req.length + 1, //左侧选项卡数量+1
n = 21; //每个选项卡列表数量+1
for(; i < m; i++) {
html.push('<a class="mui-control-item" href="#content' + i + '">' + req[i - 1].name + '</a>');
}
controls.innerHTML = html.join('');
html = [];
for(i = 1; i < m; i++) {
n = req[i - 1].users.length;
html.push('<div id="content' + i + '" class="mui-control-content"><ul class="mui-table-view">');
for(j = 1; j < n; j++) {
html.push('<li class="mui-table-view-cell mui-checkbox mui-left"><input id="cks' + req[i - 1].users[j - 1].id + '" class="cks" value="' + req[i - 1].users[j - 1].id + '" type="checkbox" />' + req[i - 1].users[j - 1].realName + '</li>');
}
html.push('</ul></div>');
}
contents.innerHTML = html.join('');
//默认选中第一个
controls.querySelector('.mui-control-item').classList.add('mui-active');
contents.querySelector('.mui-control-content').classList.add('mui-active');
if(setids != "") {
var arr = setids.split(",");
for(var i = 0; i < arr.length; i++) {
$("#cks" + arr[i]).attr("checked", "checked");
}
}
});
$(function() {
$("#choosed").on("tap", function() {
var parentWin = plus.webview.getWebviewById('add_dc');
resids();
parentWin.evalJS("setids('" + setids + "')");
plus.webview.currentWebview().close();
});
});
});
function resids() {
var ids = "";
$(".cks:checked").each(function() {
ids += $(this).val() + ",";
});
if(ids != "") {
ids = ids.substring(0, ids.length - 1);
setids = ids;
} else {
setids = "";
}
}
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。