<!-- 货源 -->
<template>
	<view class="content">
	找车
	</view>
</template>

<script>
	var that
	import {
		mapState
	} from 'vuex';
	import MescrollItem from "./mescroll-swiper-item.vue";
	export default {
		components: {
			MescrollItem
		},
		data() {
			return {
				src: 'https://cdn.uviewui.com/uview/album/1.jpg',
				height: "", // 需要固定swiper的高度
				tabs: [{name:'推荐'}, {name:'按时间'}, {name:'按距离'}, {name:'运费先付'}],
				tabIndex: 0 // 当前tab的下标

			}
		},
		onShow() {
			console.log(1212)
			this.$request.baseRequest('get', '/newsInfo/unreadMessage', {
				reCommonId: this.userInfo.id,
			}).then(res3 => {
				if (res3.data||res3.data==0) {
					let name = 'myTip';
					let value = res3.data
					console.log(value)
					if (value == 0) {
						uni.removeTabBarBadge({
							index: 2
						})
					}
					this.$store.commit('$uStore', {
						name,
						value
					});
					if (value != 0 && value) {
						uni.setTabBarBadge({
							index: 2,
							text: value + ""
						})
					}
				}
			})
		},
		onLoad() {
			let _isHave = this.$utils.getRoles('aaa')
			console.log(_isHave)
			// 需要固定swiper的高度 (需减去悬浮tabs的高度64rpx)
			this.height = uni.getSystemInfoSync().windowHeight - uni.upx2px(64) + 'px'
		},
		computed: {
			...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
		},
		methods: {
			changeCity(type) {
				console.log(type)
			},
			swiperChange(e) {
				this.tabIndex = e.detail.current
			}
		}
	}
</script>

<style scoped lang="scss">

</style>
