expert.vue 1.8 KB
<template>
	<view>

		<view :style="'height:' + common.statusBarH + 'px;'"></view>

		<v-tabs class="tab_c" v-model="current" :tabs="tabs" @change="changeTab" :fixed="true" line-height="8rpx"
			line-color="#04764E" color="#AAAAAA" activeColor="#04764E" height="88rpx"></v-tabs>


		<customWebview :src="tabsUrl[current]" :top="webview_top" :height="webview_height" ref="Webview">
		</customWebview>


		</z-swiper>

	</view>
</template>

<script>
	import customWebview from '../../components/customWebview.vue'
	import common from '@/utils/common.js'

	export default {
		components: {
			customWebview
		},
		data() {
			return {
				common,
				tabs: ["快乐8", "福彩3D", "排列3", "双色球", "大乐透", "排列5", "足球"],
				current: 0,
				webview_top: 0,
				webview_height: uni.getSystemInfoSync().windowHeight,
				tabsUrl: [
					'https://app.ydniu.com/experts/kl8?zqe&app_header=true',
					'https://app.ydniu.com/experts/sd?zqe&app_header=true',
					'https://app.ydniu.com/experts/pl3?zqe&app_header=true',
					'https://app.ydniu.com/experts/ssq?zqe&app_header=true',
					'https://app.ydniu.com/experts/dlt?zqe&app_header=true',
					'https://app.ydniu.com/experts/pl5?zqe&app_header=true',
					'https://app.ydniu.com/experts/zq?zqe&app_header=true'
				]
			}
		},
		onLoad() {
			this.webview_top = 88
			this.webview_height = uni.getSystemInfoSync().safeArea.bottom - this.webview_top
		},
		methods: {
			changeTab(index) {
				console.log('当前选中的项:' + index)
				var ref = this.$refs.Webview
				this.current = index
				console.log(this.$refs.Webview)

				ref.onRefreshInfo(this.tabsUrl[this.current])
			}
		}
	}
</script>

<style>
	.tab_c {
		/* position: fixed; */
		z-index: 999;
	}
</style>