<template>
    <view class="visitor">
        <view class="visits-time">{{ accDateTime }}</view>
        <template>
            <visits-cell
                @handlerVisits="handlerVisits"
                :visits-info="visitsInfo"
                v-for="visitsInfo in visitsList"
                :key="visitsInfo.clubId"
            />
        </template>
    </view>
</template>

<script>
import VisitsCell from '../components/visits-cell.vue'
export default {
    components: {
        VisitsCell
    },
    data() {
        return {
            visitsList: [{
                image: '',
                pageLabel: '',
                name: '',
                linkMan: '',
                contractMobile: '',
                accessTime: '2023-08-29',
                clubId: '1111'
            }],
            accDateTime: '',
            userInfo: {}
        }
    },
    onLoad(options) {
        this.accDateTime = options.accDateTime
    },
    mounted() {
        this.userInfo = uni.getStorageSync('userInfo')
        this.getVisitesClubList()
    },
    onReachBottom() {
    },
    onPullDownRefresh() {
    	//下拉刷新
    	this.getVisitesClubList()
    	uni.stopPullDownRefresh()
    },
    methods: {
        handlerVisits($event) {
            this.$api.navigateTo(
                '/pages/seller/notice/service/visits_details?spId=' +
                    this.userInfo.serviceProviderId +
                    '&clubId=' +
                    $event.clubId +
                    '&accessTime=' +
                    $event.accessTime
            )
        },
        async getVisitesClubList() {
            const { data } = await this.SellerService.getVisitesClubList({
                spId: this.userInfo.serviceProviderId,
                accDateTime: this.accDateTime
            })
            this.visitsList = data.list
        }
    }
}
</script>

<style lang="scss">
page {
    background-color: #f7f7f7;
}
.visitor {
    .visits-time {
        font-size: 32rpx;
        font-weight: bold;
        color: #333333;
        padding: 40rpx 0 24rpx 16rpx;
    }
}
</style>
