xxxrrrdddd 3 years ago
parent
commit
5cc3838a7d

+ 5 - 0
application/admin/controller/UserOrder.php

@@ -87,4 +87,9 @@ class UserOrder extends Backend
         $this->assign('senders',$senders);
         return parent::edit($ids);
     }
+    public function send_detail($ids){
+        $order=$this->model->findOrFail($ids);
+        $this->assign('order',$order);
+        return view();
+    }
 }

+ 1 - 0
application/admin/view/user_order/index.html

@@ -25,6 +25,7 @@
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                            data-operate-edit="{:$auth->check('user_order/edit')}" 
                            data-operate-del="{:$auth->check('user_order/del')}"
+                           data-operate-send_detail="{:$auth->check('user_order/send_detail')}"
                            width="100%">
                     </table>
                 </div>

+ 24 - 0
application/admin/view/user_order/send_detail.html

@@ -0,0 +1,24 @@
+<style>
+    table tr{line-height: 30px;}
+    table td{text-align: center;border: 1px solid #d4d4d4;}
+</style>
+<div class="info clearfix table table-hover">
+    <table style="float: left;width: 100%">
+        <tr>
+            <td>视频</td>
+            <td>备注</td>
+            <td>时间</td>
+        </tr>
+        {foreach name='order.send_detail.log' item='a'}
+        <tr>
+            <td>
+                {foreach name='a.media' item='aa'}
+                <video src="{$aa}" controls style="max-width: 150px;max-height: 300px;"></video>
+                {/foreach}
+            </td>
+            <td>{$a.txt}</td>
+            <td>{$a.created_at|date='Y-m-d H:i:s',###}</td>
+        </tr>
+        {/foreach}
+    </table>
+</div>

+ 17 - 3
public/assets/js/backend/user_order.js

@@ -60,7 +60,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                     classname: 'btn btn-xs btn-primary btn-dialog btn-detail',
                                     icon: 'fa fa-list',
                                     url: 'user_order/edit',
-                                    width:'700',
                                     callback: function (data) {
                                         //Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
                                     },
@@ -69,14 +68,29 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                         return true;
                                     }
                                 },
+                                {
+                                    name: 'send_detail',
+                                    text: __('运送详情'),
+                                    title: __('运送详情'),
+                                    classname: 'btn btn-xs btn-primary btn-dialog btn-send_detail',
+                                    icon: 'fa fa-list',
+                                    url: 'user_order/send_detail',
+                                    callback: function (data) {
+                                        //Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
+                                    },
+                                    visible: function (row) {
+                                        //返回true时按钮显示,返回false隐藏
+                                        return $('#table').data('operate-send_detail')===1;
+                                    }
+                                },
                             ],
                         }
                     ]
                 ],
                 onLoadSuccess:function(){
                 // 这里就是数据渲染结束后的回调函数
-                $(".btn-detail,.btn-detail").data("area", ['1000px','100%']);
-                $(".btn-detail,.btn-detail").data("shade", [0.5,"#000"]);
+                $(".btn-detail,.btn-send_detail").data("area", ['1000px','100%']);
+                $(".btn-detail,.btn-send_detail").data("shade", [0.5,"#000"]);
             }
             });