goods.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. {template 'common/header'}
  2. <ul class="nav nav-tabs">
  3. <li {if $do == 'display'}class="active"{/if}><a href="{php echo url('activity/goods/display', array());}">管理实物兑换</a></li>
  4. <li {if $do == 'post' && !$id}class="active"{/if}><a href="{php echo url('activity/goods/post', array());}">添加实物兑换</a></li>
  5. {if $do == 'post' && $id}<li class="active"><a href="{php echo url('activity/goods/post', array('id' => $id));}">编辑实物兑换</a></li>{/if}
  6. <li {if $do == 'record'}class="active"{/if}><a href="{php echo url('activity/goods/record');}">实物兑换记录</a></li>
  7. <li {if $do == 'deliver'}class="active"{/if}><a href="{php echo url('activity/goods/deliver');}">发货记录</a></li>
  8. {if $do == 'receiver' && $id}<li class="active"><a href="{php echo url('activity/goods/receiver', array('id' => $id));}">编辑收货人信息</a></li>{/if}
  9. </ul>
  10. {if $do == 'post'}
  11. <style>
  12. .text-danger{color:red;}
  13. </style>
  14. <div class="main">
  15. <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data" id="form1">
  16. <div class="panel panel-default">
  17. <div class="panel-heading">
  18. 兑换真实物品
  19. </div>
  20. <div class="panel-body">
  21. <div class="form-group">
  22. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 兑换名称</label>
  23. <div class="col-sm-9 col-xs-12">
  24. <input type="text" name="title" class="form-control" value="{$item['title']}" />
  25. <span class="help-block">此设置项为当前礼品兑换设置一个名称。</span>
  26. </div>
  27. </div>
  28. <div class="form-group">
  29. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 兑换内容</label>
  30. <div class="col-sm-9 col-xs-12">
  31. <input type="text" name="extra[title]" class="form-control" value="{$item['extra']['title']}" />
  32. <span class="help-block">此设置项设置当前礼品兑换的礼品名称。</span>
  33. </div>
  34. </div>
  35. <div class="form-group">
  36. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 积分类型</label>
  37. <div class="col-sm-9 col-xs-12">
  38. <select name="credittype" class="form-control">
  39. {loop $creditnames $key $credit}
  40. <option value="{$key}" {if $key == $item['credittype']}selected{/if}>{$credit}</option>
  41. {/loop}
  42. </select>
  43. <span class="help-block">此设置项设置当前礼品兑换需要消耗的积分类型,如:金币、积分、贡献等。</span>
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <label class="col-xs-12 col-sm-3 col-md-2 control-label">积分数量</label>
  48. <div class="col-sm-9 col-xs-12">
  49. <input type="text" name="credit" class="form-control" value="{$item['credit']}" />
  50. <span class="help-block">此设置项设置当前礼品兑换需要消耗的积分数量。</span>
  51. </div>
  52. </div>
  53. <div class="form-group">
  54. <label class="col-xs-12 col-sm-3 col-md-2 control-label">使用期限</label>
  55. <div class="col-sm-9 col-xs-12">
  56. {php echo tpl_form_field_daterange('datelimit', array('start' => date('Y-m-d', $item['starttime']),'end' => date('Y-m-d', $item['endtime'])), '')}
  57. </div>
  58. </div>
  59. <div class="form-group">
  60. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 每人最大兑换次数</label>
  61. <div class="col-sm-9 col-xs-12">
  62. <input type="text" name="pretotal" class="form-control" value="{$item['pretotal']}" />
  63. <span class="help-block">此设置项设置每个用户最大兑换次数。</span>
  64. </div>
  65. </div>
  66. <div class="form-group">
  67. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 兑换总数</label>
  68. <div class="col-sm-9 col-xs-12">
  69. <input type="text" name="total" class="form-control" value="{$item['total']}" />
  70. <span class="help-block">此设置项设置兑换总量。</span>
  71. </div>
  72. </div>
  73. <div class="form-group">
  74. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 封面</label>
  75. <div class="col-sm-9 col-xs-12">
  76. {php echo tpl_form_field_image('thumb', $item['thumb'])}
  77. </div>
  78. </div>
  79. <div class="form-group">
  80. <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 说明</label>
  81. <div class="col-sm-9 col-xs-12">
  82. {php echo tpl_ueditor('description', $item['description'])}
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="form-group col-sm-12">
  88. <input name="id" type="hidden" value="{$item['id']}">
  89. <input name="submit" type="submit" value="提交" class="btn btn-primary col-lg-1">
  90. <input type="hidden" name="token" value="{$_W['token']}" />
  91. </div>
  92. </form>
  93. </div>
  94. {elseif $do == 'display'}
  95. <div class="main">
  96. <div class="panel panel-info">
  97. <div class="panel-heading">筛选</div>
  98. <div class="panel-body">
  99. <form action="./index.php" method="get" class="form-horizontal" role="form">
  100. <input type="hidden" name="c" value="activity" />
  101. <input type="hidden" name="a" value="goods" />
  102. <div class="form-group">
  103. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">兑换名称</label>
  104. <div class="col-sm-7 col-lg-9 col-xs-12">
  105. <input class="form-control" name="keyword" id="" type="text" value="{$_GPC['keyword']}">
  106. </div>
  107. <div class="pull-right col-xs-12 col-sm-3 col-lg-2">
  108. <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
  109. </div>
  110. </div>
  111. </form>
  112. </div>
  113. </div>
  114. <div class="panel panel-default">
  115. <div class="table-responsive panel-body">
  116. <table class="table table-hover">
  117. <thead>
  118. <tr>
  119. <th style="width:50px">图标</th>
  120. <th style="width:100px;">标题</th>
  121. <th style="width:80px;">领取条件</th>
  122. <th style="width:90px;">可兑换次数</th>
  123. <th style="width:80px;">已兑换</th>
  124. <th style="width:80px;">总量</th>
  125. <th style="width:150px;">有效时间</th>
  126. <th style="text-align:right; width:120px;">操作</th>
  127. </tr>
  128. </thead>
  129. <tbody>
  130. {loop $list $item}
  131. <tr>
  132. <td><img width="40" src="{$item['thumb']}"></td>
  133. <td>{$item['title']}</td>
  134. <td>{$item['credit']} {$creditnames[$item['credittype']]}</td>
  135. <td>{$item['pretotal']} 次</td>
  136. <td>{$item['num']} 个</td>
  137. <td>{$item['total']} 个</td>
  138. <td>{php echo date('Y-m-d', $item['starttime'])} - {php echo date('Y-m-d', $item['endtime'])}</td>
  139. <td style="text-align:right;">
  140. <a href="{php echo url('activity/goods/post', array('id' => $item['id']))}" title="编辑">编辑</a>&nbsp;-&nbsp;
  141. <a href="{php echo url('activity/goods/del', array('id' => $item['id']))}" onclick="return confirm('此操作不可恢复,确认删除?');return false;" title="删除">删除</a>
  142. <a href="{php echo url('activity/goods/record', array('exid' => $item['id']))}" title="兑换记录">兑换记录</a>
  143. </td>
  144. </tr>
  145. {/loop}
  146. </tbody>
  147. </table>
  148. </div>
  149. </div>
  150. {$pager}
  151. </div>
  152. {elseif $do == 'record'}
  153. <div class="main">
  154. <div class="panel panel-info">
  155. <div class="panel-heading">筛选</div>
  156. <div class="panel-body">
  157. <form action="./index.php" method="get" class="form-horizontal" role="form">
  158. <input type="hidden" name="c" value="activity">
  159. <input type="hidden" name="a" value="goods">
  160. <input type="hidden" name="do" value="record">
  161. <div class="form-group">
  162. <label class="col-xs-12 col-sm-3 col-md-2 control-label">兑换标题</label>
  163. <div class="col-sm-6 col-lg-8 col-xs-12">
  164. <select class="form-control" name="exid">
  165. {loop $exchanges $exchange}
  166. <option value="{$exchange['id']}" {if $_GPC['exid'] == $exchange['id']}selected{/if}>{$exchange['title']}</option>
  167. {/loop}
  168. </select>
  169. </div>
  170. </div>
  171. <div class="form-group">
  172. <label class="col-xs-12 col-sm-3 col-md-2 control-label">用户UID</label>
  173. <div class="col-sm-6 col-lg-8 col-xs-12">
  174. <input class="form-control" name="uid" id="" type="text" value="{$_GPC['uid']}">
  175. </div>
  176. </div>
  177. <div class="form-group">
  178. <label class="col-xs-12 col-sm-3 col-md-2 control-label">兑奖日期</label>
  179. <div class="col-sm-6 col-lg-8 col-xs-12">
  180. {php echo tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d', $starttime),'endtime'=>date('Y-m-d', $endtime)));}
  181. </div>
  182. <div class="pull-right col-xs-12 col-sm-3 col-lg-2">
  183. <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
  184. </div>
  185. </div>
  186. </form>
  187. </div>
  188. </div>
  189. <div class="panel panel-default">
  190. <div class="table-responsive panel-body">
  191. <table class="table table-hover">
  192. <thead class="navbar-inner">
  193. <tr>
  194. <th style="width:80px; text-align:center;">用户ID</th>
  195. <th style="width:80px; text-align:center;">标题</th>
  196. <th style="width:150px; text-align:center;">图标</th>
  197. <th style="width:150px; text-align:center;">兑换物品</th>
  198. <th style="width:150px; text-align:center;">兑换时间</th>
  199. <th style="width:120px; text-align:center;">操作</th>
  200. </tr>
  201. </thead>
  202. <tbody>
  203. {loop $list $item}
  204. <tr>
  205. <td class="text-center">{$item['uid']}</td>
  206. <td class="text-center">{$item['title']}</td>
  207. <td class="text-center"><img src="{$item['thumb']}" style="max-width:50px; max-height: 30px;"></td>
  208. <td class="text-center">{$item['extra']['title']}</td>
  209. <td class="text-center">{php echo date('Y-m-d H:i', $item['createtime'])}</td>
  210. <td class="text-center">
  211. <a onclick="if(!confirm('删除后不可恢复,您确定删除吗?')) return false;" href="{php echo url('activity/goods/record-del', array('id' => $item['tid']))}" class="btn btn-default btn-sm" title="删除兑换记录"><i class="fa fa-times"></i></a>
  212. <a href="{php echo url('activity/goods/receiver', array('id' => $item['tid']))}" class="btn btn-default btn-sm" title="收货人信息"><i class="fa fa-truck"></i></a>
  213. </td>
  214. </tr>
  215. {/loop}
  216. </tbody>
  217. </table>
  218. </div>
  219. </div>
  220. {$pager}
  221. </div>
  222. {elseif $do == 'deliver'}
  223. <div class="main">
  224. <div class="panel panel-info">
  225. <div class="panel-heading">筛选</div>
  226. <div class="panel-body">
  227. <form action="./index.php" method="get" class="form-horizontal" role="form">
  228. <input type="hidden" name="c" value="activity">
  229. <input type="hidden" name="a" value="goods">
  230. <input type="hidden" name="do" value="deliver">
  231. <div class="form-group">
  232. <label class="col-xs-12 col-sm-3 col-md-2 control-label">兑换标题</label>
  233. <div class="col-sm-6 col-lg-8 col-xs-12">
  234. <select class="form-control" name="exid">
  235. {loop $exchanges $exchange}
  236. <option value="{$exchange['id']}" {if $_GPC['exid'] == $exchange['id']}selected{/if}>{$exchange['title']}</option>
  237. {/loop}
  238. </select>
  239. </div>
  240. </div>
  241. <div class="form-group">
  242. <label class="col-xs-12 col-sm-3 col-md-2 control-label">用户UID</label>
  243. <div class="col-sm-6 col-lg-8 col-xs-12">
  244. <input class="form-control" name="uid" id="" type="text" value="{$_GPC['uid']}">
  245. </div>
  246. </div>
  247. <div class="form-group">
  248. <label class="col-xs-12 col-sm-3 col-md-2 control-label">兑奖日期</label>
  249. <div class="col-sm-6 col-lg-8 col-xs-12">
  250. {php echo tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d', $starttime),'endtime'=>date('Y-m-d', $endtime)));}
  251. </div>
  252. <div class="pull-right col-xs-12 col-sm-3 col-lg-2">
  253. <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
  254. </div>
  255. </div>
  256. </form>
  257. </div>
  258. </div>
  259. <div class="panel panel-default">
  260. <div class="table-responsive panel-body">
  261. <table class="table table-hover">
  262. <thead class="navbar-inner">
  263. <tr>
  264. <th style="width:60px;">用户ID</th>
  265. <th style="width:80px;">标题</th>
  266. <th style="width:100px;">兑换物品</th>
  267. <th style="width:100px;">收件人</th>
  268. <th style="width:100px;">收件人电话</th>
  269. <th style="width:100px;">收件人邮编</th>
  270. <th style="width:150px;">收件地址</th>
  271. <th style="width:80px;">状态</th>
  272. <th style="text-align:center;width:80px;">操作</th>
  273. </tr>
  274. </thead>
  275. <tbody>
  276. {loop $list $item}
  277. <tr>
  278. <td>{$item['uid']}</td>
  279. <td>{$item['title']}</td>
  280. <td>{$item['extra']['title']}</td>
  281. <td>{$item['name']}</td>
  282. <td>{$item['mobile']}</td>
  283. <td>{$item['zipcode']}</td>
  284. <td>{$item['province']} {$item['city']} {$item['district']} {$item['address']}</td>
  285. <td>
  286. {if $item['status'] == 0}
  287. <span class="label label-danger">待发货</span>
  288. {elseif $item['status'] == 1}
  289. <span class="label label-warning">已发货</span>
  290. {elseif $item['status'] == 2}
  291. <span class="label label-success">已收货</span>
  292. {elseif $item['status'] == -1}
  293. <span class="label label-default">已关闭</span>
  294. {/if}
  295. </td>
  296. <td style="text-align:center;">
  297. <a href="{php echo url('activity/goods/receiver',array('id'=>$item['tid']));}" title="编辑">编辑</a>
  298. <!-- <a onclick="return confirm('确定要删除当前物品吗?');" href="{php echo url('activity/exchange/shipping',array('op'=>'delete','id'=>$item['id']));}" title="删除">删除</a>-->
  299. </td>
  300. </tr>
  301. {/loop}
  302. </tbody>
  303. </table>
  304. </div>
  305. </div>
  306. {$pager}
  307. </div>
  308. {elseif $do == 'receiver'}
  309. <div class="main">
  310. <form action="" method="post" class="form-horizontal form">
  311. <div class="panel panel-default">
  312. <div class="panel-heading">
  313. 收货人信息
  314. </div>
  315. <div class="panel-body">
  316. <div class="form-group">
  317. <label class="col-xs-12 col-sm-3 col-md-2 control-label">收货人姓名</label>
  318. <div class="col-sm-9">
  319. <input type="text" name="realname" class="form-control" value="{$shipping['name']}" />
  320. </div>
  321. </div>
  322. <div class="form-group">
  323. <label class="col-xs-12 col-sm-3 col-md-2 control-label">收货人电话</label>
  324. <div class="col-sm-9">
  325. <input type="text" name="mobile" class="form-control" value="{$shipping['mobile']}" />
  326. </div>
  327. </div>
  328. <div class="form-group">
  329. <label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">邮寄地址</label>
  330. <div class="col-sm-9">
  331. {php echo tpl_fans_form('reside', array('province' => $shipping['province'], 'city' => $shipping['city'], 'district' => $shipping['district']));}
  332. </div>
  333. </div>
  334. <div class="form-group">
  335. <label class="col-xs-12 col-sm-3 col-md-2 control-label">收货人邮编</label>
  336. <div class="col-sm-9">
  337. <input type="text" name="zipcode" class="form-control" value="{$shipping['zipcode']}" />
  338. </div>
  339. </div>
  340. <div class="form-group">
  341. <label class="col-xs-12 col-sm-3 col-md-2 control-label">收件地址</label>
  342. <div class="col-sm-9">
  343. <input type="text" name="address" class="form-control" value="{$shipping['address']}" />
  344. </div>
  345. </div>
  346. <div class="form-group">
  347. <label class="col-xs-12 col-sm-3 col-md-2 control-label">状态</label>
  348. <div class="col-sm-9">
  349. <label class="radio-inline"><input type="radio" value="0" {if $shipping['status'] == 0}checked{/if} name="status">待发货</label>
  350. <label class="radio-inline"><input type="radio" value="1" {if $shipping['status'] == 1}checked{/if} name="status">已发货</label>
  351. <label class="radio-inline"><input type="radio" value="2" {if $shipping['status'] == 2}checked{/if} name="status">已收货</label>
  352. </div>
  353. </div>
  354. </div>
  355. </div>
  356. <div class="form-group">
  357. <div class="col-sm-12">
  358. <input name="id" type="hidden" value="{$id}">
  359. <input name="submit" type="submit" value="保存" class="btn btn-primary">
  360. <input type="hidden" name="token" value="{$_W['token']}" />
  361. </div>
  362. </div>
  363. </form>
  364. </div>
  365. {/if}
  366. {template 'common/footer'}