Nenhuma descrição
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

ask_list.htm 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="overflow-y: scroll; cursor: default; -moz-user-select: inherit;">
  3. <div id="append_parent"></div>
  4. <div id="ajaxwaitid"></div>
  5. <div class="page" style="min-width: auto;">
  6. {include file="ask/bar" /}
  7. <div class="flexigrid">
  8. <div class="mDiv">
  9. <div class="ftitle">
  10. <h3>问题列表</h3>
  11. </div>
  12. <form class="navbar-form form-inline" action="{:url('Ask/ask_list')}" method="get" onsubmit="layer_loading('正在处理');">
  13. {$searchform.hidden|default=''}
  14. <div class="sDiv">
  15. <div class="sDiv2">
  16. <input type="text" size="30" name="keywords" class="qsbox" placeholder="搜索相关数据...">
  17. <input type="submit" class="btn" value="搜索">
  18. <i class="iconfont e-sousuo"></i>
  19. </div>
  20. </div>
  21. </form>
  22. </div>
  23. <div class="hDiv">
  24. <div class="hDivBox">
  25. <table cellspacing="0" cellpadding="0" style="width: 100%">
  26. <thead>
  27. <tr>
  28. <th class="sign w40" axis="col0">
  29. <div class="tc"><input type="checkbox" class="checkAll"></div>
  30. </th>
  31. <th abbr="article_show" axis="col5" class="w40">
  32. <div class="tc">ID</div>
  33. </th>
  34. <th abbr="ac_id" axis="col4">
  35. <div style="text-align: left; padding-left: 10px;" class="">问题标题</div>
  36. </th>
  37. <th abbr="article_title" axis="col3" class="w180">
  38. <div class="tc">用户名</div>
  39. </th>
  40. <th abbr="article_title" axis="col3" class="w150">
  41. <div class="tc">提问时间</div>
  42. </th>
  43. <th abbr="article_time" axis="col6" class="w50">
  44. <div class="tc">推荐</div>
  45. </th>
  46. <th abbr="article_time" axis="col6" class="w60">
  47. <div class="tc">审核</div>
  48. </th>
  49. <th abbr="article_time" axis="col6" class="w100">
  50. <div class="tc">所属栏目</div>
  51. </th>
  52. <th axis="col1" class="w50">
  53. <div class="tc">回答</div>
  54. </th>
  55. <th axis="col1" class="w50">
  56. <div class="tc">点击</div>
  57. </th>
  58. <th abbr="article_show" axis="col5" class="w80">
  59. <div class="tc">问题状态</div>
  60. </th>
  61. <th abbr="article_show" axis="col5" class="w60">
  62. <div class="tc">操作</div>
  63. </th>
  64. </tr>
  65. </thead>
  66. </table>
  67. </div>
  68. </div>
  69. <div class="bDiv" style="height: auto;">
  70. <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
  71. <table style="width: 100%">
  72. <tbody>
  73. {empty name="list"}
  74. <tr>
  75. <td class="no-data" align="center" axis="col0" colspan="50">
  76. <div class="no_row">
  77. <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
  78. </div>
  79. </td>
  80. </tr>
  81. {else/}
  82. {volist name="list" id="vo"}
  83. <tr>
  84. <td class="sign">
  85. <div class="w40 tc"><input type="checkbox" name="ask_ids[]" value="{$vo.ask_id}"></div>
  86. </td>
  87. <td class="sort">
  88. <div class="w40 tc">
  89. {$vo.ask_id}
  90. </div>
  91. </td>
  92. <td style="width: 100%">
  93. <div class="tl" style="padding-left: 10px;">
  94. <a href="{$vo.HomeUrl}" target="_blank">
  95. {$vo.ask_title}
  96. </a>
  97. </div>
  98. </td>
  99. <td class="">
  100. <div class="w180 tc" style="padding: 5px 0px;text-align: left;">
  101. <div style="float: left; margin: 0px 5px; padding: 0px;">
  102. <img width="40" height="40" style="margin-right: 5px;float: unset;margin: auto;" src="{$users_list[$vo['users_id']]['head_pic']|get_head_pic=###}" />
  103. </div>
  104. <div style="float: left; padding: 0px;">
  105. <p style="margin-top: -5px;">
  106. {$users_list[$vo['users_id']]['username']|default=''}
  107. </p>
  108. <p style="margin-top: -10px; color: #cccccc; font-size: 12px;">昵称:{$users_list[$vo['users_id']]['nickname']|default=$users_list[$vo['users_id']]['username']}</p>
  109. </div>
  110. </div>
  111. </td>
  112. <td class="">
  113. <div class="w150 tc">
  114. {$vo.add_time|MyDate='Y-m-d H:i:s',###}
  115. </div>
  116. </td>
  117. <td class="">
  118. <div class="w50 tc">
  119. {eq name="$vo['is_recom']" value='1'}
  120. <span class="yes" onclick="changeTableVal('ask','ask_id','{$vo.ask_id}','is_recom',this);">
  121. <i class="fa fa-check-circle"></i>是
  122. </span>
  123. {else /}
  124. <span class="no" onclick="changeTableVal('ask','ask_id','{$vo.ask_id}','is_recom',this);">
  125. <i class="fa fa-ban"></i>否
  126. </span>
  127. {/eq}
  128. </div>
  129. </td>
  130. <td class="">
  131. <div class="w60 tc">
  132. {eq name="$vo['is_review']" value='1'}
  133. <span class="yes" onclick="changeTableVal('ask','ask_id','{$vo.ask_id}','is_review',this);">
  134. <i class="fa fa-check-circle"></i>是
  135. </span>
  136. {else /}
  137. <span class="no" onclick="changeTableVal('ask','ask_id','{$vo.ask_id}','is_review',this);">
  138. <i class="fa fa-ban"></i>否
  139. </span>
  140. {/eq}
  141. </div>
  142. </td>
  143. <td class="">
  144. <div class="w100 tc">
  145. {$vo.type_name}
  146. <br/>
  147. {$vo.sub_type_name}
  148. </div>
  149. </td>
  150. <td>
  151. <div class="w50 tc">
  152. {$vo.replies}
  153. </div>
  154. </td>
  155. <td>
  156. <div class="w50 tc">
  157. {$vo.click}
  158. </div>
  159. </td>
  160. <td class="sort">
  161. <div class="w80 tc">
  162. {$vo.status}
  163. </div>
  164. </td>
  165. <td class="operation">
  166. <div class="w60 tc">
  167. {eq name="$Think.const.CONTROLLER_NAME.'@ask_del'|is_check_access" value="1"}
  168. <a class="btn red" href="javascript:void(0);" data-url="{:url('Ask/ask_del')}" onclick="FindDelData(this, '{$vo.ask_id}');">删除</a>
  169. {/eq}
  170. </div>
  171. </td>
  172. </tr>
  173. {/volist}
  174. {/empty}
  175. </tbody>
  176. </table>
  177. </div>
  178. <div class="iDiv" style="display: none;"></div>
  179. </div>
  180. <div class="tDiv">
  181. <div class="tDiv2">
  182. <div class="fbutton checkboxall">
  183. <input type="checkbox" class="checkAll">
  184. </div>
  185. <div class="fbutton">
  186. <a onclick="BatchDelData(this, 'ask_ids');" data-url="{:url('Ask/ask_del')}" class="layui-btn layui-btn-primary">
  187. <span>批量删除</span>
  188. </a>
  189. </div>
  190. <div class="fbutton">
  191. <a onclick="BatchReview(this, 'ask_ids');" data-url="{:url('Ask/ask_review')}" class="layui-btn layui-btn-primary">
  192. <span>批量审核</span>
  193. </a>
  194. </div>
  195. <div class="fbutton">
  196. <a onclick="BatchRecom(this, 'ask_ids');" data-url="{:url('Ask/ask_recom')}" class="layui-btn layui-btn-primary">
  197. <span>批量推荐</span>
  198. </a>
  199. </div>
  200. {include file="public/page" /}
  201. </div>
  202. <div style="clear:both"></div>
  203. </div>
  204. </div>
  205. </div>
  206. <script type="text/javascript">
  207. $(function(){
  208. $('input[name*=ids]').click(function(){
  209. if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
  210. $('.checkAll').prop('checked','checked');
  211. } else {
  212. $('.checkAll').prop('checked', false);
  213. }
  214. });
  215. $('input[type=checkbox].checkAll').click(function(){
  216. $('input[type=checkbox]').prop('checked',this.checked);
  217. });
  218. });
  219. $(document).ready(function(){
  220. // 表格行点击选中切换
  221. $('#flexigrid > table>tbody >tr').click(function(){
  222. $(this).toggleClass('trSelected');
  223. });
  224. // 点击刷新数据
  225. $('.fa-refresh').click(function(){
  226. location.href = location.href;
  227. });
  228. });
  229. /**
  230. * 批量删除提交
  231. */
  232. function BatchDelData(obj, name) {
  233. var a = [];
  234. $('input[name^='+name+']').each(function(i,o){
  235. if($(o).is(':checked')){
  236. a.push($(o).val());
  237. }
  238. })
  239. if(a.length == 0){
  240. layer.alert('请至少选择一项', {
  241. shade: layer_shade,
  242. area: ['480px', '190px'],
  243. move: false,
  244. title: '提示',
  245. btnAlign:'r',
  246. closeBtn: 3,
  247. success: function () {
  248. $(".layui-layer-content").css('text-align', 'left');
  249. }
  250. });
  251. return;
  252. }
  253. // 删除按钮
  254. layer.confirm('确认批量删除?', {
  255. area: ['480px', '190px'],
  256. move: false,
  257. title: '提示',
  258. shade: layer_shade,
  259. btnAlign:'r',
  260. closeBtn: 3,
  261. btn: ['确定','取消'] ,//按钮
  262. success: function () {
  263. $(".layui-layer-content").css('text-align', 'left');
  264. }
  265. }, function () {
  266. layer_loading('正在处理');
  267. $.ajax({
  268. type: "POST",
  269. url: $(obj).attr('data-url'),
  270. data: {del_id:a,_ajax:1},
  271. dataType: 'json',
  272. success: function (data) {
  273. layer.closeAll();
  274. if(parseInt(data.code) == 1){
  275. layer.msg(data.msg, {icon: 1});
  276. window.location.reload();
  277. }else{
  278. layer.alert(data.msg, {icon: 5});
  279. }
  280. },
  281. error:function(e){
  282. layer.closeAll();
  283. layer.alert(e.responseText, {icon: 5});
  284. }
  285. });
  286. }, function (index) {
  287. layer.closeAll(index);
  288. });
  289. }
  290. /**
  291. * 批量审核提交
  292. */
  293. function BatchReview(obj, name) {
  294. var a = [];
  295. $('input[name^='+name+']').each(function(i,o){
  296. if($(o).is(':checked')){
  297. a.push($(o).val());
  298. }
  299. })
  300. if(a.length == 0){
  301. layer.alert('请至少选择一项', {
  302. shade: layer_shade,
  303. area: ['480px', '190px'],
  304. move: false,
  305. title: '提示',
  306. btnAlign:'r',
  307. closeBtn: 3,
  308. success: function () {
  309. $(".layui-layer-content").css('text-align', 'left');
  310. }
  311. });
  312. return;
  313. }
  314. // 删除按钮
  315. layer.confirm('确认批量审核?', {
  316. area: ['480px', '190px'],
  317. move: false,
  318. title: '提示',
  319. shade: layer_shade,
  320. btnAlign:'r',
  321. closeBtn: 3,
  322. btn: ['确定','取消'] ,//按钮
  323. success: function () {
  324. $(".layui-layer-content").css('text-align', 'left');
  325. }
  326. }, function () {
  327. layer_loading('正在处理');
  328. $.ajax({
  329. type: "POST",
  330. url: $(obj).attr('data-url'),
  331. data: {ask_id:a,_ajax:1},
  332. dataType: 'json',
  333. success: function (data) {
  334. layer.closeAll();
  335. if(parseInt(data.code) == 1){
  336. layer.msg(data.msg, {icon: 1});
  337. window.location.reload();
  338. }else{
  339. layer.alert(data.msg, {icon: 5});
  340. }
  341. },
  342. error:function(e){
  343. layer.closeAll();
  344. layer.alert(e.responseText, {icon: 5});
  345. }
  346. });
  347. }, function (index) {
  348. layer.closeAll(index);
  349. });
  350. }
  351. /**
  352. * 批量推荐提交
  353. */
  354. function BatchRecom(obj, name) {
  355. var a = [];
  356. $('input[name^='+name+']').each(function(i,o){
  357. if($(o).is(':checked')){
  358. a.push($(o).val());
  359. }
  360. })
  361. if(a.length == 0){
  362. layer.alert('请至少选择一项', {
  363. shade: layer_shade,
  364. area: ['480px', '190px'],
  365. move: false,
  366. title: '提示',
  367. btnAlign:'r',
  368. closeBtn: 3,
  369. success: function () {
  370. $(".layui-layer-content").css('text-align', 'left');
  371. }
  372. });
  373. return;
  374. }
  375. // 删除按钮
  376. layer.confirm('确认批量推荐?', {
  377. area: ['480px', '190px'],
  378. move: false,
  379. title: '提示',
  380. shade: layer_shade,
  381. btnAlign:'r',
  382. closeBtn: 3,
  383. btn: ['确定','取消'] ,//按钮
  384. success: function () {
  385. $(".layui-layer-content").css('text-align', 'left');
  386. }
  387. }, function () {
  388. layer_loading('正在处理');
  389. $.ajax({
  390. type: "POST",
  391. url: $(obj).attr('data-url'),
  392. data: {ask_id:a,_ajax:1},
  393. dataType: 'json',
  394. success: function (data) {
  395. layer.closeAll();
  396. if(parseInt(data.code) == 1){
  397. layer.msg(data.msg, {icon: 1});
  398. window.location.reload();
  399. }else{
  400. layer.alert(data.msg, {icon: 5});
  401. }
  402. },
  403. error:function(e){
  404. layer.closeAll();
  405. layer.alert(e.responseText, {icon: 5});
  406. }
  407. });
  408. }, function (index) {
  409. layer.closeAll(index);
  410. });
  411. }
  412. /**
  413. * 单个删除
  414. */
  415. function FindDelData(obj, del_id) {
  416. layer.confirm('确认删除?', {
  417. area: ['480px', '190px'],
  418. move: false,
  419. title: '提示',
  420. shade: layer_shade,
  421. btnAlign:'r',
  422. closeBtn: 3,
  423. btn: ['确定','取消'] ,//按钮
  424. success: function () {
  425. $(".layui-layer-content").css('text-align', 'left');
  426. }
  427. }, function () {
  428. layer_loading('正在处理');
  429. $.ajax({
  430. url: $(obj).data('url'),
  431. type: 'post',
  432. dataType: 'json',
  433. data:{del_id:del_id,_ajax:1},
  434. success: function(res){
  435. layer.closeAll();
  436. if (1 == res.code) {
  437. layer.msg(res.msg, {time: 1000},function(){
  438. window.location.reload();
  439. });
  440. } else {
  441. layer.msg(res.msg, {time: 1500, icon: 5});
  442. }
  443. },
  444. error : function(e) {
  445. layer.closeAll();
  446. layer.alert(e.responseText, {icon: 5});
  447. }
  448. });
  449. }, function (index) {
  450. layer.closeAll(index);
  451. });
  452. }
  453. </script>
  454. {include file="public/footer" /}