records.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view class="container">
  3. <tui-tab :tabs="tabs" isSticky :current="currentTab" selectedColor="#E41F19" sliderBgColor="#E41F19"
  4. @change="change"></tui-tab>
  5. <view class="tui-records__list">
  6. <tui-list-cell :hover="false" v-for="(item,index) in datalist" :key="index">
  7. <view class="tui-records__item">
  8. <image v-if="item.prefix==2" class="tui-icon" src="/static/images/mall/wallet/icon_expend_3x.png"></image>
  9. <image v-if="item.prefix==1" class="tui-icon" src="/static/images/mall/wallet/icon_income_3x.png"></image>
  10. <view>
  11. <view class="tui-title">{{ item.remarks }}</view>
  12. <view class="tui-desc">{{ item.create_time }}</view>
  13. </view>
  14. <view class="tui-right__box">
  15. <view class="tui-amount" :class="{'tui-expend':item.prefix==2}">
  16. {{item.prefix==2?'-':'+'}}{{ item.amount }}
  17. </view>
  18. <view class="tui-desc">订单号: {{item.order_num_alias}}</view>
  19. </view>
  20. </view>
  21. </tui-list-cell>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. tabs: ["全部", "收入", "支出"],
  30. currentTab: 0,
  31. datalist:[]
  32. }
  33. },
  34. onLoad() {
  35. this.getRecordsList()
  36. },
  37. methods: {
  38. change(e) {
  39. this.currentTab = e.index;
  40. this.getRecordsList();
  41. },
  42. getRecordsList() {
  43. const _this = this
  44. _this.$request.post('membercashlogs.list', {
  45. prefix: this.currentTab,
  46. page: 1,
  47. pageSize: 50
  48. }).then(res => {
  49. if (res.errno == 0) {
  50. _this.datalist = res.data
  51. } else {
  52. _this.datalist = []
  53. }
  54. })
  55. }
  56. },
  57. /**
  58. * 页面相关事件处理函数--监听用户下拉动作
  59. */
  60. onPullDownRefresh: function() {
  61. setTimeout(() => {
  62. uni.stopPullDownRefresh()
  63. }, 200);
  64. },
  65. onReachBottom() {}
  66. }
  67. </script>
  68. <style>
  69. .container {
  70. padding-bottom: env(safe-area-inset-bottom);
  71. }
  72. .tui-records__list {
  73. margin-top: 20rpx;
  74. }
  75. .tui-records__item {
  76. width: 100%;
  77. display: flex;
  78. align-items: center;
  79. }
  80. .tui-icon {
  81. width: 72rpx;
  82. height: 72rpx;
  83. margin-right: 20rpx;
  84. }
  85. .tui-title {
  86. font-size: 30rpx;
  87. font-weight: 400;
  88. color: #333333;
  89. }
  90. .tui-desc {
  91. font-size: 24rpx;
  92. font-weight: 400;
  93. color: #888888;
  94. padding-top: 12rpx;
  95. }
  96. .tui-right__box {
  97. margin-left: auto;
  98. text-align: right;
  99. }
  100. .tui-amount {
  101. font-size: 30rpx;
  102. font-weight: 400;
  103. color: #EB0909;
  104. }
  105. .tui-expend {
  106. color: #19be6b !important;
  107. }
  108. </style>