wupengfei %!s(int64=2) %!d(string=hai) anos
pai
achega
1c2c9a57a4

+ 13 - 1
application/order/controller/AppOrder.php

@@ -76,7 +76,19 @@ class AppOrder extends Controller
         $this->title = '订单详情';
         $this->_form($this->table);
     }
-
+    /**
+     * 删除
+     * @auth true
+     * @menu true
+     * @param array $data
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function remove()
+    {
+        $this->_save($this->table, ['is_deleted' => '1']);
+    }
     /**
      * 表单数据处理
      * @auth true

+ 90 - 0
application/order/view/app_order/detail.html

@@ -0,0 +1,90 @@
+<div style="padding: 20px; background-color: #F2F2F2;">
+    <div class="layui-row layui-col-space15">
+        <div class="layui-col-md12">
+            <div class="layui-card">
+                <div class="layui-card-header">订单信息</div>
+                <div class="layui-card-body">
+                    <div class="layui-col-md6">订单号:{$data['order_no']}</div>
+                    <div class="layui-col-md6">订单状态:
+                        {eq name='vo.status' value='0'}<span class="layui-badge layui-bg-orange margin-left-5">待付款</span>{/eq}
+                        {eq name='vo.status' value='1'}<span class="layui-badge layui-bg-black margin-left-5">待发货</span>{/eq}
+                        {eq name='vo.status' value='2'}<span class="layui-badge layui-bg-green margin-left-5">已发货</span>{/eq}
+                        {eq name='vo.status' value='3'}<span class="layui-badge layui-bg-blue margin-left-5">已收货待评价</span>{/eq}
+                        {eq name='vo.status' value='4'}<span class="layui-badge layui-bg-blue margin-left-5">已完成</span>{/eq}
+                        {eq name='vo.status' value='9'}<span class="layui-badge layui-bg-blue margin-left-5">已取消</span>{/eq}
+                    </div><hr />
+                    <div class="layui-col-md6">商品总价:{$data['price_goods']|default='0'}</div><hr />
+                    <div class="layui-col-md6">需支付金额:{$data['price_total']|default='0'}</div>
+                    <div class="layui-col-md6">实际支付金额:{$data['price_total']|default='0'}</div><hr />
+                    <div class="layui-col-md6">优惠券抵扣金额:{$data['coupon_cash']|default='0'}</div>
+                    <hr />
+                    <div class="layui-col-md6">支付方式:
+                        {eq name='vo.pay_type' value='0'}<span class="layui-badge layui-bg-green margin-left-5">未支付</span>{/eq}
+                        {eq name='vo.pay_type' value='1'}<span class="layui-badge layui-bg-green margin-left-5">微信</span>{/eq}
+                        {eq name='vo.pay_type' value='2'}<span class="layui-badge layui-bg-blue margin-left-5">余额</span>{/eq}
+                        {eq name='vo.pay_type' value='3'}<span class="layui-badge layui-bg-orange margin-left-5">支付宝</span>{/eq}
+                    </div>
+                    <hr />
+                    <div class="layui-col-md6">下单时间:{$data.create_at|default='--'}</div>
+                    <div class="layui-col-md6">
+                        支付时间:{$vo.pay_at|default='--'}
+                    </div>
+                    <hr />
+                </div>
+            </div>
+        </div>
+        <div class="layui-col-md12">
+            <div class="layui-card">
+                <div class="layui-card-header">收货信息</div>
+                <div class="layui-card-body">
+                    <div class="layui-col-md6">收货人姓名:{$data.user_name|default='--'}</div>
+                    <div class="layui-col-md6">收货人手机:{$data.phone|default='--'}</div><hr />
+                    <div class="layui-col-md6">地址:{$vo.pro_name|default='--'}{$vo.city_name}{$vo.county_name}{$vo.street_name}{$vo.add_detail}{$vo.add_detail}</div><hr />
+                    <hr />
+                </div>
+            </div>
+        </div>
+        <div class="layui-col-md12">
+            <div class="layui-card">
+                <div class="layui-card-header">商品信息</div>
+                <div class="layui-card-body">
+                    <table class="layui-table margin-top-10" lay-skin="line">
+                        {notempty name='order_item'}
+                        <thead>
+                        <tr>
+                            <th class='text-left nowrap'>商品</th>
+                            <th class='text-left nowrap'>分类</th>
+                            <th class='text-left nowrap'>价格</th>
+                            <th class='text-left nowrap'>数量</th>
+                        </tr>
+                        </thead>
+                        {/notempty}
+                        <tbody>
+                        {foreach $order_item as $key=>$iv}
+                        <tr>
+                            <td class='text-left nowrap'>
+                                <div class="inline-block" style="max-width: 210px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
+                                    {foreach $iv.images_arr as $mv}
+                                        <img data-tips-image style="width:40px;height:40px;vertical-align:top" src="{$mv}" class="margin-right-5">
+                                    {/foreach}
+                                </div>
+                            </td>
+                            <td class='text-left'>
+                                {$iv.title|default='--'}
+                            </td>
+                            <td class='text-left'>
+                                {$iv.sell_price|default='0'}
+                            </td>
+                            <td class='text-left'>
+                                {$iv.num|default='0'}
+                            </td>
+                        </tr>
+                        {/foreach}
+                        </tbody>
+                    </table>
+                    {empty name='order_item'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
+                </div>
+            </div>
+        </div>
+    </div>
+</div>

+ 1 - 1
application/order/view/app_order/index.html

@@ -57,7 +57,7 @@
                 {eq name='vo.status' value='9'}<span class="layui-badge layui-bg-black margin-left-5">已取消</span>{/eq}
             </td>
             <td class='text-left nowrap'>
-                <a data-title="查看详情" class="layui-btn layui-btn-sm" data-modal='{:url("detail")}?id={$vo.id}'>查看详情</a>
+                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该记录吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}">删 除</a>
                 {if $vo.status == 0}
                     <span class="layui-btn layui-btn-sm layui-btn-warm" onclick="btn_confirm('订单完成','complete','{$vo.id}');">订单完成</span>
                 {/if}