index.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <view :data-theme="theme">
  3. <view class='bill-details'>
  4. <view class='nav acea-row'>
  5. <view class='item' :class='type==="all" ? "on":""' @click='changeType("all")'>全部</view>
  6. <view class='item' :class='type==="expenditure" ? "on":""' @click='changeType("expenditure")'>支出</view>
  7. <view class='item' :class='type==="recharge" ? "on":""' @click='changeType("recharge")'>充值</view>
  8. <view class='item' :class='type==="income" ? "on":""' @click='changeType("income")'>收入</view>
  9. </view>
  10. <view class='sign-record'>
  11. <view class='list borderPad' v-for="(item,index) in userBillList" :key="index">
  12. <view class='item'>
  13. <view class='data'>{{item.month}}</view>
  14. <view class='listn borRadius14'>
  15. <view class="itemn" v-for="(vo,indexn) in item.list" :key="indexn">
  16. <view class='acea-row row-between-wrapper'>
  17. <view>
  18. <view class='name line1' v-if="vo.linkType === 'withdraw_refuse'">提现拒绝增加余额</view>
  19. <view class='name line1' v-if="vo.linkType === 'withdraw'">提现操作</view>
  20. <view class='name line1' v-if="vo.linkType === 'order'">订单消费</view>
  21. <view class='name line1' v-if="vo.linkType === 'recharge'">充值入账</view>
  22. <view class='name line1' v-if="vo.linkType === 'system'">系统后台</view>
  23. <view class='name line1' v-if="vo.linkType === 'brokerage'">佣金转余额</view>
  24. <view class='name line1' v-if="vo.linkType === 'svip'">购买VIO</view>
  25. <view>{{vo.createTime}}</view>
  26. </view>
  27. <view class="right-box">
  28. <view class='num font_color' v-if="vo.type == 1"><span style="font-size: 15px;color: #999;">+sL</span> {{vo.amount}}</view>
  29. <view class='num' v-else><span style="font-size: 15px;color: #999;">-sL</span> {{vo.amount}}</view>
  30. <!-- 状态标签示例,请自行添加判断逻辑 -->
  31. <!-- <view class="status-txt success">提现成功</view> -->
  32. <!-- <view class="status-txt processing">提现中</view> -->
  33. <!-- <view class="status-txt failure">提现被拒</view> -->
  34. <view class="status-txt success" v-if="vo.withdrawStatus === 1">提现成功</view>
  35. <view class="status-txt processing" v-if="vo.withdrawStatus === 0">提现中</view>
  36. <view class="status-txt failure" v-if="vo.withdrawStatus === 2">提现被拒</view>
  37. </view>
  38. </view>
  39. <view class="remark">说明:{{vo.remark}}</view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class='loadingicon acea-row row-center-wrapper'>
  45. <text class='loading iconfont icon-jiazai'
  46. :hidden='loading==false'></text>{{userBillList.length > 0?loadTitle:''}}
  47. </view>
  48. <view v-if="userBillList.length == 0 && !loading">
  49. <emptyPage title="暂无账单的记录哦~" :imgSrc="urlDomain+'crmebimage/presets/noJilu.png'"></emptyPage>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. // +----------------------------------------------------------------------
  57. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  58. // +----------------------------------------------------------------------
  59. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  60. // +----------------------------------------------------------------------
  61. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  62. // +----------------------------------------------------------------------
  63. // | Author: CRMEB Team <admin@crmeb.com>
  64. // +----------------------------------------------------------------------
  65. import {
  66. getBillList
  67. } from '@/api/user.js';
  68. import {
  69. toLogin
  70. } from '@/libs/login.js';
  71. import {
  72. mapGetters
  73. } from "vuex";
  74. import emptyPage from '@/components/emptyPage.vue';
  75. let app = getApp();
  76. export default {
  77. components: {
  78. emptyPage
  79. },
  80. data() {
  81. return {
  82. urlDomain: this.$Cache.get("imgHost"),
  83. loadTitle: '加载更多',
  84. loading: true,
  85. loadend: false,
  86. page: 1,
  87. limit: 12,
  88. type: 'all',
  89. userBillList: [],
  90. theme: app.globalData.theme,
  91. };
  92. },
  93. computed: mapGetters(['isLogin']),
  94. onShow() {
  95. if (this.isLogin) {
  96. this.getUserBillList();
  97. } else {
  98. toLogin();
  99. }
  100. },
  101. /**
  102. * 生命周期函数--监听页面加载
  103. */
  104. onLoad: function(options) {
  105. this.type = options.type;
  106. },
  107. /**
  108. * 页面上拉触底事件的处理函数
  109. */
  110. onReachBottom: function() {
  111. this.getUserBillList();
  112. },
  113. methods: {
  114. remarkFormat: function(remark,rate) {
  115. return remark.replace(/\d+(\.\d+)?/g, rate).replace("元"," sLGNS").replace("余额","余额 ");
  116. },
  117. /**
  118. * 获取账户明细
  119. */
  120. getUserBillList: function() {
  121. let that = this;
  122. if (that.loadend) return;
  123. that.loading = true;
  124. that.loadTitle = "";
  125. let data = {
  126. page: that.page,
  127. limit: that.limit,
  128. type: that.type
  129. }
  130. getBillList(data).then(function(res) {
  131. let list = res.data.list ? res.data.list : [],
  132. loadend = res.data.totalPage <= that.page;
  133. for (let i = 0; i < list.length; i++) {
  134. let time1 = list[i].month;
  135. let array1 = list[i].list;
  136. let isEquals = false;
  137. for (let j = 0; j < that.userBillList.length; j++) {
  138. let time2 = that.userBillList[j].month;
  139. let array2 = that.userBillList[j].list;
  140. if (time1 == time2) {
  141. array2.push.apply(array2, array1);
  142. that.userBillList[j].list = array2;
  143. isEquals = true;
  144. break;
  145. }
  146. }
  147. if (!isEquals) {
  148. that.userBillList.push({
  149. month: time1,
  150. list: array1
  151. })
  152. }
  153. }
  154. that.$set(that, 'userBillList', that.userBillList);
  155. that.page += 1;
  156. that.loadend = loadend;
  157. that.loadTitle = loadend ? "到底了~~" : "加载更多";
  158. that.loading = false;
  159. }, function(res) {
  160. that.loadTitle = '加载更多';
  161. that.loading = false;
  162. });
  163. },
  164. /**
  165. * 切换导航
  166. */
  167. changeType: function(type) {
  168. this.type = type;
  169. this.loadend = false;
  170. this.page = 1;
  171. this.$set(this, 'userBillList', []);
  172. this.getUserBillList();
  173. },
  174. }
  175. }
  176. </script>
  177. <style scoped lang='scss'>
  178. .remark {
  179. font-size: 24rpx;
  180. margin-top: 10rpx;
  181. }
  182. .bill-details .nav {
  183. background-color: #fff;
  184. height: 90rpx;
  185. width: 100%;
  186. line-height: 90rpx;
  187. }
  188. .bill-details .nav .item {
  189. flex: 1;
  190. text-align: center;
  191. font-size: 30rpx;
  192. color: #282828;
  193. }
  194. .bill-details .nav .item.on {
  195. @include main_color(theme);
  196. @include tab_border_bottom(theme);
  197. }
  198. .font_color {
  199. color: #E93323 !important;
  200. }
  201. .right-box {
  202. display: flex;
  203. flex-direction: column;
  204. align-items: flex-end;
  205. .num {
  206. margin-bottom: 5rpx;
  207. }
  208. .status-txt {
  209. font-size: 28rpx;
  210. &.success {
  211. color: #0987fc; // 绿色
  212. }
  213. &.processing {
  214. color: #4B67AF; // 蓝色
  215. }
  216. &.failure {
  217. color: red; // 红色
  218. }
  219. }
  220. }
  221. </style>