From 9f03ae0b6bab4f2bb0abbe40ec66abd1d1ae87c4 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Sun, 26 Sep 2021 15:11:05 +0800
Subject: [PATCH] 20210926

---
 src/main/resources/templates/febs/views/modules/order/orderList.html |   35 ++++++++++++++++++++++++++++-------
 1 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/src/main/resources/templates/febs/views/modules/order/orderList.html b/src/main/resources/templates/febs/views/modules/order/orderList.html
index 09fb319..9e76b4a 100644
--- a/src/main/resources/templates/febs/views/modules/order/orderList.html
+++ b/src/main/resources/templates/febs/views/modules/order/orderList.html
@@ -120,7 +120,11 @@
                     maxmin: true,
                 });
             }
-
+            if (layEvent === 'cancelOrder') {
+                febs.modal.confirm('取消订单', '确认取消订单?', function () {
+                    cancelOrder(data.id);
+                });
+            }
             if (layEvent === 'seePayImage') {
                 var t = $view.find('#seePayImage'+data.id+'');
                 //页面层
@@ -137,6 +141,13 @@
                 });
             }
         });
+
+        function cancelOrder(id) {
+            febs.get(ctx + 'admin/order/cancelOrder/' + id, null, function () {
+                febs.alert.success('操作成功');
+                $query.click();
+            });
+        }
 
         // 查询按钮
         $query.on('click', function () {
@@ -195,12 +206,22 @@
                             }, minWidth: 80,align:'center'},
                     {title: '操作',
                         templet: function (d) {
-                             if (d.status === 2) {
-                                return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>'
-                                 +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>'
-                             }else{
-                                 return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>'
-                             }
+                            if(d.payMethod === '支付宝支付' || d.payMethod === '微信支付'){
+                                if (d.status === 2) {
+                                    return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>'
+                                        +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="cancelOrder" shiro:hasPermission="user:update">取消订单</button>'
+                                        +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>'
+                                }else{
+                                    return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>'
+                                }
+                            }else{
+                                if (d.status === 2) {
+                                    return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>'
+                                        +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>'
+                                }else{
+                                    return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>'
+                                }
+                            }
                         },minWidth: 300,align:'center'}
                 ]]
             });

--
Gitblit v1.9.1