index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  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="orderWithdrawList.length>0" style="width: 100%;padding: 0 30rpx;box-sizing: border-box;">
  29. <view v-for="(item,index) in orderWithdrawList" :key="index">
  30. <view class="custom-list-item">
  31. <view class="custom-list-item-left">
  32. <text>申请状态:{{ withdrawStatus(item.status) }}</text>
  33. <text>提现类型:{{ withdrawType(item.withdrawType) }}</text>
  34. <text>支付方式:{{ payWay(item.payWay) }}</text>
  35. <text>支付状态:{{ payStatus(item.payStatus) }}</text>
  36. <text>手续费:{{ item && item.servicePrice }}</text>
  37. <text>提现时间:{{ item && item.createTime }}</text>
  38. </view>
  39. <text
  40. class="custom-list-item-right">{{ item.withdrawPrice }}</text>
  41. </view>
  42. </view>
  43. </view>
  44. </customScrollList>
  45. </view>
  46. <!-- 收支列表 结束 -->
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import {
  52. navigateTo
  53. } from "@/utils/util.js"
  54. export default {
  55. data() {
  56. return {
  57. title: '收支明细',
  58. statusBarHeight: 0, // 状态栏安全距离
  59. monry: 123456.789,
  60. moneyValue: null,
  61. tool: [ // 我的工具
  62. {
  63. title: "支付设置",
  64. icon: this.$commonConfig.staticUrl + 'balance/zhifu.png',
  65. url: '/pages/invitationStatistics/index'
  66. },
  67. {
  68. title: "余额提现",
  69. icon: this.$commonConfig.staticUrl + 'balance/mingxi.png',
  70. url: '/pages/balance/index'
  71. },
  72. ],
  73. list1: [
  74. {
  75. name: '全部',
  76. key: '',
  77. },
  78. {
  79. name: '提现中',
  80. key: 0,
  81. },
  82. {
  83. name: '提现成功',
  84. key: 1,
  85. },
  86. {
  87. name: '提现失败',
  88. key: 2,
  89. }
  90. ],
  91. serialType: '',
  92. orderWithdrawList: []
  93. }
  94. },
  95. onLoad() {
  96. },
  97. onShow() {
  98. this.statusBarHeight = getApp().globalData.statusBarHeight
  99. },
  100. methods: {
  101. /**
  102. * @author ygh
  103. * @data 2023-12-20
  104. */
  105. navigateToFun() {
  106. navigateTo('/pages/cash/index')
  107. },
  108. /**
  109. * 数字显示格式化
  110. *
  111. */
  112. numFormat(num = 0) {
  113. if (num < 100000) {
  114. return num
  115. } else if (num > 100000) {
  116. return (num / 10000).toFixed(2)
  117. }
  118. },
  119. /**
  120. * 选择tabs
  121. */
  122. clickTabs(item) {
  123. console.log('item', item);
  124. if(this.serialType == item.key) return
  125. this.serialType = item.key
  126. this.$refs.customScrollList.refresh()
  127. },
  128. /**
  129. * 获取数据
  130. */
  131. async load(paging) {
  132. try{
  133. this.$refs.customScrollList.showPullUp = true
  134. let res = await this.$u.api.orderWithdrawList({
  135. noSign: 1,
  136. userid: this.distribution_user_info.userId,
  137. pageNum: 1,
  138. pageSize: 10,
  139. serialType: this.serialType
  140. })
  141. if(res && res.code ===200) {
  142. if(res.data.rows){
  143. this.orderWithdrawList = this.orderWithdrawList.concat(res.data.rows)
  144. }else {
  145. this.orderWithdrawList = []
  146. }
  147. this.$refs.customScrollList.loadSuccess({
  148. list: this.orderWithdrawList,
  149. total: this.orderWithdrawList.length
  150. })
  151. } else {
  152. this.$refs.customScrollList.loadSuccess({
  153. list: [],
  154. total: res.data.total || this.orderWithdrawList.length
  155. })
  156. }
  157. }catch(e){
  158. //TODO handle the exception
  159. console.error("e===",e)
  160. this.$refs.customScrollList.loadSuccess({
  161. list: [],
  162. total: res.data.total || this.orderWithdrawList.length
  163. })
  164. }
  165. },
  166. paging(paging){
  167. console.log("下拉 加载数据")
  168. },
  169. /**
  170. * 下拉触底
  171. */
  172. async refresh(paging){
  173. console.log("上拉 加载数据")
  174. //this.$refs.customScrollList.showEmpty = true
  175. try{
  176. //this.$refs.customScrollList.showPullUp = true
  177. let res = await this.$u.api.orderWithdrawList({
  178. pageNum: paging.page,
  179. pageSize: paging.size
  180. })
  181. if(res && res.code ===200) {
  182. if(res.data.performList){
  183. this.orderWithdrawList = [].concat(res.data.performList)
  184. }else {
  185. this.orderWithdrawList = []
  186. }
  187. // this.orderWithdrawList = null
  188. this.$refs.customScrollList.refreshSuccess({
  189. list: this.orderWithdrawList,
  190. total: this.orderWithdrawList.length
  191. })
  192. } else {
  193. this.$refs.customScrollList.refreshSuccess({
  194. list: [],
  195. total: res.data.total || this.orderWithdrawList.length
  196. })
  197. }
  198. }catch(e){
  199. //TODO handle the exception
  200. console.error("e===",e)
  201. this.$refs.customScrollList.refreshSuccess({
  202. list: [],
  203. total: res.data.total || this.orderWithdrawList.length
  204. })
  205. }
  206. },
  207. /**
  208. * 支付方式
  209. */
  210. payWay(type){
  211. let src = ''
  212. switch(type) {
  213. case 'cahsh': src="现金"; break;
  214. case 'wecaht.applet': src="微信小程序支付"; break;
  215. case 'alipay': src="支付宝"; break;
  216. }
  217. return src
  218. },
  219. /**
  220. * 支付状态
  221. */
  222. payStatus(type){
  223. let src = ''
  224. switch(type) {
  225. case '0': src="未支付"; break;
  226. case '1': src="已支付"; break;
  227. case '2': src="支付中"; break;
  228. case '3': src="支付失败"; break;
  229. case '4': src="支付退款"; break;
  230. }
  231. return src
  232. },
  233. /**
  234. * 提现方式
  235. */
  236. withdrawType(type){
  237. let src = ''
  238. switch(type) {
  239. case 'wechat': src="微信零钱"; break;
  240. case 'bank': src="银行卡"; break;
  241. }
  242. return src
  243. },
  244. /**
  245. * 申请状态
  246. */
  247. withdrawStatus(type){
  248. let src = ''
  249. switch(type) {
  250. case '0': src="申请中"; break;
  251. case '1': src="提现成功"; break;
  252. case '2': src="提现失败"; break;
  253. }
  254. return src
  255. },
  256. }
  257. }
  258. </script>
  259. <style lang="scss" scoped>
  260. .consume-content {
  261. width: 100%;
  262. height: 100%;
  263. --header-h: 90rpx;
  264. .consume-content-info {
  265. width: 100%;
  266. height: 100%;
  267. display: flex;
  268. flex-direction: column;
  269. box-sizing: border-box;
  270. }
  271. }
  272. /** 头部主要内容 开始 */
  273. .consume-content-header {
  274. width: 100%;
  275. //height: var(--header-h);
  276. box-sizing: border-box;
  277. position: relative;
  278. ::v-deep .u-search {
  279. padding: 0 30rpx !important;
  280. }
  281. ::v-deep .u-search__action {
  282. color: #fff !important;
  283. }
  284. /** 余额 开始 */
  285. .consume-content-money {
  286. width: 100%;
  287. box-sizing: border-box;
  288. margin-top: 50rpx;
  289. padding-left: 66rpx;
  290. color: #fff;
  291. >text {
  292. font-size: 24rpx;
  293. }
  294. .consume-content-money-num {
  295. display: flex;
  296. justify-content: center;
  297. align-items: flex-start;
  298. flex-direction: column;
  299. margin-top: 24rpx;
  300. >text:nth-child(1) {
  301. .balance-userinfo-util {
  302. font-size: 24rpx;
  303. margin-left: 5rpx;
  304. }
  305. ::v-deep .u-count-num {
  306. font-weight: bold !important;
  307. font-size: 48rpx !important;
  308. }
  309. }
  310. >text:nth-child(2) {
  311. margin-top: 20rpx;
  312. font-size: 24rpx;
  313. }
  314. }
  315. }
  316. /** 余额 结束 */
  317. /** 提现 开始 */
  318. .consume-content-cash {
  319. width: 100%;
  320. box-sizing: border-box;
  321. position: absolute;
  322. top: 100%;
  323. transform: translateY(-50%);
  324. padding: 0 12rpx;
  325. .consume-content-consume-box {
  326. width: 100%;
  327. height: 100%;
  328. background-color: #fff;
  329. box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(221, 221, 221, 0.5);
  330. border-radius: 20rpx;
  331. box-sizing: border-box;
  332. padding: 34rpx 30rpx 38rpx;
  333. >text {
  334. font-size: 28rpx;
  335. color: #363636;
  336. }
  337. .consume-content-consume-money {
  338. width: 100%;
  339. display: flex;
  340. align-items: center;
  341. padding: 40rpx 0 20rpx;
  342. border-bottom: 2rpx solid #EEEEEE;
  343. ::v-deep .u-cell__body {
  344. padding: 20rpx 0 !important;
  345. }
  346. .consume-content-consume-input {
  347. width: 100%;
  348. padding: 0 10rpx;
  349. }
  350. >text {
  351. flex-shrink: 0;
  352. flex-wrap: nowrap;
  353. white-space: nowrap;
  354. }
  355. .consume-content-consume-money-icon {
  356. font-size: 32rpx;
  357. }
  358. .consume-content-consume-money-all {
  359. color: var(--gd-but-color);
  360. font-size: 24rpx;
  361. cursor: pointer;
  362. }
  363. }
  364. .consume-content-consume-card {
  365. width: 100%;
  366. ::v-deep .u-cell__body {
  367. padding: 20rpx 0 !important;
  368. }
  369. }
  370. .consume-content-consume-submit {
  371. width: 100%;
  372. height: 92rpx;
  373. display: flex;
  374. align-items: center;
  375. justify-content: center;
  376. box-sizing: border-box;
  377. padding: 0 80rpx 0;
  378. margin-top: 70rpx;
  379. >view {
  380. width: 100%;
  381. height: 100%;
  382. border-radius: 46rpx;
  383. color: #fff;
  384. background-color: var(--gd-but-color);
  385. font-size: 28rpx;
  386. font-family: SourceHanSansCN, SourceHanSansCN;
  387. display: flex;
  388. align-items: center;
  389. justify-content: center;
  390. }
  391. }
  392. }
  393. }
  394. /** 提现 结束 */
  395. }
  396. /** 头部主要内容 结束 **/
  397. /** 收支列表 开始 */
  398. .consume-content-list {
  399. width: 100%;
  400. height: 100%;
  401. background: #F7F7F9;
  402. // overflow: hidden;
  403. >view {
  404. width: 100%;
  405. }
  406. }
  407. .custom-list-item {
  408. width: 100%;
  409. border-bottom: 2rpx solid #EEEEEE;
  410. padding: 40rpx 10rpx;
  411. box-sizing: border-box;
  412. display: flex;
  413. justify-content: space-between;
  414. align-items: center;
  415. .custom-list-item-left {
  416. display: flex;
  417. flex-direction: column;
  418. font-family: SourceHanSansCN, SourceHanSansCN;
  419. >text {
  420. margin-bottom: 10rpx;
  421. font-size: 28rpx;
  422. font-weight: 400;
  423. color: #363636;
  424. }
  425. >text:last-child {
  426. font-size: 24rpx;
  427. font-weight: 400;
  428. color: #999999;
  429. }
  430. }
  431. .custom-list-item-right {
  432. font-size: 28rpx;
  433. font-family: SourceHanSansCN, SourceHanSansCN;
  434. font-weight: 400;
  435. color: #363636;
  436. white-space: nowrap;
  437. }
  438. }
  439. /** 收支列表 结束 */
  440. </style>