10.10综合交易所原始源码-管理后台
admin
2026-01-06 a3cc41349752d6fb067df2a58e4e4b723a915f21
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
<template>
  <div class="mod-c2c_pay_order">
    <avue-crud
      ref="crud"
      :page.sync="page"
      :data="dataList"
      :option="tableOption"
      @search-change="searchChange"
      @selection-change="selectionChange"
      :cell-class-name="addClasscolor"
      @on-load="getDataList"
    >
      <!-- <template slot="menuLeft">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="small"
          v-if="isAuth('sys:user:save')"
          @click.stop="addOrUpdateHandle()"
          >新增演示账号</el-button
        >
      </template> -->
      <template slot-scope="scope" slot="methodImg">
        <img :src="scope.row.methodImg" alt="" />
      </template>
      <template slot-scope="scope" slot="uscodemn">
        <span>{{ scope.row.c2c_user_code }}</span>
      </template>
      <template slot-scope="scope" slot="c2cUscodemn">
        <span>{{ scope.row.c2c_user_party_code }}</span>
      </template>
      <template slot-scope="scope" slot="username">
        <el-button type="text" @click.stop="searchName(scope.row)">{{
          scope.row.username
        }}</el-button>
      </template>
      <template slot-scope="scope" slot="c2c_user_party_name">
        <el-button type="text" @click.stop="searchName(scope.row)">{{
          scope.row.c2c_user_party_name
        }}</el-button>
      </template>
      <template slot-scope="scope" slot="method_type_name">
        <el-button type="text" @click.stop="searPaymsg(scope.row.order_no)"
          >点击查看</el-button
        >
      </template>
      <template slot-scope="scope" slot="paramName3">
        <el-button type="text" @click.stop="searchOtherMsg(scope.row)"
          ><span class="clcleChear">查看</span>
          <span v-if="scope.row.unread_msg" class="cicleMsg">{{
            scope.row.unread_msg
          }}</span></el-button
        >
      </template>
      <template slot-scope="scope" slot="paramName4">
        <el-button type="text" @click.stop="lastSearch(scope.row)"
          >更多信息</el-button
        >
      </template>
      <!-- <template slot-scope="scope" slot="menu">
        <el-select
          v-model="scope.row.select"
          class="celectSpeac"
          clearable
          placeholder="操作"
          @change="
            changeSelet(
              scope.row.userId,
              scope.row.select,
              scope.row.userCode,
              scope.row
            )
          "
        >
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
      </template> -->
      <template slot-scope="scope" slot="menu">
 
        <el-button
          type="primary"
          icon="el-icon-edit"
          size="small"
          v-if="
           scope.row.direction == 'buy'&&(scope.row.state == '1' ||
            scope.row.state == '2' ||
            scope.row.state == '5')&&
            isAuth('c2c:c2c_pay_order:pass')
          "
          @click.stop="passtHandle(scope.row, 'n')"
          >手动放行</el-button
        >
        <el-button
          type="primary"
          icon="el-icon-edit"
          size="small"
          v-if="
          scope.row.direction == 'sell'&&(scope.row.state == '1' ||
            scope.row.state == '2' ||
            scope.row.state == '5')&& isAuth('c2c:c2c_pay_order:adminpass')
          "
          @click.stop="passtHandle(scope.row, 'n')"
          >已付款管理员手动放行</el-button
        >
        <el-button
          type="primary"
          icon="el-icon-edit"
          size="small"
          v-if="
          isAuth('c2c:c2c_pay_order:transfer') &&
          scope.row.direction == 'sell'&&(scope.row.state == '0' ||
            scope.row.state == '2') 
          "
          @click.stop="passtSellHandle(scope.row)"
          >手动转账</el-button
        >
        <el-button
          type="primary"
          icon="el-icon-edit"
          size="small"
          v-if="isAuth('c2c:c2c_pay_order:pass') && scope.row.state == '0' && scope.row.direction == 'buy'"
          @click.stop="passtHandle(scope.row)"
          >一键通过</el-button
        >
        <el-button
          type="danger"
          icon="el-icon-delete"
          size="small"
          v-if="
            isAuth('c2c:c2c_pay_order:cancel') && (
            scope.row.state == '0' ||
            scope.row.state == '1' ||
            scope.row.state == '2' ||
            //scope.row.state == '3' ||
            scope.row.state == '5')
          "
          @click.stop="deletOrdeHandle(scope.row)"
          >取消订单</el-button
        >
      </template>
    </avue-crud>
    <!-- 弹窗, 新增 / 修改 -->
    <add-or-update
      v-if="addOrUpdateVisible"
      ref="addOrUpdate"
      @refreshDataList="getDataList"
    ></add-or-update>
    <!-- 参数管理 -->
    <parameters
      v-if="parametersFlag"
      @refreshDataList="getDataList"
      ref="parameters"
    >
    </parameters>
    <!-- 参数管理 -->
    <lastMsg v-if="lastVisible" @refreshDataList="getDataList" ref="lastUpdate">
    </lastMsg>
    <!-- 参数管理 -->
    <payMsg v-if="payMsgVisible" @refreshDataList="getDataList" ref="payUpdate">
    </payMsg>
    <!-- 查看 聊天 -->
    <otherMsg
      v-if="otherVisible"
      @refreshDataList="getDataList"
      ref="otherUpdate"
    >
    </otherMsg>
    <!-- 取消订单 -->
    <deletMsg
      v-if="deletVisible"
      @refreshDataList="getDataList"
      ref="deletUpdate"
    >
    </deletMsg>
    <!-- 取消订单 -->
    <passtpn
      v-if="passtpnVisible"
      @refreshDataList="getDataList"
      ref="passtpnUpdate"
    >
    </passtpn>
    <!-- 手动转账 -->
        <passSelltpn
      v-if="passSelltpnVisible"
      @refreshDataList="getDataList"
      ref="passSelltUpdate"
    >
    </passSelltpn>
  </div>
