| | |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="switchUseRobot"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="switchAutoSend"> |
| | | {{# if(d.autoSend === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchAutoSend"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="switchAutoSend"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="isModelType"> |
| | | {{# if(d.modelType === 1) { }} |
| | | <span>简单模式</span> |
| | |
| | | {field: 'amountMax', title: '下限', minWidth: 100,align:'center'}, |
| | | {field: 'redBagCnt', title: '红包个数', minWidth: 100,align:'center'}, |
| | | {field: 'useRobot', title: '使用机器人', templet: '#switchUseRobot', minWidth: 80,align:'center'}, |
| | | {field: 'autoSend', title: '自动发红包', templet: '#switchAutoSend', minWidth: 180,align:'center'}, |
| | | {templet:"#isModelType", title: '模式', minWidth: 150,align:'center'}, |
| | | {field: 'createTime', title: '创建时间', minWidth: 180,align:'center'}, |
| | | {title: '操作', |
| | |
| | | ]] |
| | | }); |
| | | } |
| | | form.on('switch(switchAutoSend)', function (data) { |
| | | if (data.elem.checked) { |
| | | openSwitchAutoSend(data.value); |
| | | } else { |
| | | closeSwitchAutoSend(data.value); |
| | | } |
| | | }) |
| | | function openSwitchAutoSend(id) { |
| | | febs.get(ctx + 'admin/chat/openSwitchAutoSend/' + id, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function closeSwitchAutoSend(id) { |
| | | febs.get(ctx + 'admin/chat/closeSwitchAutoSend/' + id, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | form.on('switch(switchUseRobot)', function (data) { |
| | | if (data.elem.checked) { |
| | | openSwitchUseRobot(data.value); |