CommissionDetails.vue 4.3 KB

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