<template>
	<!-- 谁看过我 -->
	<view class="page">
		<navbar :title="role ? '谁看过我的招工' : '谁看过我的简历'"
		bgColor="#3796F8" 
		leftClick 
		color="#fff"
		@leftClick="$utils.navigateBack"/>
		
		<!-- <statisticsNumber title="简历被查看量" /> -->
		<statisticsNumber :title="role ? '招工被查看量' : '简历被查看量'" :num="total"/>
		
		<userList :api="mixinsListApi" ref="list" v-if="role"/>
		
		<bossList :api="mixinsListApi" ref="list" v-else/>
		
		
	</view>
</template>

<script>
	import bossList from '@/components/list/bossList/index.vue'
	import userList from '@/components/list/userList/index.vue'
	import statisticsNumber from '../components/statistics/statisticsNumber.vue'
	// import mixinList from '@/mixins/list.js'
	import { mapState } from 'vuex'
	export default {
		// mixins : [mixinList],
		components : {
			statisticsNumber,
			bossList,
			userList,
		},
		data() {
			return {
				options: [
					{
						text: '修改',
						style: {
							backgroundColor: '#ffa12c'
						}
					}, 
					{
						text: '删除',
						style: {
							backgroundColor: '#FA5A0A'
						}
					}, 
				],
				mixinsListApi : '',
				total : 0,
			}
		},
		computed : {
			...mapState([
				'role', 
			]),
		},
		onLoad() {
			this.mixinsListApi = (this.role ? 'boss' : 'employee') + 'QueryWatchMe'
		},
		onShow() {
			this.$nextTick(() => {
				this.$refs.list.getData()
			})
		},
		onReachBottom() {
			this.$refs.list.loadMoreData()
		},
		methods: {
			clickSwipeAction({e, item}){
				console.log(e, item);
			},
		}
	}
</script>

<style scoped lang="scss">
.page{
	/deep/ .uv-swipe-action{
		width: 100%;
	}
}
</style>