<!-- 货源 -->
<template>
	<view class="content">
		<view class="head flex">
			<u-search placeholder="日照香炉生紫烟" v-model="keyword"></u-search>
		</view>
		<me-tabs v-model="tabIndex" :tabs="tabs" class="m-topr20"></me-tabs>
		<swiper :style="{height: height}" :current="tabIndex" @change="swiperChange">
			<swiper-item v-for="(tab,i) in tabs" :key="i">
				<mescroll-item ref="mescrollItem" :i="i" :index="tabIndex" :tabs="tabs" :height="height">
				</mescroll-item>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	import MescrollItem from "./mescroll-swiper-item.vue";
	export default {
		components: {
			MescrollItem
		},
		data() {
			return {
				keyword:'',
				src: 'https://cdn.uviewui.com/uview/album/1.jpg',
				height: "", // 需要固定swiper的高度
				tabs: [{
					name: '全部'
				}, {
					name: '未发运'
				}, {
					name: '运输中'
				}, {
					name: '代收货'
				},
				{
					name: '评价'
				},
				{
					name: '待结算'
				},
				{
					name: '已完结'
				},
				
				
				],
				tabIndex: 0 // 当前tab的下标

			}
		},
		onLoad() {
			let _isHave = this.$utils.getRoles('aaa')
			console.log(_isHave)
			// 需要固定swiper的高度 (需减去悬浮tabs的高度64rpx)
			this.height = uni.getSystemInfoSync().windowHeight - uni.upx2px(64) + 'px'
		},
		methods: {
			changeCity(type) {
				console.log(type)
			},
			swiperChange(e) {
				this.tabIndex = e.detail.current
			}
		}
	}
</script>

<style scoped lang="scss">

</style>
