|
Server : Apache System : Linux iZ6xhqomji47p1Z 5.10.134-15.al8.x86_64 #1 SMP Thu Jul 20 00:44:04 CST 2023 x86_64 User : www ( 1000) PHP Version : 8.1.30 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv Directory : /www/wwwroot/fsjlkj.cn/application/admin/template/sharp/ |
{include file="public/layout" /}
<div class="bodystyle">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
<div class="flexigrid">
<div class="ncap-form-default">
<form class="form-horizontal" id="post_form" action="{:url('Sharp/active_time_edit')}" method="post">
<dl class="row">
<dt class="tit">
<label for="limit"><em>*</em>活动日期</label>
</dt>
<dd class="opt">
{$info.active_date|date='Y-m-d',###}
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="limit"><em>*</em>活动场次</label>
</dt>
<dd class="opt">
{$info.active_time}
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="total_stock"><em>*</em>选择商品 </label>
</dt>
<dd class="opt">
<a href="javascript:void(0);" onclick="choGoods();" class="ncap-btn ncap-btn-green"><i class="layui-icon"></i>选择秒杀商品</a>
<p class="notic2">注:每个活动场次中出售的秒杀商品,此处非必填,可在场次管理中单独设置</p>
<div class="{empty name='$goods'} none {/empty}" id="goods_show_list" style="margin-top: 15px;width: 850px;">
<div class="flexigrid">
<div class="hDiv">
<div class="hDivBox">
<table cellspacing="0" cellpadding="0" style="width: 100%;">
<thead>
<tr>
<th abbr="id" axis="col5" class="w60">
<div class="tc">商品ID</div>
</th>
<th align="center" abbr="article_title" axis="col3" class="w40">
<div class="tc">封面图</div>
</th>
<th align="left" abbr="article_title" axis="col3" class="">
<div style="text-align: left; padding-left: 10px;" class="">商品标题</div>
</th>
<th abbr="article_time" axis="col6" class="w60">
<div class="tc">操作</div>
</th>
</tr>
</thead>
</table>
</div>
<div class="bDiv" style="height: auto;">
<div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
<table style="width: 100%;">
<tbody id="Template">
{empty name="$goods"}
<tr>
<td class="no-data" align="center" axis="col0" colspan="50">
<i class="fa fa-exclamation-circle"></i>没有选择秒杀商品
</td>
</tr>
{else/}
{foreach name="$goods" item="vo" key="k"}
<tr class="tr goods_show_list_div goods_show_list_div_{$vo.sharp_goods_id}">
<td class="sort">
<div class="w60 tc">
{$vo.sharp_goods_id}
<input type="hidden" name="goods[sharp_goods_id][]" value="{$vo.sharp_goods_id}">
<input type="hidden" name="goods[aid][]" value="{$vo.aid}">
</div>
</td>
<td class="w40">
<div class="tc">
<img width="40" height="40" src="{$vo.litpic|get_default_pic=###}">
</div>
</td>
<td class="" style="width: 100%;">
<div class="tl" style="padding-left: 10px;">
{$vo.title}
</div>
</td>
<td class="">
<div class="w60 tc">
<a class="btn red" href="javascript:void(0);" onclick="del('{$vo.sharp_goods_id}');">删除</a>
</div>
</td>
</tr>
{/foreach}
{/empty}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</dd>
</dl>
<div class="bot">
<input type="hidden" name="active_time_id" value="{$info.active_time_id}">
<input type="hidden" name="active_id" value="{$info.active_id}">
<a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green"
id="submitBtn">确认提交</a>
</div>
</form>
</div>
</div>
</div>
<script>
function reback(info) {
layer.closeAll();
if (info) {
$("#goods_show_list").show();
info.forEach(function (v) {
v = JSON.parse(v, true)
if ($('div').is('.goods_show_list_div_' + v.sharp_goods_id) == false) {
var html = '';
html += '<tr class="tr goods_show_list_div goods_show_list_div_' + v.sharp_goods_id + '">';
html += ' <td class="sort">';
html += ' <div class="w60 tc">';
html += ' ' + v.sharp_goods_id;
html += ' <input type="hidden" name="goods[sharp_goods_id][]" value="' + v.sharp_goods_id + '">';
html += ' <input type="hidden" name="goods[aid][]" value="' + v.aid + '">';
html += ' </div>';
html += ' </td>';
html += ' <td class="w40">';
html += ' <div class="tc">';
html += ' <img width="40" height="40" src="' + v.litpic + '">';
html += ' </div>';
html += ' </td>';
html += ' <td class="" style="width: 100%;">';
html += ' <div class="tl" style="padding-left: 10px;">';
html += ' ' + v.title;
html += ' </div>';
html += ' </td>';
html += ' <td class="">';
html += ' <div class="w60 tc">';
html += ' <a class="btn red" href="javascript:void(0);" onclick="del(' + v.sharp_goods_id + ');">删除</a>';
html += ' </div>';
html += ' </td>';
html += '</tr>';
$("#Template").append(html);
}
})
}
}
function del(sid) {
$(".goods_show_list_div_" + sid).remove();
if ($('.goods_show_list_div').length <= 0) {
$("#goods_show_list").hide();
}
}
function choGoods() {
layer.open({
type: 2,
title: '选择秒杀商品',
fixed: true, //不固定
shadeClose: false,
shade: layer_shade,
maxmin: true, //开启最大化最小化按钮
area: ['80%', '90%'],
content: "{:url('Sharp/goods_list')}"
});
}
</script>
<script type="text/javascript">
var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
// 判断输入框是否为空
function checkForm() {
if($('.goods_show_list_div').length == 0){
showErrorMsg('请先选择秒杀商品!');
$('input[name=seckill_price]').focus();
return false;
}
layer_loading('正在处理');
$.ajax({
url : "{:url('Sharp/active_time_edit')}",
data: $('#post_form').serialize(),
type: 'post',
dataType: 'json',
success: function(res) {
layer.closeAll();
if (res.code == 1) {
layer.msg(res.msg, {icon: 1, shade: 0.1, time: 1000}, function(){
window.location.reload();
});
} else {
showErrorAlert(res.msg);
}
},
error: function(e) {
layer.closeAll();
showErrorAlert(e.responseText);
}
})
}
</script>
{include file="public/footer" /}