index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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.marketPersonsSerialList = []
  109. this.$refs.customScrollList.refresh()
  110. },
  111. /**
  112. * 获取数据
  113. */
  114. async load(paging) {
  115. try{
  116. if(paging.page == 1) {
  117. this.marketPersonsSerialList = []
  118. }
  119. this.$refs.customScrollList.showPullUp = true
  120. let res = await this.$u.api.marketPersonsSerial({
  121. noSign: 1,
  122. userid: this.distribution_user_info.userId,
  123. pageNum: paging.page,
  124. pageSize: paging.size,
  125. serialType: this.serialType
  126. })
  127. if(res && res.code ===200) {
  128. if(res.data.rows){
  129. let list = JSON.parse(JSON.stringify(this.marketPersonsSerialList))
  130. res.data.rows.forEach(item=>{
  131. list.push({
  132. ...item
  133. })
  134. })
  135. this.marketPersonsSerialList = list
  136. }else {
  137. }
  138. this.$refs.customScrollList.loadSuccess({
  139. list: this.marketPersonsSerialList,
  140. total: res.data.total
  141. })
  142. } else {
  143. this.$refs.customScrollList.loadSuccess({
  144. list: [],
  145. total: res.data.total || this.marketPersonsSerialList.length
  146. })
  147. }
  148. }catch(e){
  149. //TODO handle the exception
  150. console.error("e===",e)
  151. this.$refs.customScrollList.loadSuccess({
  152. list: [],
  153. total: this.marketPersonsSerialList.length
  154. })
  155. }
  156. },
  157. paging(paging){
  158. console.log("下拉 加载数据")
  159. },
  160. /**
  161. * 下拉触底
  162. */
  163. async refresh(paging){
  164. console.log("上拉 加载数据")
  165. //this.$refs.customScrollList.showEmpty = true
  166. try{
  167. //this.$refs.customScrollList.showPullUp = true
  168. let res = await this.$u.api.marketPersonsSerial({
  169. pageNum: paging.page,
  170. pageSize: paging.size,
  171. userid: this.distribution_user_info.userId,
  172. serialType: this.serialType
  173. })
  174. if(res && res.code ===200) {
  175. if(res.data.rows){
  176. let list = []
  177. res.data.rows.forEach(item=>{
  178. list.push({
  179. ...item
  180. })
  181. })
  182. this.marketPersonsSerialList = list
  183. }else {
  184. this.marketPersonsSerialList = []
  185. }
  186. // this.marketPersonsSerialList = null
  187. this.$refs.customScrollList.refreshSuccess({
  188. list: this.marketPersonsSerialList,
  189. total: res.data.total
  190. })
  191. } else {
  192. this.$refs.customScrollList.refreshSuccess({
  193. list: [],
  194. total: res.data.total || this.marketPersonsSerialList.length
  195. })
  196. }
  197. }catch(e){
  198. //TODO handle the exception
  199. console.error("e===",e)
  200. this.$refs.customScrollList.refreshSuccess({
  201. list: [],
  202. total: this.marketPersonsSerialList.length
  203. })
  204. }
  205. },
  206. }
  207. }
  208. </script>
  209. <style lang="scss" scoped>
  210. .consume-content {
  211. width: 100%;
  212. height: 100%;
  213. --header-h: 90rpx;
  214. .consume-content-info {
  215. width: 100%;
  216. height: 100%;
  217. display: flex;
  218. flex-direction: column;
  219. box-sizing: border-box;
  220. }
  221. }
  222. /** 头部主要内容 开始 */
  223. .consume-content-header {
  224. width: 100%;
  225. //height: var(--header-h);
  226. box-sizing: border-box;
  227. position: relative;
  228. ::v-deep .u-search {
  229. padding: 0 30rpx !important;
  230. }
  231. ::v-deep .u-search__action {
  232. color: #fff !important;
  233. }
  234. /** 余额 开始 */
  235. .consume-content-money {
  236. width: 100%;
  237. box-sizing: border-box;
  238. margin-top: 50rpx;
  239. padding-left: 66rpx;
  240. color: #fff;
  241. >text {
  242. font-size: 24rpx;
  243. }
  244. .consume-content-money-num {
  245. display: flex;
  246. justify-content: center;
  247. align-items: flex-start;
  248. flex-direction: column;
  249. margin-top: 24rpx;
  250. >text:nth-child(1) {
  251. .balance-userinfo-util {
  252. font-size: 24rpx;
  253. margin-left: 5rpx;
  254. }
  255. ::v-deep .u-count-num {
  256. font-weight: bold !important;
  257. font-size: 48rpx !important;
  258. }
  259. }
  260. >text:nth-child(2) {
  261. margin-top: 20rpx;
  262. font-size: 24rpx;
  263. }
  264. }
  265. }
  266. /** 余额 结束 */
  267. /** 提现 开始 */
  268. .consume-content-cash {
  269. width: 100%;
  270. box-sizing: border-box;
  271. position: absolute;
  272. top: 100%;
  273. transform: translateY(-50%);
  274. padding: 0 12rpx;
  275. .consume-content-consume-box {
  276. width: 100%;
  277. height: 100%;
  278. background-color: #fff;
  279. box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(221, 221, 221, 0.5);
  280. border-radius: 20rpx;
  281. box-sizing: border-box;
  282. padding: 34rpx 30rpx 38rpx;
  283. >text {
  284. font-size: 28rpx;
  285. color: #363636;
  286. }
  287. .consume-content-consume-money {
  288. width: 100%;
  289. display: flex;
  290. align-items: center;
  291. padding: 40rpx 0 20rpx;
  292. border-bottom: 2rpx solid #EEEEEE;
  293. ::v-deep .u-cell__body {
  294. padding: 20rpx 0 !important;
  295. }
  296. .consume-content-consume-input {
  297. width: 100%;
  298. padding: 0 10rpx;
  299. }
  300. >text {
  301. flex-shrink: 0;
  302. flex-wrap: nowrap;
  303. white-space: nowrap;
  304. }
  305. .consume-content-consume-money-icon {
  306. font-size: 32rpx;
  307. }
  308. .consume-content-consume-money-all {
  309. color: var(--gd-but-color);
  310. font-size: 24rpx;
  311. cursor: pointer;
  312. }
  313. }
  314. .consume-content-consume-card {
  315. width: 100%;
  316. ::v-deep .u-cell__body {
  317. padding: 20rpx 0 !important;
  318. }
  319. }
  320. .consume-content-consume-submit {
  321. width: 100%;
  322. height: 92rpx;
  323. display: flex;
  324. align-items: center;
  325. justify-content: center;
  326. box-sizing: border-box;
  327. padding: 0 80rpx 0;
  328. margin-top: 70rpx;
  329. >view {
  330. width: 100%;
  331. height: 100%;
  332. border-radius: 46rpx;
  333. color: #fff;
  334. background-color: var(--gd-but-color);
  335. font-size: 28rpx;
  336. font-family: SourceHanSansCN, SourceHanSansCN;
  337. display: flex;
  338. align-items: center;
  339. justify-content: center;
  340. }
  341. }
  342. }
  343. }
  344. /** 提现 结束 */
  345. }
  346. /** 头部主要内容 结束 **/
  347. /** 收支列表 开始 */
  348. .consume-content-list {
  349. width: 100%;
  350. height: 100%;
  351. background: #F7F7F9;
  352. // overflow: hidden;
  353. }
  354. /** 收支列表 结束 */
  355. </style>