<template>
	<view>
		<u-swiper v-if="homeTemplate&&homeTemplate.banner&&homeTemplate.banner.length>0" :list="homeTemplate.banner" keyName="path" easingFunction="easeOutCubic" height="120" indicator radius="10"
			@click="click"></u-swiper>
	</view>
</template>

<script>
	import {
		mapMutations,
		mapActions,
		mapState,
		mapGetters
	} from 'vuex';
	export default {
		name: "wike-ad",
		data() {
			return {};
		},
		computed: {
			...mapGetters(['appInfo', 'homeTemplate'])
		},
		methods: {
			click(index) {
				var that = this,
					del = {};
				del = that.homeTemplate.banner[index];
				// console.log(del);
				if (del.link_type == 2) {
					// uni.navigateTo({
					// 	url: '/pages/user/public/webview?url=' + escape(del.link_url)
					// })
					window.location = del.link_url
				} else if (del.link_type == 1) {
					// console.log(del);
					uni.navigateTo({
						url: del.link_url,
					});
				
				} else if (del.link_type == 0) {
					uni.switchTab({
						url: del.link_url
					});
				} else if (del.link_type == 3) {
					uni.navigateToMiniProgram({
						appId: del.link_url,
						path: del.link_other,
						success(res) {}
					})
				}
			}
		}
	}
</script>

<style>

</style>
