extractRecord.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="checkInRecord">
  3. <scroll-view scroll-y="true" class="checkInList" lower-threshold="80" @scrolltolower="scrolltolower">
  4. <view style="margin: 0 20rpx 20rpx" v-if="adConfig.videoAd">
  5. <ad-view :unitId="adConfig.videoAd" adIntervals="200" adType="video"></ad-view>
  6. </view>
  7. <view v-for="item in signList" :key="item.id" class="item">
  8. <view class="left">
  9. <view class="title">提取{{item.value}}书币</view>
  10. <view class="data">{{item.createTime}}</view>
  11. </view>
  12. </view>
  13. <view style="margin: 80rpx 0;" v-if="signList.length === 0">
  14. <u-empty text="提取记录空" mode="list"></u-empty>
  15. </view>
  16. <view class="baseline" v-if="signList.length > 0 && this.total === this.signList.length">
  17. —— 我是有底线的 ——
  18. </view>
  19. </scroll-view>
  20. </view>
  21. </template>
  22. /**
  23. * 提现记录
  24. *
  25. **/
  26. <script>
  27. import { getCoinRemoveList, config } from '@/api/api.js'
  28. import { videoAd } from '@/utils/ad_config.js'
  29. import adView from '@/components/ad-view/ad-view.vue'
  30. export default {
  31. components: {
  32. adView
  33. },
  34. data() {
  35. return {
  36. adConfig: {
  37. videoAd
  38. },
  39. queryForm: {
  40. page: 1,
  41. pageSize: 20,
  42. appId: config.appid
  43. },
  44. isShowYeer: false, //是否展示年月
  45. signList: [],
  46. total: 0
  47. };
  48. },
  49. onLoad(options) {
  50. if (Object.keys(options).length > 0) {
  51. this.queryForm = {...this.queryForm, ...options}
  52. this.getList()
  53. }
  54. },
  55. filters: {
  56. getYMFilter(value) {
  57. if(!value) return ''
  58. let data = value.split('-')
  59. if (data.length > 1) {
  60. return data[0] + '-' + data[1]
  61. }else {
  62. return value
  63. }
  64. },
  65. getDateFilter(value) { // 获取月
  66. if(!value) return ''
  67. let data = value.split('-')
  68. if (data.length > 1) {
  69. return Number(data[1])
  70. }else {
  71. return value
  72. }
  73. },
  74. getTimerFilter(value) { // 获取年月日时分秒
  75. if(!value) return ''
  76. let timestamp = Date.parse(new Date(value))
  77. let date = new Date(timestamp)
  78. let Y = date.getFullYear()
  79. let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
  80. let D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
  81. let H = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
  82. let minute = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
  83. let S = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
  84. return `${Y}-${M}-${D} ${H}:${minute}:${S}`
  85. }
  86. },
  87. methods: {
  88. getList() {
  89. getCoinRemoveList({ ...this.queryForm }).then(res => {
  90. this.signList = this.signList.concat(res.data.records)
  91. this.total = res.data.total
  92. })
  93. },
  94. // 滚动到底部去获取数据
  95. scrolltolower() {
  96. if ( this.signList.length !== this.total ) {
  97. this.$set(this.queryForm, 'page', this.queryForm.page + 1)
  98. this.getList()
  99. }
  100. },
  101. // 选择时间
  102. selectDataTime(e) {
  103. this.isShowYeer = true
  104. this.signList = []
  105. this.$set(this.queryForm, 'page', 1)
  106. this.$set(this.queryForm, 'dayTime', e.target.value)
  107. this.getList()
  108. },
  109. // 获取年月
  110. getDate() {
  111. let timestamp = Date.parse(new Date())
  112. let date = new Date(timestamp)
  113. let Y = date.getFullYear()
  114. let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
  115. let D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
  116. return Y + '-' + M
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss">
  122. page {
  123. background-color: #f3f3f3;
  124. }
  125. .checkInRecord {
  126. width: 100%;
  127. height: 100vh;
  128. }
  129. .checkInList{
  130. height: 100vh;
  131. padding-bottom: 40rpx;
  132. box-sizing: border-box;
  133. overflow: hidden;
  134. .item {
  135. padding: 10rpx 0;
  136. margin: 0 30rpx;
  137. border-bottom: 1rpx solid #efefef;
  138. display: flex;
  139. justify-content: space-between;
  140. align-items: center;
  141. }
  142. .title {
  143. font-size: 28rpx;
  144. font-weight: 500;
  145. color: #000000;
  146. }
  147. .data {
  148. font-size: 24rpx;
  149. margin-top: 8rpx;
  150. color: #808080;
  151. }
  152. .center {
  153. font-size: 24rpx;
  154. color: #808080;
  155. }
  156. .right {
  157. text-align: center;
  158. &>text {
  159. font-size: 28rpx;
  160. }
  161. .error {
  162. font-size: 24rpx;
  163. color: #FC6E53;
  164. }
  165. }
  166. }
  167. .baseline {
  168. text-align: center;
  169. padding: 30rpx 0;
  170. font-size: 24rpx;
  171. color: #999999;
  172. }
  173. </style>