sendallmodifywxmsg_analys.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <extend name="Public:base" />
  2. <block name="content">
  3. <div class="page-header">
  4. <h1>
  5. {$breadcrumb2}
  6. <small>
  7. <i class="icon-double-angle-right"></i>
  8. 群发自定义模板消息
  9. </small>
  10. </h1>
  11. </div>
  12. <div class="row">
  13. <div class="col-xs-12 search-row">
  14. <div class="panel-body">
  15. <ul class="nav nav-tabs">
  16. <li <?php if($type == 1){ ?>class="active" <?php } ?>><a href="{:U('settings/wxtempmsg')}">参数配置</a></li>
  17. <li <?php if($type == 2){ ?>class="active" <?php } ?>><a href="{:U('settings/sendallwxmsg')}">消息群发</a></li>
  18. <li <?php if($type == 3){ ?>class="active" <?php } ?>><a href="{:U('settings/sendallcuswxmsg')}">客服消息群发</a></li>
  19. <li <?php if($type == 4){ ?>class="active" <?php } ?>><a href="{:U('settings/sendallmodifywxmsg')}">自定义模板消息群发</a></li>
  20. </ul>
  21. </div>
  22. </div>
  23. <div class="col-xs-12">
  24. <div class="alert alert-block alert-success" >
  25. {$moban}
  26. </div>
  27. </div>
  28. <div class="col-xs-12">
  29. <form class="form-horizontal" id="form" method="post" action="{:U('Settings/sendallmodifywxmsg_save')}">
  30. <?php foreach($data as $val){ ?>
  31. <?php
  32. $arr = explode('.',$val);
  33. $val = $arr[0].'_'.$arr[1];
  34. ?>
  35. <div class="form-group">
  36. <label class="col-sm-2 control-label no-padding-left"> <?php echo $val; ?> </label>
  37. <div class="col-sm-10">
  38. <div class="clearfix">
  39. <input name="<?php echo $val; ?>" class="col-xs-10 col-sm-10 form-control" value="" type="text">
  40. <span class="help-inline ">
  41. <span class="middle red"></span>
  42. </span>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <label class="col-sm-2 control-label no-padding-left"> <?php echo $val; ?>色值 </label>
  48. <div class="col-sm-10">
  49. <div class="clearfix">
  50. <input name="<?php echo $val; ?>_color" class="col-xs-10 col-sm-10 form-control" value="" type="text">
  51. <span class="help-inline ">
  52. <span class="middle red">请填写色值例如:(#173177)</span>
  53. </span>
  54. </div>
  55. </div>
  56. </div>
  57. <?php } ?>
  58. <div class="form-group">
  59. <label class="col-sm-2 control-label no-padding-left"> 点击链接 </label>
  60. <div class="col-sm-10">
  61. <div class="clearfix">
  62. <input name="url_link" class="col-xs-10 col-sm-10 form-control" value="" type="text">
  63. <span class="help-inline ">
  64. <span class="middle red">如(http://pinduoduo.liofis.com/index.php?s=/goods/95.html)注意:http:// 这是必填的</span>
  65. </span>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="form-group">
  70. <label class="col-sm-2 control-label no-padding-left"> 模板ID </label>
  71. <div class="col-sm-10">
  72. <div class="clearfix">
  73. <input name="moban_id" class="col-xs-10 col-sm-10 form-control" value="" type="text">
  74. <span class="help-inline ">
  75. <span class="middle red">开发者调用模板消息接口时需提供模板ID</span>
  76. </span>
  77. </div>
  78. </div>
  79. </div>
  80. <input type="hidden" name="page" id="page" value="1" />
  81. </form>
  82. <div class="form-group">
  83. <label class="col-sm-1 control-label no-padding-left"> </label>
  84. <div class="col-sm-11">
  85. <button form="form" id="submit_btn" type="submit" class="btn btn-sm btn-primary">提交</button>
  86. </div>
  87. </div>
  88. <div class="col-xs-12">
  89. <div class="alert alert-block alert-success" id="tip_html" style="display:none;">
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </block>
  95. <block name="javascript">
  96. <script>
  97. var can_go = true;
  98. $(function(){
  99. $('#submit_btn').click(function(){
  100. go_to_send();
  101. return false;
  102. })
  103. })
  104. function over_time()
  105. {
  106. setTimeout('go_to_send()',3000);
  107. }
  108. function go_to_send()
  109. {
  110. if(can_go)
  111. {
  112. can_go = false;
  113. $('#tip_html').show();
  114. $('#tip_html').html('正在导入发送数据........');
  115. $.ajax({
  116. url:"{:U('Settings/sendallmodifywxmsg_save')}",
  117. type:'post',
  118. data:$('#form').serialize(),
  119. dataType:'json',
  120. success:function(res)
  121. {
  122. if(res.has_next == 1)
  123. {
  124. var _page = parseInt($('#page').val())+1;
  125. $('#page').val(_page);
  126. $('#tip_html').html('请勿关闭此页面,数据导入中。还剩'+res.del_count+'会员数据正在导入......');
  127. can_go = true;
  128. over_time();
  129. } else {
  130. $('#tip_html').html('全部会员数据导入成功,模板消息将陆续发出。');
  131. can_go = false;
  132. }
  133. }
  134. })
  135. }
  136. return false;
  137. }
  138. </script>
  139. </block>