123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- {extend name="public/container"}
- {block name="head_top"}
- <link href="{__MODULE_PATH}wechat/news/css/index.css" type="text/css" rel="stylesheet">
- {/block}
- {block name="content"}
- <style>
- tr td img{height: 50px;}
- </style>
- <div class="row"
- <div class="col-sm-9 m-l-n-md">
- <div class="ibox">
- <div class="ibox-title">
- <!--<button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}',{w:1100,h:760})">添加问答</button>-->
- <div style="margin-top: 2rem"></div>
- <div class="row">
- <div class="m-b m-l">
- <form action="" class="form-inline">
- <div class="input-group">
- <input type="text" name="title" value="{$where.title}" placeholder="请输入关键词" class="input-sm form-control"> <span class="input-group-btn"><button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span>
- </div>
- </form>
- <div class="layui-card-header">
- <button style="margin-left: 20px" type="button" class="layui-btn layui-btn-primary layui-btn-xs"
- id="lb">返回列表
- </button>
- </div>
- </div>
- </div>
- </div>
- <div class="ibox-content">
- <table class="footable table table-striped table-bordered " data-page-size="20">
- <thead>
- <tr>
- <th class="text-center" width="5%">id</th>
- <th class="text-center"width="40%">内容</th>
- <th class="text-left" >发布者</th>
- <th class="text-left">审核状态</th>
- <th class="text-center">添加时间</th>
- <th class="text-center" width="20%">操作</th>
- </tr>
- </thead>
- <tbody>
- {volist name="list" id="vo"}
- <tr>
- <td>{$vo.id}</td>
- <td>{$vo.content}</td>
- <td>{$vo.nickname}</td>
- <td class="text-center">
- {if condition="$vo['status'] eq 1"}
- 审核通过<br/>
- {elseif condition="$vo['status'] eq 2"/}
- 审核未通过
- {else/}
- 未审核<br/>
- <button data-url="{:url('fail',['id'=>$vo['id']])}" class="j-fail btn btn-danger btn-xs"
- type="button"><i class="fa fa-close"></i> 无效
- </button>
- <button data-url="{:url('succ',['id'=>$vo['id']])}" class="j-success btn btn-primary btn-xs"
- type="button"><i class="fa fa-check"></i> 通过
- </button>
- {/if}
- </td>
- <td>{$vo.add_time|date="Y-m-d H:i:s"}</td>
- <td class="text-center">
- <button style="margin-top: 5px;" class="btn btn-danger btn-xs del_news_one" data-id="{$vo.id}" type="button" data-url="{:Url('delete',array('id'=>$vo['id']))}" ><i class="fa fa-times"></i> 删除</button>
- </td>
- </tr>
- {/volist}
- </tbody>
- </table>
- </div>
- <div style="margin-left: 10px">
- {include file="public/inner_page"}
- </div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script>
- $('.del_news_one').on('click',function(){
- window.t = $(this);
- var _this = $(this),url =_this.data('url');
- $eb.$swal('delete',function(){
- $eb.axios.get(url).then(function(res){
- console.log(res);
- if(res.status == 200 && res.data.code == 200) {
- $eb.$swal('success',res.data.msg);
- _this.parents('tr').remove();
- }else
- return Promise.reject(res.data.msg || '删除失败')
- }).catch(function(err){
- $eb.$swal('error',err);
- });
- })
- });
- $('#lb').on('click',function(){
- location.href = "{:Url('qa.Questions/index')}";
- })
- $('.j-fail').on('click', function () {
- var url = $(this).data('url');
- $eb.$swal('delete', function () {
- $eb.axios.post(url).then(function (res) {
- if (res.data.code == 200) {
- setTimeout(function () {
- window.location.reload();
- }, 1000);
- $eb.$swal('success', res.data.msg);
- } else
- $eb.$swal('error', res.data.msg || '操作失败!');
- });
- }, {
- title: '确定审核拒绝?',
- text: '拒绝后无法撤销,请谨慎操作!',
- confirm: '审核拒绝'
- });
- });
- $('.j-success').on('click', function () {
- var url = $(this).data('url');
- $eb.$swal('delete', function () {
- $eb.axios.post(url).then(function (res) {
- if (res.data.code == 200) {
- setTimeout(function () {
- window.location.reload();
- }, 1000);
- $eb.$swal('success', res.data.msg);
- } else
- $eb.$swal('error', res.data.msg || '操作失败!');
- });
- }, {
- title: '确定审核通过?',
- text: '通过后无法撤销,请谨慎操作!',
- confirm: '审核通过'
- });
- });
- </script>
- {/block}
|