CashRecord.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view class="cash-record">
  3. <!-- 头部背景 -->
  4. <view class="promoterHeader bg-color-red">
  5. <view class="headerCon acea-row row-between-wrapper">
  6. <view>
  7. <view class="name">提现记录</view>
  8. <view class="money">
  9. ¥<text class="num">{{ commission || '0.00' }}</text>
  10. </view>
  11. </view>
  12. <view class="iconfont icon-jinbi1"></view>
  13. </view>
  14. </view>
  15. <!-- 内容区域 -->
  16. <view class="sign-record">
  17. <view class="list">
  18. <view class="item" v-for="(item, listIndex) in list" :key="listIndex">
  19. <view class="data">{{ item.createTime }}</view>
  20. <view class="listn">
  21. <view class="itemn acea-row row-between-wrapper">
  22. <view>
  23. <view class="name line1">{{ item.title }}</view>
  24. <view class="time">{{ item.createTime }}</view>
  25. </view>
  26. <view class="num font-color-red" v-if="item.pm === 0">-{{ item.number }}</view>
  27. <view class="num" v-else-if="item.pm === 1">+{{ item.number }}</view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. name: "CashRecord",
  38. data: function() {
  39. return {
  40. list: [],
  41. commission: 0,
  42. where: {
  43. page: 1,
  44. limit: 15
  45. },
  46. loaded: false,
  47. loading: false,
  48. loadTitle: ""
  49. };
  50. },
  51. mounted: function() {
  52. this.getCommission();
  53. this.getIndex();
  54. },
  55. onReachBottom() {
  56. !this.loading && this.getIndex();
  57. },
  58. methods: {
  59. getIndex: function() {
  60. let that = this;
  61. if (that.loaded == true || that.loading == true) return;
  62. that.loading = true;
  63. uni.showLoading({
  64. title: '加载中...'
  65. })
  66. this.$api.request('get', 'app/userBill/spread/commission/4', that.where).then(
  67. res => {
  68. uni.hideLoading();
  69. that.loading = false;
  70. that.loaded = res.rows.length < that.where.limit;
  71. that.loadTitle = that.loaded ? "人家是有底线的" : "上拉加载更多";
  72. that.where.page = that.where.page + 1;
  73. that.list.push.apply(that.list, res.rows);
  74. },
  75. err => {
  76. uni.hideLoading();
  77. uni.showToast({
  78. title: err.msg || err.response.data.msg|| err.response.data.message,
  79. icon: "none",
  80. duration: 2000
  81. });
  82. },
  83. 300
  84. );
  85. },
  86. getCommission: function() {
  87. let that = this;
  88. this.$api.request('get', 'app/userBill/commission').then(
  89. res => {
  90. that.commission = res.data.commissionCount;
  91. },
  92. err => {
  93. uni.showToast({
  94. title: err.msg || err.response.data.msg|| err.response.data.message,
  95. icon: "none",
  96. duration: 2000
  97. });
  98. }
  99. );
  100. }
  101. }
  102. };
  103. </script>
  104. <style lang="less">
  105. .cash-record {
  106. .promoterHeader {
  107. background-image: url('https://kxmalls.oss-cn-hangzhou.aliyuncs.com/bg/bg.png');
  108. background-repeat: no-repeat;
  109. background-size: 100% 80%;
  110. width: 100%;
  111. height: 300rpx;
  112. padding: 0 50rpx;
  113. box-sizing: border-box;
  114. color: #fff;
  115. .headerCon {
  116. padding: 50rpx 0;
  117. .name {
  118. font-size: 28rpx;
  119. opacity: 0.9;
  120. margin-bottom: 10rpx;
  121. }
  122. .money {
  123. font-size: 36rpx;
  124. font-weight: bold;
  125. line-height: 1.2;
  126. font-family: 'Arial Rounded MT Bold', 'Helvetica Rounded', sans-serif;
  127. text-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.1);
  128. .num {
  129. font-size: 48rpx;
  130. font-family: 'GuildfordProBook 5';
  131. }
  132. }
  133. .iconfont {
  134. font-size: 60rpx;
  135. opacity: 0.8;
  136. }
  137. }
  138. }
  139. .sign-record {
  140. background-color: #fff;
  141. border-radius: 16rpx 16rpx 0 0;
  142. margin-top: -20rpx;
  143. padding: 0 30rpx;
  144. .item {
  145. padding: 30rpx 0;
  146. border-bottom: 1rpx solid #f5f5f5;
  147. .data {
  148. font-size: 28rpx;
  149. color: #333;
  150. margin-bottom: 20rpx;
  151. font-weight: bold;
  152. }
  153. .itemn {
  154. padding: 20rpx 0;
  155. align-items: flex-start;
  156. .name {
  157. font-size: 28rpx;
  158. color: #333;
  159. margin-bottom: 8rpx;
  160. }
  161. .time {
  162. font-size: 24rpx;
  163. color: #999;
  164. }
  165. .num {
  166. font-size: 30rpx;
  167. font-weight: bold;
  168. }
  169. .font-color-red {
  170. color: #eb3729;
  171. }
  172. }
  173. }
  174. }
  175. }
  176. .acea-row {
  177. display: flex;
  178. flex-wrap: wrap;
  179. }
  180. .row-between-wrapper {
  181. justify-content: space-between;
  182. align-items: center;
  183. }
  184. .line1 {
  185. overflow: hidden;
  186. text-overflow: ellipsis;
  187. white-space: nowrap;
  188. }
  189. </style>