wxprogram_template.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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. </small>
  9. </h1>
  10. </div>
  11. <div class="row">
  12. <div class="col-xs-12 search-row">
  13. <div class="panel-body">
  14. <ul class="nav nav-tabs">
  15. <li <?php if($type == 1){ ?>class="active" <?php } ?>><a href="{:U('settings/wxprogram')}">参数配置</a></li>
  16. <li <?php if($type == 2){ ?>class="active" <?php } ?>><a href="{:U('settings/wxprogram_template')}">模板消息配置</a></li>
  17. </ul>
  18. </div>
  19. </div>
  20. <div class="col-xs-12">
  21. <form class="form-horizontal" id="form" method="post" action="{:U('Settings/save')}">
  22. <div class="col-xs-12 top">
  23. <div class="col-sm-2 ">拼团开团通知:</div>
  24. <div class="col-sm-6">
  25. <input type="text" value="{$site.weprogram_template_open_pin.value|default=''}" id="weprogram_template_open_pin" name="weprogram_template_open_pin" class="form-control" placeholder="">
  26. </div>
  27. </div>
  28. <div class="col-xs-12 top">
  29. <div class="col-sm-2 ">拼团参与通知:</div>
  30. <div class="col-sm-6">
  31. <input type="text" value="{$site.weprogram_template_take_pin.value|default=''}" id="weprogram_template_take_pin" name="weprogram_template_take_pin" class="form-control" placeholder="">
  32. </div>
  33. </div>
  34. <div class="col-xs-12 top">
  35. <div class="col-sm-2 ">拼团成功通知:</div>
  36. <div class="col-sm-6">
  37. <input type="text" value="{$site.weprogram_template_success_pin.value|default=''}" id="weprogram_template_success_pin" name="weprogram_template_success_pin" class="form-control" placeholder="">
  38. </div>
  39. </div>
  40. <div class="col-xs-12 top">
  41. <div class="col-sm-2 ">拼团失败通知:</div>
  42. <div class="col-sm-6">
  43. <input type="text" value="{$site.weprogram_template_fail_pin.value|default=''}" id="weprogram_template_fail_pin" name="weprogram_template_fail_pin" class="form-control" placeholder="">
  44. </div>
  45. </div>
  46. <div class="col-xs-12 top">
  47. <div class="col-sm-2 ">退款成功通知:</div>
  48. <div class="col-sm-6">
  49. <input type="text" value="{$site.weprogram_template_refund_order.value|default=''}" id="weprogram_template_refund_order" name="weprogram_template_refund_order" class="form-control" placeholder="">
  50. </div>
  51. </div>
  52. <div class="col-xs-12 top">
  53. <div class="col-sm-2 ">参团人数不足通知:</div>
  54. <div class="col-sm-6">
  55. <input type="text" value="{$site.weprogram_template_tip_pin.value|default=''}" id="weprogram_template_tip_pin" name="weprogram_template_tip_pin" class="form-control" placeholder="">
  56. </div>
  57. </div>
  58. <div class="col-xs-12 top">
  59. <div class="col-sm-2 ">订单支付成功通知:</div>
  60. <div class="col-sm-6">
  61. <input type="text" value="{$site.weprogram_template_pay_order.value|default=''}" id="weprogram_template_pay_order" name="weprogram_template_pay_order" class="form-control" placeholder="">
  62. </div>
  63. </div>
  64. <div class="col-xs-12 top">
  65. <div class="col-sm-2 ">抽奖结果通知:</div>
  66. <div class="col-sm-6">
  67. <input type="text" value="{$site.weprogram_template_lottery_result.value|default=''}" id="weprogram_template_lottery_result" name="weprogram_template_lottery_result" class="form-control" placeholder="">
  68. </div>
  69. </div>
  70. <div class="col-xs-12 top">
  71. <div class="col-sm-2 ">订单发货通知:</div>
  72. <div class="col-sm-6">
  73. <input type="text" value="{$site.weprogram_template_send_order.value|default=''}" id="weprogram_template_send_order" name="weprogram_template_send_order" class="form-control" placeholder="">
  74. </div>
  75. </div>
  76. </form>
  77. <div class="form-group">
  78. <label class="col-sm-1 control-label no-padding-left"> </label>
  79. <div class="col-sm-11">
  80. <button form="form" type="submit" class="btn btn-sm btn-primary">提交</button>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </block>
  86. <block name="javascript">
  87. <style>
  88. .top, .buttom {
  89. margin-top: 15px;
  90. }
  91. </style>
  92. <script src="__PUBLIC__/fileupload/jquery.ui.widget.js"></script>
  93. <script src="__PUBLIC__/fileupload/jquery.fileupload.js"></script>
  94. <script>
  95. $(function(){
  96. // tooltips on hover button-upload
  97. $('[data-toggle=\'tooltip\']').tooltip({container: 'body', html: true});
  98. // Makes tooltips work on ajax generated content
  99. $(document).ajaxStop(function() {
  100. $('[data-toggle=\'tooltip\']').tooltip({container: 'body'});
  101. });
  102. $(document).delegate('a[data-toggle=\'image\']', 'click', function(e) {
  103. e.preventDefault();
  104. var index=$(this).attr('num');
  105. //alert(index);
  106. var element = this;
  107. if(index==undefined){
  108. $(element).popover({
  109. html: true,
  110. placement: 'right',
  111. trigger: 'manual',
  112. content: function() {
  113. 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>';
  114. }
  115. });
  116. }
  117. $(element).popover('toggle');
  118. //商品图片
  119. $('#thumb-image').on('click', function() {
  120. //alert('333');
  121. $('#modal-image').remove();
  122. $('#form-upload').remove();
  123. $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input osctype="btn_upload_image" type="file" name="file" /></form>');
  124. $('#form-upload input[name=\'file\']').trigger('click');
  125. $(element).popover('hide');
  126. $('[osctype="btn_upload_image"]').fileupload({
  127. dataType: 'json',
  128. url: "{:U('Image/upload_image',array('dir'=>'shop'))}",
  129. add: function(e, data) {
  130. $parent = $('#thumb');
  131. $input = $parent.find('[osctype="image_input"]');
  132. $img = $parent.find('[osctype="image"]');
  133. data.formData = {old_goods_image:$input.val()};
  134. $img.attr('src', "__IMG__/loading.gif");
  135. data.submit();
  136. },
  137. done: function (e,data) {
  138. var image=data.result;
  139. $parent = $('#thumb');
  140. $input = $parent.find('[osctype="image_input"]');
  141. $img = $parent.find('[osctype="image"]');
  142. if(image) {
  143. // $img.prev('i').hide();
  144. $img.attr('src', '__ROOT__'+image.image_thumb);
  145. $img.show();
  146. $input.val(image.image);
  147. } else {
  148. alert('上传失败');
  149. }
  150. }
  151. });
  152. });
  153. $('#button-clear').on('click', function() {
  154. $(element).find('img').attr('src', $(element).find('img').attr('data-placeholder'));
  155. $(element).parent().find('input').attr('value', '');
  156. $(element).popover('hide');
  157. });
  158. });
  159. });
  160. </script>
  161. </block>