|  |  |  | 
|---|
|  |  |  | <a lay-event="edit" shiro:hasPermission="vipConfig:update"><i | 
|---|
|  |  |  | class="layui-icon febs-edit-area febs-blue"></i></a> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script type="text/html" id="validTypeFormat"> | 
|---|
|  |  |  | {{# if(d.validType == "day") { }} | 
|---|
|  |  |  | <span>日</span> | 
|---|
|  |  |  | {{# } else if(d.validType == "month") { }} | 
|---|
|  |  |  | <span>月</span> | 
|---|
|  |  |  | {{# } else { }} | 
|---|
|  |  |  | <span>年</span> | 
|---|
|  |  |  | {{# } }} | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script type="text/html" id="typeFormat"> | 
|---|
|  |  |  | {{# if(d.validType == "day") { }} | 
|---|
|  |  |  | <span>指定商品</span> | 
|---|
|  |  |  | {{# } else { }} | 
|---|
|  |  |  | <span>周期内消费指定金额</span> | 
|---|
|  |  |  | {{# } }} | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <!-- 表格操作栏 end --> | 
|---|
|  |  |  | <script data-th-inline="none" type="text/javascript"> | 
|---|
|  |  |  | // 引入组件并初始化 | 
|---|
|  |  |  | 
|---|
|  |  |  | var data = obj.data, | 
|---|
|  |  |  | layEvent = obj.event; | 
|---|
|  |  |  | if (layEvent === 'benefitsUpdate') { | 
|---|
|  |  |  | febs.modal.open('编辑', 'modules/vip/config/editBenefits/' + data.id, { | 
|---|
|  |  |  | febs.modal.open('编辑', 'modules/vip/config/levelEdit/' + data.id, { | 
|---|
|  |  |  | btn: ['提交', '取消'], | 
|---|
|  |  |  | yes: function (index, layero) { | 
|---|
|  |  |  | $('#febs-vipConfig-edit').find('#submit').trigger('click'); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'delBenefits') { | 
|---|
|  |  |  | if (layEvent === 'delVipConfig') { | 
|---|
|  |  |  | febs.modal.confirm('删除', '确认删除?', function () { | 
|---|
|  |  |  | delBenefits(data.id); | 
|---|
|  |  |  | delVipConfig(data.id); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function delBenefits(id) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/vip/benefits/delBenefits/' + id, null, function () { | 
|---|
|  |  |  | function delVipConfig(id) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/vip/config/del/' + id, null, function () { | 
|---|
|  |  |  | febs.alert.success('操作成功'); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | {field: 'name', title: '会员名称', minWidth: 120, align: 'center'}, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | field: 'icon', title: '主图', | 
|---|
|  |  |  | field: 'thumb', title: '主图', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | return ''; | 
|---|
|  |  |  | return '<a lay-event="seeImgThumb"><img id="seeImgThumb'+d.id+'" src="'+d.thumb+'" alt=""></a>'; | 
|---|
|  |  |  | }, minWidth: 150, align: 'center' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | {field: 'level', title: '等级', minWidth: 120, align: 'center'}, | 
|---|
|  |  |  | {field: 'validType', title: '有效类型', minWidth: 120, align: 'center'}, | 
|---|
|  |  |  | {field: 'type', title: '成为会员条件', minWidth: 120, align: 'center'}, | 
|---|
|  |  |  | {field: 'validTime', title: '有效时长', minWidth: 120, align: 'center'}, | 
|---|
|  |  |  | {templet:"#validTypeFormat",title: '有效类型', minWidth: 120, align: 'center'}, | 
|---|
|  |  |  | {templet:"#typeFormat", title: '成为会员条件', minWidth: 120, align: 'center'}, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | title: '操作', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="benefitsUpdate" shiro:hasPermission="user:update">编辑</button>' | 
|---|
|  |  |  | + '<button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delBenefits" shiro:hasPermission="user:update">删除</button>' | 
|---|
|  |  |  | + '<button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delVipConfig" shiro:hasPermission="user:update">删除</button>' | 
|---|
|  |  |  | }, minWidth: 300, align: 'center' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ]] | 
|---|