institutional-activity-analysis.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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. name: 'ceshi机构',
  70. activeState: '忠诚用户',
  71. customerValue: '忠诚用户',
  72. linkMan: 'ceshi',
  73. contractMobile: '12654641'
  74. },
  75. {
  76. name: 'ceshi机构',
  77. activeState: '忠诚用户',
  78. customerValue: '忠诚用户',
  79. linkMan: 'ceshi',
  80. contractMobile: '12654641'
  81. },
  82. {
  83. name: 'ceshi机构',
  84. activeState: '忠诚用户',
  85. customerValue: '忠诚用户',
  86. linkMan: 'ceshi',
  87. contractMobile: '12654641'
  88. },
  89. {
  90. name: 'ceshi机构',
  91. activeState: '忠诚用户',
  92. customerValue: '忠诚用户',
  93. linkMan: 'ceshi',
  94. contractMobile: '12654641'
  95. }], // 机构列表
  96. pageNum: 1,
  97. isLastPage: true, // 是否是最后一页
  98. }
  99. },
  100. mounted() {
  101. this.userInfo = uni.getStorageSync('userInfo')
  102. this.getLivelyClub()
  103. this.getClubList()
  104. },
  105. watch: {
  106. currentTab(val) {
  107. if (val) {
  108. this.pageNum = 1
  109. this.clubList = []
  110. this.getClubList()
  111. }
  112. }
  113. },
  114. onReachBottom() {
  115. if (!this.isLastPage) {
  116. this.pageNum++
  117. this.getClubList()
  118. }
  119. console.log('触底刷新')
  120. },
  121. methods: {
  122. handleChangeActive(e) {
  123. this.currentTab = e
  124. },
  125. handleNavigateBack() {
  126. this.$api.navigateBack(1)
  127. },
  128. // 获取机构活跃分析占比
  129. async getLivelyClub() {
  130. const { data: data } = await this.SellerService.getLivelyClub({ spId: this.userInfo.serviceProviderId })
  131. this.dataList = data
  132. },
  133. // 获取机构列表
  134. async getClubList() {
  135. const { data } = await this.SellerService.getClubList({
  136. spId: this.userInfo.serviceProviderId,
  137. userIdentity: 4,
  138. status: 90,
  139. type: this.currentTab,
  140. pageNum: this.pageNum,
  141. pageSize: 10
  142. })
  143. this.clubList = [...this.clubList, ...data.clubList.list]
  144. this.isLastPage = data.clubList.isLastPage
  145. },
  146. }
  147. }
  148. </script>
  149. <style lang="scss" scoped>
  150. .container {
  151. background: #ffffff;
  152. position: relative;
  153. }
  154. .club-search {
  155. height: 700rpx;
  156. width: 100%;
  157. background: #ffffff;
  158. display: flex;
  159. flex-direction: column;
  160. position: sticky;
  161. top: 0;
  162. left: 0;
  163. z-index: 99;
  164. box-sizing: border-box;
  165. .search-top {
  166. display: flex;
  167. align-items: center;
  168. box-sizing: border-box;
  169. position: relative;
  170. margin-bottom: 80rpx;
  171. .title {
  172. position: absolute;
  173. left: 50%;
  174. top: 50%;
  175. transform: translate(-50%, -50%);
  176. }
  177. .search-icon {
  178. text-align: center;
  179. float: left;
  180. .icon-fanhui {
  181. font-size: 44rpx;
  182. color: #333333;
  183. }
  184. .icon-shouye {
  185. font-size: 44rpx;
  186. color: #333333;
  187. }
  188. }
  189. }
  190. }
  191. .analysis-list {
  192. padding: 38rpx 24rpx;
  193. box-sizing: border-box;
  194. .list {
  195. margin-top: 40rpx;
  196. }
  197. .analysis-tabs {
  198. color: #666666;
  199. display: flex;
  200. align-items: center;
  201. margin-bottom: 12rpx;
  202. position: fixed;
  203. background: #fff;
  204. width: 100%;
  205. height: 100rpx;
  206. top: 700rpx;
  207. .analysis-tab {
  208. font-size: 32rpx;
  209. height: 54rpx;
  210. margin-right: 80rpx;
  211. &.active {
  212. color: #ff5b00;
  213. border-bottom: 2px solid #ff5b00;
  214. font-weight: bold;
  215. }
  216. }
  217. }
  218. }
  219. </style>