index.vue 8.0 KB

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