123456789101112131415161718192021222324252627282930313233 |
- function getList(page){
- var data = $("#saerchFrm").serializeJSON();
- data['page'] = page || 1;
- data['size'] = 20;
- $("#list, #page").empty();
- ajax(apiUrl+"user/list",data,function(res){
- if(res.code == 1){
- if(res.data.length > 0){
- $("#list").html($.Template7.renderTpl("tempaltelist",res.data));
- var newpage = new createPage(res['total'],data['page'],data['size'],3);
- $("#page").html(newpage.pageHtml);
- $(".table").hoverTable(true);
- }else
- $("#list").info("暂无信息。");
- }else
- $("#list").info(res.msg);
- });
- }
- pageGo = getList;
- function updateStatus(obj, id){
- var $this = $(obj), status = $this.data("status"), statusTxt=status.toString().decode(0,'禁用','-1','启用'), $td = $this.parent().prev();
- confirm("禁用该用户将无法在小程序中进行操作,是否继续?",function(){
- ajax(apiUrl+"user/forbid",{"id": id,"status": status},function(res){
- if(res.code == 1){
- $this.text(statusTxt);
- $this.data("status", (status == -1 ? 0 : -1));
- $td.text(status.toString().decode(0,'正常','-1','已禁用'));
- }
- });
- });
- }
|