<template>
	<view class="banner translate-y-0">
		<u-swiper borderRadius="16" height="auto" :list="banner" mode="none" @click="handleClick"></u-swiper>
	</view>
</template>

<script setup lang="ts">
	import { navigateTo, jumpTo } from '@/utils/util'

	const props = defineProps({
		banner: {
			type: Object,
			default: () => ({})
		},
		styles: {
			type: Object,
			default: () => ({})
		}
	})
	const handleClick = (index : any) => {
		let linkArr = {}
		let link = props.banner[index]['link']
		if (link == "") return
		if (link.indexOf('http') == 0) {
			jumpTo(link)
		} else {
			linkArr = { path: link }
		}
		if (link.indexOf('/pages/team/index') == 0) {
			navigateTo(linkArr, 'switchTab')
		} else {
			navigateTo(linkArr)
		}
	}
</script>

<style></style>