newRecords.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <view class="MakeMoneyRecordsBox">
  3. <view class="tabNavs">
  4. <view style="display:flex;">
  5. <view
  6. v-for="(item, index) in tabNavs" :key="item.name" class="tabNavsItem"
  7. :class="{ active: currentIndex == index }" @click="chekoutCurrent(index)"
  8. >
  9. {{ item.name }}
  10. </view>
  11. </view>
  12. <view class="dateSelection">
  13. <view
  14. v-for="(item, index) in dateSelection" :key="item.name" class="dateSetItem"
  15. :class="{ activeDate: dateIndex == index }" @click="chekoutDateSelection(index)"
  16. >
  17. {{ item.name }}
  18. </view>
  19. </view>
  20. </view>
  21. <view class="listMain">
  22. <keep-alive>
  23. <RecordsEvery
  24. v-if="currentIndex == 0" ref="RecordsEvery" show-type="income" :acount-numbers="acountNumbers"
  25. :condition="dateValue"
  26. ></RecordsEvery>
  27. <RecordsEvery
  28. v-if="currentIndex == 1" ref="RecordsEvery" show-type="expenditure" :acount-numbers="acountNumbers"
  29. :condition="dateValue"
  30. ></RecordsEvery>
  31. <IncrementRecord
  32. v-if="currentIndex == 2" ref="IncrementRecord" :acount-numbers="acountNumbers"
  33. :condition="dateValue"
  34. ></IncrementRecord>
  35. </keep-alive>
  36. </view>
  37. <view class="footer">
  38. <view class="titles">
  39. <text>使用规则</text>|<text>常见问题</text>|<text>联系客服</text>
  40. </view>
  41. <view class="titles2">
  42. 本服务由广东团蜂生活服务有限公司提供
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import RecordsEvery from '../cpns/RecordsEvery.vue'
  49. import IncrementRecord from '../cpns/IncrementRecord.vue'
  50. import { getTotalVoucherOrderApi } from '../../../../api/anotherTFInterface'
  51. export default {
  52. name: 'Records',
  53. components: {
  54. RecordsEvery,
  55. IncrementRecord
  56. },
  57. data() {
  58. return {
  59. tabNavs: [{ name: '收益记录' }, { name: '支出记录' }, { name: '充值记录' }],
  60. currentIndex: 0,
  61. dateSelection: [{ name: '年', value: 5 }, { name: '月', value: 4 }, { name: '日', value: 1 }],
  62. dateIndex: 0,
  63. dateValue: 0,
  64. acountNumbers: null
  65. }
  66. },
  67. created() {
  68. this.getAcountNumber()
  69. },
  70. methods: {
  71. getAcountNumber() {
  72. getTotalVoucherOrderApi({
  73. type: 3 - this.currentIndex,
  74. condition: this.dateValue
  75. }).then((res) => {
  76. console.log(res)
  77. this.acountNumbers = res.data
  78. })
  79. .catch((err) => {
  80. console.log(err)
  81. })
  82. },
  83. chekoutCurrent(index) {
  84. this.currentIndex = index
  85. this.getAcountNumber()
  86. },
  87. chekoutDateSelection(index) {
  88. if (index == this.dateIndex) {
  89. this.dateIndex = -1
  90. this.dateValue = 0
  91. } else {
  92. this.dateIndex = index
  93. this.dateValue = this.dateSelection[index].value
  94. }
  95. this.getAcountNumber()
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .MakeMoneyRecordsBox {
  102. flex: 1;
  103. width: 100vw;
  104. /* min-height: 84.6vh; */
  105. box-sizing: border-box;
  106. background-color: #ffffff;
  107. border-top-left-radius: 20rpx;
  108. border-top-right-radius: 20rpx;
  109. overflow: hidden auto;
  110. padding: 30rpx;
  111. display: flex;
  112. flex-direction: column;
  113. .tabNavs {
  114. width: 100%;
  115. height: 84rpx;
  116. display: flex;
  117. justify-content: space-between;
  118. align-items: center;
  119. background-color: #fff;
  120. .tabNavsItem {
  121. box-sizing: border-box;
  122. text-align: center;
  123. padding: 0rpx 10rpx;
  124. /* width: 132rpx; */
  125. height: 51rpx;
  126. border-radius: 10rpx;
  127. font-family: 思源黑体;
  128. font-size: 28rpx;
  129. font-weight: normal;
  130. line-height: 51rpx;
  131. color: #222229;
  132. margin-right: 20rpx;
  133. }
  134. .active {
  135. background: #FF380C;
  136. color: #fff;
  137. }
  138. .dateSelection {
  139. width: 152rpx;
  140. height: 46rpx;
  141. border: 2rpx solid #FF380C;
  142. border-radius: 10rpx;
  143. display: flex;
  144. .dateSetItem {
  145. text-align: center;
  146. line-height: 46rpx;
  147. flex: 1;
  148. color: #FF380C;
  149. }
  150. .activeDate {
  151. font-size: 32rpx;
  152. color: #fff;
  153. background: #FF380C;
  154. }
  155. }
  156. }
  157. .listMain {
  158. width: 100%;
  159. flex: 1;
  160. /* height: 1360rpx; */
  161. overflow: hidden;
  162. }
  163. .footer {
  164. position: fixed;
  165. left: 0;
  166. bottom: 0;
  167. width: 100%;
  168. height: 196rpx;
  169. display: flex;
  170. flex-direction: column;
  171. align-items: center;
  172. background: #F4F3F8;
  173. .titles {
  174. margin-top: 54rpx;
  175. width: 432rpx;
  176. height: 32rpx;
  177. display: flex;
  178. align-items: center;
  179. justify-content: space-between;
  180. color: #D8D8D8;
  181. >text {
  182. /* margin-top: 4rpx; */
  183. font-size: 24rpx;
  184. font-weight: 350;
  185. line-height: 30rpx;
  186. color: #222229;
  187. }
  188. }
  189. .titles2 {
  190. margin-top: 24rpx;
  191. position: relative;
  192. font-size: 24rpx;
  193. font-weight: 350;
  194. line-height: 32rpx;
  195. color: #888889;
  196. &::before {
  197. content: '';
  198. width: 93rpx;
  199. height: 2rpx;
  200. position: absolute;
  201. background-color: #888889;
  202. left: -110rpx;
  203. top: 50%;
  204. }
  205. &::after {
  206. content: '';
  207. width: 93rpx;
  208. height: 2rpx;
  209. position: absolute;
  210. background-color: #888889;
  211. right: -110rpx;
  212. top: 50%;
  213. }
  214. }
  215. }
  216. }
  217. </style>