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.

179 lines
3.2 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. <!-- 流水页面 -->
  2. <template>
  3. <view class="running-water bx">
  4. <view class="type">
  5. <view
  6. :class="{select : index == select}"
  7. :key="index"
  8. @click="selectType(index)"
  9. v-for="(item, index) in type">
  10. <text>{{ item.name }}</text>
  11. </view>
  12. </view>
  13. <u-list @scrolltolower="scrolltolower" height="calc(100vh - 90rpx)">
  14. <!-- 流水列表 -->
  15. <view class="running-water-list content">
  16. <view v-for="item in runningWaterList" :key="item.id" class="running-water-item">
  17. <view class="left">
  18. <view class="time">{{ item.createTime }}</view>
  19. <div :class="{ red : item.type == 1 }" class="tag">{{ $t(`page.runningWater.${item.state == 0 ? 3 : item.type }`) }}</div>
  20. </view>
  21. <view class="money-detail">
  22. ${{ item.money }}
  23. </view>
  24. </view>
  25. </view>
  26. </u-list>
  27. <sTabbar/>
  28. </view>
  29. </template>
  30. <script>
  31. import index from '../../uni_modules/uview-ui'
  32. import navbar from '@/components/base/m-navbar.vue'
  33. export default {
  34. components: {
  35. navbar
  36. },
  37. data() {
  38. return {
  39. queryparams: {
  40. pageNo: 1,
  41. pageSize: 10
  42. },
  43. runningWaterList: [],
  44. select : 0,
  45. type : [
  46. {
  47. name : 'all'
  48. },
  49. {
  50. name : 'income'
  51. },
  52. {
  53. name : 'expenditure'
  54. },
  55. ]
  56. }
  57. },
  58. onShow() {
  59. this.getRunningWater()
  60. },
  61. methods: {
  62. leftClick() {
  63. uni.navigateTo({
  64. url: '/pages/center/center'
  65. })
  66. },
  67. selectType(index){
  68. this.select = index
  69. },
  70. //获取流水
  71. getRunningWater() {
  72. this.request('WaterPage', {}, this.queryparams).then(res => {
  73. if (res.code == 200) {
  74. this.runningWaterList = res.result.records
  75. }
  76. })
  77. },
  78. //滑动到页面底部
  79. scrolltolower(){
  80. this.queryparams.pageSize += 10
  81. this.getRunningWater()
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .running-water {
  88. width: 750rpx;
  89. min-height: 100vh;
  90. background-color: #f7f7f7;
  91. margin: 0 auto;
  92. background-size: 100%;
  93. background-repeat: no-repeat;
  94. padding-top: 90rpx;
  95. .type{
  96. display: flex;
  97. background-color: #fff;
  98. position: fixed;
  99. width: 100%;
  100. top: 0;
  101. left: 0;
  102. height: 90rpx;
  103. justify-content: center;
  104. align-items: center;
  105. color: #989898;
  106. font-size: 28rpx;
  107. z-index: 999;
  108. &>view{
  109. flex: 1;
  110. display: flex;
  111. justify-content: center;
  112. align-items: center;
  113. }
  114. .select{
  115. color: #000;
  116. text{
  117. padding-bottom: 10rpx;
  118. border-bottom: 3px solid #000;
  119. }
  120. }
  121. }
  122. .content {
  123. width: 96%;
  124. margin: 0 auto;
  125. }
  126. .running-water-list {
  127. display: flex;
  128. justify-content: space-between;
  129. flex-wrap: wrap;
  130. margin-top: 20rpx;
  131. .running-water-item {
  132. display: flex;
  133. justify-content: space-between;
  134. box-sizing: border-box;
  135. padding: 15rpx;
  136. width: 100%;
  137. margin-bottom: 25rpx;
  138. background: white;
  139. .left{
  140. .time {
  141. margin: 15rpx 0rpx;
  142. }
  143. .tag{
  144. display: inline-block;
  145. background: #61ABFF;
  146. font-size: 24rpx;
  147. border-radius: 50rpx;
  148. padding: 0rpx 15rpx;
  149. }
  150. .red{
  151. color: red;
  152. }
  153. }
  154. .money-detail {
  155. // color: #3AA56B;
  156. font-size: 36rpx;
  157. color: #3FCE9D;
  158. }
  159. }
  160. }
  161. }
  162. </style>