index.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <page title="充值记录" ref="pageRef" nav-color="transparent">
  3. <view v-for="(item, index) in tableData" :key="index" class="cell">
  4. <view class="flex-align-between ">
  5. <view class="color-1 font5">充值金额: {{item.amount}}元</view>
  6. <view :style="{color: item.status === 99 ? '#30b914' : '#999'}">{{item.status === 99 ? '已完成' : '待支付'}}</view>
  7. </view>
  8. <view class="color-1 font3 paddingT5">交易号: {{item.tradeNo}}</view>
  9. <view class="paddingT5 color-2 font2">{{item.createTime}}</view>
  10. </view>
  11. <empty v-if="isEmpty" :top="200" />
  12. </page>
  13. </template>
  14. <script>
  15. import pageMixin from './../../mixin/page'
  16. import empty from '@/components/empty'
  17. const STATUS_MAP = {
  18. 0: { title: '待审核', color: '#b9b914' },
  19. 1: { title: '待打款', color: '#b9b914' },
  20. 2: { title: '已完成', color: '#30b914' },
  21. '-1': { title: '未完成', color: '#999' }
  22. }
  23. export default {
  24. mixins: [pageMixin],
  25. components: { empty },
  26. data() {
  27. return {
  28. STATUS_MAP
  29. }
  30. },
  31. mounted() {
  32. this.refresh()
  33. },
  34. onPullDownRefresh() {
  35. this.refresh()
  36. },
  37. onReachBottom() {
  38. this.loadMore()
  39. },
  40. methods: {
  41. init() {
  42. this.refresh()
  43. },
  44. async loadData() {
  45. const res = await this.$service.wallet.rechargeRecord(
  46. this.pageNum,
  47. this.pageSize,
  48. 'CASH'
  49. )
  50. return res
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. .cell {
  57. margin: 10rpx 30rpx;
  58. padding: 30rpx;
  59. border-radius: 12rpx;
  60. background: #fff;
  61. border: 2rpx solid #eee;
  62. }
  63. </style>