截流自动化的商城平台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

index.html 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. {layout name="layout1" /}
  2. <style>
  3. .layui-form-label {
  4. width: 120px;
  5. text-align: left;
  6. padding-left:30px;
  7. }
  8. .invite_appoint_user{
  9. display: none;
  10. }
  11. </style>
  12. <div class="wrapper">
  13. <!-- 面板 -->
  14. <div class="layui-panel">
  15. <!-- 表单 -->
  16. <form class="layui-form">
  17. <!-- 字段集区块 -->
  18. <fieldset class="layui-elem-field layui-field-title">
  19. <legend>邀请下级</legend>
  20. <div class="layui-field-box">
  21. <div class="layui-form-item">
  22. <label class="layui-form-label">邀请下级</label>
  23. <div class="layui-input-block">
  24. <input type="radio" name="is_open" value="0" title="关闭" {if $config.is_open == 0}checked{/if}>
  25. <input type="radio" name="is_open" value="1" title="开启" {if $config.is_open == 1}checked{/if}>
  26. </div>
  27. </div>
  28. <div class="layui-form-item">
  29. <label class="layui-form-label"></label>
  30. <div class="layui-input-block layui-word-aux">
  31. 关闭功能后用户之间不能建立新的上下级关系。
  32. </div>
  33. </div>
  34. <div class="layui-form-item">
  35. <label class="layui-form-label">邀请下级资格</label>
  36. <div class="layui-input-block">
  37. <input type="radio" lay-filter="qualifications" lay-skin="primary" name="qualifications" value="1" title="全部用户" >
  38. <input type="radio" lay-filter="qualifications" lay-skin="primary" name="qualifications" value="2" title="分销会员" >
  39. </div>
  40. <div class="layui-input-block invite_appoint_user">
  41. {foreach $user_level as $key => $vo}
  42. <input type="checkbox" lay-skin="primary" name="invite_appoint_user[{$vo.id}]" title="{$vo.name}" {if in_array($vo.id, $config.invite_appoint_user)}checked{/if}>
  43. {/foreach}
  44. </div>
  45. </div>
  46. <div class="layui-form-item">
  47. <label class="layui-form-label"></label>
  48. <div class="layui-input-block layui-word-aux">
  49. 勾选全部用户可以邀请表示系统所有用户都有邀请下级的资格
  50. </div>
  51. </div>
  52. <div class="layui-form-item">
  53. <label class="layui-form-label">成为下级的条件</label>
  54. <div class="layui-input-block">
  55. <input type="radio" name="condition" value="1" title="邀请码" {if $config.condition == 1}checked{/if}>
  56. </div>
  57. </div>
  58. <div class="layui-form-item">
  59. <label class="layui-form-label"></label>
  60. <div class="layui-input-block layui-word-aux">
  61. 用户登录后首次绑定邀请码建立上下级关系。包括扫码,点击分享链接,输入邀请码等场景。
  62. </div>
  63. </div>
  64. <div class="layui-form-item">
  65. <label class="layui-form-label">自定义邀请海报:</label>
  66. <div class="layui-input-block">
  67. <div class="like-upload-image">
  68. {if !empty($config.poster)}
  69. <div class="upload-image-div">
  70. <img src="{$config.poster}" alt="img" style="background-color:#EEEEEE;height: 80px;width:auto">
  71. <input name="poster" type="hidden" value="{$config.poster}">
  72. <div class="del-upload-btn">x</div>
  73. </div>
  74. <div class="upload-image-elem" style="display:none;"><a class="add-upload-image poster"> + 添加图片</a></div>
  75. {else}
  76. <div class="upload-image-elem"><a class="add-upload-image poster"> + 添加图片</a></div>
  77. {/if}
  78. </div>
  79. </div>
  80. </div>
  81. <div class="layui-form-item">
  82. <label class="layui-form-label"></label>
  83. <label class=" layui-form-mid layui-word-aux">自定义分销推广海报图片,建议尺寸:800*800像素</label>
  84. </div>
  85. <div class="layui-form-item">
  86. <label class="layui-form-label"></label>
  87. <div class="layui-input-block">
  88. <button class="layui-btn layui-bg-blue layui-btn layui-btn-sm" lay-submit lay-filter="*">保存设置</button>
  89. </div>
  90. </div>
  91. </div>
  92. </fieldset>
  93. </form>
  94. </div>
  95. </div>
  96. <script>
  97. layui.config({
  98. version: "{$front_version}",
  99. base: '/static/lib/'
  100. }).use(['element', 'form'], function () {
  101. var $ = layui.$
  102. , form = layui.form
  103. , layer = layui.layer;
  104. var qualifications = {:json_encode($config.qualifications)};
  105. if(Array.isArray(qualifications)){
  106. if(qualifications.indexOf("1") > -1){
  107. $("input[name=qualifications][value='1']").prop('checked',"true");
  108. }else{
  109. $("input[name=qualifications][value='2']").prop('checked',"true");
  110. $('.invite_appoint_user').show();
  111. }
  112. }else{
  113. var select = qualifications[Object.keys(qualifications)[0]];
  114. $("input[name=qualifications][value="+select+"]").prop('checked',"true");
  115. if(2 == select){
  116. $('.invite_appoint_user').show();
  117. }
  118. }
  119. form.render();
  120. layui.form.on('radio(qualifications)', function(data){
  121. var value = data.value;
  122. if(1 == value){
  123. $('.invite_appoint_user').hide();
  124. }
  125. if(2 == value){
  126. $('.invite_appoint_user').show();
  127. }
  128. })
  129. like.delUpload();
  130. // 自定义邀请海报
  131. $(document).on("click", ".poster", function () {
  132. like.imageUpload({
  133. limit: 1,
  134. field: "poster",
  135. that: $(this)
  136. });
  137. });
  138. form.on('submit(*)', function (data) {
  139. like.ajax({
  140. url: '{:url("setting.user/set")}'
  141. , data: data.field
  142. , type: 'post'
  143. , success: function (res) {
  144. if (res.code == 1) {
  145. layer.msg(res.msg);
  146. }
  147. }
  148. });
  149. return false; //阻止表单跳转
  150. });
  151. });
  152. </script>