AdminGrant.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <el-row>
  3. <el-row class="movie-list">
  4. <el-col :md="16" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
  5. <el-card class="box-card">
  6. <div slot="header" class="clearfix">
  7. <span>充值请求</span>
  8. </div>
  9. <div class="text item">
  10. <el-table
  11. :data="chargeReqList"
  12. border
  13. style="width: 100%"
  14. >
  15. <el-table-column
  16. fixed="left"
  17. label="No"
  18. type="index"
  19. />
  20. <el-table-column
  21. prop="chargeId"
  22. label="充值 ID"
  23. />
  24. <el-table-column
  25. prop="quantity"
  26. label="金额"
  27. />
  28. <el-table-column
  29. prop="owner"
  30. label="用户"
  31. />
  32. <el-table-column
  33. fixed="right"
  34. label="操作"
  35. >
  36. <template slot-scope="scope">
  37. <el-button
  38. size="mini"
  39. @click="onApprove(scope.row)"
  40. >同意</el-button>
  41. <el-button
  42. size="mini"
  43. type="danger"
  44. @click="onDecline(scope.row)"
  45. >拒绝</el-button>
  46. </template>
  47. </el-table-column>
  48. </el-table>
  49. </div>
  50. </el-card>
  51. </el-col>
  52. </el-row>
  53. </el-row>
  54. </template>
  55. <script>
  56. import { userMixin } from 'assets/js/mixin'
  57. import {
  58. approveCharge, declineCharge,
  59. getChargeReq, getVipPlan
  60. } from '@/api/admin'
  61. export default {
  62. name: 'AdminCharge',
  63. mixins: [userMixin],
  64. data() {
  65. return {
  66. chargeReqList: [],
  67. vipPlanList: []
  68. }
  69. },
  70. created() {
  71. document.title = '站点配置'
  72. getVipPlan().then(resp => {
  73. if (resp.code === 0) {
  74. this.vipPlanList = resp.data
  75. } else {
  76. this.$message.error(resp.msg)
  77. }
  78. })
  79. this.getData()
  80. },
  81. methods: {
  82. getData() {
  83. getChargeReq(1).then(resp => {
  84. if (resp.code === 0) {
  85. this.chargeReqList = resp.data
  86. } else {
  87. this.$message.error(resp.msg)
  88. }
  89. })
  90. },
  91. onApprove(row) {
  92. approveCharge(row.chargeId).then(resp => {
  93. if (resp.code === 0) {
  94. this.getData()
  95. } else {
  96. this.$message.error(resp.msg)
  97. }
  98. })
  99. },
  100. onDecline(row) {
  101. declineCharge(row.chargeId).then(resp => {
  102. if (resp.code === 0) {
  103. this.getData()
  104. } else {
  105. this.$message.error(resp.msg)
  106. }
  107. })
  108. }
  109. }
  110. }
  111. </script>
  112. <style>
  113. </style>