</template>
<script>
import { tableOption } from "@/crud/order/c2c_order";
import AddOrUpdate from "./c2c-pay-update";
import parameters from "./grid-parameters";
import lastMsg from "./c2c-order-more-last";
import payMsg from "./c2c-order-pay-msg";
import otherMsg from "./c2c-order-other-msg";
import deletMsg from "./c2c-ord-delet";
import passtpn from "./c2c-ord-passtpn";
import passSelltpn from "./c2c-ord-passtSellpn";
export default {
  data() {
    return {
      dataList: [],
      dataListLoading: false,
      dataListSelections: [],
      addOrUpdateVisible: false,
      passSelltpnVisible:false,
      passtpnVisible: false,
      deletVisible: false,
      otherVisible: false,
      payMsgVisible: false,
      parametersFlag: false,
      lastVisible: false,
      tableOption: tableOption,
      options: [
        {
          value: "1",
          label: "修改账户余额",
        },
        {
          value: "2",
          label: "转移账户锁定金额",
        },
        {
          value: "3",
          label: "增加账户锁定金额",
        },
        {
          value: "4",
          label: "减少账户锁定金额",
        },
        {
          value: "5",
          label: "转移账户冻结金额",
        }
      ],
      searchParams: {}, // 搜索条件
      page: {
        total: 0, // 总页数
        currentPage: 1, // 当前页数
        pageSize: 10, // 每页显示多少条
      },
    };
  },
  components: {
    AddOrUpdate,
    parameters,
    lastMsg,
    payMsg,
    otherMsg,
    deletMsg,
    passtpn,
    passSelltpn
  },
  created() {
    this.getC2cPaymentMethodType();
  },
   // 在页面销毁前销毁定时器
   beforeDestroy() {
    this.stopTimer();
  },
  // mounted() {
  //   this.startTimer();
  // },
  beforeRouteLeave(to, from, next) {
    console.log('停止定时器')
    // 在路由离开之前停止定时器
    this.stopTimer();
    next();
  },
  beforeRouteEnter(to, from, next) {
    console.log('启动定时器')
    // 在路由进入之前执行,通过 next 回调传递实例给回调函数
    next(vm => {
      vm.startTimer(); // 通过回调函数重新启动定时器
    });
  },
  methods: {
    // 获取数据列表
    getDataList(page, done) {
      this.dataListLoading = true;
      const params = {
        current: page == null ? this.page.currentPage : page.currentPage,
        size: page == null ? this.page.pageSize : page.pageSize,
        ...this.searchParams,
      };
      this.$http({
        url: this.$http.adornUrl("/c2cOrder/list"),
        method: "post",
        data: this.$http.adornData(
          Object.assign(
            {
              current: page == null ? this.page.currentPage : page.currentPage,
              size: page == null ? this.page.pageSize : page.pageSize,
            },
            params
          )
        ),
      }).then(({ data }) => {
        console.log(data.total);
        this.dataList = data.data.records;
        this.page.total = data.data.total;
        this.dataListLoading = false;
        if (done) {
          done();
        }
      });
    },
     // 启动定时器
     startTimer() {
      this.timer = setInterval(() => {
        this.getDataList(this.page);
      }, 5000); // 5秒钟执行一次
    },
    // 停止定时器
    stopTimer() {
      clearInterval(this.timer);
    },
    changeSelet(uid, val, userCode, row) {
      if (val) {
        let m = this.options[val - 1].label; //弹窗标题
        if (
          val == 1 ||
          val == 8 ||
          val == 7 ||
          val == 9 ||
          val == 6 ||
          val == 10 ||
          val == 12
        ) {
          // 1资金账户 2转移账户锁定金额 3增加账户锁定金额 4减少账户锁定金额 5转移账户冻结金额 8谷歌验证 7密码 9资金密码 6提现限制流水 10强制退出 12 赠送USDT
          this.addOrUpdateVisible = true;
          this.$nextTick(() => {
            this.$refs.addOrUpdate.init(uid, m, val,row);
          });
        } else if (val == 2 || val == 5 || val == 3 || val == 4) {
          this.otherdateHand(uid, m, val, userCode);
        } else if (val == 11) {
          this.$router.push({
            path: "/sys-config-account-change-record-sys-config",
            query: { uid: userCode },
          });
          // router.push({ name: 'account-change-record-sys-config' })
        }
        row.select = "";
      }
    },
    // 获取数据列表
    getC2cPaymentMethodType(page, params, done) {
      this.dataListLoading = true;
      this.$http({
        url: this.$http.adornUrl(
          "/paymentMethodConfig/getC2cPaymentMethodType"
        ),
        method: "get",
        params: this.$http.adornParams(Object.assign({}, params), false),
      }).then(({ data }) => {
        console.log(data);
        if (done) {
          done();
        }
      });
    },
    addClasscolor({ column, row }) {
      //表单样式
      if (
        (column.property === "rolename" && row.rolename == "MEMBER") ||
        (column.property === "state" && row.state == "3") ||
        (column.property === "direction" && row.direction == "buy")
      ) {
        return "green";
      } else if (
        (column.property === "rolename" && row.rolename == "GUEST") ||
        (column.property === "state" && row.state == "0")
      ) {
        return "yellow";
      } else if (
        (column.property === "state" && row.state == "5") ||
        (column.property === "direction" && row.direction == "sell")
      ) {
        return "red";
      }
    },
 
    // 条件查询
    searchChange(params, done) {
      this.page.currentPage = 1; // 重置当前页为第一页
      this.searchParams = params;
      this.getDataList(this.page, done);
    },
    // 多选变化
    selectionChange(val) {
      this.dataListSelections = val;
    },
    // 新增 / 修改
    addOrUpdateHandle(row, id) {
      this.addOrUpdateVisible = true;
      this.$nextTick(() => {
        this.$refs.addOrUpdate.init(row, id);
      });
    },
    searchName(row) {
      //this.userNamevisible = true
      this.parametersFlag = true;
      this.$nextTick(() => {
        this.$refs.parameters.init(row);
      });
    },
    lastSearch(row) {
      //this.userNamevisible = true
      this.lastVisible = true;
      this.$nextTick(() => {
        this.$refs.lastUpdate.init(row);
      });
    },
    searPaymsg(id) {
      this.payMsgVisible = true;
      this.$nextTick(() => {
        this.$refs.payUpdate.init(id);
      });
    },
    searchOtherMsg(row) {
      this.otherVisible = true;
      this.$nextTick(() => {
        this.$refs.otherUpdate.init(row);
      });
    },
    deletOrdeHandle(row) {
      this.deletVisible = true;
      this.$nextTick(() => {
        this.$refs.deletUpdate.init(row);
      });
    },
    passtHandle(row, n) {
      this.passtpnVisible = true;
      this.$nextTick(() => {
        this.$refs.passtpnUpdate.init(row, n);
      });
    },
    passtSellHandle(row) {
      this.passSelltpnVisible = true;
      this.$nextTick(() => {
        this.$refs.passSelltUpdate.init(row);
      });
    },
    // 删除
    deleteHandle(id) {
      var userIds = id
        ? [id]
        : this.dataListSelections.map((item) => {
            return item.userId;
          });
      this.$confirm(
        `确定对[id=${userIds.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
        "提示",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }
      )
        .then(() => {
          this.$http({
            url: this.$http.adornUrl("/sys/user"),
            method: "delete",
            data: this.$http.adornData(userIds, false),
          }).then(({ data }) => {
            this.$message({
              message: "操作成功",
              type: "success",
              duration: 1500,
              onClose: () => {
                this.getDataList();
              },
            });
          });
        })
        .catch(() => {});
    },
  },
};
</script>
<style lang="scss" scoped>
.mod-mange {
}
.clcleChear {
  float: left;
}
.cicleMsg {
  color: #fff;
  background: red;
  border-radius: 50%;
  float: right;
  height: 15px;
  width: 15px;
  line-height: 15px;
}
</style>