<template>
	<view class="bg" @click="goIndex()">
		<image :src="showImg(screenPng)"></image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				screenPng: ""

			}
		},
		onLoad() {
			
		},
		onReady () {
			// 小轮播
			this.Post({
				type_id: 3,
				position: 5,
			}, '/api/adv/getAdv').then(res => {
				if(res.data && res.data.length>0) {
					this.screenPng = res.data[0].head_img
				}
			});
		},
		methods: {
			goIndex () {
				uni.switchTab({
					url:"/pages/index/index"
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.bg{
		height: 100vh;
		image{
			width: 100%;
			height: 100%;
		}
	}
</style>