From 9244eda73db2445b4fd298339652deb16e2e72ef Mon Sep 17 00:00:00 2001 From: Administrator <15274802129@163.com> Date: Wed, 23 Apr 2025 17:19:42 +0800 Subject: [PATCH] feat(mall): 新增活动管理功能 --- src/main/resources/templates/febs/views/modules/votesActivity/groupList.html | 60 +++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 49 insertions(+), 11 deletions(-) diff --git a/src/main/resources/templates/febs/views/modules/votesActivity/groupList.html b/src/main/resources/templates/febs/views/modules/votesActivity/groupList.html index 16ab05b..cd82262 100644 --- a/src/main/resources/templates/febs/views/modules/votesActivity/groupList.html +++ b/src/main/resources/templates/febs/views/modules/votesActivity/groupList.html @@ -1,4 +1,4 @@ -<div class="layui-fluid layui-anim febs-anim" id="febs-activity-group" lay-title="活动分类列表"> +<div class="layui-fluid layui-anim febs-anim" id="febs-activity-group" lay-title="活动分类管理"> <div class="layui-row febs-container"> <div class="layui-col-md12"> <div class="layui-card"> @@ -20,6 +20,16 @@ <option value="">请选择</option> <option value="0">未开启</option> <option value="1">开启</option> + </select> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label layui-form-label-sm">推荐首页</label> + <div class="layui-input-inline"> + <select name="hotState"> + <option value="">请选择</option> + <option value="0">不推荐</option> + <option value="1">推荐</option> </select> </div> </div> @@ -50,8 +60,15 @@ <a lay-event="edit" shiro:hasPermission="votesActivityUpdate:update"><i class="layui-icon febs-edit-area febs-blue"></i></a> </script> +<script type="text/html" id="hotStateSwitch"> + {{# if(d.hotState === 1) { }} + <input type="checkbox" value={{d.id}} lay-text="推荐|不推荐" checked lay-skin="switch" lay-filter="hotStateSwitch"> + {{# } else { }} + <input type="checkbox" value={{d.id}} lay-text="推荐|不推荐" lay-skin="switch" lay-filter="hotStateSwitch"> + {{# } }} +</script> <script type="text/html" id="groupStatusSwitch"> - {{# if(d.status === 1) { }} + {{# if(d.state === 1) { }} <input type="checkbox" value={{d.id}} lay-text="开启|关闭" checked lay-skin="switch" lay-filter="groupStatusSwitch"> {{# } else { }} <input type="checkbox" value={{d.id}} lay-text="开启|关闭" lay-skin="switch" lay-filter="groupStatusSwitch"> @@ -66,6 +83,15 @@ <script type="text/html" id="groupOption"> <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="groupInfo:view" lay-event="groupInfo">编辑</button> <button class="layui-btn layui-btn-danger layui-btn-sm" type="button" shiro:hasPermission="groupDelete:delete" lay-event="groupDelete">删除</button> +</script> +<script type="text/html" id="deleteFlag"> + {{# + var deleteFlag = { + 0: {title: '生效中', color: 'green'}, + 1: {title: '已删除', color: 'red'}, + }[d.deleteFlag]; + }} + <span class="layui-badge febs-bg-{{deleteFlag.color}}">{{ deleteFlag.title }}</span> </script> <style> @@ -102,7 +128,7 @@ }); } if (layEvent === 'groupInfo') { - febs.modal.open('审核编辑','modules/votesActivity/groupInfo/' + data.id, { + febs.modal.open('编辑','modules/votesActivity/groupInfo/' + data.id, { btn: ['提交', '取消'], area: ['100%', '100%'], yes: function (index, layero) { @@ -115,7 +141,7 @@ } }); function groupDelete(id) { - febs.get(ctx + 'admin/votesActivity/groupDelete/' + id, null, function (data) { + febs.get(ctx + 'admin/happyActivity/groupDelete/' + id, null, function (data) { febs.alert.success(data.message); $query.click(); }); @@ -145,28 +171,39 @@ tableIns = febs.table.init({ elem: $view.find('table'), id: 'groupTable', - url: ctx + 'admin/votesActivity/groupList', + url: ctx + 'admin/happyActivity/groupList', toolbar:"#groupToolbar", defaultToolbar:[], cols: [[ - {type: 'numbers', title: '序号', width: 80}, + {type: 'numbers', title: '', width: 80}, {title: '操作', toolbar: '#groupOption', minWidth: 200, align: 'center'}, + {field: 'orderCnt', title: '排序', minWidth: 100,align:'center'}, {field: 'name', title: '名称', minWidth: 100,align:'center'}, - {title: '审核状态', templet: '#groupStatusSwitch', minWidth: 100,align:'center'}, + {title: '推荐首页', templet: '#hotStateSwitch', minWidth: 100,align:'center'}, + {title: '状态', templet: '#groupStatusSwitch', minWidth: 100,align:'center'}, + {title: '是否删除', templet: '#deleteFlag', minWidth: 100,align:'center'}, {field: 'createdTime', title: '创建时间', minWidth: 150,align:'left'} ]] }); } - form.on('switch(groupStatusSwitch)', function (data) { + form.on('switch(hotStateSwitch)', function (data) { if (data.elem.checked) { groupState(data.value,1); } else { - groupState(data.value,0); + groupState(data.value,1); } }) - function groupState(id,state) { - febs.get(ctx + 'admin/votesActivity/groupState/' + id+'/' + state, null, function (data) { + + form.on('switch(groupStatusSwitch)', function (data) { + if (data.elem.checked) { + groupState(data.value,2); + } else { + groupState(data.value,2); + } + }) + function groupState(id,type) { + febs.get(ctx + 'admin/happyActivity/groupState/' + id+'/' + type, null, function (data) { febs.alert.success(data.message); $query.click(); }); @@ -191,6 +228,7 @@ return { name: $searchForm.find('input[name="name"]').val().trim(), status: $searchForm.find("select[name='status']").val(), + hotState: $searchForm.find("select[name='hotState']").val(), }; } -- Gitblit v1.9.1