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.

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