From 57c12d09f1478036f659a718c81a18f7875aeccb Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 26 May 2023 15:10:47 +0800
Subject: [PATCH] twoCoin项目修改

---
 src/main/resources/templates/febs/views/dapp/money-change-flow.html |  123 +++++++++++++++++-----------------------
 1 files changed, 52 insertions(+), 71 deletions(-)

diff --git a/src/main/resources/templates/febs/views/dapp/money-change-flow.html b/src/main/resources/templates/febs/views/dapp/money-change-flow.html
index 18d85f8..18fbf71 100644
--- a/src/main/resources/templates/febs/views/dapp/money-change-flow.html
+++ b/src/main/resources/templates/febs/views/dapp/money-change-flow.html
@@ -7,40 +7,29 @@
                         <div class="layui-row">
                             <div class="layui-col-md10">
                                 <div class="layui-form-item">
+
                                     <div class="layui-inline">
+                                        <label class="layui-form-label">地址:</label>
                                         <div class="layui-input-inline">
-                                            <input type="text" name="address" autocomplete="off" placeholder="输入地址或邀请码" class="layui-input">
+                                            <input type="text" placeholder="输入地址" name="address" autocomplete="off" class="layui-input">
                                         </div>
                                     </div>
+
                                     <div class="layui-inline">
-                                        <label class="layui-form-label layui-form-label-sm">类型</label>
+                                        <label class="layui-form-label">转账HASH:</label>
+                                        <div class="layui-input-inline">
+                                            <input type="text" placeholder="输入转账HASH" name="fromHash" autocomplete="off" class="layui-input">
+                                        </div>
+                                    </div>
+
+                                    <div class="layui-inline">
+                                        <label class="layui-form-label">类型:</label>
                                         <div class="layui-input-inline">
                                             <select name="type">
                                                 <option value=""></option>
-                                                <option value="1">兑换</option>
-                                                <option value="2">提现</option>
-                                                <option value="3">采矿</option>
-                                                <option value="4">代理返利</option>
-                                            </select>
-                                        </div>
-                                    </div>
-<!--                                    <div class="layui-inline">-->
-<!--                                        <label class="layui-form-label layui-form-label-sm">可兑换</label>-->
-<!--                                        <div class="layui-input-inline">-->
-<!--                                            <select name="changeAble">-->
-<!--                                                <option value=""></option>-->
-<!--                                                <option value="2">否</option>-->
-<!--                                                <option value="1">是</option>-->
-<!--                                            </select>-->
-<!--                                        </div>-->
-<!--                                    </div>-->
-                                    <div class="layui-inline">
-                                        <label class="layui-form-label layui-form-label-sm">可提现</label>
-                                        <div class="layui-input-inline">
-                                            <select name="withdrawAble">
-                                                <option value=""></option>
-                                                <option value="2">否</option>
-                                                <option value="1">是</option>
+                                                <option value="1">购买节点</option>
+                                                <option value="2">直推收益</option>
+                                                <option value="3">收益</option>
                                             </select>
                                         </div>
                                     </div>
@@ -62,30 +51,32 @@
         </div>
     </div>
 </div>
-<style>
-    .layui-table-cell {
-        height: auto !important;
-    }
-</style>
-<script type="text/html" id="type-format">
+<script type="text/html" id="flow-type">
     {{#
     var type = {
-    1: {title: '兑换'},
-    2: {title: '提现'},
-    3: {title: '采矿'},
-    4: {title: '代理返利'}
+    1: {title: '购买节点', color: 'orange'},
+    2: {title: '直推收益', color: 'green'},
+    3: {title: '收益', color: 'blue'},
     }[d.type];
     }}
-    <span>{{ type.title }}</span>
+    <span class="layui-badge febs-bg-{{type.color}}">{{ type.title }}</span>
+</script>
+<script type="text/html" id="status-able">
+    {{#
+    var status = {
+    1: {title: '进行中', color: 'blue'},
+    2: {title: '成功', color: 'green'},
+    3: {title: '失败', color: 'red'}
+    }[d.status];
+    }}
+    <span class="layui-badge febs-bg-{{status.color}}">{{ status.title }}</span>
 </script>
 <script data-th-inline="none" type="text/javascript">
-    layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () {
+    layui.use(['jquery',  'form', 'table', 'febs'], function () {
         var $ = layui.jquery,
-            laydate = layui.laydate,
             febs = layui.febs,
             form = layui.form,
             table = layui.table,
-            dropdown = layui.dropdown,
             $view = $('#febs-money-change'),
             $query = $view.find('#query'),
             $reset = $view.find('#reset'),
@@ -102,16 +93,6 @@
                 layEvent = obj.event;
         });
 
-        table.on('sort(moneyChangeTable)', function (obj) {
-            sortObject = obj;
-            tableIns.reload({
-                initSort: obj,
-                where: $.extend(getQueryParams(), {
-                    field: obj.field,
-                    order: obj.type
-                })
-            });
-        });
 
         $query.on('click', function () {
             var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type});
@@ -127,34 +108,34 @@
             tableIns = febs.table.init({
                 elem: $view.find('table'),
                 id: 'moneyChangeTable',
-                url: ctx + 'flow/accountMoneyChangeFlow',
+                url: ctx + 'flow/fundFlow',
                 cols: [[
-                    {field: 'address', title: '地址', minWidth: 150},
-                    {field: 'preAmount', title: '变化前金额', minWidth: 100},
-                    {field: 'amount', title: '变化金额', minWidth: 100},
-                    {field: 'afterAmount', title: '变化后金额', minWidth: 100},
-                    {field: 'content', title: '描述', minWidth: 130},
-                    {title: '类型', templet: '#type-format'},
-                    {field: 'createTime', title: '创建时间', minWidth: 180}
+                    {field: 'address', title: '地址', minWidth: 400},
+                    {title: '类型', minWidth: 100,templet: '#flow-type',align:'center'},
+                    {field: 'amount', title: '金额',
+                        templet: function (d) {
+                            if (d.amount > 0) {
+                                return '<span style="color:green;">'+d.amount+'</span>'
+                            } else if (d.amount < 0) {
+                                return '<span style="color:red;">'+d.amount+'</span>'
+                            }else{
+                                return d.amount
+                            }
+                        }, minWidth: 80,align:'center'},
+                    {field: 'createTime', title: '创建时间', minWidth: 150},
+                    {title: '状态', templet: '#status-able', minWidth: 80},
+                    {field: 'fromHash', title: '转账HASH', minWidth: 150},
                 ]]
             });
         }
 
         function getQueryParams() {
-            // return {
-            //     inviteId: $searchForm.find('input[name="inviteId"]').val().trim(),
-            //     changeAble: $searchForm.find("select[name='changeAble']").val(),
-            //     accountStatus: $searchForm.find("select[name='accountStatus']").val(),
-            //     withdrawAble: $searchForm.find("input[name='withdrawAble']").val(),
-            //     invalidate_ie_cache: new Date()
-            // };
+            return {
+                address: $searchForm.find('input[name="address"]').val().trim(),
+                fromHash: $searchForm.find('input[name="fromHash"]').val().trim(),
+                type: $searchForm.find("select[name='type']").val()
+            };
         }
 
-        function changeStatus(url) {
-            febs.post(ctx + url, null, function () {
-                febs.alert.success('设置成功');
-                $query.click();
-            });
-        }
     })
 </script>

--
Gitblit v1.9.1