setting.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>任务设置</title>
  6. <style>
  7. .wrap {
  8. display: none;
  9. }
  10. </style>
  11. </head>
  12. <body class="laytp-container">
  13. <div class="layui-card">
  14. <div class="layui-card-body">
  15. <form class="layui-form" lay-filter="layui-form">
  16. <div class="table-container">
  17. </div>
  18. <div class="bottom">
  19. <div class="button-container">
  20. <button type="submit" class="laytp-btn laytp-btn-primary laytp-btn-sm" lay-submit="" lay-filter="add">
  21. <i class="layui-icon layui-icon-ok"></i>
  22. 保存配置
  23. </button>
  24. <button type="reset" class="laytp-btn laytp-btn-sm">
  25. <i class="layui-icon layui-icon-refresh"></i>
  26. 重置
  27. </button>
  28. </div>
  29. </div>
  30. </form>
  31. </div>
  32. </div>
  33. <script id="confTableHtml" type="text/html">
  34. <input type="hidden" name="group" id="group" value="{{=d.group}}" />
  35. <div class="layui-card">
  36. <div class="layui-card-body">
  37. <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
  38. <ul class="layui-tab-title">
  39. <li lay-id="1" class="layui-this">分销模式</li>
  40. <li lay-id="2">返佣设置</li>
  41. <li lay-id="3">提现设置</li>
  42. </ul>
  43. <div class="layui-tab-content" style="height: 30px;">
  44. <!-- 基础配置 -->
  45. <div class="layui-tab-item layui-show">
  46. <table class="layui-table" style="margin: 0;" lay-skin="nob">
  47. <colgroup>
  48. <col width="15%">
  49. <col width="70%">
  50. <col width="15%">
  51. </colgroup>
  52. <tbody>
  53. <tr>
  54. <td style="text-align:right;">
  55. 分销功能开关
  56. </td>
  57. <td>
  58. <!-- 隐藏域设置开关未选中时需要传递的参数值 -->
  59. <input type="hidden" name="is_commission" value="2" />
  60. <input type="checkbox" name="is_commission" lay-skin="switch" lay-text="打开|关闭" value="1" {{# if(d.is_commission == 1){ }}checked="checked" {{# } }} />
  61. <input type="hidden" name="form_type[is_commission]" value="switch" />
  62. </td>
  63. <td>
  64. <div class="conf-des layui-form-mid layui-word-aux">
  65. <label title="配置说明">分销功能</label>
  66. <br />
  67. <code title="{{=d.group}}.is_commission">{{=d.group}}.is_commission</code>
  68. </div>
  69. </td>
  70. </tr>
  71. <tr>
  72. <td style="text-align:right;">
  73. 分销级别
  74. </td>
  75. <td>
  76. <input type="radio" name="level" value="1" {{#if (d.level == 1 || !d.level){ }}checked="checked"{{# } }} title="一级"/>
  77. <input type="radio" name="level" value="2" {{#if (d.level == 2){ }}checked="checked"{{# } }} title="二级" />
  78. <input type="radio" name="level" value="3" {{#if (d.level == 3){ }}checked="checked"{{# } }} title="三级"/>
  79. <input type="hidden" name="form_type[level]" value="radio" />
  80. <div class="layui-form-mid layui-word-aux">
  81. 最多可达三级分销,对设置保存后产生的绑定生效
  82. </div>
  83. </td>
  84. <td>
  85. <div class="conf-des layui-form-mid layui-word-aux">
  86. <label title="配置说明">分销级别</label>
  87. <br />
  88. <code title="{{=d.group}}.extract_rate">{{=d.group}}.level</code>
  89. </div>
  90. </td>
  91. </tr>
  92. <tr>
  93. <td style="text-align:right;">
  94. 入驻分销商费用
  95. </td>
  96. <td>
  97. <input type="hidden" name="commission_price" value="0" />
  98. <input autocomplete="off" type="text" name="commission_price" id="commission_price" value="{{d.commission_price?d.commission_price:0}}"
  99. placeholder="请输入金额" class="layui-input">
  100. <input type="hidden" name="form_type[commission_price]" value="input" />
  101. <div class="layui-form-mid layui-word-aux">
  102. 单位:元
  103. </div>
  104. </td>
  105. <td>
  106. <div class="conf-des layui-form-mid layui-word-aux">
  107. <label title="配置说明">入驻分销商费用</label>
  108. <br />
  109. <code title="{{=d.group}}.commission_price">{{=d.group}}.commission_price</code>
  110. </div>
  111. </td>
  112. </tr>
  113. <tr>
  114. <td style="text-align:right;">
  115. 分销中心别名
  116. </td>
  117. <td>
  118. <input autocomplete="off" type="text" name="commission_alias" id="input" value="{{=d.commission_alias}}" placeholder="请输入单行文本输入框" class="layui-input" lay-verify="">
  119. <input type="hidden" name="form_type[commission_alias]" value="input" />
  120. </td>
  121. <td>
  122. <div class="conf-des layui-form-mid layui-word-aux">
  123. <label title="名称">名称</label>
  124. <br />
  125. <code title="{{=d.group}}.input">{{=d.group}}.commission_alias</code>
  126. </div>
  127. </td>
  128. </tr>
  129. <!-- <tr>
  130. <td style="text-align:right;">
  131. 分销商付费入驻是否奖励
  132. </td>
  133. <td>
  134. <input type="radio" name="level" value="1" {{#if (d.level == 1 || !d.level){ }}checked="checked"{{# } }} title="不奖励"/>
  135. <input type="radio" name="level" value="2" {{#if (d.level == 2){ }}checked="checked"{{# } }} title="奖励点数" />
  136. <input type="radio" name="level" value="3" {{#if (d.level == 3){ }}checked="checked"{{# } }} title="奖励会员卡"/>
  137. <input type="hidden" name="form_type[level]" value="radio" />
  138. </td>
  139. <td>
  140. <div class="conf-des layui-form-mid layui-word-aux">
  141. <label title="配置说明">分销级别</label>
  142. <br />
  143. <code title="{{=d.group}}.extract_rate">{{=d.group}}.level</code>
  144. </div>
  145. </td>
  146. </tr>
  147. <tr>
  148. <td style="text-align:right;">
  149. 分销商付费入驻是否奖励
  150. </td>
  151. <td>
  152. <div class="layui-form-item">
  153. <label class="layui-form-label" title="类别">类别</label>
  154. <div class="layui-input-block">
  155. <div class="xmSelect"
  156. data-name="pid"
  157. data-sourceType="route"
  158. data-source="/admin.template/index?is_tree=true"
  159. data-sourceTree="true"
  160. data-paging="false"
  161. data-radio="true"
  162. data-valueField="id"
  163. data-selected="{{=d.pid}}"
  164. data-textField ='title'
  165. data-subTextField="sub_title"
  166. data-placeholder="请选择类别"
  167. ></div>
  168. </div>
  169. </div>
  170. </td>
  171. <td>
  172. <div class="conf-des layui-form-mid layui-word-aux">
  173. <label title="配置说明">分销级别</label>
  174. <br />
  175. <code title="{{=d.group}}.extract_rate">{{=d.group}}.level</code>
  176. </div>
  177. </td>
  178. </tr> -->
  179. <tr>
  180. <td style="text-align:right;">
  181. 是否开启分销商审核(仅限免费入驻的)
  182. </td>
  183. <td>
  184. <!-- 隐藏域设置开关未选中时需要传递的参数值 -->
  185. <input type="hidden" name="is_examine" value="2" />
  186. <input type="checkbox" name="is_examine" lay-skin="switch" lay-text="打开|关闭" value="1" {{# if(d.is_examine == 1){ }}checked="checked" {{# } }} />
  187. <input type="hidden" name="form_type[is_examine]" value="switch" />
  188. </td>
  189. <td>
  190. <div class="conf-des layui-form-mid layui-word-aux">
  191. <label title="配置说明">分销商审核</label>
  192. <br />
  193. <code title="{{=d.group}}.is_examine">{{=d.group}}.is_examine</code>
  194. </div>
  195. </td>
  196. </tr>
  197. <tr>
  198. <td style="text-align:right;">
  199. 是否展示排行榜
  200. </td>
  201. <td>
  202. <!-- 隐藏域设置开关未选中时需要传递的参数值 -->
  203. <input type="hidden" name="is_ranking" value="2" />
  204. <input type="checkbox" name="is_ranking" lay-skin="switch" lay-text="打开|关闭" value="1" {{# if(d.is_ranking == 1){ }}checked="checked" {{# } }} />
  205. <input type="hidden" name="form_type[is_ranking]" value="switch" />
  206. </td>
  207. <td>
  208. <div class="conf-des layui-form-mid layui-word-aux">
  209. <label title="配置说明">排行榜</label>
  210. <br />
  211. <code title="{{=d.group}}.is_ranking">{{=d.group}}.is_ranking</code>
  212. </div>
  213. </td>
  214. </tr>
  215. <tr>
  216. <td style="text-align:right;">
  217. 入驻说明
  218. </td>
  219. <td>
  220. <iframe src='{{=localStorage.getItem("adminDomain")}}/admin/ueditor.html?id=intro'
  221. class="editor" data-type="intro"
  222. data-id="intro" style="width:100%;height:530px;border: 0"></iframe>
  223. <textarea class="editorContent" data-id="intro"
  224. style="display:none;">{{=d.intro}}</textarea>
  225. </td>
  226. <td>
  227. <div class="conf-des layui-form-mid layui-word-aux">
  228. <label title="配置说明">配置说明</label>
  229. <br />
  230. <code title="{{=d.group}}.intro">{{=d.group}}.intro</code>
  231. </div>
  232. </td>
  233. <input type="hidden" name="form_type[intro]" value="intro" />
  234. </tr>
  235. </tbody>
  236. </table>
  237. </div>
  238. <!-- 返佣设置 -->
  239. <div class="layui-tab-item">
  240. <table class="layui-table" style="margin: 0;" lay-skin="nob">
  241. <colgroup>
  242. <col width="15%">
  243. <col width="70%">
  244. <col width="15%">
  245. </colgroup>
  246. <tbody>
  247. <tr>
  248. <td style="text-align:right;">
  249. 自购返佣
  250. </td>
  251. <td>
  252. <!-- 隐藏域设置开关未选中时需要传递的参数值 -->
  253. <input type="hidden" name="is_self_buy" value="2" />
  254. <input type="checkbox" name="is_self_buy" lay-skin="switch" lay-text="打开|关闭" value="1" {{# if(d.is_self_buy == 1){ }}checked="checked" {{# } }} />
  255. <input type="hidden" name="form_type[is_self_buy]" value="switch" />
  256. </td>
  257. <td>
  258. <div class="conf-des layui-form-mid layui-word-aux">
  259. <label title="配置说明">是否开启自购返佣(开启:分销员自己购买商品,享受直推返佣,上级享受间推返佣,上上级享受再间推返佣; 关闭:分销员自己购买商品没有返佣)</label>
  260. <br />
  261. <code title="{{=d.group}}.is_self_buy">{{=d.group}}.is_self_buy</code>
  262. </div>
  263. </td>
  264. </tr>
  265. <tr>
  266. <td style="text-align:right;">
  267. 分销商入驻费是否返佣
  268. </td>
  269. <td>
  270. <!-- 隐藏域设置开关未选中时需要传递的参数值 -->
  271. <input type="hidden" name="is_self_buy_commission" value="2" />
  272. <input type="checkbox" name="is_self_buy_commission" lay-skin="switch" lay-text="打开|关闭" value="1" {{# if(d.is_self_buy_commission == 1){ }}checked="checked" {{# } }} />
  273. <input type="hidden" name="form_type[is_self_buy_commission]" value="switch" />
  274. </td>
  275. <td>
  276. <div class="conf-des layui-form-mid layui-word-aux">
  277. <label title="配置说明">分销商入驻费是否返佣</label>
  278. <br />
  279. <code title="{{=d.group}}.is_self_buy_commission">{{=d.group}}.is_self_buy_commission</code>
  280. </div>
  281. </td>
  282. </tr>
  283. <tr>
  284. <td style="text-align:right;">
  285. 直推佣金比例
  286. </td>
  287. <td>
  288. <input autocomplete="off" type="text" name="first" id="first" value="{{=d.first}}"
  289. placeholder="请输入数字" class="layui-input">
  290. <input type="hidden" name="form_type[first]" value="input" />
  291. <div class="layui-form-mid layui-word-aux">
  292. 请填写数字,单位:%
  293. </div>
  294. </td>
  295. <td>
  296. <div class="conf-des layui-form-mid layui-word-aux">
  297. <label title="配置说明">a->b->c->d(消费者)中的c</label>
  298. <br />
  299. <code title="{{=d.group}}.first">{{=d.group}}.first</code>
  300. </div>
  301. </td>
  302. </tr>
  303. <tr>
  304. <td style="text-align:right;">
  305. 间推佣金比例
  306. </td>
  307. <td>
  308. <input autocomplete="off" type="text" name="second" id="second" value="{{=d.second}}"
  309. placeholder="请输入数字" class="layui-input">
  310. <input type="hidden" name="form_type[second]" value="input" />
  311. <div class="layui-form-mid layui-word-aux">
  312. 请填写数字,单位:%
  313. </div>
  314. </td>
  315. <td>
  316. <div class="conf-des layui-form-mid layui-word-aux">
  317. <label title="配置说明">a->b->c->d(消费者)中的b</label>
  318. <br />
  319. <code title="{{=d.group}}.second">{{=d.group}}.second</code>
  320. </div>
  321. </td>
  322. </tr>
  323. <tr>
  324. <td style="text-align:right;">
  325. 再间推佣金比例
  326. </td>
  327. <td>
  328. <input autocomplete="off" type="text" name="third" id="third" value="{{=d.third}}"
  329. placeholder="请输入数字" class="layui-input">
  330. <input type="hidden" name="form_type[third]" value="input" />
  331. <div class="layui-form-mid layui-word-aux">
  332. 请填写数字,单位:%
  333. </div>
  334. </td>
  335. <td>
  336. <div class="conf-des layui-form-mid layui-word-aux">
  337. <label title="配置说明">a->b->c->d(消费者)中的a</label>
  338. <br />
  339. <code title="{{=d.group}}.third">{{=d.group}}.third</code>
  340. </div>
  341. </td>
  342. </tr>
  343. </tbody>
  344. </table>
  345. </div>
  346. <!-- 提现设置 -->
  347. <div class="layui-tab-item">
  348. <table class="layui-table" style="margin: 0;" lay-skin="nob">
  349. <colgroup>
  350. <col width="15%">
  351. <col width="70%">
  352. <col width="15%">
  353. </colgroup>
  354. <tbody>
  355. <tr>
  356. <td style="text-align:right;">
  357. 分销提现说明
  358. </td>
  359. <td>
  360. <textarea name="instructions" class="layui-textarea">{{=d.instructions}}</textarea>
  361. <input type="hidden" name="form_type[instructions]" value="textarea" />
  362. </td>
  363. <td>
  364. <div class="conf-des layui-form-mid layui-word-aux">
  365. <label title="网站名称">分销提现说明</label>
  366. <br />
  367. <code title="{{=d.group}}.input">{{=d.group}}.instructions</code>
  368. </div>
  369. </td>
  370. </tr>
  371. <tr>
  372. <td style="text-align:right;">
  373. 最低提现金额
  374. </td>
  375. <td>
  376. <input autocomplete="off" type="text" name="extract_min_price" id="extract_min_price" value="{{=d.extract_min_price}}"
  377. placeholder="请输入最低提现金额" class="layui-input">
  378. <input type="hidden" name="form_type[extract_min_price]" value="input" />
  379. <div class="layui-form-mid layui-word-aux">
  380. 单位:元
  381. </div>
  382. </td>
  383. <td>
  384. <div class="conf-des layui-form-mid layui-word-aux">
  385. <label title="最低提现金额">最低提现金额</label>
  386. <br />
  387. <code title="{{=d.group}}.extract_min_price">{{=d.group}}.extract_min_price</code>
  388. </div>
  389. </td>
  390. </tr>
  391. <!-- <tr>
  392. <td style="text-align:right;">
  393. 提现手续费率
  394. </td>
  395. <td>
  396. <input autocomplete="off" type="text" name="extract_rate" id="extract_rate" value="{{=d.extract_rate}}"
  397. placeholder="请输入提现手续费率" class="layui-input">
  398. <input type="hidden" name="form_type[extract_rate]" value="input" />
  399. <div class="layui-form-mid layui-word-aux">
  400. 单位:%
  401. </div>
  402. </td>
  403. <td>
  404. <div class="conf-des layui-form-mid layui-word-aux">
  405. <label title="提现时的手续费">提现手续费</label>
  406. <br />
  407. <code title="{{=d.group}}.extract_rate">{{=d.group}}.extract_rate</code>
  408. </div>
  409. </td>
  410. </tr> -->
  411. </tbody>
  412. </table>
  413. </div>
  414. </div>
  415. </div>
  416. </div>
  417. </div>
  418. </script>
  419. <script type="application/javascript">
  420. document.write("<link rel='stylesheet' href='" + localStorage.getItem("staticDomain") +
  421. "/component/layui/css/layui.css?v=" + localStorage.getItem("version") + "'>");
  422. document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/layui/layui.js?v=" +
  423. localStorage.getItem("version") + "'><\/script>");
  424. document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/laytp/layuiConfig.js?v=" +
  425. localStorage.getItem("version") + "'><\/script>");
  426. document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/jquery_3.3.1.js?v=" +
  427. localStorage.getItem("version") + "'><\/script>");
  428. document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/jquery.tablednd.js?v=" +
  429. localStorage.getItem("version") + "'><\/script>");
  430. </script>
  431. <script>
  432. let dom;
  433. layui.use(['laytp', 'drawer','element'], function() {
  434. var group = "system.commission";
  435. var drawer = layui.drawer;
  436. var element = layui.element;
  437. // 先获取数据,渲染表单
  438. // 渲染完表单之后,设置滚动条
  439. facade.ajax({
  440. route: "/admin.conf/getGroupConf",
  441. data: {
  442. "group": group
  443. },
  444. successAlert: false,
  445. showLoading: true
  446. }).done(function(res) {
  447. if (res.code === 0) {
  448. res.data.group = group;
  449. layui.laytpl($("#confTableHtml").html()).render(res.data, function(string) {
  450. $(".table-container").html(string);
  451. layui.laytpForm.render();
  452. var windowHeight = $(window).height();
  453. var maxHeight = parseInt(windowHeight) - 86;
  454. var minHeight = parseInt(windowHeight) - 86;
  455. // 设置table-container的最大高度和超过高度后展示滚动条
  456. $(".table-container").css("margin-bottom", '40px');
  457. $(".table-container").css("max-height", maxHeight + 'px');
  458. $(".table-container").css("min-height", minHeight + 'px');
  459. $(".table-container").css("overflow-y", "auto");
  460. $('.bottom').css("background-color", "#f6f6f6");
  461. });
  462. }
  463. });
  464. // 选项卡
  465. var layid = location.hash.replace(/^#docDemoTabBrief=/, '');
  466. element.tabChange('test1', layid);
  467. element.on('tab(docDemoTabBrief)', function(data) {
  468. location.hash = 'test1=' + this.getAttribute('lay-id');
  469. });
  470. layui.form.on('submit(add)', function(data) {
  471. var btnAnim = layui.button.load({
  472. elem: $(this)
  473. });
  474. try {
  475. data = facade.setEditorField(data);
  476. } catch (e) {
  477. facade.error(e);
  478. return false;
  479. }
  480. data.field.group = group;
  481. facade.ajax({
  482. route: '/admin.conf/saveGroupConf',
  483. data: data.field
  484. }).done(function() {
  485. btnAnim.stop();
  486. }).fail(function() {
  487. btnAnim.stop();
  488. });
  489. return false;
  490. });
  491. $('#btnClose').on('click',function(){
  492. dom.close();
  493. })
  494. })
  495. </script>
  496. <script type="text/javascript">
  497. function drawer(){
  498. layui.use(['drawer'], function() {
  499. var drawer = layui.drawer;
  500. dom = drawer.open({
  501. direction: "right",
  502. dom: ".layer-right",
  503. distance: "30%"
  504. });
  505. });
  506. }
  507. </script>
  508. </body>
  509. </html>