<template>
	<view class="xiangce">
		<image v-for="(a,i) in list" :key="i" :src="a" @click="previewImage(i)"></image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
			};
		},
		onLoad(o) {
			this.id = o.id;
			this.getList();
		},
		methods: {
			async getList() {
				const { code, data, msg } = await this.$api.myAlbums({
					userId: this.id
				})
				if(code == 200){
					this.list = data.split(",")
				}
			},
			previewImage(id) {
				uni.previewImage({
					urls: this.list,
					count: id
				})
			}
		}
	}
</script>

<style scoped lang="scss">
.xiangce{
	padding: 0 25rpx 0 5rpx;
	overflow: hidden;
	image{
		width: 220rpx;
		height: 220rpx;
		border-radius: 10rpx;
		margin-left: 20rpx;
		margin-top: 20rpx;
	}
}
</style>
