institutional-activity-analysis.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. }
  71. },
  72. mounted() {
  73. this.userInfo = uni.getStorageSync('userInfo')
  74. this.getLivelyClub()
  75. this.getClubList()
  76. },
  77. watch: {
  78. currentTab(val) {
  79. if (val) {
  80. this.pageNum = 1
  81. this.clubList = []
  82. this.getClubList()
  83. }
  84. }
  85. },
  86. methods: {
  87. handleChangeActive(e) {
  88. this.currentTab = e
  89. },
  90. handleNavigateBack() {
  91. this.$api.navigateBack(1)
  92. },
  93. // 获取机构活跃分析占比
  94. async getLivelyClub() {
  95. const { data: data } = await this.SellerService.getLivelyClub({ spId: this.userInfo.serviceProviderId })
  96. this.dataList = data
  97. },
  98. // 获取机构列表
  99. async getClubList() {
  100. const { data } = await this.SellerService.getClubList({
  101. spId: this.userInfo.serviceProviderId,
  102. userIdentity: 4,
  103. status: 90,
  104. type: this.currentTab,
  105. pageNum: this.pageNum,
  106. pageSize: 10
  107. })
  108. this.clubList = [...this.clubList, ...data.clubList.list]
  109. this.isLastPage = data.clubList.isLastPage
  110. },
  111. }
  112. }
  113. </script>
  114. <style lang="scss" scoped>
  115. .container {
  116. background: #ffffff;
  117. position: relative;
  118. }
  119. .club-search {
  120. height: 700rpx;
  121. width: 100%;
  122. background: #ffffff;
  123. display: flex;
  124. flex-direction: column;
  125. position: sticky;
  126. top: 0;
  127. left: 0;
  128. z-index: 99;
  129. box-sizing: border-box;
  130. .search-top {
  131. display: flex;
  132. align-items: center;
  133. box-sizing: border-box;
  134. position: relative;
  135. margin-bottom: 80rpx;
  136. .title {
  137. position: absolute;
  138. left: 50%;
  139. top: 50%;
  140. transform: translate(-50%, -50%);
  141. }
  142. .search-icon {
  143. text-align: center;
  144. float: left;
  145. .icon-fanhui {
  146. font-size: 44rpx;
  147. color: #333333;
  148. }
  149. .icon-shouye {
  150. font-size: 44rpx;
  151. color: #333333;
  152. }
  153. }
  154. }
  155. }
  156. .analysis-list {
  157. padding: 38rpx 24rpx;
  158. box-sizing: border-box;
  159. .analysis-tabs {
  160. color: #666666;
  161. display: flex;
  162. align-items: center;
  163. margin-bottom: 12rpx;
  164. position: fixed;
  165. background: #fff;
  166. width: 100%;
  167. height: 100rpx;
  168. top: 700rpx;
  169. .analysis-tab {
  170. font-size: 32rpx;
  171. height: 54rpx;
  172. margin-right: 80rpx;
  173. &.active {
  174. color: #ff5b00;
  175. border-bottom: 2px solid #ff5b00;
  176. font-weight: bold;
  177. }
  178. }
  179. }
  180. }
  181. </style>