fastadmin 在操作里加订单详情弹窗

第一步找到控制器对应的js文件。

//添加一个详情按钮
buttons:[{
  name: 'detail',
  text: '详情',
  title: '详情',
  icon: 'fa fa-list',
  extend: 'data-area=\'["80%", "80%"]\'',
  classname: 'btn btn-xs btn-primary btn-dialog',
  url: 'order/detail'
}],

 

 在order控制器添加方法:

/**
     * 详情
     */
    public function detail($ids)
    {
        $row = $this->model->get(['id' => $ids]);
        if (!$row) {
            $this->error(__('No Results were found'));
        }
        if (!$this->auth->isSuperAdmin()) {
            if (!$row['admin_id'] || !in_array($row['admin_id'], $this->childrenAdminIds)) {
                $this->error(__('You have no permission'));
            }
        }
        $this->view->assign("row", $row->toArray());
        return $this->view->fetch();
    }

 添加一个新页面

<style>
    .table-adminlog tr td {
        word-break: break-all;
    }
</style>
<table class="table table-striped table-adminlog">
    <thead>
    <tr>
        <th width="100">{:__('Title')}</th>
        <th>{:__('Content')}</th>
    </tr>
    </thead>
    <tbody>
    {volist name="row" id="vo" }
    <tr>
        <td>{:__($key)}</td>
        <td>{if $key=='createtime'}{$vo|datetime}{else/}{$vo|htmlentities}{/if}</td>
    </tr>
    {/volist}
    </tbody>
</table>
<div class="hide layer-footer">
    <label class="control-label col-xs-12 col-sm-2"></label>
    <div class="col-xs-12 col-sm-8">
        <button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button>
    </div>
</div>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值