<template>
	<view>
		<view :style="{ height: contentHeight + 'px' }" style="voerflow: hidden; overflow-y: auto;">
			<view class="head-pin-box">
				<view class="left">
					<image src="../../static/images/icon/search.png" mode="widthfix" style="width:20px;height:20px;" />
				</view>
				<view class="middle"></view>
				<view class="right">
					<u-tabs name="name" :list="myPageData.home_pages.navs" :is-scroll="true" :active-color="mainColor" :current="active"
					 :bar-width="80" :font-size="32" :bold="false" @change="changeHandler"></u-tabs>
				</view>
			</view>
		</view>
		<tabbars></tabbars>
	</view>
</template>

<script>
	import tabbars from "@/components/tabbar/index";
	export default {
		components: {
			tabbars,
		},
		data() {
			return {
				contentHeight: 0,
				pageTitle: "拼团",
				advertisement: {},
				banners: []
			};
		},
		mounted() {
			let currentPages = getCurrentPages();
			let c = this.$uiConfig.is_bang ? 80 : 52;
			this.contentHeight = this.$utils.calcContentHeight(c);
			console.log(this.contentHeight);
			let u = "/" + currentPages[currentPages.length - 1].route;
			let pages = uni.getStorageSync("basedata") ?
				uni.getStorageSync("basedata").bar_title :
				[];
			pages.forEach((x) => {
				if (x.value == u) {
					this.pageTitle = x.new_name ? x.new_name : x.name;
				}
			});
			uni.setNavigationBarTitle({
				title: this.pageTitle,
			});
			uni.showNavigationBarLoading();
		},
		methods: {
			init() {
				let h = this.apiheader();
				this.request({
						url: "",
						header: h,
						data: {
							r: "plugin/pintuan/api/v2/index/index",
							status: this.current + 1,
							page: this.page,
						},
					},
					(res) => {
						this.loading = false;
						if (res.data.list.length > 0) {
							this.g = this.g.concat(res.data.list);
						}
					}
				);
			},
		},
	};
</script>

<style>
	.head-pin-box {
		height: 80rpx;
		display: flex;
		align-items: center;
		padding: 0 20rpx;
	}

	.head-pin-box .left {
		height: 100%;
		width: 90rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.head-pin-box .middle {
		width: 2rpx;
		background: #ddd;
		height: 45rpx;
		margin: 0 20rpx;
	}

	.head-pin-box .right {
		height: 100%;
		flex: 1;
	}
</style>
