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.

188 lines
3.3 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
9 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 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. this.getRunningWater()
  70. },
  71. //获取流水
  72. getRunningWater() {
  73. let queryparams = {
  74. ...this.queryparams
  75. }
  76. if(this.select != 0){
  77. queryparams.type = this.select - 1
  78. }
  79. this.request('WaterPage', {}, queryparams).then(res => {
  80. if (res.code == 200) {
  81. this.runningWaterList = res.result.records
  82. }
  83. })
  84. },
  85. //滑动到页面底部
  86. scrolltolower(){
  87. this.queryparams.pageSize += 10
  88. this.getRunningWater()
  89. }
  90. }
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. .running-water {
  95. width: 750rpx;
  96. min-height: 100vh;
  97. background-color: #f7f7f7;
  98. margin: 0 auto;
  99. background-size: 100%;
  100. background-repeat: no-repeat;
  101. padding-top: 90rpx;
  102. .type{
  103. display: flex;
  104. background-color: #fff;
  105. position: fixed;
  106. width: 100%;
  107. top: 0;
  108. left: 0;
  109. height: 90rpx;
  110. justify-content: center;
  111. align-items: center;
  112. color: #989898;
  113. font-size: 28rpx;
  114. z-index: 999;
  115. &>view{
  116. flex: 1;
  117. display: flex;
  118. justify-content: center;
  119. align-items: center;
  120. }
  121. .select{
  122. color: #000;
  123. text{
  124. padding-bottom: 10rpx;
  125. border-bottom: 3px solid #000;
  126. }
  127. }
  128. }
  129. .content {
  130. width: 96%;
  131. margin: 0 auto;
  132. }
  133. .running-water-list {
  134. display: flex;
  135. justify-content: space-between;
  136. flex-wrap: wrap;
  137. margin-top: 20rpx;
  138. .running-water-item {
  139. display: flex;
  140. justify-content: space-between;
  141. box-sizing: border-box;
  142. padding: 15rpx;
  143. width: 100%;
  144. margin-bottom: 25rpx;
  145. background: white;
  146. .left{
  147. .time {
  148. margin: 15rpx 0rpx;
  149. }
  150. .tag{
  151. display: inline-block;
  152. background: #61ABFF;
  153. font-size: 24rpx;
  154. border-radius: 50rpx;
  155. padding: 0rpx 15rpx;
  156. }
  157. .red{
  158. color: red;
  159. }
  160. }
  161. .money-detail {
  162. // color: #3AA56B;
  163. font-size: 36rpx;
  164. color: #3FCE9D;
  165. }
  166. }
  167. }
  168. }
  169. </style>