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.

120 lines
5.3 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{extend name="../views/public/detail.html"/}
{block name="form"}
<script type="text/javascript" src="/static/admin/js/searchableselect/jquery.searchableSelect.js"></script>
<link rel="stylesheet" type="text/css" href="/static/admin/js/searchableselect/jquery.searchableSelect.css"/>
<script type="text/javascript">
$(document).off('click', '.change-value');
$(document).on('click', '.change-value', function() {
var change_name = $(this).attr('data-change');
var original_name = $(this).attr('data-original');
$('input[name*=' + change_name + ']').val($('input[name=' + original_name + ']').val());
});
$(document).ready(function () {
});
</script>
<div class="form-group">
<label class="control-label col-lg-2">秒杀时间段</label>
<div class="col-lg-10">
<p>{$data.start_time|date="Y-m-d H:i"}--{$data.end_time|date="Y-m-d H:i"}</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-2">商品名称</label>
<div class="col-lg-4">
<p>{$data.name}</p>
</div>
</div>
<div id="add-data">
<div class="form-group">
<label class="control-label col-lg-2">秒杀信息设置</label>
<div class="col-lg-10">
<table class="table table-bordered">
<thead>
<tr>
<th width="20%">规格</th>
<th width="10%">价格</th>
<th width="30%">秒杀价格
<div class="input-group">
<input type="number" min="0" step="0.01" max="99999999.99" class="form-control" name="option_price">
<div class="input-group-btn">
<a href="javascript:void(0)" type="button" class="btn btn-white change-value" data-original="option_price" data-change="option_price_" data-toggle="dropdown" title="批量设置">
<span class="icon-double-angle-down"></span>
</a>
</div>
</div>
</th>
<th width="10%">库存</th>
<th width="30%">限量
<div class="input-group">
<input type="number" min="1" step="1" class="form-control" name="option_number" >
<div class="input-group-btn">
<a href="javascript:void(0)" type="button" class="btn btn-white change-value" data-original="option_number" data-change="option_number_" data-toggle="dropdown" title="批量设置">
<span class="icon-double-angle-down"></span>
</a>
</div>
</div>
</th>
</tr>
</thead>
<tbody>
{notempty name="sku"}
{volist name="sku" id="vo"}
<tr>
<td >{$vo.sku_name}<input type="hidden" name="sku[]" value="{$vo.sku}"></td>
<td>{$vo.price}</td>
<td><input type="number" name="option_price_{$vo.sku}" min="0.01" step="0.01" max="99999999.99" notnull notice='请填写该规格秒杀价格数据' class="form-control" value="{$vo.price_spike}"></td>
<td>{$vo.stock}</td>
<td><input type="number" name="option_number_{$vo.sku}" min="0" step="1" max="{$vo.stock}" notnull notice='请填写该规格秒杀限量数据' class="form-control" value="{$vo.number}"></td>
</tr>
{/volist}
{else /}
<tr>
<td>默认</td>
<td>{$data.price}</td>
<td>
<input type="number" name="option_price_" min="0.01" step="0.01" max="99999999.99" notnull notice='请填写该规格秒杀价格数据' class="form-control" value="{$data.price_spike}">
</td>
<td>{$data.stock}</td>
<td>
<input type="number" name="option_number_" min="0" step="1" max="{$data.stock}" notnull notice='请填写该规格秒杀限量数据' class="form-control" value="{$data.number}">
</td>
</tr>
{/notempty}
</tbody>
</table>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-2">排序</label>
<div class="col-lg-10">
<input class="form-control" placeholder='最大值2147483647' type="number" min="0" step="1" name="sort" notnull
value="{$data.sort | default = 0}"/>
<p class="help-block">数字越大越靠前</p>
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<input class="btn btn-danger" type="submit" value="提交保存">
<button class="btn btn-default backPrev" type="button">返回列表</button>
</div>
</div>
<input type="hidden" name="id" value="{$data.id | default=''}">
<input type="hidden" name="product_id" value="{$data.product_id | default=''}">
<input type="hidden" id="do_action" value="{:url('Spike/'.request()->action())}"/>
<input type="hidden" id="do_jump" value="{:url('Spike/activity')}"/>
{/block}