bill.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view class="bill">
  3. <view class="list_box">
  4. <view class="option" v-for="(item,index) in list" :key="index">
  5. <view class="top">
  6. <view class="type" v-if="item.billType == 1">
  7. 充值
  8. </view>
  9. <view class="type" v-if="item.billType == 2">
  10. 余额支付
  11. </view>
  12. <view class="type" v-if="item.billType == 3">
  13. 订单收益
  14. </view>
  15. <view class="type" v-if="item.billType == 4">
  16. 提现
  17. </view>
  18. <view class="type" v-if="item.billType == 6">
  19. 分销
  20. </view>
  21. <view class="type" v-if="item.billType == 7">
  22. 订单退款
  23. </view>
  24. <view class="type" v-if="item.billType == 8">
  25. 取消订单
  26. </view>
  27. <view class="money add" v-if="item.amount>0">
  28. +{{item.amount}}
  29. </view>
  30. <view class="money" v-else>
  31. {{item.amount}}
  32. </view>
  33. </view>
  34. <view class="top color">
  35. <view class="type">
  36. {{item.createTime.slice(0,10)}}
  37. </view>
  38. <!-- <view class="money">
  39. 余额{{item.balance}}
  40. </view> -->
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. import {
  48. ConsumptionLog
  49. } from '../../api/index.js'
  50. export default {
  51. data() {
  52. return {
  53. list: []
  54. }
  55. },
  56. methods: {
  57. onsumptionLog() {
  58. let data = {}
  59. data.openId = uni.getStorageSync('wx_copenid')
  60. ConsumptionLog(data).then(res => {
  61. this.list = res.data.data.records
  62. })
  63. }
  64. },
  65. onShow() {
  66. this.onsumptionLog()
  67. }
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .bill {
  72. width: 100%;
  73. height: 100%;
  74. // padding: 20rpx;
  75. // box-sizing: border-box;
  76. .list_box {
  77. width: 100%;
  78. padding: 0px 20rpx;
  79. box-sizing: border-box;
  80. .option {
  81. padding: 10px;
  82. border-bottom: 2px solid #f6f6f6;
  83. .top {
  84. width: 100%;
  85. background-color: #fff;
  86. display: flex;
  87. justify-content: space-between;
  88. .add {
  89. color: #fac43e;
  90. }
  91. }
  92. .top:nth-child(1) {
  93. margin-bottom: 10px;
  94. }
  95. }
  96. .color {
  97. color: #ccc;
  98. }
  99. }
  100. }
  101. </style>