config.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  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. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. </head>
  45. <body layadmin-themealias="default">
  46. <div class="layui-fluid">
  47. <div class="layui-card">
  48. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">分销设置</span></div>
  49. <div class="layui-card-body" style="padding:15px;">
  50. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  51. <div class="layui-form-item">
  52. <label class="layui-form-label">分销</label>
  53. <div class="layui-input-block">
  54. <label class="radio-inline"><input type="radio" lay-filter="radi" class="radi" name="data[commiss_level]" value="0" <?php if($data['commiss_level'] ==0){ ?> checked="checked"<?php } ?> title="不开启" /> </label>
  55. <label class="radio-inline"><input type="radio" lay-filter="radi" class="radi" name="data[commiss_level]" value="1" <?php if($data['commiss_level'] ==1){ ?> checked="checked"<?php } ?> title="一级分销" /> </label>
  56. <label class="radio-inline"><input type="radio" lay-filter="radi" class="radi" name="data[commiss_level]" value="2" <?php if($data['commiss_level'] ==2){ ?> checked="checked"<?php } ?> title="二级分销" /> </label>
  57. <label class="radio-inline"><input type="radio" lay-filter="radi" class="radi" name="data[commiss_level]" value="3" <?php if($data['commiss_level'] ==3){ ?> checked="checked"<?php } ?> title="三级分销" /> </label>
  58. </div>
  59. </div>
  60. <div class="layui-form-item community_commiss1" <?php if( !empty($data) && $data['commiss_level'] >= 1 ){ ?> style="display:block;"<?php }else{ ?> style="display:none;"<?php } ?> >
  61. <label class="layui-form-label">1级:</label>
  62. <div class="layui-input-block fixmore-input-group">
  63. <div class="input-group">
  64. <input type="text" name="data[community_commiss1]" class="form-control valid" value="<?php echo empty($data['community_commiss1'])?0:$data['community_commiss1']; ?>" />
  65. <span class="input-group-addon">% </span>
  66. </div>
  67. <div class="help-block">1级分佣比例</div>
  68. </div>
  69. </div>
  70. <div class="layui-form-item community_commiss2" <?php if( !empty($data) && $data['commiss_level'] >= 2 ){ ?> style="display:block;"<?php }else{ ?> style="display:none;"<?php } ?>>
  71. <label class="layui-form-label">2级:</label>
  72. <div class="layui-input-block fixmore-input-group">
  73. <div class="input-group">
  74. <input type="text" name="data[community_commiss2]" class="form-control valid" value="<?php echo empty($data['community_commiss2'])?0:$data['community_commiss2'];?>" />
  75. <span class="input-group-addon">% </span>
  76. </div>
  77. <div class="help-block">2级分佣比例</div>
  78. </div>
  79. </div>
  80. <div class="layui-form-item community_commiss3" <?php if( !empty($data) && $data['commiss_level'] >= 3 ){ ?> style="display:block;"<?php }else{ ?> style="display:none;"<?php } ?>>
  81. <label class="layui-form-label">3级:</label>
  82. <div class="layui-input-block fixmore-input-group">
  83. <div class="input-group">
  84. <input type="text" name="data[community_commiss3]" class="form-control valid" value="<?php echo empty($data['community_commiss3'])?0:$data['community_commiss3'];?>" />
  85. <span class="input-group-addon">% </span>
  86. </div>
  87. <div class="help-block">3级分佣比例</div>
  88. </div>
  89. </div>
  90. <div class="layui-form-item">
  91. <label class="layui-form-label">分销内购</label>
  92. <div class="layui-input-block">
  93. <label class="radio-inline"><input type="radio" name="data[commiss_selfbuy]" value="1" <?php if($data['commiss_selfbuy'] ==1){ ?> checked="checked"<?php } ?> title="开启" /> </label>
  94. <label class="radio-inline"><input type="radio" name="data[commiss_selfbuy]" value="0" <?php if($data['commiss_selfbuy'] ==0){ ?> checked="checked"<?php } ?> title="关闭" /> </label>
  95. <span class='help-block'>开启分销内购,分销商自己购买商品,享受一级佣金,上级享受二级佣金,上上级享受三级佣金</span>
  96. </div>
  97. </div>
  98. <div class="layui-form-item">
  99. <label class="layui-form-label">
  100. <span class="layui-badge layui-bg-blue">第一条件:</span>
  101. </label>
  102. </div>
  103. <div class="layui-form-item">
  104. <label class="layui-form-label">是否需要分享</label>
  105. <div class="layui-input-block">
  106. <label class="radio-inline"><input type="radio" lay-filter="radi_share_form" name="data[commiss_sharemember_need]" value="0" <?php if(!isset($data['commiss_sharemember_need']) || $data['commiss_sharemember_need'] ==0){ ?> checked="checked" <?php } ?> title="不需要" /> </label>
  107. <label class="radio-inline"><input type="radio" lay-filter="radi_share_form" name="data[commiss_sharemember_need]" value="1" <?php if($data['commiss_sharemember_need'] ==1){ ?> checked="checked"<?php } ?> title="需要" /> </label>
  108. <span class='help-block'></span>
  109. </div>
  110. </div>
  111. <div class="layui-form-item" id="share_div" <?php if( !empty($data) && $data['commiss_sharemember_need'] == 1 ){ ?> style="display:block;"<?php }else{ ?> style="display:none;"<?php } ?>>
  112. <label class="layui-form-label">分享</label>
  113. <div class="layui-input-block">
  114. <div class="input-group">
  115. <input type="text" name="data[commiss_share_member_update]" class="form-control" value="<?php echo empty($data['commiss_share_member_update'])?0:$data['commiss_share_member_update'];?>" >
  116. <span class="input-group-addon">人</span>
  117. </div>
  118. <span class="help-block">分享满指定会员数量才有机会申请成为分销商&nbsp;(达到分享人数后,依据下方表单、审核设置进行判断)</span>
  119. </div>
  120. </div>
  121. <div class="layui-form-item">
  122. <label class="layui-form-label">
  123. <span class="layui-badge layui-bg-blue">第二条件:</span>
  124. </label>
  125. </div>
  126. <div class="layui-form-item">
  127. <label class="layui-form-label">填写表单</label>
  128. <div class="layui-input-block">
  129. <label class="radio-inline"><input type="radio" lay-filter="radi_form" name="data[commiss_biaodan_need]" value="0" <?php if(!isset($data['commiss_biaodan_need']) || $data['commiss_biaodan_need'] ==0){ ?> checked="checked" <?php } ?> title="不需要" /> </label>
  130. <label class="radio-inline"><input type="radio" lay-filter="radi_form" name="data[commiss_biaodan_need]" value="1" <?php if($data['commiss_biaodan_need'] ==1){ ?> checked="checked"<?php } ?> title="需要" /> </label>
  131. </div>
  132. </div>
  133. <div class="layui-form-item" id="form_div" <?php if( !empty($data) && $data['commiss_biaodan_need'] == 1 ){ ?> style="display:block;"<?php }else{ ?> style="display:none;"<?php } ?>>
  134. <label class="layui-form-label"></label>
  135. <div class="layui-input-block">
  136. <a href="javascript:;" --lay-href="{:U('distribution/addForm')}" id="load_ifram_url" class="layui-btn layui-btn-sm"><i class="fa fa-plus"></i> 设置表单 </a>&nbsp;<font color="red">(*必填)</font>
  137. <span class="help-block text-danger" style="color:red;display:none;">如果已开启自动分享成为分销商,此处用户成为分销商时,需要再次填写表格</span>
  138. </div>
  139. </div>
  140. <div class="layui-form-item">
  141. <label class="layui-form-label">
  142. <span class="layui-badge layui-bg-blue">第三条件:</span>
  143. </label>
  144. </div>
  145. <div class="layui-form-item">
  146. <label class="layui-form-label">是否需要审核</label>
  147. <div class="layui-input-block">
  148. <label class="radio-inline"><input type="radio" name="data[commiss_become_condition]" value="0" <?php if(!isset($data['commiss_become_condition']) || $data['commiss_become_condition'] ==0){ ?> checked="checked" <?php } ?> title="不需要" /> </label>
  149. <label class="radio-inline"><input type="radio" name="data[commiss_become_condition]" value="1" <?php if($data['commiss_become_condition'] ==1){ ?> checked="checked"<?php } ?> title="需要" /> </label>
  150. </div>
  151. </div>
  152. <div class="layui-form-item">
  153. <label class="layui-form-label"></label>
  154. <div class="layui-input-block">
  155. <hr>
  156. </div>
  157. </div>
  158. <div class="layui-form-item">
  159. <label class="layui-form-label">分销名称:</label>
  160. <div class="layui-input-block fixmore-input-group">
  161. <div class="input-group">
  162. <input type="text" name="data[commiss_diy_name]" class="form-control valid" value="{$data['commiss_diy_name']}" />
  163. </div>
  164. <div class="help-block">默认:分销</div>
  165. </div>
  166. </div>
  167. <div class="layui-form-item">
  168. <label class="layui-form-label"></label>
  169. <div class="layui-input-block">
  170. <hr>
  171. </div>
  172. </div>
  173. <div class="layui-form-item">
  174. <label class="layui-form-label">申请页面内容</label>
  175. <div class="layui-input-block fixmore-input-group">
  176. <div class="">
  177. {:tpl_ueditor('data[communitymember_apply_page]',$data['communitymember_apply_page'],array('height'=>'300'))}
  178. </div>
  179. </div>
  180. </div>
  181. <div class="layui-form-item">
  182. <label class="layui-form-label"> </label>
  183. <div class="layui-input-block">
  184. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  185. </div>
  186. </div>
  187. </form>
  188. </div>
  189. </div>
  190. </div>
  191. <script src="/layuiadmin/layui/layui.js"></script>
  192. <script>
  193. layui.config({
  194. base: '/layuiadmin/' //静态资源所在路径
  195. }).extend({
  196. index: 'lib/index' //主入口模块
  197. }).use('index');
  198. </script>
  199. <script>
  200. var layer = layui.layer;
  201. var $;
  202. var cur_open_div;
  203. layui.use(['jquery', 'layer','form'], function(){
  204. $ = layui.$;
  205. var form = layui.form;
  206. form.on('radio(linktype)', function(data){
  207. if (data.value == 2) {
  208. $('#typeGroup').show();
  209. } else {
  210. $('#typeGroup').hide();
  211. }
  212. });
  213. $('#load_ifram_url').click(function(){
  214. console.log(12);
  215. layer.open({
  216. type: 2,
  217. area: ['100%', '100%'],
  218. content: '{:U('distribution/addForm')}'
  219. });
  220. })
  221. form.on('radio(radi_form)', function(data){
  222. if (data.value == 1) {
  223. $('#form_div').show();
  224. } else {
  225. $('#form_div').hide();
  226. }
  227. });
  228. form.on('radio(radi_share_form)', function(data){
  229. if (data.value == 1) {
  230. $('#share_div').show();
  231. } else {
  232. $('#share_div').hide();
  233. }
  234. });
  235. form.on('radio(radi)', function(data){
  236. var open_community_leve = data.value ;
  237. console.log(open_community_leve);
  238. if( open_community_leve == 0 )
  239. {
  240. $('.community_commiss1').hide();
  241. $('.community_commiss2').hide();
  242. $('.community_commiss3').hide();
  243. }else if( open_community_leve == 1 ){
  244. $('.community_commiss1').show();
  245. $('.community_commiss2').hide();
  246. $('.community_commiss3').hide();
  247. }else if(open_community_leve == 2){
  248. $('.community_commiss1').show();
  249. $('.community_commiss2').show();
  250. $('.community_commiss3').hide();
  251. }else if(open_community_leve == 3){
  252. $('.community_commiss1').show();
  253. $('.community_commiss2').show();
  254. $('.community_commiss3').show();
  255. }
  256. });
  257. $('#chose_link').click(function(){
  258. cur_open_div = $(this).attr('data-input');
  259. $.post("{:U('util/selecturl', array('ok' => 1))}", {}, function(shtml){
  260. layer.open({
  261. type: 1,
  262. area: '930px',
  263. content: shtml //注意,如果str是object,那么需要字符拼接。
  264. });
  265. });
  266. })
  267. form.verify({
  268. title: [
  269. /^[\S]{1,}$/,'标题不能为空'
  270. ]
  271. });
  272. //监听提交
  273. form.on('submit(formDemo)', function(data){
  274. $.ajax({
  275. url: data.form.action,
  276. type: data.form.method,
  277. data: data.field,
  278. dataType:'json',
  279. success: function (info) {
  280. if(info.status == 0)
  281. {
  282. layer.msg(info.result.message,{icon: 1,time: 2000});
  283. }else if(info.status == 1){
  284. var go_url = location.href;
  285. if( info.result.hasOwnProperty("url") )
  286. {
  287. go_url = info.result.url;
  288. }
  289. layer.msg('操作成功',{time: 1000,
  290. end:function(){
  291. var backurl = "{:U('distribution/config',array('ok'=>'1'))}";
  292. location.href = backurl;
  293. // location.href = info.result.url;
  294. }
  295. });
  296. }
  297. }
  298. });
  299. return false;
  300. });
  301. })
  302. </script>
  303. <script>
  304. $(function(){
  305. $('#clear_member_qrcode').click(function(){
  306. $.ajax({
  307. url:"{:U('distribution/clear_user_member_qrcode')}",
  308. type:'get',
  309. dataType:'json',
  310. success:function(){
  311. tip.msgbox.suc('清空成功');
  312. }
  313. })
  314. })
  315. })
  316. function addCategory(){
  317. var html ='<tr>';
  318. html+='<td style="width:200px;">';
  319. html+='<input type="text" class="form-control" name="data[value][]" value="">';
  320. html+='</td>';
  321. html+='<td style="width: 45px;">';
  322. html+=' <a href="javascript:void(0);" class="btn btn-default btn-del btn-op btn-operation" data-confirm="确认删除此标签?">';
  323. html+='<span data-toggle="tooltip" data-placement="top" title="" data-original-title="删除">';
  324. html+='<i class="icow icow-shanchu1"></i>';
  325. html+='</span>';
  326. html+='</a>';
  327. html+='</td>';
  328. html+='</tr>';
  329. $('#tbody-items').append(html);
  330. }
  331. $(function(){
  332. $(document).delegate('.btn-del','click',function(){
  333. var $btntr = $(this).parents('tr');
  334. $btntr.remove();
  335. })
  336. });
  337. </script>
  338. </body>