Commit 521fb109 authored by yangshuxing's avatar yangshuxing

切换榜单

parent ec06ad3a
...@@ -71,4 +71,6 @@ public interface CmptMapper { ...@@ -71,4 +71,6 @@ public interface CmptMapper {
String getDefaultPartnerId(Integer cmptid); String getDefaultPartnerId(Integer cmptid);
Partner getParnterByParnterId(String partnerId); Partner getParnterByParnterId(String partnerId);
void updateDayRank(@Param("cmptId") int cmptId,@Param("status") int status);
} }
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
date_format(start_time,'%Y-%m-%d %H:%s:%i') as startTime, date_format(start_time,'%Y-%m-%d %H:%s:%i') as startTime,
logo, logo,
bg_color as cmptbgColor, bg_color as cmptbgColor,
del_flag AS "delFlag" del_flag AS "delFlag",is_day_rank isDayRank
FROM `gk_cmpt` FROM `gk_cmpt`
WHERE cmpt_id = #{id} LIMIT 1 WHERE cmpt_id = #{id} LIMIT 1
</select> </select>
...@@ -224,4 +224,9 @@ ...@@ -224,4 +224,9 @@
from gk_app_info from gk_app_info
where partner_id=#{partnerId} where partner_id=#{partnerId}
</select> </select>
<update id="updateDayRank">
update gk_cmpt set is_day_rank=#{status}
where cmpt_id = #{cmptId}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -35,4 +35,5 @@ public class Cmpt extends JaapRecord<Cmpt> { ...@@ -35,4 +35,5 @@ public class Cmpt extends JaapRecord<Cmpt> {
private String startTime; private String startTime;
@ApiModelProperty(value = "赛事结束时间", notes = "赛事结束时间") @ApiModelProperty(value = "赛事结束时间", notes = "赛事结束时间")
private String endTime; private String endTime;
private boolean isDayRank;
} }
...@@ -184,4 +184,8 @@ public class CmptService { ...@@ -184,4 +184,8 @@ public class CmptService {
public Partner getPartnerById(String parnter) { public Partner getPartnerById(String parnter) {
return cmptMapper.getParnterByParnterId(parnter); return cmptMapper.getParnterByParnterId(parnter);
} }
public void updateDayRank(int cmptId, int status) {
cmptMapper.updateDayRank(cmptId,status);
}
} }
...@@ -228,6 +228,15 @@ public class CmptController { ...@@ -228,6 +228,15 @@ public class CmptController {
} }
@RequestMapping("/updateDayRank")
@ResponseBody
public com.neusoft.www.utils.web.Result updateDayRank(@RequestParam("cmptId") int cmptId,
@RequestParam("status") int status) {
cmptService.updateDayRank(cmptId,status);
return new com.neusoft.www.utils.web.Result().success().setMsg("设置成功!");
}
// 以POST方式获得请求,图片上传成功后,以JSON格式将图片返回,用于回显  // 以POST方式获得请求,图片上传成功后,以JSON格式将图片返回,用于回显 
@ResponseBody @ResponseBody
public Result handleFileUpload(HttpServletRequest request) { public Result handleFileUpload(HttpServletRequest request) {
...@@ -254,7 +263,5 @@ public class CmptController { ...@@ -254,7 +263,5 @@ public class CmptController {
} }
} }
return Result.error(); return Result.error();
} }
} }
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
<div class="section" style="display: flex;justify-content: space-between;align-items: center;"> <div class="section" style="display: flex;justify-content: space-between;align-items: center;">
<span style="font-size:24px;color: #333">榜单设置</span> <span style="font-size:24px;color: #333">榜单设置</span>
<div> <div>
<input type="checkbox"> <input type="checkbox" name="dayRank" ${cmpt.dayRank ? 'checked':''}>
<span style="font-size:20px;color: #333">启用日榜</span> <span style="font-size:20px;color: #333">启用日榜</span>
</div> </div>
...@@ -157,6 +157,23 @@ ...@@ -157,6 +157,23 @@
} }
}) })
}); });
$('input[name=dayRank]').click(function () {
let status =$(this).get(0).checked ? 1 : 0;
$.ajax({
url : '/gk/cmpt/updateDayRank',
data:{cmptId:getCId(),"status":status},
success:function (data) {
if(data.code == 200){
layer.msg("切换成功!",{icon:1,duraion:1500});
}else{
layer.msg("切换失败!",{icon:5,duraion:1500});
}
},
complete:function () {
}
});
})
// //
}); });
</script> </script>
......
...@@ -56,16 +56,21 @@ ...@@ -56,16 +56,21 @@
left: 45px; left: 45px;
top: 6px; top: 6px;
} }
.icon-function{ .icon-function{
width: 32px; width: 32px;
height: 32px; height: 32px;
display: inline-block; display: inline-block;
background: url('/static/images/manage/function.png') no-repeat center; background: url('/static/images/manage/func_white.png') no-repeat center;
background-size: 50%; background-size: 50%;
position: absolute; position: absolute;
left: 45px; left: 45px;
top: 6px; top: 6px;
} }
.active .icon-function{
background: url('/static/images/manage/function.png') no-repeat center;
background-size: 50%;
}
.icon-base-setting{ .icon-base-setting{
width: 32px; width: 32px;
height: 32px; height: 32px;
...@@ -80,7 +85,7 @@ ...@@ -80,7 +85,7 @@
position: relative; position: relative;
} }
.arrow{ .meun-arrow{
width: 24px; width: 24px;
height: 12px; height: 12px;
display: inline-block; display: inline-block;
...@@ -113,7 +118,7 @@ ...@@ -113,7 +118,7 @@
<a href="/gk/cmpt/cmptSetting/${cmpt.cmptId}?uId=${uId}&cId=${cId}&timestamp=${timestamp}&sign=${sign}"> <a href="/gk/cmpt/cmptSetting/${cmpt.cmptId}?uId=${uId}&cId=${cId}&timestamp=${timestamp}&sign=${sign}">
<span class="icon-function"></span> <span class="icon-function"></span>
<span class="menu-txt">功能管理</span> <span class="menu-txt">功能管理</span>
<span class="arrow"></span> <span class="meun-arrow"></span>
</a> </a>
</li> </li>
<ul class="collapse list-unstyled show"> <ul class="collapse list-unstyled show">
...@@ -186,7 +191,7 @@ ...@@ -186,7 +191,7 @@
<ul> <ul>
<li class="base menu-item"> <li class="base menu-item">
<a href="/gk/cmpt/${cmpt.cmptId}?uId=${uId}&cId=${cId}&timestamp=${timestamp}&sign=${sign}"> <a href="#">
<span class="icon-base-setting"></span> <span class="icon-base-setting"></span>
<span class="menu-txt">基础设置</span> <span class="menu-txt">基础设置</span>
<span class="arrow"></span> <span class="arrow"></span>
...@@ -243,6 +248,9 @@ ...@@ -243,6 +248,9 @@
for (var i in classes) { for (var i in classes) {
if (url.indexOf(classes[i]) > -1) { if (url.indexOf(classes[i]) > -1) {
document.getElementsByClassName(classes[i])[0].classList.add('active'); document.getElementsByClassName(classes[i])[0].classList.add('active');
if(classes[i] != 'cmptSetting'){
document.getElementsByClassName(classes[i])[0].parentNode.parentNode.firstElementChild.classList.add('active');
}
done = true; done = true;
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment