From db93e8671fe9192dcd3ec5b364b65c672073b56e Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 04 Jun 2021 11:39:19 +0800
Subject: [PATCH] 20210604

---
 src/main/resources/templates/febs/views/modules/otc/otcOrderList.html |   82 ++++++++++++++++++++++------------------
 1 files changed, 45 insertions(+), 37 deletions(-)

diff --git a/src/main/resources/templates/febs/views/modules/otc/otcOrderList.html b/src/main/resources/templates/febs/views/modules/otc/otcOrderList.html
index 5bd5136..395e639 100644
--- a/src/main/resources/templates/febs/views/modules/otc/otcOrderList.html
+++ b/src/main/resources/templates/febs/views/modules/otc/otcOrderList.html
@@ -1,4 +1,4 @@
-<div class="layui-fluid layui-anim febs-anim" id="febs-user" lay-title="订单">
+<div class="layui-fluid layui-anim febs-anim" id="febs-user-order" lay-title="订单">
     <div class="layui-row febs-container">
         <div class="layui-col-md12">
             <div class="layui-card">
@@ -13,7 +13,7 @@
                                         </div>
                                     </div>
                                     <div class="layui-inline">
-                                        <label class="layui-form-label layui-form-label-sm">类型</label>
+                                        <label class="layui-form-label layui-form-label-sm">订单状态</label>
                                         <div class="layui-input-inline">
                                             <select name="status">
                                                 <option value="">请选择</option>
@@ -58,7 +58,7 @@
             febs = layui.febs,
             form = layui.form,
             table = layui.table,
-            $view = $('#febs-user'),
+            $view = $('#febs-user-order'),
             $query = $view.find('#query'),
             $reset = $view.find('#reset'),
             $searchForm = $view.find('form'),
@@ -75,29 +75,26 @@
             var data = obj.data,
                 layEvent = obj.event;
             if (layEvent === 'dealIng') {
-                febs.modal.confirm('处理', '开始处理申诉?', function () {
-                    dealIng(data.id);
+                febs.modal.open('付款', 'modules/otc/otcOrderInfo/' + data.id, {
+                    btn: ['提交', '取消'],
+                    yes: function (index, layero) {
+                        $('#user-update').find('#submit').trigger('click');
+                    },
+                    btn2: function () {
+                        layer.closeAll();
+                    }
                 });
             }
-            if (layEvent === 'dealDone') {
-                febs.modal.confirm('处理结束', '确认已处理结束?', function () {
-                    dealDone(data.id);
+
+            if (layEvent === 'reduceCoin') {
+                febs.modal.confirm('放币', '确定直接放币?', function () {
+                    febs.post(ctx + 'otc/reduceCoin/' + data.id, null, function () {
+                        febs.alert.success('放币成功');
+                        $query.click();
+                    });
                 });
             }
         });
-        function dealIng(id) {
-            febs.get(ctx + 'otc/dealIng/' + id, null, function () {
-                febs.alert.success('成功');
-                $query.click();
-            });
-        }
-        function dealDone(id) {
-            febs.get(ctx + 'otc/dealDone/' + id, null, function () {
-                febs.alert.success('成功');
-                $query.click();
-            });
-        }
-
 
         // 查询按钮
         $query.on('click', function () {
@@ -118,13 +115,23 @@
                 id: 'userTable',
                 url: ctx + 'otc/otcOrderList',
                 cols: [[
-                    {field: 'phone', title: '手机号', minWidth: 150,align:'left'},
+                    {field: 'phone', title: '手机号', minWidth: 100,align:'left'},
                     {field: 'realName', title: '姓名', minWidth: 100,align:'left'},
                     {field: 'inviteId', title: '邀请码', minWidth: 80,align:'center'},
-                    {field: 'order_no', title: '订单编号', minWidth: 80,align:'center'},
-                    {field: 'unitPrice', title: '单价',minWidth: 100,align:'center'},
-                    {field: 'coinAmount', title: '数量',minWidth: 100,align:'center'},
+                    {field: 'orderNo', title: '订单编号', minWidth: 150,align:'center'},
+                    {field: 'unitPrice', title: '单价',minWidth: 80,align:'center'},
+                    {field: 'coinAmount', title: '数量',minWidth: 80,align:'center'},
                     {field: 'totalAmount', title: '委托总金额',minWidth: 100,align:'center'},
+                    {field: 'orderType', title: '类型',
+                        templet: function (d) {
+                            if (d.orderType === 'B') {
+                                return '<span style="color:green;">买入</span>'
+                            } else if (d.orderType === 'S') {
+                                return '<span style="color:blue;">卖出</span>'
+                            } else{
+                                return ''
+                            }
+                        }, minWidth: 80,align:'center'},
                     {field: 'status', title: '订单状态',
                         templet: function (d) {
                             if (d.status === 1) {
@@ -139,18 +146,19 @@
                                 return ''
                             }
                         }, minWidth: 80,align:'center'},
-                    {field: 'nickname', title: '商家昵称',minWidth: 100,align:'center'},
-                    {field: 'payTime', title: '付款时间',minWidth: 100,align:'center'},
-                    {field: 'finishTime', title: '完成时间',minWidth: 100,align:'center'},
-                    // {title: '操作',templet: function (d) {
-                    //         if(d.status === 1){
-                    //             return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="dealIng" shiro:hasPermission="user:update">马上处理</button>'
-                    //         }else if(d.status === 2){
-                    //             return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="dealDone" shiro:hasPermission="user:update">已处理</button>'
-                    //         }else{
-                    //             return ''
-                    //         }
-                    //     },minWidth: 200,align:'center'}
+                    {field: 'payName', title: '付款人姓名',minWidth: 100,align:'center'},
+                    {field: 'payTime', title: '付款时间',minWidth: 150,align:'center'},
+                    {field: 'finishTime', title: '完成时间',minWidth: 150,align:'center'},
+                    {title: '操作',templet: function (d) {
+                            // return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="dealIng" shiro:hasPermission="user:update">付款</button>'
+                            if(d.status === 1){
+                                return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="dealIng" shiro:hasPermission="user:update">付款</button>'
+                            }else if (d.status === 2 && d.orderType === 'S'){
+                                return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="reduceCoin">放币</button>'
+                            } else {
+                                return '';
+                            }
+                        },minWidth: 100,align:'center'}
                 ]]
             });
         }

--
Gitblit v1.9.1