Jurisdiction.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  9. <link rel="stylesheet" href="../../static/css/font.css">
  10. <link rel="stylesheet" href="../../static/css/weadmin.css">
  11. <link rel="stylesheet" href="../../static/css/style.css">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <style>
  18. html{
  19. overflow-y: auto;
  20. }
  21. .layui-form-label{
  22. width: 100px;
  23. }
  24. .layui-input-block{
  25. margin-left: 138px;
  26. }
  27. .w-e-toolbar{
  28. padding: 0 !important;
  29. }
  30. .w-e-toolbar .w-e-menu{
  31. padding: 5px 4px !important;
  32. }
  33. .options{
  34. line-height: 38px;
  35. }
  36. .options span{
  37. margin: 0 10px;
  38. font-size: 16px;
  39. color: #333;
  40. cursor: pointer;
  41. }
  42. </style>
  43. </head>
  44. <body>
  45. <div class="weadmin-body">
  46. <form class="layui-form">
  47. <div class="layui-form-item">
  48. <label class="layui-form-label">
  49. 手机用户:
  50. </label>
  51. <div class="layui-input-block options">
  52. <span style="margin: 0">所有人可见</span>
  53. <span>用户组</span>
  54. <span>密码</span>
  55. </div>
  56. <div class="layui-input-block">
  57. <div class="option_content">
  58. <textarea name="desc" placeholder="点击选择用户组" class="layui-textarea hides textarea"></textarea>
  59. <span class="textareaID" style="display: none;"></span>
  60. <input type="text" placeholder="请输入四位密码" class="layui-input hides passInput">
  61. </div>
  62. </div>
  63. </div>
  64. </form>
  65. <div class="layui-form-item" style="text-align: center;padding-top: 50px">
  66. <button class="layui-btn JurisdictionSubmit">提交</button>
  67. </div>
  68. <span class="text" style="display: none"></span>
  69. </div>
  70. <script src="../../lib/layui/layui.js" charset="utf-8"></script>
  71. <script>
  72. layui.use(['form','layer','jquery','laydate'], function(){
  73. var form = layui.form,
  74. $ = layui.jquery,
  75. laydate= layui.laydate,
  76. layer = layui.layer;
  77. form.render();
  78. var indexType = '',permissionValue = '',index;
  79. $("body").on("click",'.options>span',function () {
  80. index = $(this).index();
  81. indexType = index +1;
  82. if (index == 0) {
  83. $(".textarea").hide();
  84. $('.passInput').hide();
  85. permissionValue = "";
  86. } else if (index == 1) {
  87. $(".textarea").show();
  88. $('.passInput').hide();
  89. permissionValue = $('.textareaID').html();
  90. }else if (index == 2) {
  91. $(".textarea").hide();
  92. $('.passInput').show();
  93. permissionValue = $('.passInput').val();
  94. }
  95. });
  96. $('body').on("click",'.JurisdictionSubmit',function () {
  97. if (index == 0) {
  98. permissionValue = "";
  99. } else if (index == 1) {
  100. permissionValue = $('.textareaID').html();
  101. }else if (index == 2) {
  102. permissionValue = $('.passInput').val();
  103. }
  104. $.ajax({
  105. url:'http://apptest.jieweizhineng.com/api/swagger/api/page/v1/setPagePermission',
  106. type:'post',
  107. data:{
  108. id:sessionStorage.getItem("QRcodeID"),
  109. permissionType:indexType,
  110. permissionValue:permissionValue,
  111. _method:'put'
  112. },
  113. dataType:'json',
  114. success:function (res) {
  115. console.log(res,'res')
  116. },
  117. error:function () {
  118. }
  119. })
  120. });
  121. $("body").on("click",'.textarea',function () {
  122. parent.userGroup();
  123. })
  124. });
  125. </script>
  126. </body>
  127. </html>