records.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <view style="padding: 20rpx;">
  3. <view class="box" v-for="item in recordList" :key="item.id" style="margin-bottom: 10rpx;">
  4. <view style="display: flex; margin-bottom: 10rpx;">
  5. <view>
  6. <uni-tag type="success" text="充值" size="mini" v-if="item.type === '充值'"></uni-tag>
  7. <uni-tag type="primary" text="骑手" size="mini" v-if="item.type === '骑手'"></uni-tag>
  8. <uni-tag type="error" text="支出" size="mini" v-if="item.type === '支出'"></uni-tag>
  9. <uni-tag type="warning" text="取消" size="mini" v-if="item.type === '取消'"></uni-tag>
  10. <text style="margin-left: 10rpx;">{{ item.content }}</text>
  11. </view>
  12. <view style="flex: 1; text-align: right; font-weight: bold;">
  13. <text style="color: red;" v-if="item.type === '充值'">+{{ item.money }}</text>
  14. <text style="color: dodgerblue;" v-if="item.type === '骑手'">+{{ item.money }}</text>
  15. <text style="color: #888;" v-if="item.type === '支出'">-{{ item.money }}</text>
  16. <text style="color: orange;" v-if="item.type === '取消'">+{{ item.money }}</text>
  17. </view>
  18. </view>
  19. <view style="text-align: right; color: #888; font-size: 24rpx;">{{ item.time }}</view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. recordList: [],
  28. user: uni.getStorageSync('xm-user')
  29. }
  30. },
  31. onLoad() {
  32. this.load()
  33. },
  34. methods: {
  35. load() {
  36. this.$request.get('/records/selectAll', { userId: this.user.id }).then(res => {
  37. this.recordList = res.data || []
  38. })
  39. }
  40. }
  41. }
  42. </script>
  43. <style>
  44. </style>