subscribetemplateconfig.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  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-card-body" style="padding:15px;display:block" >
  52. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  53. <div class="layui-form-item">
  54. <label class="layui-form-label">订单支付成功通知</label>
  55. <div class="layui-input-block">
  56. <input type="text" name="parameter[weprogram_subtemplate_pay_order]" class="layui-input" value="{$data['weprogram_subtemplate_pay_order']}" />
  57. </div>
  58. </div>
  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_send_order]" class="layui-input" value="{$data['weprogram_subtemplate_send_order']}" />
  63. </div>
  64. </div>
  65. <div class="layui-form-item" >
  66. <label class="layui-form-label">核销成功通知</label>
  67. <div class="layui-input-block">
  68. <input type="text" name="parameter[weprogram_subtemplate_hexiao_success]" class="layui-input" value="{$data['weprogram_subtemplate_hexiao_success']}" />
  69. </div>
  70. </div>
  71. <div class="layui-form-item" style="display:none;">
  72. <label class="layui-form-label">退款成功通知</label>
  73. <div class="layui-input-block">
  74. <input type="text" name="parameter[weprogram_subtemplate_refund_order]" class="layui-input" value="{$data['weprogram_subtemplate_refund_order']}" />
  75. </div>
  76. </div>
  77. <div class="layui-form-item">
  78. <label class="layui-form-label">团长申请成功发送通知</label>
  79. <div class="layui-input-block">
  80. <input type="text" name="parameter[weprogram_subtemplate_apply_community]" class="layui-input" value="{$data['weprogram_subtemplate_apply_community']}" />
  81. </div>
  82. </div>
  83. <div class="layui-form-item">
  84. <label class="layui-form-label">开团成功发送通知</label>
  85. <div class="layui-input-block">
  86. <input type="text" name="parameter[weprogram_subtemplate_open_tuan]" class="layui-input" value="{$data['weprogram_subtemplate_open_tuan']}" />
  87. </div>
  88. <div class="layui-form-mid">
  89. </div>
  90. </div>
  91. <div class="layui-form-item">
  92. <label class="layui-form-label">参团成功发送通知</label>
  93. <div class="layui-input-block">
  94. <input type="text" name="parameter[weprogram_subtemplate_take_tuan]" class="layui-input" value="{$data['weprogram_subtemplate_take_tuan']}" />
  95. </div>
  96. <div class="layui-form-mid">
  97. </div>
  98. </div>
  99. <div class="layui-form-item">
  100. <label class="layui-form-label">拼团成功发送通知</label>
  101. <div class="layui-input-block">
  102. <input type="text" name="parameter[weprogram_subtemplate_pin_tuansuccess]" class="layui-input" value="{$data['weprogram_subtemplate_pin_tuansuccess']}" />
  103. </div>
  104. <div class="layui-form-mid">
  105. </div>
  106. </div>
  107. <div class="layui-form-item">
  108. <label class="layui-form-label">预售商品到货通知</label>
  109. <div class="layui-input-block">
  110. <input type="text" name="parameter[weprogram_subtemplate_presale_ordercan_continuepay]" class="layui-input" value="{$data['weprogram_subtemplate_presale_ordercan_continuepay']}" />
  111. </div>
  112. <div class="layui-form-mid">
  113. </div>
  114. </div>
  115. <div class="layui-form-item">
  116. <label class="layui-form-label">团长提现到账提醒</label>
  117. <div class="layui-input-block">
  118. <input type="text" name="parameter[weprogram_subtemplate_apply_tixian]" class="layui-input" value="{$data['weprogram_subtemplate_apply_tixian']}" />
  119. </div>
  120. <div class="layui-form-mid">
  121. <!--<a href="https://shiziyu.liofis.com/订阅消息模板.docx" style="color:blue;">点击下载设置教程</a>
  122. &nbsp;&nbsp;&nbsp;&nbsp;-->
  123. 需开通小程序类目:商家自营------>服装/鞋/箱包 、 生活服务---->百货/线下超市/便利店
  124. </div>
  125. </div>
  126. <div class="layui-form-item">
  127. <label class="layui-form-label"> </label>
  128. <div class="layui-input-block">
  129. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  130. &nbsp;
  131. <input type="submit" value="一键获取" lay-submit lay-filter="sub_auto_get" class="btn btn-primary" />
  132. </div>
  133. </div>
  134. </form>
  135. </div>
  136. </div>
  137. </div>
  138. <script src="/layuiadmin/layui/layui.js"></script>
  139. <script>
  140. layui.config({
  141. base: '/layuiadmin/' //静态资源所在路径
  142. }).extend({
  143. index: 'lib/index' //主入口模块
  144. }).use('index');
  145. </script>
  146. <script>
  147. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  148. var layer = layui.layer;
  149. var $;
  150. var cur_open_div;
  151. var can_sub = true;
  152. layui.use(['jquery', 'layer','form'], function(){
  153. $ = layui.$;
  154. var form = layui.form;
  155. form.on('radio(linktype)', function(data){
  156. if (data.value == 2) {
  157. $('#typeGroup').show();
  158. } else {
  159. $('#typeGroup').hide();
  160. }
  161. });
  162. form.on('radio(all_msg_send_type)', function(data){
  163. if (data.value == 1) {
  164. $('#type_1').show();
  165. } else if( data.value == 2 )
  166. {
  167. $('#type_1').hide();
  168. $('#type_2').show();
  169. }
  170. else if( data.value == 3 )
  171. {
  172. $('#type_1').hide();
  173. $('#type_2').hide();
  174. }
  175. });
  176. //subtitle
  177. $(document).on("input propertychange","#subtitle",function(){
  178. //("\r|\n|\\s", "");
  179. var s_content = $('#subtitle').val();
  180. s_content.replace(/\r|\n|\\s/g,"");
  181. var regex3 = /\{\{(.+?)\}\}/g; // {}
  182. var new_arr = s_content.match(regex3);
  183. var s_html = "";
  184. for( var i in new_arr )
  185. {
  186. s_html+=' <div class="layui-form-item">';
  187. s_html+=' <label class="layui-form-label">'+new_arr[i]+'内容</label>';
  188. s_html+=' <div class="layui-input-block">';
  189. s_html+=' <input type="text" name="datas['+new_arr[i]+']" class="layui-input" lay-required="true" value="" />';
  190. s_html+=' </div>';
  191. s_html+=' </div>';
  192. }
  193. $('#analy_div').html(s_html);
  194. });
  195. $('#chose_member_id').click(function(){
  196. cur_open_div = $(this).attr('data-input');
  197. $.post("{:U('user/zhenquery', array('ok' => 1))}", {}, function(shtml){
  198. layer.open({
  199. type: 1,
  200. area: '930px',
  201. content: shtml //注意,如果str是object,那么需要字符拼接。
  202. });
  203. });
  204. })
  205. $('#chose_agent_id').click(function(){
  206. cur_open_div = $(this).attr('data-input');
  207. $.post("{:U('user/zhenquery_many', array('template' => 'mult'))}", {}, function(shtml){
  208. layer.open({
  209. type: 1,
  210. area: '930px',
  211. content: shtml //注意,如果str是object,那么需要字符拼接。
  212. });
  213. });
  214. })
  215. $('#chose_link').click(function(){
  216. cur_open_div = $(this).attr('data-input');
  217. $.post("{:U('util/selecturl', array('ok' => 1))}", {}, function(shtml){
  218. layer.open({
  219. type: 1,
  220. area: '930px',
  221. content: shtml //注意,如果str是object,那么需要字符拼接。
  222. });
  223. });
  224. })
  225. form.on('submit(sub_auto_get)', function(data){
  226. var loadingIndex = layer.load(); // 加载中动画遮罩层(1)
  227. $.ajax({
  228. url: "{:U('weprogram/autosubscribetemplateconfig',array('ok'=>'1'))}",
  229. type: 'get',
  230. dataType:'json',
  231. success: function (info) {
  232. layer.close(loadingIndex); // 提交成功失败都需要关闭
  233. if(info.status == 0)
  234. {
  235. layer.msg(info.result.message,{icon: 1,time: 2000});
  236. }else if(info.status == 1){
  237. layer.msg('操作成功',{time: 1000,
  238. end:function(){
  239. var backurl = "{:U('weprogram/subscribetemplateconfig')}";
  240. location.href = backurl;
  241. // location.href = info.result.url;
  242. }
  243. });
  244. can_sub = true;
  245. }
  246. }
  247. });
  248. return false;
  249. })
  250. //监听提交
  251. form.on('submit(formDemo)', function(data){
  252. var gd_ar = [];
  253. var gd_str = '';
  254. $('.mult_choose_member_id').each(function(){
  255. gd_ar.push( $(this).attr('data-member-id') );
  256. })
  257. gd_str = gd_ar.join(',');
  258. data.field.limit_user_list = gd_str;
  259. $.ajax({
  260. url: data.form.action,
  261. type: data.form.method,
  262. data: data.field,
  263. dataType:'json',
  264. success: function (info) {
  265. if(info.status == 0)
  266. {
  267. layer.msg(info.result.message,{icon: 1,time: 2000});
  268. }else if(info.status == 1){
  269. var go_url = location.href;
  270. if( info.result.hasOwnProperty("url") )
  271. {
  272. go_url = info.result.url;
  273. }
  274. layer.msg('操作成功',{time: 1000,
  275. end:function(){
  276. location.href = info.result.url;
  277. }
  278. });
  279. }
  280. }
  281. });
  282. return false;
  283. });
  284. })
  285. function cancle_bind(obj,sdiv)
  286. {
  287. $('#'+sdiv).val('');
  288. $(obj).parent().parent().remove();
  289. }
  290. </script>
  291. </body>