commission-statistics.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <view class="commision-page">
  3. <view class="back">
  4. <tui-icon name="arrowleft" color="#000" :size="30" @click="handleBack"></tui-icon>
  5. </view>
  6. <!-- 上面三个统计 -->
  7. <view class="top-pane">
  8. <view class="item" @click="go('/another-tf/another-user/commission-statistics/commission-detail?tag=1')">
  9. <image class="img" src="../../../static/images/new-user/group/today-price.png"></image>
  10. <view class="text">今日佣金</view>
  11. <view class="value">¥{{ commissionData.todaySum || 0 }}</view>
  12. </view>
  13. <view class="item" @click="go('/another-tf/another-user/commission-statistics/commission-detail?tag=2')">
  14. <image class="img" src="../../../static/images/new-user/group/total-price.png"></image>
  15. <view class="text">累计佣金</view>
  16. <view class="value">¥{{ commissionData.remainAmount || 0 }}</view>
  17. </view>
  18. <view class="item" @click="go('/another-tf/another-user/commission-statistics/commission-detail?tag=3')">
  19. <image class="img" src="../../../static/images/new-user/group/lu-price.png"></image>
  20. <view class="text">途中佣金</view>
  21. <view class="value">¥{{ commissionData.inTheAccount || 0 }}</view>
  22. </view>
  23. </view>
  24. <!-- 列表统计 -->
  25. <view class="list">
  26. <view class="list-wrapper">
  27. <view class="item" @click="go('/another-tf/another-user/commission-statistics/vip-user')">
  28. <image class="img" src="../../../static/images//new-user/group/total-vip-number.png"></image>
  29. <view class="text">累计会员(个)</view>
  30. <view class="value">{{ commissionData.fans || 0 }}</view>
  31. </view>
  32. <view class="item" @click="go('/another-tf/another-user/commission-statistics/vip-user?date=now')">
  33. <image class="img" src="../../../static/images//new-user/group/today-vip-number.png"></image>
  34. <view class="text">今日会员(个)</view>
  35. <view class="value">{{ commissionData.todayFans || 0 }}</view>
  36. </view>
  37. <!-- <view class="item">
  38. <image class="img" src="../../static/images//new-user/group/can-whith.png"></image>
  39. <view class="text">可提现(元)</view>
  40. <view class="value">{{ commissionData.totalAmount || 0 }}</view>
  41. </view>
  42. <view class="item">
  43. <image class="img" src="../../static/images//new-user/group/has-whitdh.png"></image>
  44. <view class="text">已提现(元)</view>
  45. <view class="value">{{ commissionData.withdrawAmount || 0 }}</view>
  46. </view> -->
  47. </view>
  48. <view class="button-wrapper">
  49. <!-- <view class="tip">可提现 ¥{{ commissionData.totalAmount || 0 }}</view> -->
  50. <button
  51. :class="{ disabled: !commissionData.totalAmount || commissionData.totalAmount == 0 }" class="uni-btn"
  52. @click="handleWithdrawal(commissionData.totalAmount)"
  53. >
  54. 去提现
  55. </button>
  56. </view>
  57. </view>
  58. <tui-toast ref="toast"></tui-toast>
  59. </view>
  60. </template>
  61. <script>
  62. import { getSmallAccountBookStatisticsApi } from '../../../api/anotherTFInterface'
  63. export default {
  64. data() {
  65. return {
  66. commissionData: {}
  67. }
  68. },
  69. onShow() {
  70. this.getCommissionData()
  71. },
  72. methods: {
  73. handleBack() {
  74. uni.switchTab({
  75. url: '/'
  76. })
  77. },
  78. async getCommissionData() {
  79. try {
  80. const res = await getSmallAccountBookStatisticsApi()
  81. this.commissionData = res.data
  82. } catch (error) {
  83. this.ttoast({
  84. type: 'fail',
  85. content: error || '获取佣金信息失败',
  86. title: '获取佣金详情失败'
  87. })
  88. } finally {
  89. uni.stopPullDownRefresh()
  90. }
  91. },
  92. async getVipCommissionStatistics() {
  93. },
  94. // 点击提现
  95. handleWithdrawal(account) {
  96. // if (!account) {
  97. // this.ttoast({
  98. // type: 'fail',
  99. // title: '佣金正在审批中'
  100. // });
  101. // return;
  102. // }
  103. uni.navigateTo({
  104. url: '/another-tf/another-user/platform-recharge/index'
  105. })
  106. }
  107. },
  108. onPullDownRefresh() {
  109. this.getCommissionData()
  110. }
  111. }
  112. </script>
  113. <style lang="less" scoped>
  114. .commision-page {
  115. position: relative;
  116. width: 100vw;
  117. min-height: 100vh;
  118. background-color: #f5f7fb;
  119. display: flex;
  120. align-items: center;
  121. flex-direction: column;
  122. .back {
  123. position: absolute;
  124. top: 40upx;
  125. left: 40upx;
  126. right: 40upx;
  127. display: flex;
  128. align-items: center;
  129. justify-content: space-between;
  130. .uni-btn {
  131. display: flex;
  132. align-items: center;
  133. justify-content: space-between;
  134. font-size: 28upx;
  135. .img {
  136. width: 50upx;
  137. height: 50upx;
  138. margin-right: 8upx;
  139. }
  140. }
  141. }
  142. .top-pane {
  143. display: flex;
  144. align-items: center;
  145. justify-content: space-between;
  146. padding: 206upx 56upx 56upx 56upx;
  147. box-sizing: border-box;
  148. width: 100vw;
  149. .item {
  150. display: flex;
  151. align-items: center;
  152. flex-direction: column;
  153. font-size: 26upx;
  154. counter-reset: #3d3d3d;
  155. .text {
  156. margin: 16upx 0 12upx 0;
  157. }
  158. .value {
  159. font-weight: 500;
  160. }
  161. }
  162. }
  163. .list {
  164. flex: 1;
  165. width: 100vw;
  166. background-color: #fff;
  167. padding-bottom: 56upx;
  168. border-radius: 80upx 80upx 0 0;
  169. display: flex;
  170. flex-direction: column;
  171. justify-content: space-between;
  172. .list-wrapper {
  173. width: 100%;
  174. padding: 60upx 56upx;
  175. box-sizing: border-box;
  176. }
  177. .item {
  178. display: flex;
  179. align-items: center;
  180. margin-bottom: 46upx;
  181. .text {
  182. flex: 1;
  183. margin-right: 30upx;
  184. margin-left: 30upx;
  185. }
  186. }
  187. .button-wrapper {
  188. width: 100%;
  189. .tip {
  190. text-align: center;
  191. margin-bottom: 20upx;
  192. font-size: 24upx;
  193. }
  194. .uni-btn {
  195. height: 80upx;
  196. width: 702upx;
  197. margin: 0 auto;
  198. background-color: #fe751a;
  199. color: #fff;
  200. font-size: 30upx;
  201. font-weight: 500;
  202. display: flex;
  203. align-items: center;
  204. justify-content: center;
  205. transition: all 350ms;
  206. &.disabled {
  207. opacity: 0.7;
  208. }
  209. &:active {
  210. background-color: #ff8f44;
  211. }
  212. }
  213. }
  214. }
  215. }
  216. .img {
  217. width: 80upx;
  218. height: 80upx;
  219. flex-shrink: 0;
  220. }
  221. </style>