index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. <template>
  2. <view class="consume-content" :style="{'--status-bar-': statusBarHeight}">
  3. <view class="consume-content-info">
  4. <!-- 头部主要内容 开始 -->
  5. <view class="consume-content-header">
  6. <customNavbar title="收支明细" bgColor="var(--gd-bgm-color)" :customNavbarInfo="{}" :contentStyle="{}"
  7. :leftStyle="{color: '#fff'}"></customNavbar>
  8. <!-- tab 开始 -->
  9. <u-tabs
  10. :list="list1"
  11. @click="clickTabs"
  12. lineColor="var(--gd-bgm-color)"
  13. :activeStyle="{ color: 'rgba(127, 127, 127, 1)' }"
  14. :inactiveStyle="{ color: 'rgba(127, 127, 127, 1)' }"
  15. :scrollable="false"
  16. ></u-tabs>
  17. <!-- tab 结束 -->
  18. </view>
  19. <!-- 头部主要内容 结束 -->
  20. <!-- 收支列表 开始 -->
  21. <view class="consume-content-list">
  22. <customScrollList
  23. ref="customScrollList"
  24. @load="load"
  25. @paging="paging"
  26. @refresh="refresh"
  27. >
  28. <view v-if="marketPersonsSerialList.length>0" style="width: 100%;padding: 0 30rpx;box-sizing: border-box;">
  29. <customListItem :item="item" v-for="(item,index) in marketPersonsSerialList" />
  30. </view>
  31. </customScrollList>
  32. </view>
  33. <!-- 收支列表 结束 -->
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import {
  39. navigateTo
  40. } from "@/utils/util.js"
  41. export default {
  42. data() {
  43. return {
  44. title: '收支明细',
  45. statusBarHeight: 0, // 状态栏安全距离
  46. monry: 123456.789,
  47. moneyValue: null,
  48. tool: [ // 我的工具
  49. {
  50. title: "支付设置",
  51. icon: this.$commonConfig.staticUrl + 'balance/zhifu.png',
  52. url: '/pages/invitationStatistics/index'
  53. },
  54. {
  55. title: "余额提现",
  56. icon: this.$commonConfig.staticUrl + 'balance/mingxi.png',
  57. url: '/pages/balance/index'
  58. },
  59. ],
  60. list1: [
  61. {
  62. name: '全部',
  63. key: '',
  64. },
  65. {
  66. name: '收入',
  67. key: 1,
  68. },
  69. {
  70. name: '支出',
  71. key: 2,
  72. }],
  73. serialType: '',
  74. marketPersonsSerialList: []
  75. }
  76. },
  77. onLoad() {
  78. },
  79. onShow() {
  80. this.statusBarHeight = getApp().globalData.statusBarHeight
  81. },
  82. methods: {
  83. /**
  84. * @author ygh
  85. * @data 2023-12-20
  86. */
  87. navigateToFun() {
  88. navigateTo('/pages/cash/index')
  89. },
  90. /**
  91. * 数字显示格式化
  92. *
  93. */
  94. numFormat(num = 0) {
  95. if (num < 100000) {
  96. return num
  97. } else if (num > 100000) {
  98. return (num / 10000).toFixed(2)
  99. }
  100. },
  101. /**
  102. * 选择tabs
  103. */
  104. clickTabs(item) {
  105. console.log('item', item);
  106. if(this.serialType == item.key) return
  107. this.serialType = item.key
  108. this.$refs.customScrollList.refresh()
  109. },
  110. /**
  111. * 获取数据
  112. */
  113. async load(paging) {
  114. try{
  115. this.$refs.customScrollList.showPullUp = true
  116. let res = await this.$u.api.marketPersonsSerial({
  117. noSign: 1,
  118. userid: this.distribution_user_info.userId,
  119. pageNum: 1,
  120. pageSize: 10,
  121. serialType: this.serialType
  122. })
  123. if(res && res.code ===200) {
  124. if(res.data.rows){
  125. this.marketPersonsSerialList = this.marketPersonsSerialList.concat(res.data.rows)
  126. }else {
  127. this.marketPersonsSerialList = []
  128. }
  129. this.$refs.customScrollList.loadSuccess({
  130. list: this.marketPersonsSerialList,
  131. total: this.marketPersonsSerialList.length
  132. })
  133. } else {
  134. this.$refs.customScrollList.loadSuccess({
  135. list: [],
  136. total: res.data.total || this.marketPersonsSerialList.length
  137. })
  138. }
  139. }catch(e){
  140. //TODO handle the exception
  141. console.error("e===",e)
  142. this.$refs.customScrollList.loadSuccess({
  143. list: [],
  144. total: this.marketPersonsSerialList.length
  145. })
  146. }
  147. },
  148. paging(paging){
  149. console.log("下拉 加载数据")
  150. },
  151. /**
  152. * 下拉触底
  153. */
  154. async refresh(paging){
  155. console.log("上拉 加载数据")
  156. //this.$refs.customScrollList.showEmpty = true
  157. try{
  158. //this.$refs.customScrollList.showPullUp = true
  159. let res = await this.$u.api.marketPersonsSerial({
  160. pageNum: paging.page,
  161. pageSize: paging.size
  162. })
  163. if(res && res.code ===200) {
  164. if(res.data.performList){
  165. this.marketPersonsSerialList = [].concat(res.data.performList)
  166. }else {
  167. this.marketPersonsSerialList = []
  168. }
  169. // this.marketPersonsSerialList = null
  170. this.$refs.customScrollList.refreshSuccess({
  171. list: this.marketPersonsSerialList,
  172. total: this.marketPersonsSerialList.length
  173. })
  174. } else {
  175. this.$refs.customScrollList.refreshSuccess({
  176. list: [],
  177. total: res.data.total || this.marketPersonsSerialList.length
  178. })
  179. }
  180. }catch(e){
  181. //TODO handle the exception
  182. console.error("e===",e)
  183. this.$refs.customScrollList.refreshSuccess({
  184. list: [],
  185. total: this.marketPersonsSerialList.length
  186. })
  187. }
  188. },
  189. }
  190. }
  191. </script>
  192. <style lang="scss" scoped>
  193. .consume-content {
  194. width: 100%;
  195. height: 100%;
  196. --header-h: 90rpx;
  197. .consume-content-info {
  198. width: 100%;
  199. height: 100%;
  200. display: flex;
  201. flex-direction: column;
  202. box-sizing: border-box;
  203. }
  204. }
  205. /** 头部主要内容 开始 */
  206. .consume-content-header {
  207. width: 100%;
  208. //height: var(--header-h);
  209. box-sizing: border-box;
  210. position: relative;
  211. ::v-deep .u-search {
  212. padding: 0 30rpx !important;
  213. }
  214. ::v-deep .u-search__action {
  215. color: #fff !important;
  216. }
  217. /** 余额 开始 */
  218. .consume-content-money {
  219. width: 100%;
  220. box-sizing: border-box;
  221. margin-top: 50rpx;
  222. padding-left: 66rpx;
  223. color: #fff;
  224. >text {
  225. font-size: 24rpx;
  226. }
  227. .consume-content-money-num {
  228. display: flex;
  229. justify-content: center;
  230. align-items: flex-start;
  231. flex-direction: column;
  232. margin-top: 24rpx;
  233. >text:nth-child(1) {
  234. .balance-userinfo-util {
  235. font-size: 24rpx;
  236. margin-left: 5rpx;
  237. }
  238. ::v-deep .u-count-num {
  239. font-weight: bold !important;
  240. font-size: 48rpx !important;
  241. }
  242. }
  243. >text:nth-child(2) {
  244. margin-top: 20rpx;
  245. font-size: 24rpx;
  246. }
  247. }
  248. }
  249. /** 余额 结束 */
  250. /** 提现 开始 */
  251. .consume-content-cash {
  252. width: 100%;
  253. box-sizing: border-box;
  254. position: absolute;
  255. top: 100%;
  256. transform: translateY(-50%);
  257. padding: 0 12rpx;
  258. .consume-content-consume-box {
  259. width: 100%;
  260. height: 100%;
  261. background-color: #fff;
  262. box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(221, 221, 221, 0.5);
  263. border-radius: 20rpx;
  264. box-sizing: border-box;
  265. padding: 34rpx 30rpx 38rpx;
  266. >text {
  267. font-size: 28rpx;
  268. color: #363636;
  269. }
  270. .consume-content-consume-money {
  271. width: 100%;
  272. display: flex;
  273. align-items: center;
  274. padding: 40rpx 0 20rpx;
  275. border-bottom: 2rpx solid #EEEEEE;
  276. ::v-deep .u-cell__body {
  277. padding: 20rpx 0 !important;
  278. }
  279. .consume-content-consume-input {
  280. width: 100%;
  281. padding: 0 10rpx;
  282. }
  283. >text {
  284. flex-shrink: 0;
  285. flex-wrap: nowrap;
  286. white-space: nowrap;
  287. }
  288. .consume-content-consume-money-icon {
  289. font-size: 32rpx;
  290. }
  291. .consume-content-consume-money-all {
  292. color: var(--gd-but-color);
  293. font-size: 24rpx;
  294. cursor: pointer;
  295. }
  296. }
  297. .consume-content-consume-card {
  298. width: 100%;
  299. ::v-deep .u-cell__body {
  300. padding: 20rpx 0 !important;
  301. }
  302. }
  303. .consume-content-consume-submit {
  304. width: 100%;
  305. height: 92rpx;
  306. display: flex;
  307. align-items: center;
  308. justify-content: center;
  309. box-sizing: border-box;
  310. padding: 0 80rpx 0;
  311. margin-top: 70rpx;
  312. >view {
  313. width: 100%;
  314. height: 100%;
  315. border-radius: 46rpx;
  316. color: #fff;
  317. background-color: var(--gd-but-color);
  318. font-size: 28rpx;
  319. font-family: SourceHanSansCN, SourceHanSansCN;
  320. display: flex;
  321. align-items: center;
  322. justify-content: center;
  323. }
  324. }
  325. }
  326. }
  327. /** 提现 结束 */
  328. }
  329. /** 头部主要内容 结束 **/
  330. /** 收支列表 开始 */
  331. .consume-content-list {
  332. width: 100%;
  333. height: 100%;
  334. background: #F7F7F9;
  335. // overflow: hidden;
  336. }
  337. /** 收支列表 结束 */
  338. </style>