|
@@ -109,10 +109,10 @@
|
|
|
</td>
|
|
|
<td class="text-l">
|
|
|
<c:if test="${service.isRecommendation == 1}">
|
|
|
- <input type="checkbox" name = "isRecommendation" onclick="check()" value="${service.id }" checked="checked"/> 推荐
|
|
|
+ <input type="checkbox" name = "isRecommendation" onclick="check(${service.id })" value="${service.id }" checked="checked"/> 推荐
|
|
|
</c:if>
|
|
|
<c:if test="${service.isRecommendation == 0}">
|
|
|
- <input type="checkbox" name = "isRecommendation" onclick="check()" value="${service.id}"/> 推荐
|
|
|
+ <input type="checkbox" name = "isRecommendation" onclick="check(${service.id })" value="${service.id}"/> 推荐
|
|
|
</c:if>
|
|
|
|
|
|
</td>
|
|
@@ -237,28 +237,18 @@
|
|
|
|
|
|
});
|
|
|
/* 推荐复选框 */
|
|
|
- function check() {
|
|
|
-
|
|
|
- var checkVal = "";
|
|
|
- checkVal += $(this).val();
|
|
|
- alert(checkVal);
|
|
|
+ function check(obj) {
|
|
|
$.ajax({
|
|
|
- type: "POST",
|
|
|
- url: "recommendationUpdate.html",
|
|
|
- data: {
|
|
|
- "id": checkVal,
|
|
|
- dataType: "json",
|
|
|
- success: function (ajax) {
|
|
|
- if (ajax.is) {
|
|
|
- layer.alert(ajax.msg, {skin: 'layui-layer-molv', closeBtn: 0, anim: 4}, function () {
|
|
|
- window.location = window.location;
|
|
|
- });
|
|
|
- } else {
|
|
|
- layer.msg(ajax.msg, {icon: 2, time: 1000});
|
|
|
- }
|
|
|
+ type:"POST",
|
|
|
+ url:"recommendUpdate.html",
|
|
|
+ data:{"id":obj.toString()},
|
|
|
+ dataType:"json",
|
|
|
+ success:function(ajax){
|
|
|
+ if(!ajax.is){
|
|
|
+ layer.msg("修改失败",{icon:2,time:1000})
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|