index copy.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view class="finance-statistics-container">
  3. <JHeader title="加盟商统计" width="50" height="50" style="padding: 24upx 0 0;"></JHeader>
  4. <view
  5. style="padding: 8upx 0 0;text-align: center;color: #ffffff;background: linear-gradient(90deg, #EF530E 0%, #EF530E 100%);overflow: hidden;"
  6. >
  7. <view style="font-size: 28upx;">
  8. <view>累计收益</view>
  9. <view style="margin-top: 24upx;font-size: 64upx;">{{ franchiseeStatisticsData.accumulateIncome || 0 }}</view>
  10. <view style="margin-top: 22upx;color: #f6a07a;">待提现:{{ franchiseeStatisticsData.withdrawalIncome || 0 }}元</view>
  11. </view>
  12. <view
  13. style="display: flex;justify-content: space-evenly;margin-top: 76upx;padding: 20upx 0;background: linear-gradient(0deg, rgba(255, 255, 255, 0.0001) 0%, rgba(255, 255, 255, 0.15) 99%);"
  14. >
  15. <view>
  16. <view style="color: #f7a783;">今日商家数</view>
  17. <view style="margin-top: 10upx;">{{ franchiseeStatisticsData.shopTodayNum || 0 }}</view>
  18. </view>
  19. <view style="width: 2upx;background-color: #f37d49;"></view>
  20. <view>
  21. <view style="color: #f7a783;">累计商家数</view>
  22. <view style="margin-top: 10upx;">{{ franchiseeStatisticsData.shopAllNum || 0 }}</view>
  23. </view>
  24. <view style="width: 2upx;background-color: #f37d49;"></view>
  25. <view>
  26. <view style="color: #f7a783;">今日收益</view>
  27. <view style="margin-top: 10upx;">{{ franchiseeStatisticsData.todayIncome || 0 }}</view>
  28. </view>
  29. <view style="width: 2upx;background-color: #f37d49;"></view>
  30. <view>
  31. <view style="color: #f7a783;">预计收益</view>
  32. <view style="margin-top: 10upx;">{{ franchiseeStatisticsData.wayIncome || 0 }}</view>
  33. </view>
  34. </view>
  35. </view>
  36. <view style="padding: 0 24upx;background-color: #ffffff;">
  37. <tui-tabs
  38. style="width: 702upx;padding: 0 0upx 0 0upx;overflow: hidden;" :slider-width="351" :padding="24"
  39. item-width="351rpx" selected-color="#000000" bold slider-bg-color="#ff0000"
  40. :tabs="[{ name: '今天' }, { name: '全部' }]" :current-tab="currentTab"
  41. @change="handleCurrentChange"
  42. ></tui-tabs>
  43. </view>
  44. <view style="padding: 20upx;">
  45. <tui-list-view v-if="shopIncomeList && shopIncomeList.length" title="">
  46. <tui-list-cell v-for="(item, index) in shopIncomeList" :key="item.id">
  47. <view style="display: flex;justify-content: space-between;">
  48. <view>{{ item.shopName }}</view>
  49. <view>累计:¥{{ item.accumulateIncome || '--' }}</view>
  50. </view>
  51. <view style="display: flex;justify-content: space-between;">
  52. <view>今日:¥{{ item.todayIncome || '--' }}</view>
  53. <view>预计:¥{{ item.wayIncome || '--' }}</view>
  54. </view>
  55. </tui-list-cell>
  56. </tui-list-view>
  57. <view style="padding-bottom: 45upx;">
  58. <LoadingMore
  59. :status="!isEmpty && !shopIncomeList.length
  60. ? 'loading' : !isEmpty && shopIncomeList.length && (shopIncomeList.length >= shopIncomeTotal) ? 'no-more' : ''"
  61. >
  62. </LoadingMore>
  63. <tui-no-data v-if="isEmpty" :fixed="false" style="margin-top: 60upx;">暂无粉丝~</tui-no-data>
  64. </view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. import { getFranchiseeStatisticsApi, getPlatformFranchiseeIncomeApi } from '../../../api/anotherTFInterface'
  70. export default {
  71. name: 'FranchiseeStatistics',
  72. components: {},
  73. data() {
  74. return {
  75. franchiseeStatisticsData: {
  76. page: 0,
  77. pageSize: 0,
  78. shopTodayNum: 0,
  79. shopAllNum: 0,
  80. todayIncome: 0,
  81. wayIncome: 0,
  82. withdrawalIncome: 0,
  83. accumulateIncome: 0
  84. },
  85. currentTab: 1,
  86. isEmpty: false,
  87. shopIncomeList: [],
  88. shopIncomeTotal: 0,
  89. queryInfo: {
  90. page: 1,
  91. pageSize: 20
  92. }
  93. }
  94. },
  95. onLoad() {
  96. this.getShopStatistics()
  97. this.getFranchiseeShopIncomeList()
  98. },
  99. methods: {
  100. handleCurrentChange(e) {
  101. this.currentTab = e.index
  102. this.getFranchiseeShopIncomeList()
  103. },
  104. getShopStatistics() {
  105. uni.showLoading({
  106. title: '加载中'
  107. })
  108. getFranchiseeStatisticsApi({})
  109. .then((res) => {
  110. this.franchiseeStatisticsData = res.data
  111. uni.hideLoading()
  112. })
  113. .catch(() => {
  114. uni.hideLoading()
  115. })
  116. },
  117. getFranchiseeShopIncomeList(isLoadmore) {
  118. uni.showLoading()
  119. getPlatformFranchiseeIncomeApi({ ...this.queryInfo, type: this.currentTab + 1 }).then((res) => {
  120. this.shopIncomeTotal = res.data.total
  121. if (isLoadmore) {
  122. this.shopIncomeList.push(...res.data.list)
  123. } else {
  124. this.shopIncomeList = res.data.list
  125. }
  126. this.isEmpty = this.shopIncomeList.length === 0
  127. uni.hideLoading()
  128. })
  129. .catch((e) => {
  130. uni.hideLoading()
  131. })
  132. }
  133. },
  134. onReachBottom() {
  135. if (this.shopIncomeList.length < this.shopIncomeTotal) {
  136. ++this.queryInfo.page
  137. this.getFranchiseeShopIncomeList(true)
  138. }
  139. }
  140. }
  141. </script>
  142. <style lang="less" scoped>
  143. .finance-statistics-container {
  144. min-height: 100vh;
  145. width: 100%;
  146. background-color: #f6f6f6;
  147. .tui-tabs-view{
  148. /deep/ .tui-tabs-slider{
  149. margin-left: -24upx;
  150. }
  151. }
  152. }
  153. </style>