截流自动化的商城平台
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

index.html 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. {layout name="layout1" /}
  2. <style>
  3. .bubble { display: flex;justify-content: start;flex-wrap: wrap; }
  4. .bubble .layui-card { background:#eee; width:19%; min-width:155px; height:100px; margin-right:10px; }
  5. .bubble-content { padding-top: 10px; font-size: 14px; display: flex; justify-content: space-between;}
  6. </style>
  7. <div class="wrapper">
  8. <div class="layui-card">
  9. <!-- 操作提示 -->
  10. <div class="layui-card-body">
  11. <div class="layui-collapse" style="border:1px dashed #c4c4c4">
  12. <div class="layui-colla-item">
  13. <h2 class="layui-colla-title like-layui-colla-title">操作提示</h2>
  14. <div class="layui-colla-content layui-show">
  15. <p>*设置商城首页,商品详情页显示足迹气泡。营造活动氛围,增强气氛。</p>
  16. <p>*注意:需在设置中开启,并且把对应的场景也开启才可以使用。</p>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. <!-- 选项卡 -->
  22. <div class="layui-tab layui-tab-card">
  23. <ul class="layui-tab-title">
  24. <li data-type="1" class="layui-this">足迹气泡</li>
  25. <li data-type="2">设置</li>
  26. </ul>
  27. <div class="layui-tab-content">
  28. <!-- 足迹气泡 -->
  29. <div class="layui-tab-item layui-show" style="padding: 0 15px;">
  30. <div class="bubble">
  31. {volist name="footprint" id="vo"}
  32. <div class="layui-card">
  33. <div class="layui-card-header">{$vo.name}</div>
  34. <div class="layui-card-body">
  35. <div class="bubble-content">
  36. <button type="button" data-id="{$vo.id}"
  37. class="layui-btn layui-btn-normal layui-btn-sm edit-bubble">
  38. 编辑
  39. </button>
  40. <span>已开启</span>
  41. </div>
  42. </div>
  43. </div>
  44. {/volist}
  45. </div>
  46. </div>
  47. <!-- 设置模块 -->
  48. <div class="layui-tab-item">
  49. <form class="layui-form">
  50. <div class="layui-form-item">
  51. <label for="duration" class="layui-form-label" style="width:110px;">足迹气泡时长:</label>
  52. <div class="layui-input-inline" style="width:220px;">
  53. <input type="number" id="duration" name="duration" value="{$config.footprint_duration}" autocomplete="off" class="layui-input">
  54. <p style="color:#ccc;font-size: 13px;">查询多长时间范围内的足迹信息</p>
  55. </div>
  56. <div class="layui-input-inline" style="line-height: 38px;">分钟</div>
  57. </div>
  58. <div class="layui-form-item">
  59. <label class="layui-form-label" style="width:110px;">足迹气泡状态:</label>
  60. <div class="layui-input-inline" style="width:220px;">
  61. <input type="radio" name="status" value="1" title="开启" {if $config.footprint_status==1}checked{/if}>
  62. <input type="radio" name="status" value="0" title="关闭" {if $config.footprint_status==0}checked{/if}>
  63. <p style="color:#ccc;font-size: 13px;">开启还是关闭足迹气泡</p>
  64. </div>
  65. </div>
  66. <div class="layui-form-item ">
  67. <div class="layui-input-block">
  68. <a class="layui-btn layui-btn-normal" lay-submit lay-filter="update-set-submit">确定</a>
  69. </div>
  70. </div>
  71. </form>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. <script>
  78. layui.use(["form"], function () {
  79. var form = layui.form;
  80. /**
  81. * 编辑足迹气泡
  82. */
  83. $(document).on('click', '.edit-bubble', function () {
  84. var that = $(this);
  85. var id = $(this).attr('data-id');
  86. layer.open({
  87. type: 2
  88. ,title: "编辑足迹气泡"
  89. ,content: "{:url('Footprint/edit')}?id="+id
  90. ,area: ["400px", "340px"]
  91. ,btn: ["确定", "取消"]
  92. ,yes: function(index, layero){
  93. var iframeWindow = window["layui-layer-iframe" + index];
  94. var submit = layero.find("iframe").contents().find("#addSubmit");
  95. iframeWindow.layui.form.on("submit(addSubmit)", function(data){
  96. data.field["id"] = id;
  97. like.ajax({
  98. url: "{:url('Footprint/edit')}",
  99. data: data.field,
  100. type: "POST",
  101. success:function(res) {
  102. if(res.code === 1) {
  103. layui.layer.msg(res.msg);
  104. layer.close(index);
  105. var status = data.field['status'] === '0' ? '关闭' : '已开启';
  106. that.next().html(status)
  107. }
  108. }
  109. });
  110. });
  111. submit.trigger("click");
  112. }
  113. });
  114. });
  115. /**
  116. * 更新设置
  117. */
  118. form.on('submit(update-set-submit)', function(data){
  119. like.ajax({
  120. url:'{:url("footprint/set")}',
  121. data:data.field,
  122. type:"post",
  123. success:function(res) {
  124. if(res.code === 1) {
  125. layui.layer.msg(res.msg, {offset:'15px', icon:1, time: 1000});
  126. } else {
  127. layui.layer.msg(res.msg, {offset:'15px', icon:2, time: 1000});
  128. }
  129. }
  130. });
  131. return false;
  132. });
  133. })
  134. </script>