detail.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view class="page">
  3. <view class="timePicker" @click="show = true">{{ `${year}年${month}月` }}
  4. <u-icon class="icon" size="10" color="#CCCCCC" style="margin-left: 8rpx;" name="arrow-down-fill"></u-icon>
  5. </view>
  6. <view class="card">
  7. <view class="item" v-for="(item, index) in list" :key="index">
  8. <view class="phone_amount">
  9. <view class="phone">
  10. {{ item.phone || '匿名' }}
  11. </view>
  12. <view class="amount">
  13. ¥{{ currency(item.total, { fromCents: true }) }}
  14. </view>
  15. </view>
  16. <view class="date_type">
  17. <view class="date">{{ $u.timeFormat(new Date(item.receiptsTime), 'yyyy-mm-dd') }}</view>
  18. <view class="type">{{ item.planningName }}</view>
  19. </view>
  20. </view>
  21. </view>
  22. <u-empty iconSize="90px" textSize="14px" v-if="list.length == 0"></u-empty>
  23. <u-datetime-picker :show="show" v-model="time" mode="year-month" @cancel="show = false" @close="show = false"
  24. @confirm="confirm"></u-datetime-picker>
  25. </view>
  26. </template>
  27. <script>
  28. import { rewardDetailList } from "@/api/invite"
  29. import currency from '@/utils/currency'
  30. export default {
  31. data() {
  32. return {
  33. show: false,
  34. currency: currency,
  35. month: '',
  36. year: '',
  37. list: [],
  38. time: new Date()
  39. };
  40. },
  41. methods: {
  42. getRewardDetailList(query) {
  43. rewardDetailList(query).then(({ content }) => {
  44. if (content) {
  45. this.list = content
  46. }
  47. })
  48. },
  49. confirm({ value }) {
  50. this.year = new Date(value).getFullYear()
  51. this.month = new Date(value).getMonth() + 1
  52. this.getRewardDetailList({
  53. year: this.year,
  54. month: this.month
  55. })
  56. this.show = false
  57. }
  58. },
  59. onShow() {
  60. console.log(currency)
  61. const date = new Date()
  62. this.year = date.getFullYear()
  63. this.month = date.getMonth() + 1
  64. this.getRewardDetailList({
  65. year: this.year,
  66. month: this.month
  67. })
  68. }
  69. };
  70. </script>
  71. <style lang="scss" scoped>
  72. .page {
  73. min-height: 100vh;
  74. background-color: #F9F9F9;
  75. padding: 20rpx 24rpx;
  76. .timePicker {
  77. color: #181818;
  78. font-size: 28rpx;
  79. display: flex;
  80. align-items: center;
  81. }
  82. .card {
  83. background-color: #ffffff;
  84. border-radius: 16rpx;
  85. .item {
  86. border-top: 1px solid #F0F0F0;
  87. padding: 28rpx 24rpx;
  88. margin-top: 20rpx;
  89. &:first-child {
  90. border-top: none;
  91. }
  92. .phone_amount {
  93. display: flex;
  94. justify-content: space-between;
  95. .phone {
  96. font-size: 28rpx;
  97. color: #181818;
  98. }
  99. .amount {
  100. font-size: 28rpx;
  101. color: #FF3E3E;
  102. font-weight: bold;
  103. }
  104. margin-bottom: 8rpx;
  105. }
  106. .date_type {
  107. display: flex;
  108. justify-content: space-between;
  109. .date {
  110. font-size: 22rpx;
  111. color: #CCCCCC;
  112. }
  113. .type {
  114. font-size: 22rpx;
  115. color: #CCCCCC;
  116. }
  117. }
  118. }
  119. }
  120. }
  121. </style>