1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
| $(function() {
| var app = new Vue({
| el: '#container',
| data: {
| mode: 0,
| temp_screen_time_index: 0,
| current_page: 1,
| screen_time_index: 0,
| orders: [],
| hasMore: true,
| withdraw_records: [],
| order_statistic: {
| user_count: 0,
| order_count: 0,
| valid_order_count:0,
| total_money: 0.00
| },
| config: {}
| },
| mounted: function() {
|
| this.$nextTick(function() {
| app.getConfig();
| app.search();
| });
| },
| methods: {
| to_miandan: function() {
| window.location.href = app.config.submitKeyUrl;
| },
| change_mode: function(mode) {
| app.mode = mode;
| if (mode == 1) {
| app.withdrawList();
| }
| },
| open_screen: function() {
| app.temp_screen_time_index = app.screen_time_index;
| let index = layer.open({
| id: 'screen-layer',
| type: 1,
| title: false,
| offset: 'b',
| content: $("#screen"),
| shadeClose: true,
| anim: 2,
| isOutAnim: false,
| area: ['7.5rem', '4.6rem'],
| closeBtn: 0
| });
| layer.style(index, {
| background: 'transparent'
| });
| },
| closeScreen: function() {
| layer.closeAll();
| },
| selectScreenTime: function(index) {
| app.temp_screen_time_index = index;
| },
| resetScreen: function() {
| app.temp_screen_time_index = 0;
| },
| sureScreen: function() {
| app.screen_time_index = app.temp_screen_time_index;
| layer.closeAll();
| app.search();
| },
| setAlipayAccount: function() {
| window.location.href = "alipay_account_setting.html";
| },
|
| getConfig: function() {
| http.post("/agentapi/admin/getConfig", {}, function(res) {
| if (res.code == 0) {
| app.config = res.data;
| }
|
| }, function(res) {
|
| });
| },
| requestOrders: function() {
| http.post("/agentapi/admin/orderList", {
| key: $("#search_key").val(),
| timeIndex: app.screen_time_index,
| page: app.current_page
| }, function(res) {
| if (res.code == 0) {
| if (app.current_page == 1) {
| app.orders = [];
| }
| app.orders = app.orders.concat(res.data.list);
| app.order_statistic.order_count = res.data.count;
| app.order_statistic.valid_order_count = res.data.statistic.count;
| app.order_statistic.user_count = res.data.statistic.userCount;
| app.order_statistic.total_money = res.data.statistic.money;
| if (app.orders.length < app.order_statistic.order_count) {
| app.hasMore = true;
| } else {
| app.hasMore = false;
| }
| }
|
| }, function(res) {
|
| });
| },
| requestWithdraw: function() {
| http.post("/agentapi/admin/withdrawList", {
| page: app.current_page
| }, function(res) {
| if (res.code == 0) {
| if (app.current_page == 1) {
| app.withdraw_records = [];
| }
| app.withdraw_records = app.withdraw_records.concat(res.data.list);
| if (app.withdraw_records.length < res.data.count) {
| app.hasMore = true;
| } else {
| app.hasMore = false;
| }
| }
| }, function(res) {
|
| });
| },
| search: function() {
| app.current_page = 1;
| app.order_statistic = {
| user_count: 0,
| order_count: 0,
| valid_order_count: 0,
| total_money: 0.00
| };
| app.requestOrders();
| },
| withdrawList: function() {
| app.current_page = 1;
| app.requestWithdraw();
| },
|
| loadOrder: function() {
| if (!app.hasMore) {
| return;
| }
| app.current_page += 1;
| app.requestOrders();
| },
| loadWidthdraw: function() {
| if (!app.hasMore) {
| return;
| }
| app.current_page += 1;
| app.requestWithdraw();
| },
| withdraw: function(id) {
| http.post("/agentapi/admin/withdraw", {
| id: id
| }, function(res) {
| if (res.code == 0) {
| app.withdrawList();
| } else {
| layer.msg(res.msg);
| }
| }, function(res) {
|
| });
|
| }
|
| }
|
| });
|
| });
|
|