index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  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. userid: this.distribution_user_info.userId,
  163. serialType: this.serialType
  164. })
  165. if(res && res.code ===200) {
  166. if(res.data.rows){
  167. this.marketPersonsSerialList = [].concat(res.data.rows)
  168. }else {
  169. this.marketPersonsSerialList = []
  170. }
  171. // this.marketPersonsSerialList = null
  172. this.$refs.customScrollList.refreshSuccess({
  173. list: this.marketPersonsSerialList,
  174. total: this.marketPersonsSerialList.length
  175. })
  176. } else {
  177. this.$refs.customScrollList.refreshSuccess({
  178. list: [],
  179. total: res.data.total || this.marketPersonsSerialList.length
  180. })
  181. }
  182. }catch(e){
  183. //TODO handle the exception
  184. console.error("e===",e)
  185. this.$refs.customScrollList.refreshSuccess({
  186. list: [],
  187. total: this.marketPersonsSerialList.length
  188. })
  189. }
  190. },
  191. }
  192. }
  193. </script>
  194. <style lang="scss" scoped>
  195. .consume-content {
  196. width: 100%;
  197. height: 100%;
  198. --header-h: 90rpx;
  199. .consume-content-info {
  200. width: 100%;
  201. height: 100%;
  202. display: flex;
  203. flex-direction: column;
  204. box-sizing: border-box;
  205. }
  206. }
  207. /** 头部主要内容 开始 */
  208. .consume-content-header {
  209. width: 100%;
  210. //height: var(--header-h);
  211. box-sizing: border-box;
  212. position: relative;
  213. ::v-deep .u-search {
  214. padding: 0 30rpx !important;
  215. }
  216. ::v-deep .u-search__action {
  217. color: #fff !important;
  218. }
  219. /** 余额 开始 */
  220. .consume-content-money {
  221. width: 100%;
  222. box-sizing: border-box;
  223. margin-top: 50rpx;
  224. padding-left: 66rpx;
  225. color: #fff;
  226. >text {
  227. font-size: 24rpx;
  228. }
  229. .consume-content-money-num {
  230. display: flex;
  231. justify-content: center;
  232. align-items: flex-start;
  233. flex-direction: column;
  234. margin-top: 24rpx;
  235. >text:nth-child(1) {
  236. .balance-userinfo-util {
  237. font-size: 24rpx;
  238. margin-left: 5rpx;
  239. }
  240. ::v-deep .u-count-num {
  241. font-weight: bold !important;
  242. font-size: 48rpx !important;
  243. }
  244. }
  245. >text:nth-child(2) {
  246. margin-top: 20rpx;
  247. font-size: 24rpx;
  248. }
  249. }
  250. }
  251. /** 余额 结束 */
  252. /** 提现 开始 */
  253. .consume-content-cash {
  254. width: 100%;
  255. box-sizing: border-box;
  256. position: absolute;
  257. top: 100%;
  258. transform: translateY(-50%);
  259. padding: 0 12rpx;
  260. .consume-content-consume-box {
  261. width: 100%;
  262. height: 100%;
  263. background-color: #fff;
  264. box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(221, 221, 221, 0.5);
  265. border-radius: 20rpx;
  266. box-sizing: border-box;
  267. padding: 34rpx 30rpx 38rpx;
  268. >text {
  269. font-size: 28rpx;
  270. color: #363636;
  271. }
  272. .consume-content-consume-money {
  273. width: 100%;
  274. display: flex;
  275. align-items: center;
  276. padding: 40rpx 0 20rpx;
  277. border-bottom: 2rpx solid #EEEEEE;
  278. ::v-deep .u-cell__body {
  279. padding: 20rpx 0 !important;
  280. }
  281. .consume-content-consume-input {
  282. width: 100%;
  283. padding: 0 10rpx;
  284. }
  285. >text {
  286. flex-shrink: 0;
  287. flex-wrap: nowrap;
  288. white-space: nowrap;
  289. }
  290. .consume-content-consume-money-icon {
  291. font-size: 32rpx;
  292. }
  293. .consume-content-consume-money-all {
  294. color: var(--gd-but-color);
  295. font-size: 24rpx;
  296. cursor: pointer;
  297. }
  298. }
  299. .consume-content-consume-card {
  300. width: 100%;
  301. ::v-deep .u-cell__body {
  302. padding: 20rpx 0 !important;
  303. }
  304. }
  305. .consume-content-consume-submit {
  306. width: 100%;
  307. height: 92rpx;
  308. display: flex;
  309. align-items: center;
  310. justify-content: center;
  311. box-sizing: border-box;
  312. padding: 0 80rpx 0;
  313. margin-top: 70rpx;
  314. >view {
  315. width: 100%;
  316. height: 100%;
  317. border-radius: 46rpx;
  318. color: #fff;
  319. background-color: var(--gd-but-color);
  320. font-size: 28rpx;
  321. font-family: SourceHanSansCN, SourceHanSansCN;
  322. display: flex;
  323. align-items: center;
  324. justify-content: center;
  325. }
  326. }
  327. }
  328. }
  329. /** 提现 结束 */
  330. }
  331. /** 头部主要内容 结束 **/
  332. /** 收支列表 开始 */
  333. .consume-content-list {
  334. width: 100%;
  335. height: 100%;
  336. background: #F7F7F9;
  337. // overflow: hidden;
  338. }
  339. /** 收支列表 结束 */
  340. </style>