123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- <template>
- <view class="container club clearfix">
- <view
- class="club-search clearfix"
- :style="{ paddingTop: StatusBar + 'px', backgroundImage: `url(${imgUrl})`, backgroundSize: '100% 100%' }"
- >
- <view class="search-top" :style="{ height: CustomBar - StatusBar + 'px' }">
- <view
- class="search-icon"
- :style="{
- width: CustomBar - StatusBar + 'px',
- height: CustomBar - StatusBar + 'px',
- lineHeight: CustomBar - StatusBar + 'px;'
- }"
- >
- <text @click="handleNavigateBack" class="iconfont icon-fanhui"></text>
- </view>
- <view class="title">机构活跃分析</view>
- </view>
- <analysis-card :analysis-info="dataList" />
- </view>
- <view class="analysis-list">
- <view class="analysis-tabs">
- <view
- class="analysis-tab"
- :class="currentTab === item.id && 'active'"
- v-for="(item, index) in tabs"
- :key="item.id"
- @click="handleChangeActive(item.id)"
- >
- {{ item.name }}
- </view>
- </view>
- <view class="list">
- <activity-analysis v-for="(item, index) in clubList" :key="index" :clubInfo="item"/>
- </view>
- </view>
- </view>
- </template>
- <script>
- import analysisCard from './components/analysis-card.vue'
- import activityAnalysis from './components/activity-analysis.vue'
- export default {
- components: {
- analysisCard,
- activityAnalysis
- },
- data() {
- return {
- isIphoneX: this.$store.state.isIphoneX,
- CustomBar: this.CustomBar,
- StatusBar: this.StatusBar,
- capsule: this.capsule,
- imgUrl: 'https://static.caimei365.com/app/img/icon/analysis-bg.png',
- userInfo: {},
- currentTab: 4,
- tabs: [
- {
- id: 4,
- name: '活跃机构'
- },
- {
- id: 5,
- name: '不活跃机构'
- }
- ],
- dataList: {},
- clubList: [{
- name: 'ceshi机构',
- activeState: '忠诚用户',
- customerValue: '忠诚用户',
- linkMan: 'ceshi',
- contractMobile: '12654641'
- },
- {
- name: 'ceshi机构',
- activeState: '忠诚用户',
- customerValue: '忠诚用户',
- linkMan: 'ceshi',
- contractMobile: '12654641'
- },
- {
- name: 'ceshi机构',
- activeState: '忠诚用户',
- customerValue: '忠诚用户',
- linkMan: 'ceshi',
- contractMobile: '12654641'
- },
- {
- name: 'ceshi机构',
- activeState: '忠诚用户',
- customerValue: '忠诚用户',
- linkMan: 'ceshi',
- contractMobile: '12654641'
- }], // 机构列表
- pageNum: 1,
- isLastPage: true, // 是否是最后一页
- }
- },
- mounted() {
- this.userInfo = uni.getStorageSync('userInfo')
- this.getLivelyClub()
- this.getClubList()
- },
- watch: {
- currentTab(val) {
- if (val) {
- this.pageNum = 1
- this.clubList = []
- this.getClubList()
- }
- }
- },
- onReachBottom() {
- if (!this.isLastPage) {
- this.pageNum++
- this.getClubList()
- }
- console.log('触底刷新')
- },
- methods: {
- handleChangeActive(e) {
- this.currentTab = e
- },
- handleNavigateBack() {
- this.$api.navigateBack(1)
- },
- // 获取机构活跃分析占比
- async getLivelyClub() {
- const { data: data } = await this.SellerService.getLivelyClub({ spId: this.userInfo.serviceProviderId })
- this.dataList = data
- },
- // 获取机构列表
- async getClubList() {
- const { data } = await this.SellerService.getClubList({
- spId: this.userInfo.serviceProviderId,
- userIdentity: 4,
- status: 90,
- type: this.currentTab,
- pageNum: this.pageNum,
- pageSize: 10
- })
- this.clubList = [...this.clubList, ...data.clubList.list]
- this.isLastPage = data.clubList.isLastPage
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- background: #ffffff;
- position: relative;
- }
- .club-search {
- height: 700rpx;
- width: 100%;
- background: #ffffff;
- display: flex;
- flex-direction: column;
- position: sticky;
- top: 0;
- left: 0;
- z-index: 99;
- box-sizing: border-box;
- .search-top {
- display: flex;
- align-items: center;
- box-sizing: border-box;
- position: relative;
- margin-bottom: 80rpx;
- .title {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- }
- .search-icon {
- text-align: center;
- float: left;
- .icon-fanhui {
- font-size: 44rpx;
- color: #333333;
- }
- .icon-shouye {
- font-size: 44rpx;
- color: #333333;
- }
- }
- }
- }
- .analysis-list {
- padding: 38rpx 24rpx;
- box-sizing: border-box;
- .list {
- margin-top: 40rpx;
- }
- .analysis-tabs {
- color: #666666;
- display: flex;
- align-items: center;
- margin-bottom: 12rpx;
- position: fixed;
- background: #fff;
- width: 100%;
- height: 100rpx;
- top: 700rpx;
- .analysis-tab {
- font-size: 32rpx;
- height: 54rpx;
- margin-right: 80rpx;
- &.active {
- color: #ff5b00;
- border-bottom: 2px solid #ff5b00;
- font-weight: bold;
- }
- }
- }
- }
- </style>
|