configs.html 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. {include file="common/header"/}
  2. <div class="LM-container">
  3. <div class="LM-main">
  4. <fieldset class="layui-elem-field layui-field-title">
  5. </fieldset>
  6. <form class="layui-form layui-form-pane" lay-filter="form">
  7. <!--<input type="hidden" name="id" id="id">-->
  8. <div class="layui-form-item">
  9. <label class="layui-form-label">注册链接</label>
  10. <div class="layui-input-inline">
  11. <input type="url" name="register_url" lay-verify="required" class="layui-input">
  12. </div>
  13. <div class="layui-form-mid layui-word-aux">
  14. 注册链接 如 http://www.baidu.com
  15. </div>
  16. </div>
  17. <div class="layui-form-item">
  18. <label class="layui-form-label">手机号和邮箱</label>
  19. <div class="layui-input-inline">
  20. <input type="number" name="phone_email" lay-verify="required" class="layui-input">
  21. </div>
  22. <div class="layui-form-mid layui-word-aux">
  23. 手机号和邮箱注册次数
  24. </div>
  25. </div>
  26. <div class="layui-form-item">
  27. <div class="layui-input-inline">
  28. <button type="button" class="layui-btn" lay-submit="" lay-filter="submit">{:lang('submit')}</button>
  29. <!--<a href="{:url('hlep')}" class="layui-btn layui-btn-primary">{:lang('back')}</a>-->
  30. </div>
  31. </div>
  32. </form>
  33. </div>
  34. </div>
  35. {include file="common/footer"/}
  36. <script>
  37. layui.use(['form', 'layer','upload','laydate'], function () {
  38. var form = layui.form, laydate=layui.laydate,layer = layui.layer,$= layui.jquery,upload = layui.upload ;
  39. var info = '';
  40. var config = {$config|raw};
  41. console.log("config",config)
  42. // //日期范围
  43. // laydate.render({
  44. // elem: '#date'
  45. // ,range: true
  46. // });
  47. form.val("form", config);
  48. console.log("config",config["open"])
  49. if (config["open"]==1){
  50. $("#open").attr("checked",true)
  51. }else {
  52. $("#open").removeAttr("checked")
  53. }
  54. form.render();
  55. form.on('submit(submit)', function (data) {
  56. console.log("data",data.field)
  57. loading =layer.load(1, {shade: [0.1,'#fff']});
  58. $.post("", data.field, function (res) {
  59. layer.close(loading);
  60. if (res.code== 200) {
  61. layer.msg(res.msg, {time: 1800, icon: 1}, function () {
  62. // location.href = res.url;
  63. // location.href = res.url;
  64. });
  65. } else {
  66. layer.msg(res.msg, {time: 1800, icon: 2});
  67. }
  68. },"json");
  69. });
  70. });
  71. </script>