| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'offline/offline_withdraw/index' + location.search,
- add_url: 'offline/offline_withdraw/add',
- edit_url: 'offline/offline_withdraw/edit',
- del_url: 'offline/offline_withdraw/del',
- multi_url: 'offline/offline_withdraw/multi',
- import_url: 'offline/offline_withdraw/import',
- table: 'offline_withdraw_record',
- }
- });
- var table = $("#table");
- $(".btn-refresh").click(function (){
- getBalances();
- });
-
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- fixedColumns: true,
- fixedRightNumber: 1,
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- // {field: 'frozen_id', title: __('Frozen_id')},
- {field: 'tx_hash', title: __('Tx_hash'), operate: 'LIKE'},
- {field: 'user_id', title: __('User_id')},
- {field: 'address', title: '账号地址',cellStyle : function(value, row, index, field){
- return {
- css: {
- "white-space": "nowrap",
- "text-overflow": "ellipsis",
- "overflow": "hidden",
- "max-width":"300px"
- }
- };
- }},
- {field: 'to_address', title: '提现地址',cellStyle : function(value, row, index, field){
- return {
- css: {
- "white-space": "nowrap",
- "text-overflow": "ellipsis",
- "overflow": "hidden",
- "max-width":"300px"
- }
- };
- }},
- {field: 'symbol', title: __('Symbol'), operate: 'LIKE'},
- {field: 'amount', title: __('Amount'), operate:'BETWEEN'},
- {field: 'real_amount', title: __('Real_amount'), operate:'BETWEEN'},
- {
- field: 'status', title: '充值状态', searchList: {
- '0': '待处理',
- '100': '自动提现中',
- '200': '自动打款成功',
- '201': '手动打款成功',
- '300': '驳回',
- '400': '提现失败',
- '500': '取消',
- }, operate: 'FIND_IN_SET', formatter: Table.api.formatter.label
- },
- {field: 'usdt', title: __('实际到账金额')},
- {field: 'rate', title: __('汇率')},
- {field: 'fee', title: __('手续费')},
- {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {
- field: 'operate', title: __('Operate'), table: table,
- events: Table.api.events.operate,
- buttons: [{
- name: 'approve',
- text: '审核订单',
- title: '审核订单',
- classname: 'btn btn-xs btn-primary btn-dialog btn-receivable',
- icon: 'fa fa-keyboard-o',
- url: 'offline/offline_withdraw/approve',
- extend: 'data-area=\'["50%", "50%"]\'',
- visible: function (row) {
- // 自定义按钮 动态是否显示
- return row.status === 0;
- }
- },],
- formatter: Table.api.formatter.operate
- }
- ]
- ]
- });
- // 为表格绑定事件
- Table.api.bindevent(table);
- },
- add: function () {
- Controller.api.bindevent();
- },
- approve: function () {
- Form.api.bindevent($("form[role=form]"), function () {
- }, function () {
- }, function (success, error) {
- layer.confirm('请先仔细确认提现数据!', {
- btn: ['确定', '取消'] //按钮
- }, function (index) {
- Form.api.submit($("form[role=form]"), function (data, ret) {
- //如果我们需要在提交表单成功后做跳转,可以在此使用location.href="链接";进行跳转
- setTimeout(function () {
- parent.Layer.close(parent.Layer.getFrameIndex(window.name));
- //刷新页面
- window.parent.location.reload();
- }, 1000);
- });
- Layer.close(index);
- }, function () {
- });
- return false;
- });
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- setTimeout(getBalances, 500);
- return Controller;
- });
- //头部统计
- function getBalances(){
- $.post("offline/offline_withdraw/getBalance",{},
- function (data) {
- $("#wallet_balance").text(data.reqBalance);
- $("#handling_balance").text(data.reqFee);
- $("#residual_amount").text(data.reqAmount);
- })
- }
|