templatemsg.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. <script type="text/javascript" src="/static/js/dist/area/cascade.js"></script>
  45. <script src="https://map.qq.com/api/js?v=2.exp&key=6R4BZ-WAB3W-JITRG-OE7GY-R2753-P3BZ2" type="text/javascript" charset="utf-8"></script>
  46. </head>
  47. <body layadmin-themealias="default">
  48. <div class="layui-fluid">
  49. <div class="layui-card">
  50. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">预售订阅消息</span></div>
  51. <div class="layui-tab layui-tab-brief" >
  52. <ul class="layui-tab-title">
  53. <li><a href="{:U('presale/config')}">基本设置</a></li>
  54. <li class="layui-this"><a href="{:U('presale/templatemsg')}">订阅消息</a></li>
  55. </ul>
  56. </div>
  57. <div class="layui-card-body" style="padding:15px;display:block" >
  58. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  59. <div class="layui-form-item">
  60. <label class="layui-form-label">预售支付通知</label>
  61. <div class="layui-input-block">
  62. <input type="text" name="parameter[weprogram_subtemplate_presale_ordercan_continuepay]" class="layui-input" value="{$data['weprogram_subtemplate_presale_ordercan_continuepay']}" />
  63. </div>
  64. <div class="layui-form-mid">
  65. </div>
  66. </div>
  67. <div class="layui-form-item">
  68. <label class="layui-form-label">团长提现到账提醒</label>
  69. <div class="layui-input-block">
  70. <input type="text" name="parameter[weprogram_subtemplate_apply_tixian]" class="layui-input" value="{$data['weprogram_subtemplate_apply_tixian']}" />
  71. </div>
  72. <div class="layui-form-mid">
  73. <!--<a href="https://shiziyu.liofis.com/订阅消息模板.docx" style="color:blue;">点击下载设置教程</a>
  74. &nbsp;&nbsp;&nbsp;&nbsp;-->
  75. 需开通小程序类目:商家自营------>服装/鞋/箱包 、 生活服务---->百货/线下超市/便利店
  76. </div>
  77. </div>
  78. <div class="layui-form-item">
  79. <label class="layui-form-label"> </label>
  80. <div class="layui-input-block">
  81. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  82. &nbsp;
  83. <input type="submit" value="一键获取" lay-submit lay-filter="sub_auto_get" class="btn btn-primary" />
  84. </div>
  85. </div>
  86. </form>
  87. </div>
  88. </div>
  89. </div>
  90. <script src="/layuiadmin/layui/layui.js"></script>
  91. <script>
  92. layui.config({
  93. base: '/layuiadmin/' //静态资源所在路径
  94. }).extend({
  95. index: 'lib/index' //主入口模块
  96. }).use('index');
  97. </script>
  98. <script>
  99. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  100. var layer = layui.layer;
  101. var $;
  102. var cur_open_div;
  103. var can_sub = true;
  104. layui.use(['jquery', 'layer','form'], function(){
  105. $ = layui.$;
  106. var form = layui.form;
  107. form.on('radio(linktype)', function(data){
  108. if (data.value == 2) {
  109. $('#typeGroup').show();
  110. } else {
  111. $('#typeGroup').hide();
  112. }
  113. });
  114. form.on('radio(all_msg_send_type)', function(data){
  115. if (data.value == 1) {
  116. $('#type_1').show();
  117. } else if( data.value == 2 )
  118. {
  119. $('#type_1').hide();
  120. $('#type_2').show();
  121. }
  122. else if( data.value == 3 )
  123. {
  124. $('#type_1').hide();
  125. $('#type_2').hide();
  126. }
  127. });
  128. //subtitle
  129. $(document).on("input propertychange","#subtitle",function(){
  130. //("\r|\n|\\s", "");
  131. var s_content = $('#subtitle').val();
  132. s_content.replace(/\r|\n|\\s/g,"");
  133. var regex3 = /\{\{(.+?)\}\}/g; // {}
  134. var new_arr = s_content.match(regex3);
  135. var s_html = "";
  136. for( var i in new_arr )
  137. {
  138. s_html+=' <div class="layui-form-item">';
  139. s_html+=' <label class="layui-form-label">'+new_arr[i]+'内容</label>';
  140. s_html+=' <div class="layui-input-block">';
  141. s_html+=' <input type="text" name="datas['+new_arr[i]+']" class="layui-input" lay-required="true" value="" />';
  142. s_html+=' </div>';
  143. s_html+=' </div>';
  144. }
  145. $('#analy_div').html(s_html);
  146. });
  147. $('#chose_member_id').click(function(){
  148. cur_open_div = $(this).attr('data-input');
  149. $.post("{:U('user/zhenquery', array('ok' => 1))}", {}, function(shtml){
  150. layer.open({
  151. type: 1,
  152. area: '930px',
  153. content: shtml //注意,如果str是object,那么需要字符拼接。
  154. });
  155. });
  156. })
  157. $('#chose_agent_id').click(function(){
  158. cur_open_div = $(this).attr('data-input');
  159. $.post("{:U('user/zhenquery_many', array('template' => 'mult'))}", {}, function(shtml){
  160. layer.open({
  161. type: 1,
  162. area: '930px',
  163. content: shtml //注意,如果str是object,那么需要字符拼接。
  164. });
  165. });
  166. })
  167. $('#chose_link').click(function(){
  168. cur_open_div = $(this).attr('data-input');
  169. $.post("{:U('util/selecturl', array('ok' => 1))}", {}, function(shtml){
  170. layer.open({
  171. type: 1,
  172. area: '930px',
  173. content: shtml //注意,如果str是object,那么需要字符拼接。
  174. });
  175. });
  176. })
  177. form.on('submit(sub_auto_get)', function(data){
  178. var loadingIndex = layer.load(); // 加载中动画遮罩层(1)
  179. $.ajax({
  180. url: "{:U('weprogram/autosubscribetemplateconfig',array('ok'=>'1'))}",
  181. type: 'get',
  182. dataType:'json',
  183. success: function (info) {
  184. layer.close(loadingIndex); // 提交成功失败都需要关闭
  185. if(info.status == 0)
  186. {
  187. layer.msg(info.result.message,{icon: 1,time: 2000});
  188. }else if(info.status == 1){
  189. layer.msg('操作成功',{time: 1000,
  190. end:function(){
  191. var backurl = "{:U('weprogram/subscribetemplateconfig')}";
  192. location.href = backurl;
  193. // location.href = info.result.url;
  194. }
  195. });
  196. can_sub = true;
  197. }
  198. }
  199. });
  200. return false;
  201. })
  202. //监听提交
  203. form.on('submit(formDemo)', function(data){
  204. var gd_ar = [];
  205. var gd_str = '';
  206. $('.mult_choose_member_id').each(function(){
  207. gd_ar.push( $(this).attr('data-member-id') );
  208. })
  209. gd_str = gd_ar.join(',');
  210. data.field.limit_user_list = gd_str;
  211. $.ajax({
  212. url: data.form.action,
  213. type: data.form.method,
  214. data: data.field,
  215. dataType:'json',
  216. success: function (info) {
  217. if(info.status == 0)
  218. {
  219. layer.msg(info.result.message,{icon: 1,time: 2000});
  220. }else if(info.status == 1){
  221. var go_url = location.href;
  222. if( info.result.hasOwnProperty("url") )
  223. {
  224. go_url = info.result.url;
  225. }
  226. layer.msg('操作成功',{time: 1000,
  227. end:function(){
  228. location.href = info.result.url;
  229. }
  230. });
  231. }
  232. }
  233. });
  234. return false;
  235. });
  236. })
  237. function cancle_bind(obj,sdiv)
  238. {
  239. $('#'+sdiv).val('');
  240. $(obj).parent().parent().remove();
  241. }
  242. </script>
  243. </body>