截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

set_sms.html 3.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. {layout name="layout2" /}
  2. <style>
  3. .tips{
  4. color: red;
  5. }
  6. </style>
  7. <div class="layui-form" lay-filter="layuiadmin-form-user" id="layuiadmin-form-user" style="padding: 20px 30px 0 0;">
  8. <input type="hidden" value="{$info.id}" name="id">
  9. <input type="hidden" value="{$type}" name="type">
  10. <!--通知场景-->
  11. <div class="layui-form-item">
  12. <label class="layui-form-label">通知场景:</label>
  13. <div class="layui-input-inline" style="padding-top: 8px">
  14. {$info.scene}
  15. </div>
  16. </div>
  17. <!--模板id-->
  18. <div class="layui-form-item">
  19. <label class="layui-form-label"><span class="tips">*</span>模板ID:</label>
  20. <div class="layui-input-block">
  21. <div class="layui-col-md4">
  22. <input type="text" name="template_code" value="{$info.sms_notice.template_code | default = ''}" autocomplete="off" class="layui-input" lay-verify="required" lay-vertype="tips">
  23. <div class="layui-form-mid layui-word-aux">需要与短信接口的模板ID一致</div>
  24. </div>
  25. </div>
  26. </div>
  27. <!--场景变量-->
  28. <div class="layui-form-item">
  29. <label class="layui-form-label">场景变量:</label>
  30. <div class="layui-input-block">
  31. {foreach $info.variable as $item => $val}
  32. <button type="button" class="layui-btn layui-btn-primary variable-btn" data-value="{$item}">{$val}</button>
  33. {/foreach}
  34. </div>
  35. </div>
  36. <div class="layui-form-item">
  37. <label class="layui-form-label"></label>
  38. <div class="layui-form-mid layui-word-aux">系统在当前场景预定义好的通知变量</div>
  39. </div>
  40. <!--通知内容-->
  41. <div class="layui-form-item">
  42. <label class="layui-form-label"><span class="tips">*</span>短信内容:</label>
  43. <div class="layui-input-block">
  44. <div class="layui-col-sm4">
  45. <textarea name="content" id="content" class="layui-textarea">{$info.sms_notice.content | default = ''}</textarea>
  46. <div class="layui-form-mid layui-word-aux">支持嵌入场景变量,复制场景变量的值填入即可生效</div>
  47. </div>
  48. </div>
  49. </div>
  50. <!--状态-->
  51. <div class="layui-form-item">
  52. <label class="layui-form-label">状态</label>
  53. <div class="layui-input-inline">
  54. <input type="radio" name="status" value="1" title="开启" {if ($info.sms_notice.status ?? 0) == 1}checked{/if} />
  55. <input type="radio" name="status" value="0" title="关闭" {if ($info.sms_notice.status ?? 0) == 0}checked{/if} />
  56. <div class="layui-form-mid layui-word-aux">开启或关闭当前场景通知</div>
  57. </div>
  58. </div>
  59. <div class="layui-form-item layui-hide">
  60. <input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
  61. </div>
  62. </div>
  63. <script>
  64. layui.config({
  65. version:"{$front_version}",
  66. base: '/static/plug/' //静态资源所在路径
  67. }).extend({
  68. base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
  69. }).use(['form'], function(){
  70. var $ = layui.$
  71. ,form = layui.form ;
  72. $(document).on('click', '.variable-btn', function () {
  73. var copyText = $(this).data('value');
  74. let aux = document.createElement("input");
  75. aux.setAttribute("value", '{'+copyText+'}');
  76. document.body.appendChild(aux);
  77. aux.select();
  78. document.execCommand("copy");
  79. document.body.removeChild(aux);
  80. layer.msg('已复制场景变量');
  81. })
  82. })
  83. </script>