institutional-activity-analysis.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="container club clearfix">
  3. <view
  4. class="club-search clearfix"
  5. :style="{ paddingTop: StatusBar + 'px', backgroundImage: `url(${imgUrl})`, backgroundSize: '100% 100%' }"
  6. >
  7. <view class="search-top" :style="{ height: CustomBar - StatusBar + 'px' }">
  8. <view
  9. class="search-icon"
  10. :style="{
  11. width: CustomBar - StatusBar + 'px',
  12. height: CustomBar - StatusBar + 'px',
  13. lineHeight: CustomBar - StatusBar + 'px;'
  14. }"
  15. >
  16. <text @click="handleNavigateBack" class="iconfont icon-fanhui"></text>
  17. </view>
  18. <view class="title">机构活跃分析</view>
  19. </view>
  20. <analysis-card :analysis-info="dataList" />
  21. </view>
  22. <view class="analysis-list">
  23. <view class="analysis-tabs">
  24. <view
  25. class="analysis-tab"
  26. :class="currentTab === item.id && 'active'"
  27. v-for="(item, index) in tabs"
  28. :key="item.id"
  29. @click="handleChangeActive(item.id)"
  30. >
  31. {{ item.name }}
  32. </view>
  33. </view>
  34. <view class="list">
  35. <activity-analysis v-for="(item, index) in clubList" :key="index" :clubInfo="item" />
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import analysisCard from './components/analysis-card.vue'
  42. import activityAnalysis from './components/activity-analysis.vue'
  43. export default {
  44. components: {
  45. analysisCard,
  46. activityAnalysis
  47. },
  48. data() {
  49. return {
  50. isIphoneX: this.$store.state.isIphoneX,
  51. CustomBar: this.CustomBar,
  52. StatusBar: this.StatusBar,
  53. capsule: this.capsule,
  54. imgUrl: 'https://static.caimei365.com/app/img/icon/analysis-bg.png',
  55. userInfo: {},
  56. currentTab: 4,
  57. tabs: [
  58. {
  59. id: 4,
  60. name: '活跃机构'
  61. },
  62. {
  63. id: 5,
  64. name: '不活跃机构'
  65. }
  66. ],
  67. dataList: {},
  68. clubList: [], // 机构列表
  69. pageNum: 1,
  70. isLastPage: true // 是否是最后一页
  71. }
  72. },
  73. mounted() {
  74. this.userInfo = uni.getStorageSync('userInfo')
  75. this.getLivelyClub()
  76. this.getClubList()
  77. },
  78. watch: {
  79. currentTab(val) {
  80. if (val) {
  81. this.pageNum = 1
  82. this.clubList = []
  83. this.getClubList()
  84. }
  85. }
  86. },
  87. onReachBottom() {
  88. if (!this.isLastPage) {
  89. this.pageNum++
  90. this.getClubList()
  91. }
  92. console.log('触底刷新')
  93. },
  94. methods: {
  95. handleChangeActive(e) {
  96. this.currentTab = e
  97. },
  98. handleNavigateBack() {
  99. this.$api.navigateBack(1)
  100. },
  101. // 获取机构活跃分析占比
  102. async getLivelyClub() {
  103. const { data: data } = await this.SellerService.getLivelyClub({ spId: this.userInfo.serviceProviderId })
  104. this.dataList = data
  105. },
  106. // 获取机构列表
  107. async getClubList() {
  108. const { data } = await this.SellerService.getClubList({
  109. spId: this.userInfo.serviceProviderId,
  110. status: 90,
  111. type: this.currentTab,
  112. pageNum: this.pageNum,
  113. pageSize: 10
  114. })
  115. this.clubList = [...this.clubList, ...data.clubList.list]
  116. this.isLastPage = data.clubList.isLastPage
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. .container {
  123. background: #ffffff;
  124. position: relative;
  125. }
  126. .club-search {
  127. height: 700rpx;
  128. width: 100%;
  129. background: #ffffff;
  130. display: flex;
  131. flex-direction: column;
  132. position: fixed;
  133. top: 0;
  134. left: 0;
  135. z-index: 99;
  136. box-sizing: border-box;
  137. .search-top {
  138. display: flex;
  139. align-items: center;
  140. box-sizing: border-box;
  141. position: relative;
  142. margin-bottom: 80rpx;
  143. .title {
  144. position: absolute;
  145. left: 50%;
  146. top: 50%;
  147. transform: translate(-50%, -50%);
  148. }
  149. .search-icon {
  150. text-align: center;
  151. float: left;
  152. .icon-fanhui {
  153. font-size: 44rpx;
  154. color: #333333;
  155. }
  156. .icon-shouye {
  157. font-size: 44rpx;
  158. color: #333333;
  159. }
  160. }
  161. }
  162. }
  163. .analysis-list {
  164. padding: 38rpx 24rpx;
  165. box-sizing: border-box;
  166. .list {
  167. margin-top: 740rpx;
  168. }
  169. .analysis-tabs {
  170. color: #666666;
  171. display: flex;
  172. align-items: center;
  173. margin-bottom: 12rpx;
  174. position: fixed;
  175. background: #fff;
  176. width: 100%;
  177. height: 100rpx;
  178. top: 700rpx;
  179. .analysis-tab {
  180. font-size: 32rpx;
  181. height: 54rpx;
  182. margin-right: 80rpx;
  183. &.active {
  184. color: #ff5b00;
  185. border-bottom: 2px solid #ff5b00;
  186. font-weight: bold;
  187. }
  188. }
  189. }
  190. }
  191. </style>