ordercomment.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. <style>
  45. tbody tr td{
  46. position: relative;
  47. }
  48. tbody tr .icow-weibiaoti--{
  49. visibility: hidden;
  50. display: inline-block;
  51. color: #fff;
  52. height:18px;
  53. width:18px;
  54. background: #e0e0e0;
  55. text-align: center;
  56. line-height: 18px;
  57. vertical-align: middle;
  58. }
  59. tbody tr:hover .icow-weibiaoti--{
  60. visibility: visible;
  61. }
  62. tbody tr .icow-weibiaoti--.hidden{
  63. visibility: hidden !important;
  64. }
  65. .full .icow-weibiaoti--{
  66. margin-left:10px;
  67. }
  68. .full>span{
  69. display: -webkit-box;
  70. display: -webkit-flex;
  71. display: -ms-flexbox;
  72. display: flex;
  73. vertical-align: middle;
  74. align-items: center;
  75. }
  76. tbody tr .label{
  77. margin: 5px 0;
  78. }
  79. .goods_attribute a{
  80. cursor: pointer;
  81. }
  82. .newgoodsflag{
  83. width: 22px;height: 16px;
  84. background-color: #ff0000;
  85. color: #fff;
  86. text-align: center;
  87. position: absolute;
  88. bottom: 70px;
  89. left: 57px;
  90. font-size: 12px;
  91. }
  92. .a{cursor: pointer;}
  93. .img-40{width:40px;height:40px;}
  94. </style>
  95. </head>
  96. <body layadmin-themealias="default">
  97. <table id="demo" lay-filter="test"></table>
  98. <div class="layui-fluid">
  99. <div class="layui-card">
  100. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">商品评价管理</span></div>
  101. <div class="layui-card-body" style="padding:15px;">
  102. <form action="" method="get" class="form-horizontal form-search layui-form">
  103. <input type="hidden" name="c" value="order" />
  104. <input type="hidden" name="a" value="ordercomment" />
  105. <div class="layui-form-item">
  106. <div class="layui-inline">
  107. <div class="layui-input-inline">
  108. <input type="text" class="layui-input" name='keyword' value="{$keyword}" placeholder="输入关键词然后回车">
  109. </div>
  110. <div class="layui-input-inline">
  111. <button class="layui-btn layui-btn-sm" type="submit"> 搜索</button>
  112. </div>
  113. </div>
  114. </div>
  115. </form>
  116. <form action="" class="layui-form" lay-filter="example" method="post" >
  117. <div class="row">
  118. <div class="col-md-12">
  119. <div class="page-table-header">
  120. <span class="pull-right">
  121. <a href="{:U('goods/addvircomment', array('ok' => 1))}" class="layui-btn layui-btn-xs layui-btn-sm"><i class="fa fa-plus"></i> 添加虚拟评价</a>
  122. </span>
  123. <div class="btn-group">
  124. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:U('goods/commentstate',array('state'=>1))}">
  125. 启用
  126. </button>
  127. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:U('goods/commentstate',array('state'=>0))}">
  128. 禁用
  129. </button>
  130. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除?" data-href="{:U('goods/deletecomment')}">
  131. 删除
  132. </button>
  133. </div>
  134. </div>
  135. <table class="table table-responsive" lay-even lay-skin="line" lay-size="lg">
  136. <thead>
  137. <tr>
  138. <th style="width:25px;">
  139. <input type='checkbox' name="checkall" lay-skin="primary" lay-filter="checkboxall" />
  140. </th>
  141. <th style="width:250px;">商品/订单编号</th>
  142. <th style="">评价者</th>
  143. <th >评价内容</th>
  144. <th style="width:200px;">评价图片</th>
  145. <th style="width:200px;">星级</th>
  146. <th >评价时间</th>
  147. <th style="width:200px;">审核状态</th>
  148. <th style="width:65px;text-align: center;">操作</th>
  149. </tr>
  150. </thead>
  151. <tbody>
  152. <?php foreach( $label as $row ){ ?>
  153. <tr>
  154. <td>
  155. <input type='checkbox' name="item_checkbox" lay-skin="primary" value="{$row['comment_id']}"/>
  156. </td>
  157. <td>
  158. <div rel="pop" style="display: flex" title="">
  159. <img class="img-40" src="{:tomedia($row['goods_image']);}" style="border-radius:50%;border:1px solid #efefef;">
  160. <span style="display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-left: 5px">
  161. <span class="nickname">
  162. {$row['goods_name']} &nbsp;
  163. {$row['order_num_alias']}
  164. </span>
  165. </span>
  166. </div>
  167. </td>
  168. <td>
  169. <div rel="pop" style="display: flex" title="">
  170. <img class="img-40" src="{:tomedia($row['avatar']);}" style="border-radius:50%;border:1px solid #efefef;">
  171. <span style="display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-left: 5px">
  172. <span class="nickname">
  173. {$row['user_name']}
  174. </span>
  175. </span>
  176. </div>
  177. </td>
  178. <td>
  179. {$row['content']}
  180. </td>
  181. <td>
  182. <?php
  183. $images_str = unserialize($row['images']);
  184. $images_arr = explode(',', $images_str);
  185. ?>
  186. <?php foreach( $images_arr as $img ){ ?>
  187. <?php if($img != 'undefined' && !empty($img) ){ ?>
  188. <img class="img-40" src="{:tomedia($img);}" style="border-radius:50%;border:1px solid #efefef;">
  189. <?php } ?>
  190. <?php } ?>
  191. </td>
  192. <td>
  193. 描述等级:{$row['star']}<br/>
  194. 价格合理等级:{$row['star2']}<br/>
  195. 质量满意等级:{$row['star3']}<br/>
  196. </td>
  197. <td>
  198. {:date('Y-m-d H:i:s',$row['add_time']);}
  199. </td>
  200. <td>
  201. <input type="checkbox" name="" lay-filter="statewsitch" data-href="{:U('goods/commentstate',array('id'=>$row['comment_id']))}" <?php if( $row['state']==1){ ?>checked<?php }else{ ?><?php } ?> lay-skin="switch" lay-text="审核|未审核">
  202. </td>
  203. <td style="text-align: center;">
  204. <a class='layui-btn layui-btn-xs deldom' href="javascript:;" data-href="{:U('goods/deletecomment', array('id' => $row['comment_id']))}" data-confirm='确认要删除吗?'>
  205. 删除
  206. </a>
  207. </td>
  208. </tr>
  209. <?php } ?>
  210. </tbody>
  211. <tfoot>
  212. <tr>
  213. <td colspan="3">
  214. <div class="page-table-header">
  215. <input type="checkbox" name="checkall" lay-skin="primary" lay-filter="checkboxall">
  216. <div class="btn-group">
  217. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:U('goods/commentstate',array('state'=>1))}">
  218. 启用
  219. </button>
  220. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:U('goods/commentstate',array('state'=>0))}">
  221. 禁用
  222. </button>
  223. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除?" data-href="{:U('goods/deletecomment')}">
  224. 删除
  225. </button>
  226. </div>
  227. </div>
  228. </td>
  229. <td colspan="6" style="text-align: right">
  230. {$pager}
  231. </td>
  232. </tr>
  233. </tfoot>
  234. </table>
  235. </div>
  236. </div>
  237. </form>
  238. </div>
  239. </div>
  240. </div>
  241. <script src="/layuiadmin/layui/layui.js"></script>
  242. <script>
  243. layui.config({
  244. base: '/layuiadmin/' //静态资源所在路径
  245. }).extend({
  246. index: 'lib/index' //主入口模块
  247. }).use('index');
  248. </script>
  249. <script>
  250. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  251. var layer = layui.layer;
  252. var $;
  253. layui.use(['jquery', 'layer','form'], function(){
  254. $ = layui.$;
  255. var form = layui.form;
  256. $('.deldom').click(function(){
  257. var s_url = $(this).attr('data-href');
  258. layer.confirm($(this).attr('data-confirm'), function(index){
  259. $.ajax({
  260. url:s_url,
  261. type:'post',
  262. dataType:'json',
  263. success:function(info){
  264. if(info.status == 0)
  265. {
  266. layer.msg(info.result.message,{icon: 1,time: 2000});
  267. }else if(info.status == 1){
  268. var go_url = location.href;
  269. if( info.result.hasOwnProperty("url") )
  270. {
  271. go_url = info.result.url;
  272. }
  273. layer.msg('操作成功',{time: 1000,
  274. end:function(){
  275. location.href = info.result.url;
  276. }
  277. });
  278. }
  279. }
  280. })
  281. });
  282. })
  283. $('.btn-operation').click(function(){
  284. var ids_arr = [];
  285. var obj = $(this);
  286. var s_toggle = $(this).attr('data-toggle');
  287. var s_url = $(this).attr('data-href');
  288. console.log(s_url);
  289. console.log(s_toggle);
  290. $("input[name=item_checkbox]").each(function() {
  291. if( $(this).prop('checked') )
  292. {
  293. ids_arr.push( $(this).val() );
  294. }
  295. })
  296. if(ids_arr.length < 1)
  297. {
  298. layer.msg('请选择要操作的内容');
  299. }else{
  300. var can_sub = true;
  301. if( s_toggle == 'batch-remove' )
  302. {
  303. can_sub = false;
  304. layer.confirm($(obj).attr('data-confirm'), function(index){
  305. $.ajax({
  306. url:s_url,
  307. type:'post',
  308. dataType:'json',
  309. data:{ids:ids_arr},
  310. success:function(info){
  311. if(info.status == 0)
  312. {
  313. layer.msg(info.result.message,{icon: 1,time: 2000});
  314. }else if(info.status == 1){
  315. var go_url = location.href;
  316. if( info.result.hasOwnProperty("url") )
  317. {
  318. go_url = info.result.url;
  319. }
  320. layer.msg('操作成功',{time: 1000,
  321. end:function(){
  322. location.href = info.result.url;
  323. }
  324. });
  325. }
  326. }
  327. })
  328. });
  329. }else{
  330. $.ajax({
  331. url:s_url,
  332. type:'post',
  333. dataType:'json',
  334. data:{ids:ids_arr},
  335. success:function(info){
  336. if(info.status == 0)
  337. {
  338. layer.msg(info.result.message,{icon: 1,time: 2000});
  339. }else if(info.status == 1){
  340. var go_url = location.href;
  341. if( info.result.hasOwnProperty("url") )
  342. {
  343. go_url = info.result.url;
  344. }
  345. layer.msg('操作成功',{time: 1000,
  346. end:function(){
  347. location.href = info.result.url;
  348. }
  349. });
  350. }
  351. }
  352. })
  353. }
  354. }
  355. })
  356. form.on('switch(statewsitch)', function(data){
  357. var s_url = $(this).attr('data-href')
  358. var s_value = 1;
  359. if(data.elem.checked)
  360. {
  361. s_value = 1;
  362. }else{
  363. s_value = 0;
  364. }
  365. $.ajax({
  366. url:s_url,
  367. type:'post',
  368. dataType:'json',
  369. data:{state:s_value},
  370. success:function(info){
  371. if(info.status == 0)
  372. {
  373. layer.msg(info.result.message,{icon: 1,time: 2000});
  374. }else if(info.status == 1){
  375. var go_url = location.href;
  376. if( info.result.hasOwnProperty("url") )
  377. {
  378. go_url = info.result.url;
  379. }
  380. layer.msg('操作成功',{time: 1000,
  381. end:function(){
  382. location.href = info.result.url;
  383. }
  384. });
  385. }
  386. }
  387. })
  388. });
  389. form.on('checkbox(checkboxall)', function(data){
  390. if(data.elem.checked)
  391. {
  392. $("input[name=item_checkbox]").each(function() {
  393. $(this).prop("checked", true);
  394. });
  395. $("input[name=checkall]").each(function() {
  396. $(this).prop("checked", true);
  397. });
  398. }else{
  399. $("input[name=item_checkbox]").each(function() {
  400. $(this).prop("checked", false);
  401. });
  402. $("input[name=checkall]").each(function() {
  403. $(this).prop("checked", false);
  404. });
  405. }
  406. form.render('checkbox');
  407. });
  408. //监听提交
  409. form.on('submit(formDemo)', function(data){
  410. $.ajax({
  411. url: data.form.action,
  412. type: data.form.method,
  413. data: data.field,
  414. dataType:'json',
  415. success: function (info) {
  416. if(info.status == 0)
  417. {
  418. layer.msg(info.result.message,{icon: 1,time: 2000});
  419. }else if(info.status == 1){
  420. var go_url = location.href;
  421. if( info.result.hasOwnProperty("url") )
  422. {
  423. go_url = info.result.url;
  424. }
  425. layer.msg('操作成功',{time: 1000,
  426. end:function(){
  427. location.href = info.result.url;
  428. }
  429. });
  430. }
  431. }
  432. });
  433. return false;
  434. });
  435. })
  436. </script>
  437. </body>