From 29a53109bdab489d23285af3d12d197eed98f3a4 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 25 Oct 2022 16:17:05 +0800
Subject: [PATCH] 20221021
---
src/main/resources/templates/febs/views/onhookplan/planList.html | 151 +++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 142 insertions(+), 9 deletions(-)
diff --git a/src/main/resources/templates/febs/views/onhookplan/planList.html b/src/main/resources/templates/febs/views/onhookplan/planList.html
index 566549b..4423c11 100644
--- a/src/main/resources/templates/febs/views/onhookplan/planList.html
+++ b/src/main/resources/templates/febs/views/onhookplan/planList.html
@@ -1,10 +1,143 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title>Title</title>
-</head>
-<body>
+<div class="layui-fluid layui-anim febs-anim" id="febs-member-plan" lay-title="挂机列表">
+ <div class="layui-row febs-container">
+ <div class="layui-col-md12">
+ <div class="layui-card">
+ <div class="layui-card-body febs-table-full">
+ <form class="layui-form layui-table-form" lay-filter="user-table-form">
+ <div class="layui-row">
+ <div class="layui-col-md10">
+ <div class="layui-form-item">
+ <div class="layui-inline">
+ <label class="layui-form-label layui-form-label-sm">操作类型</label>
+ <div class="layui-input-inline">
+ <select name="state">
+ <option value=""></option>
+ <option value="1">挂机中</option>
+ <option value="2">结束</option>
+ </select>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area">
+ <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query">
+ <i class="layui-icon"></i>
+ </div>
+ <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset">
+ <i class="layui-icon"></i>
+ </div>
+ </div>
+ </div>
+ </form>
+ <table lay-filter="planTable" lay-data="{id: 'planTable'}"></table>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+<style>
+ .layui-table-cell {
+ height: auto !important;
+ }
+</style>
+<script data-th-inline="none" type="text/javascript">
+ layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () {
+ var $ = layui.jquery,
+ laydate = layui.laydate,
+ febs = layui.febs,
+ form = layui.form,
+ table = layui.table,
+ dropdown = layui.dropdown,
+ $view = $('#febs-member-plan'),
+ $query = $view.find('#query'),
+ $reset = $view.find('#reset'),
+ $searchForm = $view.find('form'),
+ sortObject = {field: 'createTime', type: null},
+ tableIns;
-</body>
-</html>
\ No newline at end of file
+ form.render();
+
+ initTable();
+
+ table.on('tool(planTable)', function (obj) {
+ var data = obj.data,
+ layEvent = obj.event;
+ if (layEvent === 'agree') {
+ febs.modal.confirm('同意', '是否同意操作?', function () {
+ agree(data.id);
+ });
+ }
+ if (layEvent === 'disagree') {
+ febs.modal.confirm('拒绝', '是否拒绝操作?', function () {
+ disagree(data.id);
+ });
+ }
+ });
+
+ function agree(id) {
+ febs.get(ctx + 'admin/walletCoin/agreeWithdraw/' + id, null, function () {
+ febs.alert.success('操作成功');
+ $query.click();
+ });
+ }
+ function disagree(id) {
+ febs.get(ctx + 'admin/walletCoin/disagreeWithdraw/' + id, null, function () {
+ febs.alert.success('操作成功');
+ $query.click();
+ });
+ }
+
+ $query.on('click', function () {
+ var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type});
+ tableIns.reload({where: params, page: {curr: 1}});
+ });
+
+ $reset.on('click', function () {
+ $searchForm[0].reset();
+ tableIns.reload({where: getQueryParams(), page: {curr: 1}});
+ });
+
+ function initTable() {
+ tableIns = febs.table.init({
+ elem: $view.find('table'),
+ id: 'planTable',
+ url: ctx + 'admin/onHook/getplanList',
+ totalRow: true,
+ cols: [[
+ {field: 'username', title: '用户名', minWidth: 120, align: 'left', totalRowText: '合计'},
+ {field: 'state', title: '挂机状态',
+ templet: function (d) {
+ if (d.state === 1) {
+ return '<span>挂机中</span>'
+ } else if (d.state === 2) {
+ return '<span>结束</span>'
+ }else{
+ return
+ }
+ }, minWidth: 100, align: 'center'},
+ {field: 'planAmount', title: '挂机总金额', minWidth: 100, align: 'center'},
+ {field: 'avaAmount', title: '剩余金额', minWidth: 120, align: 'center', totalRow: true},
+ {field: 'planCode', title: '挂机方案倍数', minWidth: 120, align: 'center'},
+ {field: 'profit', title: '总收益', minWidth: 120, align: 'center', totalRow: true},
+ {field: 'createTime', title: '时间', minWidth: 180, align: 'center'},
+ // {title: '操作',
+ // templet: function (d) {
+ // if(d.status === 1){
+ // return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agree" shiro:hasPermission="user:update">同意</button>'
+ // +'<button class="layui-btn layui-btn-danger layui-btn-xs layui-btn-danger" lay-event="disagree" shiro:hasPermission="user:update">拒绝</button>'
+ // }else{
+ // return ''
+ // }
+ // },minWidth: 120,align:'center'}
+ ]]
+ });
+ }
+
+ function getQueryParams() {
+ return {
+ state: $searchForm.find("select[name='state']").val()
+ };
+ }
+
+ })
+</script>
--
Gitblit v1.9.1