236 lines
12 KiB
HTML
236 lines
12 KiB
HTML
<include file="public/layout" />
|
|
<script src="__ROOT__/public/static/js/layer/laydate/laydate.js"></script>
|
|
<body style="background-color: #FFF; overflow: auto;">
|
|
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
|
|
<div id="append_parent"></div>
|
|
<div id="ajaxwaitid"></div>
|
|
<div class="page">
|
|
<div class="fixed-bar">
|
|
<div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
|
|
<div class="subject">
|
|
<h3>团购管理 - 编辑团购</h3>
|
|
<h5>网站系统抢购活动详情页</h5>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<form class="form-horizontal" id="handleposition" method="post">
|
|
<input type="hidden" id="goods_id" name="goods_id" value="{$info.goods_id}">
|
|
<input type="hidden" name="id" value="{$info.id}">
|
|
<input type="hidden" name="act" value="{$act}">
|
|
<input type="hidden" name="item_id" value="{$info.item_id}">
|
|
<div class="ncap-form-default">
|
|
<dl class="row">
|
|
<dt class="tit">
|
|
<label><em>*</em>团购标题</label>
|
|
</dt>
|
|
<dd class="opt">
|
|
<input type="text" name="title" id="title" value="{$info.title}" class="input-txt">
|
|
<span class="err" id="err_title"></span>
|
|
<p class="notic">请填写团购标题</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="row">
|
|
<dt class="tit">
|
|
<label><em>*</em>开始时间</label>
|
|
</dt>
|
|
<dd class="opt">
|
|
<input type="text" id="start_time" name="start_time" value="{$info.start_time}" class="input-txt">
|
|
<span class="err" id="err_start_time"></span>
|
|
<p class="notic">团购开始时间</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="row">
|
|
<dt class="tit">
|
|
<label><em>*</em>结束时间</label>
|
|
</dt>
|
|
<dd class="opt">
|
|
<input type="text" id="end_time" name="end_time" value="{$info.end_time}" class="input-txt">
|
|
<span class="err" id="err_end_time"></span>
|
|
<p class="notic">团购结束时间</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="row">
|
|
<dt class="tit">
|
|
<label><em>*</em>选择团购商品</label>
|
|
</dt>
|
|
<dd class="opt">
|
|
<input type="text" readonly id="goods_name" name="goods_name" value="{$info.goods_name}" class="input-txt">
|
|
<div style="overflow: hidden" id="selected_group_goods">
|
|
<if condition="$info['goods_id'] gt 0">
|
|
<div style="float: left;margin-right: 10px" class="selected-group-goods">
|
|
<div class="goods-thumb"><img style="width: 162px;height: 162px" <notempty name="info['specGoodsPrice']">src="{$info['specGoodsPrice']['spec_img']}"<else/>src="{$info['goods_id']|goods_thum_images=162,162}"</notempty>/></div>
|
|
<div class="goods-name">
|
|
<a target="_blank" href="{:U('Home/Goods/goodsInfo',array('id'=>$info['goods_id']))}">{$info.goods_name}</a>
|
|
</div>
|
|
<div class="goods-price">
|
|
<notempty name="info['specGoodsPrice']">
|
|
商城价:¥{$info['specGoodsPrice']['price']}库存:{$info['specGoodsPrice']['store_count']}
|
|
<else/>
|
|
商城价:¥{$info['goods']['shop_price']}库存:{$info['goods']['store_count']}
|
|
</notempty>
|
|
</div>
|
|
</div>
|
|
</if>
|
|
</div>
|
|
<span class="err" id="err_goods_name"></span>
|
|
<p class="notic">
|
|
<a onclick="selectGoods()" class="ncap-btn"><i class="fa fa-search"></i>选择商品</a>
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="row">
|
|
<dt class="tit">
|
|
<label><em>*</em>团购价格</label>
|
|
</dt>
|
|
<dd class="opt">
|
|
<input type="text" id="price" name="price" value="{$info.price}" onpaste="this.value=this.value.replace(/[^\d.]/g,'')" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" class="input-txt">
|
|
<input type="hidden" id="goods_price" name="goods_price" value="{$info.goods_price}">
|
|
<span class="err" id="err_price"></span>
|
|
<p class="notic">商品团购价格,单位:元</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="row">
|
|
<dt class="tit">
|
|
<label><em>*</em>参团数量</label>
|
|
</dt>
|
|
<dd class="opt">
|
|
<input type="text" name="goods_num" id="goods_num" value="{$info.goods_num}" onpaste="this.value=this.value.replace(/[^\d.]/g,'')" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" class="input-txt">
|
|
<span class="err" id="err_goods_num"></span>
|
|
<p class="notic">此抢购活动最多允许抢购的商品数量</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="row">
|
|
<dt class="tit">
|
|
<label><em>*</em>虚拟购买数</label>
|
|
</dt>
|
|
<dd class="opt">
|
|
<input type="text" id="virtual_num" name="virtual_num" value="{$info.virtual_num}" onpaste="this.value=this.value.replace(/[^\d.]/g,'')" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" class="input-txt">
|
|
<span class="err" id="err_virtual_num"></span>
|
|
<p class="notic">虚拟已购买参团人数</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="row">
|
|
<dt class="tit">
|
|
<label>团购介绍</label>
|
|
</dt>
|
|
<dd class="opt">
|
|
<textarea placeholder="请输入活动介绍" name="intro" rows="6" class="tarea">{$info.intro}</textarea>
|
|
<span class="err" id="err_intro"></span>
|
|
<p class="notic">团购描述介绍</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<if condition="$info['is_edit'] eq 0">
|
|
<div class="bot"><a class="ncap-btn-big">确认提交</a></div>
|
|
<else/>
|
|
<dl class="row" txt="发布活动时,进行通知">
|
|
<dt class="tit">站内信通知</dt>
|
|
<dd class="opt">
|
|
<div class="onoff">
|
|
<label for="mmt_message_switch1" class="cb-enable selected">是</label>
|
|
<label for="mmt_message_switch0" class="cb-disable ">否</label>
|
|
<input id="mmt_message_switch1" name="mmt_message_switch" checked="checked" value="1" type="radio">
|
|
<input id="mmt_message_switch0" name="mmt_message_switch" value="0" type="radio">
|
|
</div>
|
|
<p class="notic"></p>
|
|
</dd>
|
|
</dl>
|
|
<div class="bot"><a onclick="verifyForm()" class="ncap-btn-big ncap-btn-green">确认提交</a></div>
|
|
</if>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
laydate.render({
|
|
elem: '#start_time',//绑定元素
|
|
theme: 'molv', //主题
|
|
type:'datetime', //控件选择类型
|
|
format: 'yyyy-MM-dd HH:mm:ss', //自定义格式
|
|
calendar: true, //显示公历节日
|
|
min: '1970-01-01 00:00:00', //最小日期
|
|
max: '2099-12-31 00:00:00', //最大日期
|
|
// value: new Date(),//默认当前时间
|
|
isInitValue: true,
|
|
position : 'fixed', //定位方式
|
|
zIndex: 99999999, //css z-index
|
|
});
|
|
laydate.render({
|
|
elem: '#end_time',//绑定元素
|
|
theme: 'molv', //主题
|
|
type:'datetime', //控件选择类型
|
|
format: 'yyyy-MM-dd HH:mm:ss', //自定义格式
|
|
calendar: true, //显示公历节日
|
|
min: '1970-01-01 00:00:00', //最小日期
|
|
max: '2099-12-31 00:00:00', //最大日期
|
|
// value: new Date(),//默认当前时间
|
|
isInitValue: true,
|
|
position : 'fixed', //定位方式
|
|
zIndex: 99999999, //css z-index
|
|
});
|
|
})
|
|
function verifyForm(){
|
|
$('span.err').hide();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "{:U('Admin/Promotion/groupbuyHandle')}",
|
|
data: $('#handleposition').serialize(),
|
|
dataType: "json",
|
|
error: function () {
|
|
layer.alert("服务器繁忙, 请联系管理员!");
|
|
},
|
|
success: function (data) {
|
|
if (data.status == 1) {
|
|
layer.msg(data.msg, {
|
|
icon: 1,
|
|
time: 1000
|
|
}, function(){
|
|
location.href = "{:U('Admin/Promotion/group_buy_list')}";
|
|
});
|
|
} else {
|
|
layer.msg(data.msg, {icon: 2,time: 1000});
|
|
$.each(data.result, function (index, item) {
|
|
$('#err_' + index).text(item).show();
|
|
});
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function selectGoods(){
|
|
var url = "{:U('Promotion/search_goods',array('tpl'=>'select_goods','prom_type'=>2,'prom_id'=>$info[id]))}";
|
|
layer.open({
|
|
type: 2,
|
|
title: '选择商品',
|
|
shadeClose: true,
|
|
shade: 0.2,
|
|
area: ['75%', '75%'],
|
|
content: url,
|
|
});
|
|
}
|
|
|
|
function call_back(goodsItem){
|
|
$('#goods_id').val(goodsItem.goods_id);
|
|
var html = '';
|
|
if(goodsItem.spec != null){
|
|
//有规格
|
|
html = '<div style="float: left;margin: 10px auto;" class="selected-group-goods"><div class="goods-thumb">' +
|
|
'<img style="width: 162px;height: 162px" src="'+goodsItem.spec.spec_img+'"/></div> <div class="goods-name"> ' +
|
|
'<a target="_blank" href="/index.php?m=Home&c=Goods&a=goodsInfo&id='+goodsItem.goods_id+'">'+goodsItem.goods_name+goodsItem.spec.key_name+'</a> </div>' +
|
|
' <div class="goods-price">商城价:¥'+goodsItem.spec.price+'库存:'+goodsItem.spec.store_count+'</div> </div>';
|
|
$('input[name=item_id]').val(goodsItem.spec.item_id)
|
|
$('input[name=goods_name]').val(goodsItem.goods_name + goodsItem.spec.key_name);
|
|
}else{
|
|
html = '<div style="float: left;margin: 10px auto;" class="selected-group-goods"><div class="goods-thumb">' +
|
|
'<img style="width: 162px;height: 162px" src="'+goodsItem.goods_image+'"/></div> <div class="goods-name"> ' +
|
|
'<a target="_blank" href="/index.php?m=Home&c=Goods&a=goodsInfo&id='+goodsItem.goods_id+'">'+goodsItem.goods_name+'</a> </div>' +
|
|
' <div class="goods-price">商城价:¥'+goodsItem.goods_price+'库存:'+goodsItem.store_count+'</div> </div>';
|
|
$('input[name=goods_name]').val(goodsItem.goods_name);
|
|
}
|
|
$('#select_goods_button').attr('data-goods-id',goodsItem.goods_id);
|
|
$('#selected_group_goods').empty().html(html);
|
|
$('.selected-group-goods').show();
|
|
layer.closeAll('iframe');
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |