addspecial.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  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. <style type="text/css">
  45. .input-group .input-group-addon { padding: 0 5px; }
  46. .goods_tip{position: absolute;top: 0;color: red;left: 100px;}
  47. </style>
  48. <style type='text/css'>
  49. .tabs-container .layui-form-item {overflow: hidden;}
  50. .tabs-container .tabs-left > .nav-tabs {}
  51. .tab-goods .nav li {float:left;}
  52. .spec_item_thumb {position: relative; width: 30px; height: 20px; padding: 0; border-left: none;}
  53. .spec_item_thumb i {position: absolute; top: -5px; right: -5px;}
  54. .input-group .spec_item_thumb{padding:0px;}
  55. .multi-img-details {margin-top:.5em;max-width: 700px; padding:0; }
  56. .multi-audio-details .multi-audio-item {width:155px; height: 40px; position:relative; float: left; margin-right: 5px;}
  57. .region-goods-details {
  58. background: #f8f8f8;
  59. margin-bottom: 10px;
  60. padding: 0 10px;
  61. }
  62. .region-goods-left{
  63. text-align: center;
  64. font-weight: bold;
  65. color: #333;
  66. font-size: 14px;
  67. padding: 20px 0;
  68. }
  69. .region-goods-right{
  70. border-left: 3px solid #fff;
  71. padding: 10px 10px;
  72. }
  73. .input-group .input-group-btn .btn:hover{background-color:#5bc0de}
  74. .layui-form-select{display:none;}
  75. .input-group .input-group-addon{}
  76. .container{width: 100%;}
  77. </style>
  78. <style>
  79. tbody tr td{
  80. position: relative;
  81. }
  82. tbody tr .icow-weibiaoti--{
  83. visibility: hidden;
  84. display: inline-block;
  85. color: #fff;
  86. height:18px;
  87. width:18px;
  88. background: #e0e0e0;
  89. text-align: center;
  90. line-height: 18px;
  91. vertical-align: middle;
  92. }
  93. tbody tr:hover .icow-weibiaoti--{
  94. visibility: visible;
  95. }
  96. tbody tr .icow-weibiaoti--.hidden{
  97. visibility: hidden !important;
  98. }
  99. .full .icow-weibiaoti--{
  100. margin-left:10px;
  101. }
  102. .full>span{
  103. display: -webkit-box;
  104. display: -webkit-flex;
  105. display: -ms-flexbox;
  106. display: flex;
  107. vertical-align: middle;
  108. align-items: center;
  109. }
  110. tbody tr .label{
  111. margin: 5px 0;
  112. }
  113. .goods_attribute a{
  114. cursor: pointer;
  115. }
  116. .newgoodsflag{
  117. width: 22px;height: 16px;
  118. background-color: #ff0000;
  119. color: #fff;
  120. text-align: center;
  121. position: absolute;
  122. bottom: 70px;
  123. left: 57px;
  124. font-size: 12px;
  125. }
  126. .a{cursor: pointer;}
  127. .daterangepicker select.ampmselect, .daterangepicker select.hourselect, .daterangepicker select.minuteselect{
  128. width:auto!important;
  129. }
  130. .we7-modal-dialog .modal-footer, .modal-dialog .modal-footer{padding:0px;}
  131. .modal-footer{padding:0px;}
  132. .daterangepicker select.ampmselect, .daterangepicker select.hourselect, .daterangepicker select.minuteselect {
  133. width: auto!important;
  134. }
  135. </style>
  136. </head>
  137. <body layadmin-themealias="default">
  138. <div class="layui-fluid">
  139. <div class="layui-card">
  140. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text"><?php if(!empty($item['id'])){ ?>编辑<?php }else{ ?>添加<?php } ?>专题 <small><?php if(!empty($item['id'])){ ?>修改【{$item['name']}】<?php } ?></small></span></div>
  141. <div class="layui-card-body" style="padding:15px;">
  142. <form action="" method="post" class="layui-form" enctype="multipart/form-data" >
  143. <input type="hidden" name="id" value="{$item['id']}">
  144. <div class="layui-form-item">
  145. <label class="layui-form-label must">活动名称</label>
  146. <div class="layui-input-block">
  147. <input type="text" name="name" class="form-control" value="{$item['name']}" lay-verify="required" />
  148. </div>
  149. </div>
  150. <div class="layui-form-item">
  151. <label class="layui-form-label">活动首页入口图片</label>
  152. <div class="layui-input-block">
  153. {:tpl_form_field_image2('cover', $item['cover'], '', array('extras'=>array('text'=>'placeholder="必填"')) )}
  154. </div>
  155. </div>
  156. <div class="layui-form-item">
  157. <label class="layui-form-label">活动首页入口样式</label>
  158. <div class="layui-input-block" >
  159. <input type="radio" name="type" value="0" <?php if(empty($item) || $item['type'] == 0){ ?>checked="true"<?php } ?> title="单图模式" />
  160. <input type="radio" name="type" value="1" <?php if(!empty($item) && $item['type'] == 1){ ?>checked="true"<?php } ?> title="单图+商品模式" />
  161. </div>
  162. </div>
  163. <div class="layui-form-item">
  164. <label class="layui-form-label must">活动页面主题标题</label>
  165. <div class="layui-input-block">
  166. <input type="text" name="special_title" class="form-control" value="{$item['special_title']}" data-rule-required="true" />
  167. </div>
  168. </div>
  169. <div class="layui-form-item">
  170. <label class="layui-form-label">活动页面主题图片</label>
  171. <div class="layui-input-block">
  172. {:tpl_form_field_image2('special_cover', $item['special_cover'])}
  173. </div>
  174. </div>
  175. <div class="layui-form-item">
  176. <label class="layui-form-label">活动页面背景颜色</label>
  177. <div class="layui-input-block">
  178. <div style="margin:0px;">
  179. <div class="layui-input-inline" style="width: 120px;">
  180. <input type="text" name="bg_color" value="{$item['bg_color']}" placeholder="请选择颜色" class="layui-input" id="test-colorpicker-form-input">
  181. </div>
  182. <div class="layui-inline" style="left: -11px;">
  183. <div id="minicolors"></div>
  184. </div>
  185. </div>
  186. <span class='help-block'>背景颜色值,有效值为十六进制颜色。默认色值:#F6F6F6</span>
  187. </div>
  188. </div>
  189. <div class="layui-form-item">
  190. <label class="layui-form-label">活动时间</label>
  191. <div class="layui-input-block">
  192. {:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime)),true);}
  193. </div>
  194. </div>
  195. <div class="layui-form-item">
  196. <label class="layui-form-label">排序</label>
  197. <div class="layui-input-block">
  198. <input type="text" name="displayorder" class="form-control" value="{$item['displayorder']}" />
  199. <span class='help-block'>数字越大越靠前</span>
  200. </div>
  201. </div>
  202. <div class="layui-form-item">
  203. <label class="layui-form-label">活动状态</label>
  204. <div class="layui-input-block" >
  205. <input type="radio" name="enabled" value="1" <?php if( $item['enabled'] == 1){ ?>checked="true"<?php } ?> title="开启" />
  206. <input type="radio" name="enabled" value="0" <?php if(empty($item['enabled']) || $item['enabled'] == 0){ ?>checked="true"<?php } ?> title="关闭" />
  207. </div>
  208. </div>
  209. <div class="layui-form-item">
  210. <label class="layui-form-label">首页显示</label>
  211. <div class="layui-input-block" >
  212. <input type="radio" name="is_index" value="1" <?php if($item['is_index'] == 1){ ?>checked="true"<?php } ?> title="是" />
  213. <input type="radio" name="is_index" value="0" <?php if(empty($item['is_index']) || $item['is_index'] == 0){ ?>checked="true"<?php } ?> title="否" />
  214. </div>
  215. </div>
  216. <div class="layui-form-item">
  217. <label class="layui-form-label">首页显示位置</label>
  218. <div class="layui-input-block" >
  219. <input type="radio" name="index_pos" value="0" <?php if(empty($item['index_pos']) || $item['index_pos'] == 0){ ?>checked="true"<?php } ?> title="分类顶上" />
  220. <input type="radio" name="index_pos" value="1" <?php if($item['index_pos'] == 1){ ?>checked="true"<?php } ?> title="首页底部" />
  221. </div>
  222. </div>
  223. <div class="layui-form-item">
  224. <label class="layui-form-label">展示模式</label>
  225. <div class="layui-input-block" >
  226. <input type="radio" name="show_type" value="0" <?php if(empty($item['show_type']) || $item['show_type'] == 0){ ?>checked="true"<?php } ?> title="小图" />
  227. <input type="radio" name="show_type" value="1" <?php if($item['show_type'] == 1){ ?>checked="true"<?php } ?> title="大图" />
  228. <input type="radio" name="show_type" value="2" <?php if($item['show_type'] == 2){ ?>checked="true"<?php } ?> title="一行三个商品" />
  229. </div>
  230. </div>
  231. <div class="layui-form-item" id="goods_form_item">
  232. <label class="layui-form-label">选择推荐商品</label>
  233. <div class="layui-input-block">
  234. <div class="input-group " style="margin: 0;">
  235. <input type="text" disabled value="" class="form-control valid" name="" placeholder="" id="agent_id">
  236. <span class="input-group-btn">
  237. <span data-input="#agent_id" id="chose_agent_id" class="btn btn-default">选择推荐商品</span>
  238. </span>
  239. </div>
  240. <?php if(!empty($limit_goods)){ ?>
  241. <?php foreach( $limit_goods as $goods ){ ?>
  242. <div class="input-group mult_choose_goodsid" data-gid="{$goods['gid']}" style="border-radius: 0;float: left;margin: 10px;margin-left:0px;width: 22%;">
  243. <div class="layadmin-text-center choose_user">
  244. <img style="" src="{$goods['image']}">
  245. <div class="layadmin-maillist-img" style="">{$goods['goodsname']}</div>
  246. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this)">
  247. <i class="layui-icon"></i>
  248. </button>
  249. <div class="goods_tip">
  250. <?php if($goods['is_finished'] == 1){ ?>
  251. <span>[已结束]&nbsp;</span>
  252. <?php } ?>
  253. <?php if($goods['is_grab'] == 1){ ?>
  254. <span>[已抢光]</span>
  255. <?php } ?>
  256. <?php if($goods['grounding'] == 0){ ?>
  257. <span>[已下架]</span>
  258. <?php } else if($goods['grounding'] == 3){ ?>
  259. <span>[已删除]</span>
  260. <?php } ?>
  261. </div>
  262. </div>
  263. </div>
  264. <?php }} ?>
  265. </div>
  266. </div>
  267. <div class="layui-form-item">
  268. <label class="layui-form-label"></label>
  269. <div class="layui-input-block">
  270. <input type="hidden" name="limit_goods_list" value="{$item['goodsids']}" id="limit_goods_list" />
  271. <input type="submit" name="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary col-lg-1"/>
  272. </div>
  273. </div>
  274. </form>
  275. </div>
  276. </div>
  277. </div>
  278. <script src="/layuiadmin/layui/layui.js"></script>
  279. <script>
  280. layui.config({
  281. base: '/layuiadmin/' //静态资源所在路径
  282. }).extend({
  283. index: 'lib/index' //主入口模块
  284. }).use('index');
  285. </script>
  286. <script>
  287. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  288. var layer = layui.layer;
  289. var $;
  290. var cur_open_div;
  291. layui.use(['jquery', 'layer','form','colorpicker'], function(){
  292. $ = layui.$;
  293. var colorpicker = layui.colorpicker;
  294. //背景颜色
  295. var bg_color = '{$item["bg_color"]}';
  296. colorpicker.render({
  297. elem: '#minicolors'
  298. ,color: bg_color ? bg_color : '#F6F6F6'
  299. ,done: function(color){
  300. $('#test-colorpicker-form-input').val(color);
  301. }
  302. });
  303. var form = layui.form;
  304. $('#chose_agent_id').click(function(){
  305. cur_open_div = $(this).attr('data-input');
  306. $.post("{:U('goods/query_normal', array('template' => 'mult'))}", {}, function(shtml){
  307. layer.open({
  308. type: 1,
  309. area: '930px',
  310. content: shtml //注意,如果str是object,那么需要字符拼接。
  311. });
  312. });
  313. })
  314. $('#chose_link').click(function(){
  315. cur_open_div = $(this).attr('data-input');
  316. $.post("{:U('util/selecturl', array('ok' => 1))}", {}, function(shtml){
  317. layer.open({
  318. type: 1,
  319. area: '930px',
  320. content: shtml //注意,如果str是object,那么需要字符拼接。
  321. });
  322. });
  323. })
  324. //监听提交
  325. form.on('submit(formDemo)', function(data){
  326. //mult_choose_goodsid limit_goods_list
  327. var gd_ar = [];
  328. var gd_str = '';
  329. $('.mult_choose_goodsid').each(function(){
  330. gd_ar.push( $(this).attr('data-gid') );
  331. })
  332. gd_str = gd_ar.join(',');
  333. data.field.limit_goods_list = gd_str;
  334. var cover = $("input[name='cover']").val();
  335. if(cover=='') {
  336. layer.msg('活动首页入口图片必须上传', {icon: 5});
  337. return false;
  338. }
  339. $.ajax({
  340. url: data.form.action,
  341. type: data.form.method,
  342. data: data.field,
  343. dataType:'json',
  344. success: function (info) {
  345. if(info.status == 0)
  346. {
  347. layer.msg(info.result.message,{icon: 1,time: 2000});
  348. }else if(info.status == 1){
  349. var go_url = location.href;
  350. if( info.result.hasOwnProperty("url") )
  351. {
  352. go_url = info.result.url;
  353. }
  354. layer.msg('操作成功',{time: 1000,
  355. end:function(){
  356. var backurl = "{:U('marketing/special',array('ok'=>'1'))}";
  357. location.href = backurl;
  358. // location.href = info.result.url;
  359. }
  360. });
  361. }
  362. }
  363. });
  364. return false;
  365. });
  366. })
  367. function cancle_bind(obj,sdiv)
  368. {
  369. $('#'+sdiv).val('');
  370. $(obj).parent().parent().remove();
  371. }
  372. </script>
  373. </body>
  374. </html>