goodsexchange.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
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
{template 'common/header'}
<ul class="nav nav-tabs">
<li {if $op == 'display'}class="active"{/if}><a href="{php echo $this->createWeburl('goodsexchange', array('op' => 'display'));}">管理实物兑换</a></li>
<li {if $op == 'post' && !$id}class="active"{/if}><a href="{php echo $this->createWeburl('goodsexchange', array('op' => 'post'));}">添加实物兑换</a></li>
{if $op == 'post' && $id}<li class="active"><a href="{php echo $this->createWeburl('goodsexchange', array('id' => $id, 'op' => 'post'));}">编辑实物兑换</a></li>{/if}
<li {if $op == 'deliver'}class="active"{/if}><a href="{php echo $this->createWeburl('goodsexchange', array('op' => 'deliver'));}">发货记录</a></li>
{if $op == 'receiver' && $id}<li class="active"><a href="{php echo $this->createWeburl('goodsexchange', array('id' => $id, 'op' => 'receiver'));}">编辑收货人信息</a></li>{/if}
</ul>
{if $op == 'post'}
<style>
.text-danger{color:red;}
</style>
<div class="main">
<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data" id="form1">
<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 class="text-danger">*</span> 兑换名称</label>
<div class="col-sm-9 col-xs-12">
<input type="text" name="title" class="form-control" value="{$item['title']}" />
<span class="help-block">此设置项为当前礼品兑换设置一个名称。</span>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 兑换状态</label>
<div class="col-sm-9 col-xs-12">
<label class="radio-inline"><input name="status" type="radio" value="1" class="" {if !$id}checked{else}{if $item['status']}checked{/if}{/if}>开启</label>
<label class="radio-inline"><input name="status" type="radio" value="0" class="" {if $id && !$item['status']}checked{/if}>关闭</label>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 兑换内容</label>
<div class="col-sm-9 col-xs-12">
<input type="text" name="extra[title]" class="form-control" value="{$item['extra']['title']}" />
<span class="help-block">此设置项设置当前礼品兑换的礼品名称。</span>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 积分类型</label>
<div class="col-sm-9 col-xs-12">
<select name="credittype" class="form-control">
{loop $creditnames $key $credit}
<option value="{$key}" {if $key == $item['credittype']}selected{/if}>{$credit}</option>
{/loop}
</select>
<span class="help-block">此设置项设置当前礼品兑换需要消耗的积分类型,如:金币、积分、贡献等。注:所需积分(余额)必须为正整数;</span>
</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" name="credit" class="form-control" value="{$item['credit']}" />
<span class="help-block">此设置项设置当前礼品兑换需要消耗的积分数量。</span>
</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">
{php echo tpl_form_field_daterange('datelimit', array('start' => date('Y-m-d', $item['starttime']),'end' => date('Y-m-d', $item['endtime'])), '')}
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 每人最大兑换次数</label>
<div class="col-sm-9 col-xs-12">
<input type="text" name="pretotal" class="form-control" value="{$item['pretotal']}" />
<span class="help-block">此设置项设置每个用户最大兑换次数。</span>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 兑换总数</label>
<div class="col-sm-9 col-xs-12">
<input type="text" name="total" class="form-control" value="{$item['total']}" />
<span class="help-block">此设置项设置兑换总量。</span>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 封面</label>
<div class="col-sm-9 col-xs-12">
{php echo tpl_form_field_image('thumb', $item['thumb'])}
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 说明</label>
<div class="col-sm-9 col-xs-12">
{php echo tpl_ueditor('description', $item['description'])}
</div>
</div>
</div>
</div>
<div class="form-group col-sm-12">
<input name="id" type="hidden" value="{$item['id']}">
<input name="submit" type="submit" value="提交" class="btn btn-primary col-lg-1">
<input type="hidden" name="token" value="{$_W['token']}" />
</div>
</form>
</div>
{elseif $op == 'display'}
<div class="main">
<div class="panel panel-info">
<div class="panel-heading">筛选</div>
<div class="panel-body">
<form action="" method="get" class="form-horizontal" role="form">
<input type="hidden" name="c" value="site" />
<input type="hidden" name="a" value="entry" />
<input type="hidden" name="do" value="goodsexchange" />
<input type="hidden" name="m" value="we7_coupon" />
<input type="hidden" name="op" value="display" />
<div class="form-group">
<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">兑换名称</label>
<div class="col-sm-7 col-lg-9 col-xs-12">
<input class="form-control" name="keyword" id="" type="text" value="{$_GPC['keyword']}">
</div>
<div class="pull-right col-xs-12 col-sm-3 col-lg-2">
<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
</div>
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="table-responsive panel-body">
<table class="table table-hover">
<thead>
<tr>
<th style="width:50px">图标</th>
<th style="width:100px;">标题</th>
<th style="width:80px;">领取条件</th>
<th style="width:90px;">可兑换次数</th>
<th style="width:80px;">已兑换</th>
<th style="width:80px;">总量</th>
<th style="width:150px;">有效时间</th>
<th style="width:150px;">兑换状态</th>
<th style="text-align:right; width:120px;">操作</th>
</tr>
</thead>
<tbody>
{loop $list $item}
<tr>
<td><img width="40" src="{$item['thumb']}"></td>
<td>{$item['title']}</td>
<td>{$item['credit']} {$creditnames[$item['credittype']]}</td>
<td>{$item['pretotal']} 次</td>
<td>{$item['num']} 个</td>
<td>{$item['total']} 个</td>
<td>{php echo date('Y-m-d', $item['starttime'])} - {php echo date('Y-m-d', $item['endtime'])}</td>
<td>
<input class="js-flag" type="checkbox" data-id="{$item['id']}" {if $item['status']}checked{/if}/>
<script>
require(['bootstrap.switch'],function($){
$('.js-flag:checkbox').bootstrapSwitch({onText: '启用', offText: '关闭'});
$('.js-flag:checkbox').on('switchChange.bootstrapSwitch', function(event, state) {
var id = $(this).data('id');
var ban = state ? 1 : 0;
$.getJSON("{php echo $this->createWeburl('couponexchange', array('op' => 'change_status'))}", {id:id, status:ban}, function(data) {
var data = eval(data.message);
});
});
});
</script>
</td>
<td style="text-align:right;">
<a href="{php echo $this->createWeburl('goodsexchange', array('id' => $item['id'], 'op' => 'post'))}" title="编辑">编辑</a> -
<a href="{php echo $this->createWeburl('goodsexchange', array('id' => $item['id'], 'op' => 'delete'))}" onclick="return confirm('此操作不可恢复,确认删除?');return false;" title="删除">删除</a>
<a href="{php echo $this->createWeburl('goodsexchange', array('op' => 'record', 'exid' => $item['id'], 'type' => 'goods'))}" title="兑换记录">兑换记录</a>
</td>
</tr>
{/loop}
</tbody>
</table>
</div>
</div>
{$pager}
</div>
{elseif $op == 'deliver'}
<div class="main">
<div class="panel panel-info">
<div class="panel-heading">筛选</div>
<div class="panel-body">
<form action="./index.php" method="get" class="form-horizontal" role="form">
<input type="hidden" name="c" value="site">
<input type="hidden" name="a" value="entry">
<input type="hidden" name="do" value="goodsexchange">
<input type="hidden" name="m" value="we7_coupon">
<input type="hidden" name="op" value="deliver">
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">兑换标题</label>
<div class="col-sm-6 col-lg-8 col-xs-12">
<select class="form-control" name="exid">
<option value="">全部</option>
{loop $exchanges $exchange}
<option value="{$exchange['id']}" {if $_GPC['exid'] == $exchange['id']}selected{/if}>{$exchange['title']}</option>
{/loop}
</select>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">用户姓名/手机号</label>
<div class="col-sm-6 col-lg-8 col-xs-12">
<input class="form-control" name="uid" value="{$_GPC['uid']}">
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">兑奖日期</label>
<div class="col-sm-6 col-lg-8 col-xs-12">
{php echo tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d', $starttime),'endtime'=>date('Y-m-d', $endtime)));}
</div>
<div class="pull-right col-xs-12 col-sm-3 col-lg-2">
<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
<input type="submit" name="export" value="导出" class="btn btn-default">
<input type="hidden" name="token" value="{$_W['token']}" class="btn btn-default">
</div>
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="table-responsive panel-body">
<table class="table table-hover">
<thead class="navbar-inner">
<tr>
<th style="width:60px;">用户ID</th>
<th style="width:80px;">标题</th>
<th style="width:100px;">兑换物品</th>
<th style="width:100px;">收件人</th>
<th style="width:100px;">收件人电话</th>
<th style="width:100px;">收件人邮编</th>
<th style="width:150px;">收件地址</th>
<th style="width:80px;">状态</th>
<th style="text-align:center;width:80px;">操作</th>
</tr>
</thead>
<tbody>
{loop $list $item}
<tr>
<td>{$item['uid']}</td>
<td>{$item['title']}</td>
<td>{$item['extra']['title']}</td>
<td>{$item['name']}</td>
<td>{$item['mobile']}</td>
<td>{$item['zipcode']}</td>
<td>{$item['province']} {$item['city']} {$item['district']} {$item['address']}</td>
<td>
{if $item['status'] == 0}
<span class="label label-danger">待发货</span>
{elseif $item['status'] == 1}
<span class="label label-warning">已发货</span>
{elseif $item['status'] == 2}
<span class="label label-success">已收货</span>
{elseif $item['status'] == -1}
<span class="label label-default">已关闭</span>
{/if}
</td>
<td style="text-align:center;">
<a href="{php echo $this->createWeburl('goodsexchange',array('id'=>$item['tid'], 'op' => 'receiver'));}" title="编辑">编辑</a>
</td>
</tr>
{/loop}
</tbody>
</table>
</div>
</div>
{$pager}
</div>
{elseif $op == 'receiver'}
<div class="main">
<form action="" method="post" class="form-horizontal form">
<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">
<input type="text" name="realname" class="form-control" value="{$shipping['name']}" />
</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">
<input type="text" name="mobile" class="form-control" value="{$shipping['mobile']}" />
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">邮寄地址</label>
<div class="col-sm-9">
{php echo tpl_fans_form('reside', array('province' => $shipping['province'], 'city' => $shipping['city'], 'district' => $shipping['district']));}
</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">
<input type="text" name="zipcode" class="form-control" value="{$shipping['zipcode']}" />
</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">
<input type="text" name="address" class="form-control" value="{$shipping['address']}" />
</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">
<label class="radio-inline"><input type="radio" value="0" {if $shipping['status'] == 0}checked{/if} name="status">待发货</label>
<label class="radio-inline"><input type="radio" value="1" {if $shipping['status'] == 1}checked{/if} name="status">已发货</label>
<label class="radio-inline"><input type="radio" value="2" {if $shipping['status'] == 2}checked{/if} name="status">已收货</label>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<input name="id" type="hidden" value="{$id}">
<input name="submit" type="submit" value="保存" class="btn btn-primary">
<input type="hidden" name="token" value="{$_W['token']}" />
</div>
</div>
</form>
</div>
{elseif $op == 'record'}
<div class="main">
<div class="panel panel-info">
<div class="panel-heading">筛选</div>
<div class="panel-body">
<form action="./index.php" method="get" class="form-horizontal" role="form">
<input type="hidden" name="c" value="site">
<input type="hidden" name="a" value="entry">
<input type="hidden" name="do" value="goodsexchange">
<input type="hidden" name="m" value="we7_coupon">
<input type="hidden" name="op" value="record">
<input type="hidden" name="type" value="goods">
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">兑换标题</label>
<div class="col-sm-6 col-lg-8 col-xs-12">
<select class="form-control" name="exid">
{loop $exchanges_info $exchange}
<option value="{$exchange['id']}" {if $_GPC['exid'] == $exchange['id']}selected{/if}>{$exchange['title']}</option>
{/loop}
</select>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">用户UID</label>
<div class="col-sm-6 col-lg-8 col-xs-12">
<input class="form-control" name="uid" id="" type="text" value="{$_GPC['uid']}">
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">兑奖日期</label>
<div class="col-sm-6 col-lg-8 col-xs-12">
{php echo tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d', $starttime),'endtime'=>date('Y-m-d', $endtime)));}
</div>
<div class="pull-right col-xs-12 col-sm-3 col-lg-2">
<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
</div>
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="table-responsive panel-body">
<table class="table table-hover">
<thead class="navbar-inner">
<tr>
<th style="width:80px; text-align:center;">用户ID</th>
<th style="width:80px; text-align:center;">标题</th>
<th style="width:150px; text-align:center;">图标</th>
<th style="width:150px; text-align:center;">兑换物品</th>
<th style="width:150px; text-align:center;">兑换时间</th>
<th style="width:120px; text-align:center;">操作</th>
</tr>
</thead>
<tbody>
{loop $list $item}
<tr>
<td class="text-center">{$item['uid']}</td>
<td class="text-center">{$item['title']}</td>
<td class="text-center"><img src="{$item['thumb']}" style="max-width:50px; max-height: 30px;"></td>
<td class="text-center">{$item['extra']['title']}</td>
<td class="text-center">{php echo date('Y-m-d H:i', $item['createtime'])}</td>
<td class="text-center">
<a onclick="if(!confirm('删除后不可恢复,您确定删除吗?')) return false;" href="{php echo $this->createWeburl('goodsexchange', array('id' => $item['tid'], 'op' => 'record-del'))}" class="btn btn-default btn-sm" title="删除兑换记录"><i class="fa fa-times"></i></a>
<a href="{php echo $this->createWeburl('goodsexchange', array('id' => $item['tid'], 'op' => 'receiver'))}" class="btn btn-default btn-sm" title="收货人信息"><i class="fa fa-truck"></i></a>
</td>
</tr>
{/loop}
</tbody>
</table>
</div>
</div>
{$pager}
</div>
{/if}
{template 'common/footer'}