Açıklama Yok
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

active_add.htm 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. {include file="public/layout" /}
  2. <body class="bodystyle">
  3. <div id="append_parent"></div>
  4. <div id="ajaxwaitid"></div>
  5. <div class="page">
  6. <div class="flexigrid">
  7. <div class="ncap-form-default">
  8. <form class="form-horizontal" id="post_form" action="{:url('Sharp/active_add')}" method="post">
  9. <dl class="row">
  10. <dt class="tit">
  11. <label for="limit"><em>*</em>活动日期</label>
  12. </dt>
  13. <dd class="opt">
  14. <input type="text" class="input-txt" id="active_date" name="active_date" placeholder="比如:2020-05-20" autocomplete="off">
  15. </dd>
  16. </dl>
  17. <dl class="row">
  18. <dt class="tit">
  19. <label for="seckill_price"><em>*</em>活动场次</label>
  20. </dt>
  21. <dd class="opt">
  22. <label class="curpoin"><input type="checkbox" name="active_time[]" value="0" />00:00</label>&nbsp;&nbsp;&nbsp;
  23. <label class="curpoin"><input type="checkbox" name="active_time[]" value="1" />01:00</label>&nbsp;&nbsp;&nbsp;
  24. <label class="curpoin"><input type="checkbox" name="active_time[]" value="2" />02:00</label>&nbsp;&nbsp;&nbsp;
  25. <label class="curpoin"><input type="checkbox" name="active_time[]" value="3" />03:00</label>&nbsp;&nbsp;&nbsp;
  26. <label class="curpoin"><input type="checkbox" name="active_time[]" value="4" />04:00</label>&nbsp;&nbsp;&nbsp;
  27. <label class="curpoin"><input type="checkbox" name="active_time[]" value="5" />05:00</label>&nbsp;&nbsp;&nbsp;<br>
  28. <label class="curpoin"><input type="checkbox" name="active_time[]" value="6" />06:00</label>&nbsp;&nbsp;&nbsp;
  29. <label class="curpoin"><input type="checkbox" name="active_time[]" value="7" />07:00</label>&nbsp;&nbsp;&nbsp;
  30. <label class="curpoin"><input type="checkbox" name="active_time[]" value="8" />08:00</label>&nbsp;&nbsp;&nbsp;
  31. <label class="curpoin"><input type="checkbox" name="active_time[]" value="9" />09:00</label>&nbsp;&nbsp;&nbsp;
  32. <label class="curpoin"><input type="checkbox" name="active_time[]" value="10" />10:00</label>&nbsp;&nbsp;&nbsp;
  33. <label class="curpoin"><input type="checkbox" name="active_time[]" value="11" />11:00</label>&nbsp;&nbsp;&nbsp;<br>
  34. <label class="curpoin"><input type="checkbox" name="active_time[]" value="12" />12:00</label>&nbsp;&nbsp;&nbsp;
  35. <label class="curpoin"><input type="checkbox" name="active_time[]" value="13" />13:00</label>&nbsp;&nbsp;&nbsp;
  36. <label class="curpoin"><input type="checkbox" name="active_time[]" value="14" />14:00</label>&nbsp;&nbsp;&nbsp;
  37. <label class="curpoin"><input type="checkbox" name="active_time[]" value="15" />15:00</label>&nbsp;&nbsp;&nbsp;
  38. <label class="curpoin"><input type="checkbox" name="active_time[]" value="16" />16:00</label>&nbsp;&nbsp;&nbsp;
  39. <label class="curpoin"><input type="checkbox" name="active_time[]" value="17" />17:00</label>&nbsp;&nbsp;&nbsp;<br>
  40. <label class="curpoin"><input type="checkbox" name="active_time[]" value="18" />18:00</label>&nbsp;&nbsp;&nbsp;
  41. <label class="curpoin"><input type="checkbox" name="active_time[]" value="19" />19:00</label>&nbsp;&nbsp;&nbsp;
  42. <label class="curpoin"><input type="checkbox" name="active_time[]" value="20" />20:00</label>&nbsp;&nbsp;&nbsp;
  43. <label class="curpoin"><input type="checkbox" name="active_time[]" value="21" />21:00</label>&nbsp;&nbsp;&nbsp;
  44. <label class="curpoin"><input type="checkbox" name="active_time[]" value="22" />22:00</label>&nbsp;&nbsp;&nbsp;
  45. <label class="curpoin"><input type="checkbox" name="active_time[]" value="23" />23:00</label>&nbsp;&nbsp;&nbsp;
  46. <span class="err"></span>
  47. <p class="notic"></p>
  48. </dd>
  49. </dl>
  50. <dl class="row">
  51. <dt class="tit">
  52. <label for="total_stock">选择商品 </label>
  53. </dt>
  54. <dd class="opt">
  55. <a href="javascript:void(0);" onclick="choGoods();" class="ncap-btn ncap-btn-green"><i class="layui-icon">&#xe608;</i>选择秒杀商品</a>
  56. <p class="notic2">注:每个活动场次中出售的秒杀商品,此处非必选,可在场次管理中单独设置</p>
  57. <div class="none" id="goods_show_list" style="margin-top: 15px;width: 850px;">
  58. <div class="flexigrid">
  59. <div class="hDiv">
  60. <div class="hDivBox">
  61. <table cellspacing="0" cellpadding="0" style="width: 100%;">
  62. <thead>
  63. <tr>
  64. <th abbr="id" axis="col5" class="w60">
  65. <div class="tc">商品ID</div>
  66. </th>
  67. <th align="center" abbr="article_title" axis="col3" class="w40">
  68. <div class="tc">封面图</div>
  69. </th>
  70. <th align="left" abbr="article_title" axis="col3" class="">
  71. <div style="text-align: left; padding-left: 10px;" class="">商品标题</div>
  72. </th>
  73. <th abbr="article_time" axis="col6" class="w60">
  74. <div class="tc">操作</div>
  75. </th>
  76. </tr>
  77. </thead>
  78. </table>
  79. </div>
  80. <div class="bDiv" style="height: auto;">
  81. <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
  82. <table style="width: 100%;">
  83. <tbody id="Template">
  84. </tbody>
  85. </table>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </dd>
  92. </dl>
  93. <div class="bot">
  94. <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  95. </div>
  96. </form>
  97. </div>
  98. </div>
  99. </div>
  100. <script>
  101. var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  102. function reback(info) {
  103. layer.closeAll();
  104. if (info) {
  105. $("#goods_show_list").show();
  106. info.forEach(function (v) {
  107. v = JSON.parse(v,true)
  108. if ($('div').is('.goods_show_list_div_'+v.sharp_goods_id) == false){
  109. var html = '';
  110. html += '<tr class="tr goods_show_list_div goods_show_list_div_' + v.sharp_goods_id + '">';
  111. html += ' <td class="sort">';
  112. html += ' <div class="w60 tc">';
  113. html += ' ' + v.sharp_goods_id;
  114. html += ' <input type="hidden" name="goods[sharp_goods_id][]" value="' + v.sharp_goods_id + '">';
  115. html += ' <input type="hidden" name="goods[aid][]" value="' + v.aid + '">';
  116. html += ' </div>';
  117. html += ' </td>';
  118. html += ' <td class="w40">';
  119. html += ' <div class="tc">';
  120. html += ' <img width="40" height="40" src="' + v.litpic + '">';
  121. html += ' </div>';
  122. html += ' </td>';
  123. html += ' <td class="" style="width: 100%;">';
  124. html += ' <div class="tl" style="padding-left: 10px;">';
  125. html += ' ' + v.title;
  126. html += ' </div>';
  127. html += ' </td>';
  128. html += ' <td class="">';
  129. html += ' <div class="w60 tc">';
  130. html += ' <a class="btn red" href="javascript:void(0);" onclick="del(' + v.sharp_goods_id + ');">删除</a>';
  131. html += ' </div>';
  132. html += ' </td>';
  133. html += '</tr>';
  134. $("#Template").append(html);
  135. }
  136. })
  137. }
  138. }
  139. function del(sid){
  140. $(".goods_show_list_div_"+sid).remove();
  141. }
  142. layui.use(['form', 'laydate'], function(){
  143. var form = layui.form,
  144. laydate = layui.laydate;
  145. laydate.render({
  146. elem: '#active_date'
  147. });
  148. form.render();
  149. });
  150. function choGoods() {
  151. layer.open({
  152. type: 2,
  153. title: '选择秒杀商品',
  154. fixed: true, //不固定
  155. shadeClose: false,
  156. shade: layer_shade,
  157. maxmin: true, //开启最大化最小化按钮
  158. area: ['80%', '90%'],
  159. content: "{:url('Sharp/goods_list')}"
  160. });
  161. }
  162. </script>
  163. <script type="text/javascript">
  164. // 判断输入框是否为空
  165. function checkForm(){
  166. if($('input[name=active_date]').val() == ''){
  167. showErrorMsg('活动日期不能为空!');
  168. $('input[name=active_date]').focus();
  169. return false;
  170. }
  171. if($('input[name^=active_time]:checked').length == 0){
  172. showErrorMsg('请选择活动场次!');
  173. return false;
  174. }
  175. layer_loading('正在处理');
  176. $.ajax({
  177. type : 'post',
  178. url : "{:url('Sharp/active_add', ['_ajax'=>1])}",
  179. data : $('#post_form').serialize(),
  180. dataType : 'json',
  181. success : function(res){
  182. layer.closeAll();
  183. if(res.code == 1){
  184. var _parent = parent;
  185. _parent.layer.close(parentObj);
  186. _parent.layer.msg(res.msg, {icon: 1, shade: 0.1, time: 1000}, function(){
  187. _parent.window.location.reload();
  188. });
  189. }else{
  190. showErrorMsg(res.msg);
  191. }
  192. },
  193. error: function(e){
  194. layer.closeAll();
  195. showErrorAlert(e.responseText);
  196. }
  197. });
  198. }
  199. </script>
  200. {include file="public/footer" /}