<template>
	<view class="page">
		<navBar title="收藏" :back="true" color="black" background="white" />

		<view class="con">
			<view class="item" v-for="(item,index) in list" @click="goDetail(item)">
				<image :src="picBase+item.goods.cover" mode=""></image>
				<view class="bottom">
					<view class="txt">
						{{item.goods.name}}
					</view>
				</view>
			</view>
		</view>
		<u-loadmore style="" loadmoreText="已经到底啦" color="#CCCCCC" lineColor="#CCCCCC" line />
	</view>
</template>

<script>
	import {
		getMyCollectDataReq,
	} from '@/api/my/index.js'

	export default {
		components: {

		},
		data() {
			return {
				picBase: this.$picBase,
				list: []
			}
		},
		async onLoad(o) {
			let res = await getMyCollectDataReq()
			if (res.code == 0) {
				this.list = res.data.data
				console.log('我的收藏列表', this.list);
			} else {
				uni.showToast({
					title: res.message,
					icon: 'none'
				})
			}
		},
		methods: {
			goDetail(item) {
				uni.navigateTo({
					url: '/pages/my/collectDetail/index?item=' + JSON.stringify(item)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import "./index.scss";
</style>