shoplist.html
shoplist.js
$(function(){ //获取店铺信息 渲染出来就可以了 getlist(); function getlist(e){ $.ajax({ url:'/o2o/shopadmin/getshoplist', type:'get', dataType:"json", success:function(data){ if(data.success){ handleList(data.shopList); handleUser(data.user); } } }); //显示用户名 function handleUser(data){ $('#user-name').text(data.name); } //显示传回来的用户名下的店铺列表 function handleList(data){ var html = ''; data.map(function(item, index){ html += ''; }); $('.shop-wrap').html(html); } function shopStatus(data){ if(data == 0){ return '审核中'; } else if(data == -1){ return '店铺非法'; } else if(data == 1){ return '审核通过'; } } //进入店铺管理页面,一个超链接 function goShop(status, id){ if(status == 1){ return '进入'; } else{ return ''; } } }});' + item.shopName +''+ shopStatus(item.enableStatus) +'' + goShop(item.enableStatus, item.shopId) + '
shoplist.css
.row-shop { border: 1px solid #999; padding: .5rem; border-bottom: none;}.row-shop:last-child { border-bottom: 1px solid #999;}.shop-name { white-space: nowrap; overflow-x: scroll;}.shop-wrap a { }
同时处理一下路由
1 @RequestMapping(value = "/shoplist")2 public String shopList() {3 return "shop/shoplist";4 }