| | |
| | | } |
| | | if (layEvent === 'upGoods') { |
| | | febs.modal.confirm('上架', '确认上架该商品?', function () { |
| | | downGoods(data.id); |
| | | upGoods(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'see') { |
| | | febs.modal.open( '个人信息', 'modules/mallMember/detail/' + data.id, { |
| | | if (layEvent === 'delGoods') { |
| | | febs.modal.confirm('删除', '确认删除该商品?', function () { |
| | | delGoods(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'detailGoods') { |
| | | febs.modal.open( '商品详情', 'modules/goods/detailGoods/' + data.id, { |
| | | maxmin: true, |
| | | }); |
| | | } |
| | |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | function delGoods(id) { |
| | | febs.get(ctx + 'admin/goods/delMallGoods/' + id, null, function () { |
| | | febs.alert.success('删除成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function upGoods(id) { |
| | | febs.get(ctx + 'admin/goods/upMallGoods/' + id, null, function () { |
| | | febs.alert.success('上架成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 查询按钮 |
| | | $query.on('click', function () { |
| | |
| | | templet: function (d) { |
| | | if (d.isSale === 1) { |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="downGoods" shiro:hasPermission="user:update">下架</button>' |
| | | + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="detailGoods" shiro:hasPermission="user:update">详情</button>' |
| | | }else{ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="upGoods" shiro:hasPermission="user:update">上架</button>' |
| | | + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="delGoods" shiro:hasPermission="user:update">删除</button>' |
| | | + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="updateGoods" shiro:hasPermission="user:update">编辑</button>' |
| | | |
| | | } |
| | | },minWidth: 300,align:'center'} |
| | |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return { |
| | | name: $searchForm.find('input[name="goodsName"]').val().trim(), |
| | | goodsName: $searchForm.find('input[name="goodsName"]').val().trim(), |
| | | }; |
| | | } |
| | | |