seckill.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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. </head>
  45. <body layadmin-themealias="default">
  46. <div class="layui-fluid">
  47. <div class="layui-card">
  48. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">秒杀设置</span></div>
  49. <div class="layui-card-body" style="padding:15px;">
  50. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  51. <div class="layui-form-item" >
  52. <label class="layui-form-label">秒杀活动</label>
  53. <div class="layui-input-block">
  54. <input type="radio" name="data[seckill_is_open]" <?php if( !isset($data['seckill_is_open']) || $data['seckill_is_open'] ==0 ){ ?> checked <?php } ?> value="0" title="关闭" />
  55. <input type="radio" name="data[seckill_is_open]" <?php if( isset($data['seckill_is_open']) && $data['seckill_is_open'] ==1 ){ ?> checked <?php } ?> value="1" title="开启" />
  56. </div>
  57. </div>
  58. <div class="layui-form-item" >
  59. <label class="layui-form-label">首页显示</label>
  60. <div class="layui-input-block">
  61. <input type="radio" name="data[seckill_is_show_index]" <?php if( !isset($data['seckill_is_show_index']) || $data['seckill_is_show_index'] ==0 ){ ?> checked <?php } ?> value="0" title="关闭" />
  62. <input type="radio" name="data[seckill_is_show_index]" <?php if( isset($data['seckill_is_show_index']) && $data['seckill_is_show_index'] ==1 ){ ?> checked <?php } ?> value="1" title="开启" />
  63. </div>
  64. <span class='layui-form-mid'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;首页显示“封面图+秒杀商品” </span>
  65. </div>
  66. <div class="layui-form-item">
  67. <label class="layui-form-label must"> 秒杀主页标题</label>
  68. <div class="layui-input-block">
  69. <input type="text" name="data[seckill_page_title]" class="form-control" value="{$data['seckill_page_title']}" data-rule-required="true" />
  70. <span class='layui-form-mid'>默认标题为:商品秒杀</span>
  71. </div>
  72. </div>
  73. <div class="layui-form-item">
  74. <label class="layui-form-label">首页秒杀活动背景色</label>
  75. <div class="layui-input-block">
  76. <div class="" style="margin:0px;">
  77. <div class="layui-input-inline" style="width: 120px;">
  78. <input type="text" name="data[seckill_bg_color]" value="{$data['seckill_bg_color']}" placeholder="请选择颜色" class="layui-input" id="test-colorpicker-form-input">
  79. </div>
  80. <div class="layui-inline" style="left: -11px;">
  81. <div id="minicolors"></div>
  82. </div>
  83. </div>
  84. <span class='layui-form-mid'>秒杀背景颜色自定义,不设置默认 <font color="#25d6e6">#25d6e6</font>绿色</span>
  85. </div>
  86. </div>
  87. <div class="layui-form-item">
  88. <label class="layui-form-label must">整点秒杀显示时间</label>
  89. <div class="layui-input-block">
  90. <div>
  91. <label class="checkbox-inline" >
  92. <input type="checkbox" lay-ignore="" lay-filter="scekill_show_time2" name="scekill_show_time[]" value="25" class="perm-itemall" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(25, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">全选
  93. </label>
  94. </div>
  95. <div style="margin-top: 5px;">
  96. <label class="checkbox-inline">
  97. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="0" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(0, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">00:00
  98. </label>
  99. <label class="checkbox-inline">
  100. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="1" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(1, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">01:00
  101. </label>
  102. <label class="checkbox-inline">
  103. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="2" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(2, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">02:00
  104. </label>
  105. <label class="checkbox-inline">
  106. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="3" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(3, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">03:00
  107. </label>
  108. <label class="checkbox-inline">
  109. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="4" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(4, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">04:00
  110. </label>
  111. <label class="checkbox-inline">
  112. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="5" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(5, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">05:00
  113. </label>
  114. <label class="checkbox-inline">
  115. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="6" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(6, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">06:00
  116. </label>
  117. </div>
  118. <div style="margin-top: 5px;">
  119. <label class="checkbox-inline">
  120. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="7" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(7, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">07:00
  121. </label>
  122. <label class="checkbox-inline">
  123. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="8" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(8, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">08:00
  124. </label>
  125. <label class="checkbox-inline">
  126. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="9" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(9, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">09:00
  127. </label>
  128. <label class="checkbox-inline">
  129. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="10" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(10, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">10:00
  130. </label>
  131. <label class="checkbox-inline">
  132. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="11" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(11, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">11:00
  133. </label>
  134. <label class="checkbox-inline">
  135. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="12" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(12, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">12:00
  136. </label>
  137. <label class="checkbox-inline">
  138. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="13" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(13, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">13:00
  139. </label>
  140. </div>
  141. <div style="margin-top: 5px;">
  142. <label class="checkbox-inline">
  143. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="14" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(14, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">14:00
  144. </label>
  145. <label class="checkbox-inline">
  146. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="15" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(15, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">15:00
  147. </label>
  148. <label class="checkbox-inline">
  149. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="16" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(16, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">16:00
  150. </label>
  151. <label class="checkbox-inline">
  152. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="17" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(17, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">17:00
  153. </label>
  154. <label class="checkbox-inline">
  155. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="18" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(18, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">18:00
  156. </label>
  157. <label class="checkbox-inline">
  158. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="19" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(19, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">19:00
  159. </label>
  160. <label class="checkbox-inline">
  161. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="20" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(20, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">20:00
  162. </label>
  163. </div>
  164. <div style="margin-top: 5px;">
  165. <label class="checkbox-inline">
  166. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="21" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(21, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">21:00
  167. </label>
  168. <label class="checkbox-inline">
  169. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="22" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(22, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">22:00
  170. </label>
  171. <label class="checkbox-inline">
  172. <input type="checkbox" lay-ignore="" name="scekill_show_time[]" value="23" class="perm-item" <?php if( !empty($data) && is_array( $data['scekill_show_time_arr'] ) && in_array(23, $data['scekill_show_time_arr']) ){ ?> checked<?php } ?> title="" style="display: inline-block;">23:00
  173. </label>
  174. </div>
  175. </div>
  176. </div>
  177. <div class="layui-form-item">
  178. <label class="layui-form-label"> 秒杀活动分享标题</label>
  179. <div class="layui-input-block">
  180. <input type="text" name="data[seckill_share_title]" class="form-control" value="{$data['seckill_share_title']}" data-rule-required="true" />
  181. </div>
  182. </div>
  183. <div class="layui-form-item" >
  184. <label class="layui-form-label">秒杀活动分享图片</label>
  185. <div class="layui-input-block">
  186. {:tpl_form_field_image2('data[seckill_share_image]', $data['seckill_share_image'])}
  187. <span class='layui-form-mid'></span>
  188. </div>
  189. </div>
  190. <div class="layui-form-item">
  191. <label class="layui-form-label"></label>
  192. <div class="layui-input-block">
  193. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  194. </div>
  195. </div>
  196. </form>
  197. </div>
  198. </div>
  199. </div>
  200. <script src="/layuiadmin/layui/layui.js"></script>
  201. <script>
  202. layui.config({
  203. base: '/layuiadmin/' //静态资源所在路径
  204. }).extend({
  205. index: 'lib/index' //主入口模块
  206. }).use('index');
  207. </script>
  208. <script>
  209. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  210. var layer = layui.layer;
  211. var $;
  212. layui.use(['jquery', 'layer','form','colorpicker'], function(){
  213. $ = layui.$;
  214. var form = layui.form;
  215. var colorpicker = layui.colorpicker;
  216. //表单赋值
  217. colorpicker.render({
  218. elem: '#minicolors'
  219. ,color: '{$data['seckill_bg_color']}'
  220. ,done: function(color){
  221. $('#test-colorpicker-form-input').val(color);
  222. }
  223. });
  224. $('.perm-itemall').click(function(){
  225. if( $(this).prop('checked') )
  226. {
  227. $(".perm-item").each(function(){
  228. $(this).prop("checked",true);
  229. })
  230. }else{
  231. $(".perm-item").each(function(){
  232. $(this).prop("checked",false);
  233. })
  234. }
  235. })
  236. form.on('radio(open_buy_send_score)', function(data){
  237. if(data.value == 1)
  238. {
  239. $('#txtPickupDateTip').show();
  240. }else{
  241. $('#txtPickupDateTip').hide();
  242. }
  243. });
  244. form.on('radio(open_score_buy_score)', function(data){
  245. if(data.value == 1)
  246. {
  247. $('#openscorebuyscoreTip').show();
  248. $('#openscorebuyscoreTip2').show();
  249. }else{
  250. $('#openscorebuyscoreTip').hide();
  251. $('#openscorebuyscoreTip2').hide();
  252. }
  253. });
  254. //监听提交
  255. form.on('submit(formDemo)', function(data){
  256. $.ajax({
  257. url: data.form.action,
  258. type: data.form.method,
  259. data: data.field,
  260. dataType:'json',
  261. success: function (info) {
  262. if(info.status == 0)
  263. {
  264. layer.msg(info.result.message,{icon: 1,time: 2000});
  265. }else if(info.status == 1){
  266. var go_url = location.href;
  267. if( info.result.hasOwnProperty("url") )
  268. {
  269. go_url = info.result.url;
  270. }
  271. layer.msg('操作成功',{time: 1000,
  272. end:function(){
  273. location.href = info.result.url;
  274. }
  275. });
  276. }
  277. }
  278. });
  279. return false;
  280. });
  281. })
  282. </script>
  283. </body>