flash_sale_info.html
17.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
<include file="public/layout" />
<script src="__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>
</div>
</div>
</div>
<!-- 操作说明 -->
<div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); width: 99%; height: 100%; min-height: 30px;min-width: 100px;">
<div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
<h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
<span title="收起提示" id="explanationZoom" style="display: block;"></span>
</div>
<ul>
<li>1、每个商品只能参与一个促销活动,若选择不到秒杀商品,请检查是否参与了其他活动
2、销售规则选择线下库存,秒杀活动的商品获取的还是线上库存.</li>
</ul>
</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}">
<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" maxlength="40"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
value="{$info.title}" class="input-txt"> 排序: <input type="text" name="ordid" id="ordid" maxlength="4"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
value="{$info.ordid|default=0}">
<span class="err cr"></span>
<p class="notic">请填写秒杀标题,最大40字</p>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label><em>*</em>选择秒杀商品</label>
</dt>
<dd class="opt">
<input type="text" readonly id="goods_name"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
name="goods_name" value="{$info.goods_name}" class="input-txt">
<span class="err cr"></span>
<if condition="$is_start neq 1">
<p class="notic">
<a onclick="selectGoods()" class="ncap-btn"><i class="fa fa-search"></i>选择商品</a>
</p>
</if>
</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,'')"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" class="input-txt">
<span class="err cr"></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" <if condition="$is_start eq 1">readonly disabled="disabled"</if>
onkeydown="strkeydown(event, this, 'sumbitbtn')"
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 cr"></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="buy_limit" name="buy_limit" value="{$info.buy_limit}" <if condition="$is_start eq 1">readonly disabled="disabled"</if>
onkeydown="strkeydown(event, this, 'sumbitbtn')"
onpaste="this.value=this.value.replace(/[^\d]/g,'')"
onkeyup="this.value=this.value.replace(/[^\d]/g,'')" class="input-txt">
<span class="err cr"></span>
<p class="notic">限时秒杀每个人能购买的数量</p>
</dd>
</dl>
<if condition="$pattern eq 0">
<dl class="row">
<dt class="tit">
<label for="commission">佣金</label>
</dt>
<dd class="opt">
<input type="text" value="{$info.commission}" name="commission" class="t_mane"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
onKeyUp="this.value=this.value.replace(/[^\d.]/g,'')"
onpaste="this.value=this.value.replace(/[^\d.]/g,'')" />
<span class="err" id="err_commission" style="color:#F00; display:none;"></span>
<p class="notic">用于分销的分成金额</p>
</dd>
</dl>
</if>
<if condition="$pattern eq 1">
<dl class="row">
<dt class="tit">
<label for="fir_rate">一级分成</label>
</dt>
<dd class="opt">
<input type="text" value="{$info.fir_rate}" name="fir_rate" class="t_mane"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
onKeyUp="this.value=this.value.replace(/[^\d.]/g,'')"
onpaste="this.value=this.value.replace(/[^\d.]/g,'')" />
<span class="err" id="err_fir_rate" style="color:#F00; display:none;"></span>
<p class="notic">用于分销的一级分成金额</p>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="sec_rate">二级分成</label>
</dt>
<dd class="opt">
<input type="text" value="{$info.sec_rate}" name="sec_rate" class="t_mane"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
onKeyUp="this.value=this.value.replace(/[^\d.]/g,'')"
onpaste="this.value=this.value.replace(/[^\d.]/g,'')" />
<span class="err" id="err_sec_rate style="color:#F00; display:none;"></span>
<p class="notic">用于分销的二级分成金额</p>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="commission">三级分成</label>
</dt>
<dd class="opt">
<input type="text" value="{$info.thi_rate}" name="thi_rate" class="t_mane"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
onKeyUp="this.value=this.value.replace(/[^\d.]/g,'')"
onpaste="this.value=this.value.replace(/[^\d.]/g,'')" />
<span class="err" id="err_thi_rate" style="color:#F00; display:none;"></span>
<p class="notic">用于分销的三级分成金额</p>
</dd>
</dl>
</if>
<dl class="row">
<dt class="tit">
<label><em>*</em>预热时间</label>
</dt>
<dd class="opt">
<input type="text" id="show_time" name="show_time" <if condition="$is_start eq 1">readonly disabled="disabled"</if>
onkeydown="strkeydown(event, this, 'sumbitbtn')"
value="{$info.show_time}" class="input-txt">
<span class="err cr"></span>
<p class="notic">日期为空,默认提前24小时预热 </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" <if condition="$is_start eq 1">readonly disabled="disabled"</if>
onkeydown="strkeydown(event, this, 'sumbitbtn')"
value="{$info.start_time}" class="input-txt">
<span class="err cr"></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"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
value="{$info.end_time}" class="input-txt">
<span class="err cr"></span>
<p class="notic">秒杀结束时间</p>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="virtual">虚拟销售</label>
</dt>
<dd class="opt">
<input id="virtual" type="text" value="{$info.virtual}" name="virtual" class="t_mane"
onkeydown="strkeydown(event, this, 'sumbitbtn')"
onKeyUp="this.value=this.value.replace(/[^\d]/g,'')"
onpaste="this.value=this.value.replace(/[^\d]/g,'')" />
<span class="err" id="err_virtual" style="color:#F00; display:none;"></span>
<p class="notic">用于手店已售数量的显示且手店显示的库存总数量会加上此数量</p>
</dd>
</dl>
<dl class="row dn">
<dt class="tit">
<label for="is_autowx"><em>*</em>是否自动推送</label>
</dt>
<dd class="opt">
<div class="onoff" id="is_autowx">
<label for="is_autowx1" class="cb-enable <if condition="$info.is_autowx eq 1">selected</if>">是</label>
<label for="is_autowx0" class="cb-disable <if condition="$info.is_autowx eq 0">selected</if>">否</label>
<input id="is_autowx1" name="is_autowx" value="1"
onkeydown="strkeydown(event, this, 'submitbtn')"
type="radio" <if condition="$info.is_autowx eq 1"> checked="checked"</if>>
<input id="is_autowx0" name="is_autowx" value="0"
onkeydown="strkeydown(event, this, 'submitbtn')"
type="radio" <if condition="$info.is_autowx eq 0"> checked="checked"</if>>
</div>
<p class="notic">启用后在活动前一天及结束前一天会自动通过微信推送消息给会员</p>
</dd>
</dl>
<dl class="row dn">
<dt class="tit">
<label>秒杀介绍</label>
</dt>
<dd class="opt">
<textarea placeholder="请输入活动介绍" name="description" rows="6" class="tarea">{$info.description}</textarea>
<span class="err cr"></span>
<p class="notic">秒杀描述介绍</p>
</dd>
</dl>
<neq name="info.is_end" value="1">
<div class="bot"><a id="sumbitbtn" onclick="adsubmit()" class="ncap-btn-big ncap-btn-green">确认提交</a></div>
</neq>
</div>
</form>
<input type="hidden" id="storecount" value="{$storecount}">
</div>
<script type="text/javascript">
var selectgoodnum=0;
$(document).ready(function(){
<if condition="$is_start neq 1">
$('#show_time').layDate();
$('#start_time').layDate();
</if>
$('#end_time').layDate();
})
function adsubmit(){
get_event_log('5','促销秒杀商品');
layer.msg('加载中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '10px', time:100000}) ;
if($('#title').val() ==''){
$('#title').parent().find("span").text("秒杀标题不能为空");
layer.msg('秒杀标题不能为空',{icon:2,time:1000});
$('#title').focus();
return;
}
if($('#goods_name').val() ==''){
$('#goods_name').parent().find("span").text("秒杀商品不能为空");
$('#goods_name').focus();
layer.msg('秒杀商品不能为空',{icon:2,time:1000});return;
}
if($('#price').val() ==''){
$('#price').parent().find("span").text("秒杀价格不能为空");
$('#price').focus();
layer.msg('秒杀价格不能为空',{icon:2,time:1000});return;
}
if(parseFloat($('#price').val())<=0){
$('#price').parent().find("span").text("秒杀价格必须大于0");
$('#price').focus();
layer.msg('秒杀价格必须大于0',{icon:2,time:1000});return;
}
if($('#goods_num').val() ==''){
$('#goods_num').parent().find("span").text("参加秒杀数量不能为空");
$('#goods_num').focus();
layer.msg('参加秒杀数量不能为空',{icon:2,time:1000});return;
}
if(parseFloat($('#goods_num').val())<=0){
$('#goods_num').parent().find("span").text("参加秒杀数量必须大于0");
$('#goods_num').focus();
layer.msg('参加秒杀数量必须大于0',{icon:2,time:1000});return;
}
var virtual=$("#virtual").val();
if(parseFloat(virtual)>=parseFloat($('#goods_num').val())){
$('#virtual').parent().find("span").text("虚拟数量必须小于参加秒杀数量");
$('#virtual').focus();
layer.msg('虚拟数量必须小于参加秒杀数量',{icon:2,time:1000});return;
}
if(selectgoodnum==0){
selectgoodnum=parseInt($("#storecount").val());
}
var is_start="{$is_start}";
//alert(selectgoodnum+":"+$('#goods_num').val());
if(parseFloat($('#goods_num').val())>selectgoodnum && is_start!="1"){
$('#goods_num').parent().find("span").text("参加秒杀数量大于商品库存数量");
$('#goods_num').focus();
layer.msg('参加秒杀数量大于商品库存数量',{icon:2,time:1000});return;
}
/*---
if($('#buy_limit').val() ==''){
$('#buy_limit').parent().find("span").text("限购数量不能为空");
$('#buy_limit').focus();
layer.msg('限购数量不能为空',{icon:2,time:1000});return;
}
if(parseFloat($('#buy_limit').val())<=0){
$('#buy_limit').parent().find("span").text("限购数量必须大于0");
$('#buy_limit').focus();
layer.msg('限购数量必须大于0',{icon:2,time:1000});return;
}---*/
var yudate = new Date($('#show_time').val().replace(/-/g,"/"));
var startdate = new Date($('#start_time').val().replace(/-/g,"/"));
var enddate = new Date($('#end_time').val().replace(/-/g,"/"));
if(startdate <= yudate)
{
$('#start_time').parent().find("span").text("开始时间必须大于预热时间");
layer.msg('开始时间必须大于预热时间',{icon:2,time:1000});return false;
}
if(enddate <= startdate)
{
$('#end_time').parent().find("span").text("结束时间必须大于开始时间");
layer.msg('结束时间必须大于开始时间',{icon:2,time:1000});return false;
}
$("input[type='text']").removeAttr('disabled');
$('#handleposition').submit();
}
function selectGoods(){
var url = "{:U('Promotion/search_goods',array('tpl'=>'select_goods'))}";
layer.open({
type: 2,
title: '选择商品',
shadeClose: true,
shade: 0.2,
area: ['96%', '80%'],
content: url,
});
}
function call_back(goods_id,goods_name,store_count,price){
$('#goods_id').val(goods_id);
$('#goods_name').val(goods_name);
selectgoodnum=store_count;
$('#group_num').val(store_count);
$('#price').val(price);
//$("#goods_num").focus();
$("#price").focus();
layer.closeAll('iframe');
}
</script>
</body>
</html>