物联网平台 +Web 组态
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

149 lines
3.7 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="com.lp.cfg.ProConfig"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<html>
<head>
<title><%=ProConfig.PROJECT_NAME %></title>
<%@ include file="/WEB-INF/wechat/iot/common/resource_lib.jsp"%>
<style type="text/css">
.sub-container{
margin-left: 10px;
padding: 10px 10px 10px 0;
border-top: 1px solid #d9d9d9;
}
.sub-container:FIRST-CHILD{
border-top: 0;
}
.body-container{
background: #fff ;
}
.sub-container p{
font-size: 14px;
}
</style>
</head>
<body>
<div class="container">
<div class="t-c title-info">
<span>子账户列表</span>
<div class="back" onclick="forward('/wiot/user')" style=" position: fixed;top: 0px;" >返回</div>
<c:if test="${user.type != 7 }">
<div class="add" onclick="forward('/wiot/eaccount')" style=" position: fixed;top: 0px;right: 10px;" >增加</div>
</c:if>
</div>
<div style="height: 50px;"></div>
<div class="body-container">
</div>
<%@ include file="/WEB-INF/wechat/iot/common/pager.jsp"%>
</div>
<div class="hide" id="template">
<div class="sub-container clear" onclick="subAccountInit({id})">
<div class="float-left width50">
<p class="title" style="color: #333;">
<span>{name}</span>
<span class="{style}">{data.status}</span>
</p>
<p style="color: #aaa;padding-top: 10px;">{phone}</p>
</div>
<div class="float-left width50 " style="text-align: right;">
<p style="color: #aaa;">
{data.type}
</p>
<p style="color: #666;padding-top: 10px;">项目数:{scene_num}</p>
</div>
</div>
</div>
</body>
<script type="text/javascript">
function subAccountInit(id){
$.actions({
actions: [{
text: "授权",
className: "color-warning",
onClick: function() {
forward("/wiot/gaccount?id="+id);
}
},{
text: "编辑",
className: "color-success",
onClick: function() {
forward("/wiot/eaccount?id="+id);
}
},
{
text: "删除",
className: "color-danger",
onClick: function() {
$.confirm("是否确认删除", function() {
commonAjax("DELETE",localUrl+"/user/info?id="+id, "",function(){
tip("删除成功");
window.location.reload();
});
}, function() {
});
}
}]
});
}
$(function(){
function getData(n){
postAjax(localUrl+"/page/user.json?paged="+n, data,function(data){
if(isOK(data)){
var dataT = data.data.data ;
for(var i=0;i<dataT.length;i++){
if(dataT[i].status == 60 ){
dataT[i].style = 'state';
}else if(dataT[i].status == 61){
dataT[i].style = 'state-red';
}else if(dataT[i].status == 59){
dataT[i].style = 'state-default';
}
dataT[i].atimestr = time2Str(dataT[i].atime);
$(".body-container").append( $("#template").html().format(dataT[i]));
}
if(data.data.totalPage > data.data.paged){
loading = false;
}else{
loading =true ;
}
}else{
loading =true ;
}
// 传data就可以,分页的
pagerinit(data,".body-container");
});
}
// 查询条件
var data = { aid:'${user.id}' , scene_num_flag:1 } ;
var paged = 1;
getData(paged++);
var loading = false; //状态标记
$(document.body).infinite().on("infinite", function() {
if (loading)
return;
loading = true;
setTimeout(function() {
// 获取商品信息
getData(paged++);
}, 500);
});
})
</script>
</html>