推拿小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
2.7 KiB

  1. <template>
  2. <view class="page">
  3. <!-- 导航栏 -->
  4. <navbar title="积分明细" leftClick @leftClick="$utils.navigateBack" color="#fff" />
  5. <view class="tools">
  6. <uv-datetime-picker
  7. ref="datetimePicker"
  8. v-model="queryParams.createTime"
  9. mode="year-month"
  10. confirmColor="#84A73F"
  11. @confirm="onTimeChange"
  12. ></uv-datetime-picker>
  13. <button plain class="flex btn" @click="openTimePicker">
  14. <text>{{ displaySelectedTime }}</text>
  15. <image class="btn-icon" src="../static/runningWater/icon-arrow.png" mode="widthFix"></image>
  16. </button>
  17. </view>
  18. <view class="card list">
  19. <template v-if="list.length">
  20. <view class="flex list-item"
  21. v-for="(item, index) in list"
  22. :key="index"
  23. >
  24. <image class="list-item-icon" src="../static/pointsRecord/icon-points.png" mode="widthFix"></image>
  25. <view class="list-item-info">
  26. <view class="highlight">{{ item.title }}</view>
  27. <view>{{ item.createTime }}</view>
  28. </view>
  29. <view class="list-item-value">{{ `+${item.score}` }}</view>
  30. </view>
  31. </template>
  32. <template v-else>
  33. <uv-empty mode="history" textSize="28rpx" iconSize="100rpx" />
  34. </template>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import dayjs from 'dayjs'
  40. import mixinsList from "@/mixins/list.js"
  41. export default {
  42. mixins: [mixinsList],
  43. data() {
  44. return {
  45. queryParams: {
  46. pageNo: 1,
  47. pageSize: 10,
  48. createTime: dayjs().format('YYYY-MM'),
  49. },
  50. mixinsListApi: 'queryScoreList',
  51. }
  52. },
  53. computed: {
  54. displaySelectedTime() {
  55. return this.$dayjs(this.queryParams.createTime).format("YYYY年M月")
  56. }
  57. },
  58. methods: {
  59. openTimePicker() {
  60. this.$refs.datetimePicker.open();
  61. },
  62. onTimeChange(e) {
  63. this.queryParams.createTime = this.$dayjs(e.value).format('YYYY-MM')
  64. this.getData()
  65. },
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .page {
  71. background-color: $uni-bg-color;
  72. min-height: 100vh;
  73. /deep/ .nav-bar__view {
  74. background-image: linear-gradient(#84A73F, #D8FF8F);
  75. }
  76. }
  77. .tools {
  78. background-color: $uni-fg-color;
  79. padding: 25rpx 42rpx;
  80. display: flex;
  81. .btn {
  82. display: inline-block;
  83. border: none;
  84. color: #000000;
  85. font-size: 28rpx;
  86. line-height: 40rpx;
  87. &-icon {
  88. width: 28rpx;
  89. height: 28rpx;
  90. margin-left: 12rpx;
  91. }
  92. }
  93. }
  94. .list {
  95. margin: 9rpx 13rpx;
  96. padding: 31rpx 20rpx;
  97. &-item {
  98. padding-bottom: 19rpx;
  99. border-bottom: 1rpx solid #E0E0E0;
  100. margin-bottom: 20rpx;
  101. font-size: 28rpx;
  102. &-icon {
  103. width: 56rpx;
  104. height: auto;
  105. margin-right: 10rpx;
  106. }
  107. &-info {
  108. flex: 1;
  109. color: #949494;
  110. .highlight {
  111. color: #333333;
  112. }
  113. }
  114. &-value {
  115. color: #FF2A2A;
  116. }
  117. }
  118. }
  119. </style>