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 | 85 +++++++++++++++++++++++++++++++++--------- 1 files changed, 67 insertions(+), 18 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 2a62c2a..9e76b4a 100644 --- a/src/main/resources/templates/febs/views/modules/order/orderList.html +++ b/src/main/resources/templates/febs/views/modules/order/orderList.html @@ -54,6 +54,18 @@ </div> </form> <table lay-filter="orderTable" lay-data="{id: 'orderTable'}"></table> + <style type="text/css"> + .layui-table-cell{ + text-align:center; + height: auto; + white-space: nowrap; /*文本不会换行,在同一行显示*/ + overflow: hidden; /*超出隐藏*/ + text-overflow: ellipsis; /*省略号显示*/ + } + .layui-table img{ + max-width:100px + } + </style> </div> </div> </div> @@ -108,7 +120,34 @@ maxmin: true, }); } + if (layEvent === 'cancelOrder') { + febs.modal.confirm('取消订单', '确认取消订单?', function () { + cancelOrder(data.id); + }); + } + if (layEvent === 'seePayImage') { + var t = $view.find('#seePayImage'+data.id+''); + //页面层 + layer.open({ + type: 1, + title: "支付凭证", + skin: 'layui-layer-rim', //加上边框 + area: ['80%', '80%'], //宽高 + shadeClose: true, //开启遮罩关闭 + end: function (index, layero) { + return false; + }, + content: '<div style="text-align:center"><img src="' + $(t).attr('src') + '" /></div>' + }); + } }); + + function cancelOrder(id) { + febs.get(ctx + 'admin/order/cancelOrder/' + id, null, function () { + febs.alert.success('操作成功'); + $query.click(); + }); + } // 查询按钮 $query.on('click', function () { @@ -133,7 +172,18 @@ id: 'orderTable', url: ctx + 'admin/order/orderList', cols: [[ - {field: 'orderNo', title: '商品名称', minWidth: 150,align:'left'}, + {field: 'orderNo', title: '订单编号', minWidth: 120,align:'left'}, + {field: 'memberName', title: '购买人', minWidth: 120,align:'left'}, + {field: 'memberPhone', title: '联系方式', minWidth: 120,align:'left'}, + {field: 'amount', title: '订单金额', minWidth: 120,align:'left'}, + {field: 'orderTime', title: '下单时间', minWidth: 120,align:'left'}, + {field: 'payMethod', title: '支付方式', minWidth: 120,align:'left'}, + {field: 'payTime', title: '支付时间', minWidth: 120,align:'left'}, + {field: 'payOrderNo', title: '支付订单号', minWidth: 120,align:'left'}, + {field: 'payImage', title: '支付凭证', + templet: function (d) { + return '<a lay-event="seePayImage"><img id="seePayImage'+d.id+'" src="'+d.payImage+'" alt=""></a>'; + }, minWidth: 100,align:'center'}, {field: 'status', title: '状态', templet: function (d) { if (d.status === 1) { @@ -154,25 +204,24 @@ return '' } }, minWidth: 80,align:'center'}, - // {field: 'accountStatus', title: '账号状态', - // templet: function (d) { - // if (d.accountStatus === 1) { - // return '<span style="color:green;">正常</span>' - // } else if (d.accountStatus === 2) { - // return '<span style="color:red;">禁用</span>' - // }else{ - // return '' - // } - // }, minWidth: 80,align:'center'}, - // {field: 'createdTime', title: '注册时间', minWidth: 180,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