<template>
	<view>
		<text>这是我的收藏</text>
		<view v-for="(item,index) in myCollection" :key="index">
			<image :src="item.imgUrl"></image>
		</view>
	</view>
</template>

<script>
	import {getCollectionList} from '@/api/myCollection.js' 
	export default {
		data() {
			return {
				myCollection:[]
			}
		},
		onLoad() {
			this.getMyCollection(1)
		},
		methods: {
				async getMyCollection(userId){
				let data = {
					userId : userId
				}
				const res = await getCollectionList(data)
				if(res.data.code === 200){
					this.myCollection = res.data.data
					console.log(res)
				}else{
					uni.showModal({
						content: '我的收藏加载失败！', 
						showCancel: false
					});
				}
			}
		}
	}
</script>

<style>

</style>
