sendallcuswxmsg.html 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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. 封面图建议尺寸:360*200 。如需更佳清晰可以做成 900*500
  26. </div>
  27. </div>
  28. <div class="col-xs-12">
  29. <form class="form-horizontal" id="form" method="post" action="{:U('Settings/sendallcuswxmsg_save')}">
  30. <div class="form-group">
  31. <label class="col-sm-2 control-label no-padding-left"> 标题 </label>
  32. <div class="col-sm-10">
  33. <div class="clearfix">
  34. <input name="title" class="col-xs-10 col-sm-10 form-control" value="" type="text">
  35. <span class="help-inline ">
  36. <span class="middle red">原(你好,你购买的商品已经到货。)</span>
  37. </span>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="form-group">
  42. <label class="col-sm-2 control-label no-padding-left">封面图 </label>
  43. <div class="col-sm-10">
  44. <div class="col-sm-10" id="thumb">
  45. <a href="#" data-toggle="image" class="img-thumbnail">
  46. <img osctype="image"
  47. src="__ROOT__/Common/image/no_image_40x40.jpg" />
  48. </a>
  49. <input osctype="image_input" type="hidden" name="image" value="" id="input-image" />
  50. </div>
  51. </div>
  52. </div>
  53. <div class="form-group">
  54. <label class="col-sm-2 control-label no-padding-left"> 描述 </label>
  55. <div class="col-sm-10">
  56. <div class="clearfix">
  57. <input name="descript" class="col-xs-10 col-sm-10 form-control" value="" type="text">
  58. <span class="help-inline ">
  59. <span class="middle red"></span>
  60. </span>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="form-group">
  65. <label class="col-sm-2 control-label no-padding-left"> 点击链接 </label>
  66. <div class="col-sm-10">
  67. <div class="clearfix">
  68. <input name="url_link" class="col-xs-10 col-sm-10 form-control" value="" type="text">
  69. <span class="help-inline ">
  70. <span class="middle red">如(http://pinduoduo.liofis.com/index.php?s=/goods/95.html)注意:http:// 这是必填的</span>
  71. </span>
  72. </div>
  73. </div>
  74. </div>
  75. </form>
  76. <div class="form-group">
  77. <label class="col-sm-1 control-label no-padding-left"> </label>
  78. <div class="col-sm-11">
  79. <button form="form" type="submit" class="btn btn-sm btn-primary">提交</button>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </block>
  85. <block name="javascript">
  86. <script src="__PUBLIC__/fileupload/jquery.ui.widget.js"></script>
  87. <script src="__PUBLIC__/fileupload/jquery.fileupload.js"></script>
  88. <script>
  89. $(function(){
  90. // tooltips on hover button-upload
  91. $('[data-toggle=\'tooltip\']').tooltip({container: 'body', html: true});
  92. // Makes tooltips work on ajax generated content
  93. $(document).ajaxStop(function() {
  94. $('[data-toggle=\'tooltip\']').tooltip({container: 'body'});
  95. });
  96. $('#clear_user_qrcode').click(function(){
  97. $.ajax({
  98. url:'{:U("settings/clearuserqrcode")}',
  99. type:'post',
  100. dataType:'json',
  101. success:function(ret){
  102. if(ret.code ==1)
  103. {
  104. alert('清空成功');
  105. return false;
  106. }
  107. }
  108. })
  109. })
  110. $(document).delegate('a[data-toggle=\'image\']', 'click', function(e) {
  111. e.preventDefault();
  112. var index=$(this).attr('num');
  113. var type=$(this).attr('type');
  114. //alert(index);
  115. var element = this;
  116. if(index==undefined){
  117. $(element).popover({
  118. html: true,
  119. placement: 'right',
  120. trigger: 'manual',
  121. content: function() {
  122. return '<button type="button" id="thumb-image" class="btn btn-primary"><i class="icon-edit"></i></button> <button type="button" id="button-clear" class="btn btn-danger"><i class="icon-trash"></i></button>';
  123. }
  124. });
  125. }else{
  126. $(element).popover({
  127. html: true,
  128. placement: 'right',
  129. trigger: 'manual',
  130. content: function() {
  131. return '<button type="button" n="'+index+'" t="'+type+'" class="btn btn-primary button-image"><i class="icon-edit"></i></button> ';
  132. }
  133. });
  134. }
  135. $(element).popover('toggle');
  136. //商品图片
  137. $('#thumb-image').on('click', function() {
  138. //alert('333');
  139. $('#modal-image').remove();
  140. $('#form-upload').remove();
  141. $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input osctype="btn_upload_image" type="file" name="file" /></form>');
  142. $('#form-upload input[name=\'file\']').trigger('click');
  143. $(element).popover('hide');
  144. $('[osctype="btn_upload_image"]').fileupload({
  145. dataType: 'json',
  146. url: "{:U('Image/upload_image',array('dir'=>'shop'))}",
  147. add: function(e, data) {
  148. $parent = $('#thumb');
  149. $input = $parent.find('[osctype="image_input"]');
  150. $img = $parent.find('[osctype="image"]');
  151. data.formData = {old_goods_image:$input.val()};
  152. $img.attr('src', "__IMG__/loading.gif");
  153. data.submit();
  154. },
  155. done: function (e,data) {
  156. var image=data.result;
  157. $parent = $('#thumb');
  158. $input = $parent.find('[osctype="image_input"]');
  159. $img = $parent.find('[osctype="image"]');
  160. if(image) {
  161. // $img.prev('i').hide();
  162. $img.attr('src', '__ROOT__'+image.image_thumb);
  163. $img.show();
  164. $input.val(image.image);
  165. } else {
  166. alert('上传失败');
  167. }
  168. }
  169. });
  170. });
  171. $('.button-image').on('click', function() {
  172. $('#modal-image').remove();
  173. $('#form-upload').remove();
  174. var i=$(this).attr('n');
  175. var type=$(this).attr('t');
  176. $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input osctype="btn_upload_image" type="file" name="file" /></form>');
  177. $('#form-upload input[name=\'file\']').trigger('click');
  178. $(element).popover('hide');
  179. $('[osctype="btn_upload_image"]').fileupload({
  180. dataType: 'json',
  181. url: "{:U('Image/upload_image/dir')}"+'/'+type,
  182. add: function(e, data) {
  183. $parent = $('#image-row'+i);
  184. $input = $parent.find('[osctype="'+type+'_image_input'+i+'"]');
  185. $img = $parent.find('[osctype="'+type+'_image'+i+'"]');
  186. var old_name='old_'+type+'_image';
  187. data.formData = {old_name:$input.val()};
  188. $img.attr('src', "__IMG__/loading.gif");
  189. data.submit();
  190. },
  191. done: function (e,data) {
  192. var image=data.result;
  193. $parent = $('#'+type+'-image-row'+i);
  194. $input = $parent.find('[osctype="'+type+'_image_input'+i+'"]');
  195. $img = $parent.find('[osctype="'+type+'_image'+i+'"]');
  196. if(image) {
  197. // $img.prev('i').hide();
  198. $img.attr('src', '__ROOT__/'+image.image_thumb);
  199. $img.show();
  200. $input.val(image.image);
  201. } else {
  202. alert('上传失败');
  203. }
  204. }
  205. });
  206. });
  207. $('#button-clear').on('click', function() {
  208. $(element).find('img').attr('src', $(element).find('img').attr('data-placeholder'));
  209. $(element).parent().find('input').attr('value', '');
  210. $(element).popover('hide');
  211. });
  212. });
  213. });
  214. </script>
  215. </block>