截流自动化的商城平台
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

set.html 4.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. {layout name="layout1" /}
  2. <style>
  3. .layui-form-label {
  4. width: 120px;
  5. text-align: left;
  6. }
  7. </style>
  8. <div class="wrapper">
  9. <div class="layui-card">
  10. <div class="layui-card-body">
  11. <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
  12. <div class="layui-colla-item">
  13. <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
  14. <div class="layui-colla-content layui-show">
  15. <p>PC商城设置</p>
  16. </div>
  17. </div>
  18. </div>
  19. </div>
  20. <div class="layui-card-body">
  21. <div class="layui-form">
  22. <div class="layui-form-item">
  23. <div class="layui-form-label">渠道状态</div>
  24. <div class="layui-input-block">
  25. <input type="radio" name="is_open" value="0" title="关闭" {if !$config.is_open}checked{/if} />
  26. <input type="radio" name="is_open" value="1" title="开启" {if $config.is_open}checked{/if} />
  27. </div>
  28. </div>
  29. <div class="layui-form-item">
  30. <div class="layui-form-label">关闭后访问页面</div>
  31. <div class="layui-input-block">
  32. <input type="radio" name="page" value="1" title="空白页" {if $config.page == 1}checked{/if} />
  33. </div>
  34. </div>
  35. <div class="layui-form-item">
  36. <div class="layui-form-label"></div>
  37. <div class="layui-inline">
  38. <input type="radio" name="page" value="2" title="自定义页面" {if $config.page == 2}checked{/if} />
  39. </div>
  40. <div class="layui-inline" style="width: 420px;">
  41. <input type="text" name="page_url" value="{$config.page_url}" placeholder="请输入完整的url" class="layui-input" />
  42. </div>
  43. </div>
  44. <div class="layui-form-item">
  45. <div class="layui-form-label">PC商城链接</div>
  46. <div class="layui-inline" style="width: 280px;">
  47. <input type="text" style="border:none" id="pc_url" value="{$config.pc_url}" class="layui-input" readonly />
  48. </div>
  49. <button class="layui-btn layui-btn-xs layui-btn-primary" id="copy">复制</button>
  50. </div>
  51. <div class="layui-form-item">
  52. <div class="layui-form-label"></div>
  53. <div class="layui-input-block">
  54. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="set">设置</button>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <script>
  62. layui.config({
  63. version:"{$front_version}",
  64. base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
  65. }).extend({
  66. index: 'lib/index' //主入口模块
  67. }).use(['form', 'layer'], function(){
  68. var form = layui.form;
  69. var layer = layui.layer;
  70. var $ = layui.jquery;
  71. form.on('submit(set)', function (data) {
  72. $.ajax({
  73. url:'{:url("wechat.pc/set")}',
  74. type: 'post',
  75. data: data.field,
  76. success:function(res) {
  77. if (res.code == 1) {
  78. layer.msg(res.msg, {
  79. offset: '15px'
  80. , icon: 1
  81. , time: 1000
  82. });
  83. }
  84. }
  85. });
  86. });
  87. // 复制
  88. $('#copy').click(function() {
  89. var input = document.getElementById('pc_url');
  90. input.select();
  91. document.execCommand("Copy");
  92. layer.msg('复制成功');
  93. });
  94. });
  95. </script>