//商品的上下架
function upOrActive(id,isShow) {
$.ajax({
type: "POST",
url:"${RootPath}/scene/UpdateDel",
data:"id="+id+"&isShow="+isShow,
dataType : "json",
success: function(data) {
if(data.state==1)
{
topWin.JLayer.success(data.message,function(){
topWin.window.location.reload();
});
}
}
});
}
//通过驳回
function upreview(id,review) {
$.ajax({
type: "POST",
url:"${RootPath}/scene/UpdateDel",
data:"review="+review+"&id="+id,
dataType : "json",
success: function(data) {
if(data.state==1)
{
topWin.JLayer.success(data.message,function(){
topWin.window.location.reload();
});
}
}
});
}
<a href="javascript:delOrActive('${item.id}',1)" class="delete">删除</a>
<#if (item.review)??&&item.review == '2'>
<a href="javascript:upreview('${item.id}',1)">通过</a>
<#else>
<a href="javascript:upreview('${item.id}',2)">驳回</a>
</#if>
<#if (item.isShow)??&&item.isShow == '0'>
<a href="javascript:upOrActive('${item.id}',1)">下架</a>
<#else>
<a href="javascript:upOrActive('${item.id}',0)">上架</a>
@ResponseBody
@RequestMapping(value = "UpdateDel", method = RequestMethod.POST)
public ResponseData UpdateDel(HttpServletRequest request, CmsSceneProduct cmsSceneProduct) {
int state = 0;
ResponseData data = operateFailed("操作失败!");
try {
if (StringUtils.isNotBlank(cmsSceneProduct.getId())) {// 编辑
state = sceneProductService.update(cmsSceneProduct);
}
if (state >= 1) {
this.tokenRemove(request);
data = operateSucess("操作成功!");
return data;
}
} catch (Exception e) {
data.setMessage("系统异常,操作失败!");
}
return data;
}