index.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. <extend name="Public:base" />
  2. <block name="content">
  3. <div class="page-header">
  4. </div>
  5. <div class="row">
  6. <div class="col-xs-12 search-row">
  7. <div class="">
  8. <ul class="nav nav-tabs">
  9. <li <?php if($get_status == -1){ ?>class="active" <?php } ?>><a href="{:U('Goods/index')}">全部商品</a></li>
  10. <li <?php if($get_status == 1){ ?>class="active" <?php } ?>><a href="{:U('Goods/index', array('status' => 1))}">上架商品</a></li>
  11. <li <?php if($get_status == 2){ ?>class="active" <?php } ?>><a href="{:U('Goods/index', array('status' => 2))}" >待上架审核</a></li>
  12. <li <?php if($get_status == 3){ ?>class="active" <?php } ?>><a href="{:U('Goods/index', array('status' => 3))}" >未通过审核</a></li>
  13. <li <?php if($get_status == 0){ ?>class="active" <?php } ?>><a href="{:U('Goods/index', array('status' => 0))}" >已下架商品</a></li>
  14. <li <?php if($get_status == 4){ ?>class="active" <?php } ?>><a href="{:U('Goods/index', array('status' => 4))}" >回收站</a></li>
  15. </ul>
  16. </div>
  17. </div>
  18. </div>
  19. <table class="table table-striped table-bordered table-hover search-form">
  20. <thead>
  21. <th><input name="name" type="text" placeholder="输入商品名称" value="{:I('name')}" /></th>
  22. <th>
  23. <select name="store_id">
  24. <option value="">-选择商家-</option>
  25. <volist name="seller_list" id="v" >
  26. <option <?php if(isset($get_store)&&($get_store==$v['s_id'])){echo ' selected="selected"';} ?> value="{$v.s_id}">{$v.s_true_name}</option>
  27. </volist>
  28. </select>
  29. </th>
  30. <th>
  31. <select name="category">
  32. <option value="">-选择分类-</option>
  33. <volist name="category" id="v" >
  34. <option <?php if(isset($get_category)&&($get_category==$v['id'])){echo ' selected="selected"';} ?> value="{$v.id}">{$v.name}</option>
  35. <volist name="v.children" id="vv" >
  36. <option <?php if(isset($get_category)&&($get_category==$vv['id'])){echo ' selected="selected"';} ?> value="{$vv.id}">  {$vv.name}</option>
  37. <volist name="vv.children" id="vvv" >
  38. <option <?php if(isset($get_category)&&($get_category==$vvv['id'])){echo ' selected="selected"';} ?> value="{$vvv.id}">    {$vvv.name}</option>
  39. </volist>
  40. </volist>
  41. </volist>
  42. </select>
  43. </th>
  44. <th>
  45. <select name="status">
  46. <option value="">-选择状态-</option>
  47. <option <?php if(isset($get_status)&&($get_status==1)){echo ' selected="selected"';} ?> value="1">上架</option>
  48. <option <?php if(isset($get_status)&&($get_status==2)){echo ' selected="selected"';} ?> value="2">等待审核</option>
  49. <option <?php if(isset($get_status)&&($get_status==0)){echo ' selected="selected"';} ?> value="0">未上架</option>
  50. <option <?php if(isset($get_status)&&($get_status==4)){echo ' selected="selected"';} ?> value="4">回收站</option>
  51. </select>
  52. </th>
  53. <th>
  54. <a class="btn btn-primary" href="javascript:;" id="search" url="{:U('Goods/index')}">查询</a>
  55. </th>
  56. </thead>
  57. </table>
  58. <div class="row">
  59. <div class="alert alert-info" id="alert_info">
  60. <button type="button" class="close" data-dismiss="alert">
  61. <i class="ace-icon fa fa-times"></i>
  62. </button>
  63. <p id="alert_content">
  64. </p>
  65. </div>
  66. </div>
  67. <div class="row">
  68. <div class="col-xs-12">
  69. <div class="table-responsive">
  70. <table id="table" class="table table-striped table-bordered table-hover">
  71. <thead>
  72. <tr>
  73. <th class="center">
  74. <label>
  75. <input type="checkbox" class="ace check-all" />
  76. <span class="lbl"></span>
  77. </label>
  78. </th>
  79. <th>ID</th>
  80. <th>图片</th>
  81. <th>商品名称</th>
  82. <th>分类</th>
  83. <th>首页推荐</th>
  84. <th>首页排序</th>
  85. <th>价格</th>
  86. <th>库存数量</th>
  87. <th>所属商家</th>
  88. <th>是否上架</th>
  89. <th>操作</th>
  90. </tr>
  91. </thead>
  92. <tbody>
  93. <volist name="list" id="v" empty="$empty">
  94. <tr>
  95. <td class="center">
  96. <label>
  97. <input class="ace ids" type="checkbox" name="id[]" value="{$v.goods_id}"/>
  98. <span class="lbl"></span>
  99. </label>
  100. </td>
  101. <td>{$v.goods_id}</td>
  102. <td>
  103. <?php if($v['image']){ ?>
  104. <img src="__ROOT__/{$v.image}" />
  105. <?php }else{ ?>
  106. <img src="__ROOT__/Common/image/no_image_50x50.jpg" />
  107. <?php } ?>
  108. </td>
  109. <td>{$v.name}
  110. <?php if(!empty($v['model'])){ ?>
  111. <br/>
  112. 商家编号:{$v.model}
  113. <?php } ?>
  114. </td>
  115. <td>{$v.class_name1}&nbsp;{$v.class_name2}&nbsp;{$v.class_name3}
  116. <br/>
  117. <?php
  118. switch($v['type'])
  119. {
  120. case 'lottery':
  121. echo '<span class="blue bold">抽奖</span>';
  122. break;
  123. case 'subject':
  124. echo '<span class="blue bold">主题活动</span>';
  125. break;
  126. case 'free_trial':
  127. echo '<span class="blue bold">免费试用</span>';
  128. case 'super_spike':
  129. echo '<span class="blue bold">超值大牌</span>';
  130. break;
  131. case 'spike':
  132. echo '<span class="blue bold">限时秒杀</span>';
  133. break;
  134. case 'niyuan':
  135. echo '<span class="blue bold">9.9活动</span>';
  136. break;
  137. case 'oneyuan':
  138. echo '<span class="blue bold">1元购活动</span>';
  139. break;
  140. case 'pintuan':
  141. echo '<span class="blue bold">拼团活动</span>';
  142. break;
  143. }
  144. if( $v['type'] != 'normal')
  145. {
  146. $pin_goods = M('pin_goods')->field('pin_price')->where( array('goods_id' => $v['goods_id']) )->find();
  147. echo '<span class="red bold"><br/>活动价:'.$pin_goods['pin_price'].'</span>';
  148. }
  149. switch($v['lock_type'])
  150. {
  151. case 'newman':
  152. echo '<span class="red bold"><br/>(老带新拼团活动)</span>';
  153. break;
  154. }
  155. ?>
  156. </td>
  157. <td>
  158. <label class="inline">
  159. <input gid="{$v.goods_id}" <?php if($v['is_index_show'] == 1){ ?> checked <?php } ?> type="checkbox" class="index_show id-pills-stacked ace ace-switch ace-switch-5">
  160. <span class="lbl middle"></span>
  161. </label>
  162. </td>
  163. <td>
  164. <input type="text" gid="{$v.goods_id}" style="width:80px;" name="index_sort" value="{$v.index_sort}" class="index_sort" />
  165. </td>
  166. <td>
  167. <span class="blue">单独价:{$v.danprice}</span><br/>
  168. <span class="grey">市场价:{$v.price}</span><br/>
  169. </td>
  170. <td>
  171. <input type="text" gid="{$v.goods_id}" style="width:80px;" name="quantity" value="{$v.quantity}" class="quantity" />
  172. </td>
  173. <td>
  174. <?php echo $seller_key_list[$v['store_id']]; ?>
  175. <?php if($v['status'] == 3 && !empty($v['reason'])){ ?>
  176. <br/>
  177. (审核未通过原因:){$v.reason}
  178. <?php } ?>
  179. </td>
  180. <td>
  181. <label class="inline">
  182. <input gid="{$v.goods_id}" <?php if($v['status'] == 1){ ?> checked <?php } ?> type="checkbox" class="qiyongstatus id-pills-stacked ace ace-switch ace-switch-5">
  183. <span class="lbl middle"></span>
  184. </label>
  185. </td>
  186. <td>
  187. <a class="btn btn-xs btn-info" href='{:U("Goods/edit",array("id"=>$v["goods_id"]))}'>
  188. <i class="icon-edit bigger-120"></i>编辑
  189. </a>
  190. <?php if($v['status'] == 2){ ?>
  191. <a class="btn btn-xs btn-info shenhe_back" rel_goods_id="{$v.goods_id}" href='javascript:;'>
  192. <i class="icon-edit bigger-120"></i>拒绝申请
  193. </a>
  194. <?php } ?>
  195. <?php if($v['status'] == 4) { ?>
  196. <a class="btn btn-xs btn-info gobakck" href="javascript:;" rel='{:U("Goods/goback",array("id"=>$v["goods_id"]))}'>
  197. 重新上架
  198. </a>
  199. <?php } ?>
  200. <?php if($v['status'] != 4) { ?>
  201. <a class="btn btn-xs btn-info backhuiche" href="javascript:;" rel='{:U("Goods/backhuiche",array("id"=>$v["goods_id"]))}'>
  202. 删除
  203. </a>
  204. <?php } ?>
  205. </td>
  206. </tr>
  207. </volist>
  208. <tr>
  209. <td colspan="20" class="page">{$page}</td>
  210. </tr>
  211. </tbody>
  212. </table>
  213. </div>
  214. </div>
  215. </div>
  216. <link rel="stylesheet" href="__CSS__/dialog.css" />
  217. <div class="ks-ext-mask" style="position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 999; display:none"></div>
  218. <div id="dialog" class="dialog" style="z-index: 9999; display:none;top:110px;">
  219. <div class="ks-contentbox">
  220. <div class="title"><span>审核拒绝原因</span><a class="ks-ext-close" href="javascript:void(0)">X</a></div>
  221. <dl>
  222. <dt>原因</dt>
  223. <dd>
  224. <textarea id="reason" rows="6" cols="40"></textarea>
  225. </dd>
  226. </dl>
  227. <div class="J_DefaultMessage"></div>
  228. <div class="bottom">
  229. <a href="javascript:void(0);" class="J_SubmitPL ncsc-btn ncsc-btn-green">确认</a>
  230. <a href="javascript:void(0);" class="J_Cancel ncsc-btn">取消</a>
  231. </div>
  232. </div>
  233. </div>
  234. </block>
  235. <block name="javascript">
  236. <script>
  237. function alert_show(msg)
  238. {
  239. $('#alert_content').html(msg);
  240. $('#alert_info').show();
  241. setTimeout("$('#alert_info').hide();",2000);
  242. }
  243. var goods_id =0;
  244. $(function(){
  245. $('.gobakck').click(function(){
  246. var rel_url = $(this).attr('rel');
  247. if(!confirm('确认重新上架吗?'))
  248. {
  249. return false;
  250. }
  251. $.ajax({
  252. url:rel_url,
  253. type:'get',
  254. dataType:'json',
  255. success:function(ret){
  256. if(ret.code == 1)
  257. {
  258. alert('重新上架成功!');
  259. location.href = location.href;
  260. return false;
  261. } else {
  262. alert(ret.msg);
  263. return false;
  264. }
  265. }
  266. })
  267. })
  268. $('.backhuiche').click(function(){
  269. var rel_url = $(this).attr('rel');
  270. if(!confirm('确认删除吗?'))
  271. {
  272. return false;
  273. }
  274. $.ajax({
  275. url:rel_url,
  276. type:'get',
  277. dataType:'json',
  278. success:function(ret){
  279. if(ret.code == 1)
  280. {
  281. alert('删除成功,您的商品已下架!');
  282. location.href = location.href;
  283. return false;
  284. } else {
  285. alert(ret.msg);
  286. return false;
  287. }
  288. }
  289. })
  290. })
  291. //关闭弹出层
  292. $('#dialog').on('click','.ks-ext-close',function(){
  293. $("#dialog").css('display','none');
  294. $('.ks-ext-mask').css('display','none');
  295. return false;
  296. });
  297. //关闭弹出层
  298. $('#dialog').on('click','.J_Cancel',function(){
  299. $("#dialog").css('display','none');
  300. $('.ks-ext-mask').css('display','none');
  301. return false;
  302. });
  303. $('.J_SubmitPL').click(function(e){
  304. var reason = $('#reason').val();
  305. $.ajax({
  306. url:"{:U('Goods/change_goods_shenhe')}",
  307. type:'post',
  308. data:{goods_id:goods_id,reason:reason},
  309. dataType:'json',
  310. success:function(ret){
  311. if(ret.code ==1)
  312. {
  313. alert('修改成功');
  314. location.href = location.href;
  315. return false;
  316. } else {
  317. alert(ret.msg);
  318. }
  319. }
  320. })
  321. $("#dialog").css('display','none');
  322. $('.ks-ext-mask').css('display','none');
  323. });
  324. $('.shenhe_back').click(function(){
  325. goods_id = $(this).attr('rel_goods_id');
  326. $("#dialog").css({'position' : 'fixed','display' : 'block', 'z-index' : '9999'});
  327. })
  328. $('.index_sort').blur(function(){
  329. var gid = $(this).attr('gid');
  330. var index_sort = $(this).val();
  331. $.ajax({
  332. url:"{:U('Goods/toggle_index_sort')}",
  333. type:'post',
  334. data:{gid:gid,index_sort:index_sort},
  335. dataType:'json',
  336. success:function(res){
  337. alert_show('修改排序成功')
  338. }
  339. })
  340. })
  341. $('.quantity').blur(function(){
  342. var quantity = $(this).val();
  343. var gid = $(this).attr('gid');
  344. $.ajax({
  345. url:"{:U('Goods/toggle_quantity')}",
  346. type:'post',
  347. data:{gid:gid,quantity:quantity},
  348. dataType:'json',
  349. success:function(res){
  350. alert_show('修改库存成功')
  351. }
  352. })
  353. });
  354. $('.index_show').on('click', function(){
  355. var gid = $(this).attr('gid');
  356. $.ajax({
  357. url:"{:U('Goods/toggle_index_show')}",
  358. type:'post',
  359. data:{gid:gid},
  360. dataType:'json',
  361. success:function(res){
  362. //code
  363. }
  364. })
  365. });
  366. $('.qiyongstatus').on('click', function(){
  367. var gid = $(this).attr('gid');
  368. $.ajax({
  369. url:"{:U('Goods/toggle_statues_show')}",
  370. type:'post',
  371. data:{gid:gid},
  372. dataType:'json',
  373. success:function(res){
  374. //code
  375. }
  376. })
  377. });
  378. $("#search").click(function () {
  379. var url = $(this).attr('url');
  380. var query = $('.search-form').find('input,select').serialize();
  381. query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
  382. query = query.replace(/^&/g, '');
  383. if (url.indexOf('?') > 0) {
  384. url += '&' + query;
  385. } else {
  386. url += '?' + query;
  387. }
  388. window.location.href = url;
  389. });
  390. });
  391. </script>
  392. </block>