form.html
17 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
{template 'common'}
<input type="hidden" name="reply_id" value="{$reply['id']}" />
<div class="panel panel-default">
<div class="panel-heading">
活动设置 (该活动需关注公众号参与)
</div>
<div class="panel-body">
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span> 活动名称</label>
<div class="col-sm-9 col-xs-12">
<input type="text" id="title" class="form-control" placeholder="" name="title" value="{$reply['title']}">
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span> 活动图片</label>
<div class="col-sm-9 col-xs-12">
{php echo tpl_form_field_image('start_picurl',$reply['start_picurl']);}
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span> 活动说明</label>
<div class="col-sm-9 col-xs-12">
<textarea style="height:60px;" id='description' name="description" class="form-control" cols="60">{$reply['description']}</textarea>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span> 活动时间</label>
<div class="col-sm-9 col-xs-12">
{php echo tpl_form_field_daterange('datelimit', array('starttime'=>date('Y-m-d',$reply['starttime']),'endtime'=>date('Y-m-d',$reply['endtime'])))}
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span> 兑奖信息</label>
<div class="col-sm-9 col-xs-12">
<input type="text" id="ticket_information" class="form-control" placeholder="" name="ticket_information" value="{$reply['ticket_information']}">
<div class="help-block">例如: 兑奖请联系我们,电话 13xxxxxxxxx</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span> 重复抽奖信息</label>
<div class="col-sm-9 col-xs-12">
<input type="text" id="repeat_lottery_reply" class="form-control" placeholder="" name="repeat_lottery_reply" value="{$reply['repeat_lottery_reply']}">
<div class="help-block">如果设置只允许抽一次奖的,可写:你已经玩过了,下次再来。 如果设置可多次抽奖,请写:继续努力哦!</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">版权信息</label>
<div class="col-sm-9 col-xs-12">
<input type="text" id="copyright" class="form-control" placeholder="" name="copyright" value="{$reply['copyright']}">
<div class="help-block">版权信息,如果不填写,默认为公众号名称!</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
活动结束设置
</div>
<div class="panel-body">
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span> 结束标题</label>
<div class="col-sm-9 col-xs-12">
<input type="text" id="end_theme" class="form-control" placeholder="" name="end_theme" value="{$reply['end_theme']}">
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span> 结束图片</label>
<div class="col-sm-9 col-xs-12">
{php echo tpl_form_field_image('end_picurl',$reply['end_picurl']);}
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span> 结束说明</label>
<div class="col-sm-9 col-xs-12">
<textarea style="height:60px;" id='end_instruction' name="end_instruction" class="form-control" cols="60">{$reply['end_instruction']}</textarea>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
活动详细设置
</div>
<div class="panel-body">
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span> 奖品设置</label>
<div class="col-sm-9 col-xs-12">
<div class="panel panel-default">
<div class="panel-body table-responsive">
<table class='table'>
<thead>
<tr>
<th>奖品类别(10字以内)</th>
<th>奖品名称(50字以内)</th>
<th>奖品数量</th>
<th>中奖概率(%)</th>
</tr>
</thead>
<tbody id="re-items">
<tr id='c_one'>
<td><input id="c_type_one" name="c_type_one" type="text" class="form-control" value="{$reply['c_type_one']}" maxlength="10" placeholder='例如:一等奖' style="width:100px;"/></td>
<td><input id="c_name_one" name="c_name_one" type="text" class="form-control" value="{$reply['c_name_one']}" maxlength="50"/></td>
<td><input id="c_num_one" name="c_num_one" type="text" class="form-control" value="{$reply['c_num_one']}" /></td>
<td><input id="c_rate_one" name="c_rate_one" type="text" class="form-control" value="{$reply['c_rate_one']}" /></td>
</tr>
<tr id='c_two'>
<td><input id="c_type_two" name="c_type_two" type="text" class="form-control" value="{$reply['c_type_two']}" placeholder='例如:二等奖' maxlength="10" style="width:100px;"/></td>
<td><input id="c_name_two" name="c_name_two" type="text" class="form-control" value="{$reply['c_name_two']}" maxlength="50"/></td>
<td><input id="c_num_two" name="c_num_two" type="text" class="form-control" value="{$reply['c_num_two']}"/></td>
<td><input id="c_rate_two" name="c_rate_two" type="text" class="form-control" value="{$reply['c_rate_two']}" /></td>
</tr>
<tr id='c_three'>
<td><input id="c_type_three" name="c_type_three" type="text" class="form-control" value="{$reply['c_type_three']}" maxlength="10" placeholder='例如:三等奖' style="width:100px;"/></td>
<td><input id="c_name_three" name="c_name_three" type="text" class="form-control" value="{$reply['c_name_three']}" maxlength="50"/></td>
<td><input id="c_num_three" name="c_num_three" type="text" class="form-control" value="{$reply['c_num_three']}"/></td>
<td><input id="c_rate_three" name="c_rate_three" type="text" class="form-control" value="{$reply['c_rate_three']}" /></td>
</tr>
<tr id='c_four'>
<td><input id="c_type_four" name="c_type_four" type="text" class="form-control" value="{$reply['c_type_four']}" maxlength="10" placeholder='例如:四等奖' style="width:100px;"/></td>
<td><input id="c_name_four" name="c_name_four" type="text" class="form-control" value="{$reply['c_name_four']}" maxlength="50"/></td>
<td><input id="c_num_four" name="c_num_four" type="text" class="form-control" value="{$reply['c_num_four']}"/></td>
<td><input id="c_rate_four" name="c_rate_four" type="text" class="form-control" value="{$reply['c_rate_four']}" /></td>
</tr>
<tr id='c_five'>
<td><input id="c_type_five" name="c_type_five" type="text" class="form-control" value="{$reply['c_type_five']}" placeholder='例如:纪念奖' maxlength="10" style="width:100px;"/></td>
<td><input id="c_name_five" name="c_name_five" type="text" class="form-control" value="{$reply['c_name_five']}" maxlength="50"/></td>
<td><input id="c_num_five" name="c_num_five" type="text" class="form-control" value="{$reply['c_num_five']}"/></td>
<td><input id="c_rate_five" name="c_rate_five" type="text" class="form-control" value="{$reply['c_rate_five']}" /></td>
</tr>
<tr id='c_six'>
<td><input id="c_type_six" name="c_type_six" type="text" class="form-control" value="{$reply['c_type_six']}" placeholder='例如:参与奖' maxlength="10" style="width:100px;"/></td>
<td><input id="c_name_six" name="c_name_six" type="text" class="form-control" value="{$reply['c_name_six']}" maxlength="50"/></td>
<td><input id="c_num_six" name="c_num_six" type="text" class="form-control" value="{$reply['c_num_six']}"/></td>
<td><input id="c_rate_six" name="c_rate_six" type="text" class="form-control" value="{$reply['c_rate_six']}" /></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">每人最多获奖次数</label>
<div class="col-sm-5 col-xs-6">
<div class="input-group">
<input type="text" class="form-control" name="award_times" value="{$reply['award_times']}" />
<span class="input-group-addon">次</span>
</div>
<div class="help-block">单个用户最多共享几个奖项,0为不限制,推荐设置为1次!</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">每人最多抽奖次数</label>
<div class="col-sm-5 col-xs-6">
<div class="input-group">
<input type="text" class="form-control" name="number_times" value="{$reply['number_times']}" />
<span class="input-group-addon">次</span>
</div>
<div class="help-block">抽奖总次数限制,0为不限制</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">每人每天最多抽奖次数</label>
<div class="col-sm-5 col-xs-6">
<div class="input-group">
<input type="text" class="form-control" name="most_num_times" value="{$reply['most_num_times']}" />
<span class="input-group-addon">次</span>
</div>
<div class="help-block">必须小于总抽奖次数! 0 为不限制 抽完总数就不能抽了! 可以抽奖天数 = 总数/每天抽奖次数!</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span>SN码重命名</label>
<div class="col-sm-9 col-xs-12">
<input type="text" id="sn_rename" class="form-control" placeholder="" name="sn_rename" value="{$reply['sn_rename']}">
<div class="help-block">例如:CND码,充值密码,SN码。这个主要用于修改SN码的名称。如果你想导入的SN码为充值密码,就设置为充值密码,其它也是如此。</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span>手机号重命名</label>
<div class="col-sm-9 col-xs-12">
<input type="text" id="tel_rename" class="form-control" placeholder="" name="tel_rename" value="{$reply['tel_rename']}">
<div class="help-block">例如:QQ号,微信号,手机号,,邮寄地址! 不清楚的情况下,请默认设置手机号!此字段主要收集用户的信息方便联系。</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span>显示奖品数量</label>
<div class="col-sm-9 col-xs-12">
<label class="radio-inline">
<input type="radio" name="show_num" value="1" {if $reply['show_num'] == 1} checked="checked"{/if}/>显示
</label>
<label class="radio-inline">
<input type="radio" name="show_num" value="2" {if $reply['show_num'] == 2} checked="checked"{/if}/>不显示
</label>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
分享设置
</div>
<div class="panel-body">
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">分享标题</label>
<div class="col-sm-9 col-xs-12">
<input type="text" id="share_title" class="form-control" placeholder="" name="share_title" value="{$reply['share_title']}">
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">分享地址</label>
<div class="col-sm-9 col-xs-12">
<input type="text" id="share_url" class="form-control" placeholder="" name="share_url" value="{$reply['share_url']}">
<div class="help-block">分享的链接,推荐用微信平台的素材库,转成短地址。<a target="_blank" href="http://www.dwz.cn/">短网址转换</a></div>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">分享描述</label>
<div class="col-sm-9 col-xs-12">
<textarea style="height:60px;" id='share_desc' name="share_desc" class="form-control" cols="60">{$reply['share_desc']}</textarea>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">分享描述</label>
<div class="col-sm-9 col-xs-12">
<textarea style="height:60px;" id='share_txt' name="share_txt" class="form-control richtext" cols="60">{$reply['share_txt']}</textarea>
<span class="help-block">如果分享地址为空,则显示分享描述中内容,分享后用户需关注公共号,才可以参加活动! </span>
</div>
</div>
</div>
</div>
<script language='javascript'>
$('form').submit(function(){
if($("#title").isEmpty()){
Tip.focus("title","请输入活动名称!","right");
return false;
}
if($("#ticket_information").isEmpty()){
Tip.focus("ticket_information","请输入兑奖信息!","right");
return false;
}
if($("#repeat_lottery_reply").isEmpty()){
Tip.focus("repeat_lottery_reply","请输入重复抽奖信息!","right");
return false;
}
if($("#c_type_one").isEmpty()){ Tip.focus("c_type_one","请输入奖品类别!","left"); return false; }
if($("#c_name_one").isEmpty()){ Tip.focus("c_name_one","请输入奖品名称!","bottom"); return false; }
if($("#c_num_one").isEmpty()){ Tip.focus("c_num_one","请输入奖品数量!","right"); return false; }
if(!$("#c_type_two").isEmpty()){
if($("#c_name_two").isEmpty()){ Tip.focus("c_name_two","请输入奖品名称!","left"); return false; }
if($("#c_num_two").isEmpty()){ Tip.focus("c_num_two","请输入奖品数量!","right"); return false; }
}
if(!$("#c_type_three").isEmpty()){
if($("#c_name_three").isEmpty()){ Tip.focus("c_name_three","请输入奖品名称!","left"); return false; }
if($("#c_num_three").isEmpty()){ Tip.focus("c_num_three","请输入奖品数量!","right"); return false; }
}
if(!$("#c_type_four").isEmpty()){
if($("#c_name_four").isEmpty()){ Tip.focus("c_name_four","请输入奖品名称!","left"); return false; }
if($("#c_num_four").isEmpty()){ Tip.focus("c_num_four","请输入奖品数量!","right"); return false; }
}
if(!$("#c_type_five").isEmpty()){
if($("#c_name_five").isEmpty()){ Tip.focus("c_name_five","请输入奖品名称!","left"); return false; }
if($("#c_num_five").isEmpty()){ Tip.focus("c_num_five","请输入奖品数量!","right"); return false; }
}
if(!$("#c_type_six").isEmpty()){
if($("#c_name_six").isEmpty()){ Tip.focus("c_name_six","请输入奖品名称!","left"); return false; }
if($("#c_num_six").isEmpty()){ Tip.focus("c_num_six","请输入奖品数量!","right"); return false; }
}
if($("#sn_rename").isEmpty()){
Tip.focus("sn_rename","请输入SN码重命名!","right");
return false;
}
if($("#tel_rename").isEmpty()){
Tip.focus("tel_rename","请输入电话重命名!","right");
return false;
}
return true;
});
function moreItem() {
var more = $("#more_item").val();
if(more=="0" || more==""){
$("#c_four").show();
$("#c_five").show();
$("#c_six").show();
}
else{
$("#c_four").hide();
$("#c_five").hide();
$("#c_six").hide();
}
$("#more_item").val(more=='1'?'0':'1');
}
function doDeleteItemImage(obj,id) {
var filename = $('input#' + id+"-value").val();
$('.' + id +"_preview").html("");
$(obj).html("正在删除...").attr("disabled",true);
ajaxopen('./index.php?act=attachment&do=delete&filename=' + filename, function(){
$(obj).html("<i class='icon-upload-alt'></i> 删除").hide().removeAttr("disabled");
});
}
require(['jquery', 'util'], function($, u){
$(function(){
u.editor($('.richtext')[0]);
});
});
</script>