<template>
	<view class="content">
		<u-list>
			<u-list-item v-for="(item, index) in list" :key="index">
				<view class="activityModel">
					<image class="init_image" :src="item.imgUrl" mode=""></image>
				</view>
			</u-list-item>
		</u-list>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		onShow() {
			this.getCarousel()
		},
		methods: {
			//获取轮播图
			getCarousel() {
				this.$request('/carousel', 'GET', {}).then(res => {
					console.log(res);
					this.list = res.data.info;
				}).catch(err => {
					uni.showToast({

						icon: 'error',

						title: '' + err.message

					})
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100vw;
		background: #F8F8F8;
	}

	.activityModel {
		height: 504rpx;
		width: calc(100% - 80rpx);
		border-radius: 20rpx;
		margin: 20rpx 40rpx;
		overflow: hidden;
	}
</style>