index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <div class="default-width">
  3. <div class="pa-3 mb-2 white-bgc">
  4. <!-- 余额展示 -->
  5. <div class="statisticsBox">
  6. <div class="ml-10 mt-2">
  7. <div class="item-title">
  8. 您当前可用余额
  9. </div>
  10. <div class="item-value">
  11. {{ userAccount?.balance && userAccount?.balance > 0 ? (userAccount?.balance / 100.0).toFixed(2) : 0 }}
  12. <span
  13. class="text-decoration-underline cursor-pointer"
  14. style="color: #666; font-size: 13px;"
  15. @click="handleRecharge"
  16. >充值</span>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. <!-- 表格 -->
  22. <div class="mt-3 white-bgc pa-3 pt-3">
  23. <v-tabs v-model="tab" align-tabs="start" color="primary" bg-color="#f7f8fa" @update:model-value="handleChangeTab">
  24. <v-tab value="rechargeDetails">{{ $t('points.rechargeDetails') }}</v-tab>
  25. <!-- <v-tab :value="otherHeader">otherHeader</v-tab> -->
  26. </v-tabs>
  27. <CtTable
  28. class="mt-3"
  29. :items="dataList"
  30. :headers="headerList[tab]"
  31. :loading="false"
  32. :elevation="0"
  33. :isTools="false"
  34. :showPage="true"
  35. :total="total"
  36. :page-info="query"
  37. itemKey="id"
  38. @pageHandleChange="handleChangePage"
  39. >
  40. </CtTable>
  41. </div>
  42. </div>
  43. </template>
  44. <script setup>
  45. defineOptions({name: 'myWallet-myBalance-index'})
  46. import { ref } from 'vue'
  47. import { timesTampChange } from '@/utils/date'
  48. import { getUserWalletRechargePage } from '@/api/recruit/personal/myWallet.js'
  49. const tab = ref('rechargeDetails')
  50. const userAccount = ref(JSON.parse(localStorage.getItem('userAccount')) || {}) // 账户信息
  51. const total = ref(0)
  52. const query = ref({
  53. pageNo: 1,
  54. pageSize: 10,
  55. })
  56. const dataList = ref([])
  57. const headerList = {
  58. rechargeDetails: [
  59. { title: '充值金额', key: 'payPrice', sortable: false },
  60. { title: '支付方式', key: 'payChannelName', sortable: false },
  61. { title: '支付订单编号', key: 'payOrderId', sortable: false },
  62. { title: '交易时间', key: 'payTime', value: item => timesTampChange(item.payTime), sortable: false },
  63. ],
  64. // otherHeader: []
  65. }
  66. // 积分、签到明细
  67. const getData = async () => {
  68. const res = await getUserWalletRechargePage(query.value)
  69. dataList.value = res.list
  70. total.value = res.total
  71. }
  72. getData()
  73. const handleChangePage = (e) => {
  74. query.value.pageNo = e
  75. getData()
  76. }
  77. // 切换
  78. const handleChangeTab = () => {
  79. query.value.pageNo = 1
  80. getData()
  81. }
  82. // 充值
  83. import { useRouter } from 'vue-router'; const router = useRouter()
  84. const handleRecharge = () => {
  85. router.push({ path: '/personalRecharge' })
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .statisticsBox {
  90. padding: 10px 0;
  91. border-radius: 10px;
  92. background-color: var(--default-bgc);
  93. // background-color: var(--color-f3);
  94. // font-family: 宋体, SimSun;
  95. }
  96. .item-title {
  97. font-size: 20px;
  98. color: var(--color-333);
  99. line-height: 28px;
  100. font-weight: bold;
  101. }
  102. .item-value {
  103. font-size: 42px;
  104. color: #10897bba;
  105. line-height: 50px;
  106. }
  107. </style>