<template>
	<view class="container">
		<!-- 空白页 -->
		<empty v-if="favoriteList.length < 1"></empty>
		<view class="favorites flex" v-for="ls in favoriteList">
			<view class="favorites_img"><image :src="ls.image"></image></view>
			<view class="favorites_list">
				<view class="favorites_name">{{ ls.store_name }}</view>
				<view class="favorites_peice flex">
					<view>
						<text>￥{{ ls.price }}</text>
					</view>
					<view class="icon_del">
						库存:
						<text>{{ ls.number }}</text>
						件
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import { user_product } from '@/api/user.js';
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
import empty from '@/components/empty';
export default {
	components: {
		uniLoadMore,
		empty
	},
	data() {
		return {
			tabCurrentIndex: 0,
			favoriteList: '',
			delshow: true
		};
	},
	onLoad() {
		this.loadData();
	},
	methods: {
		//获取收藏夹列表
		loadData() {
			let obj = this;
			user_product({
				page: 1,
				limit: 1000
			})
				.then(function(e) {
					obj.favoriteList = e.data.list;
					console.log(obj.favoriteList);
				})
				.catch(function(e) {
					console.log(e);
				});
		}
	}
};
</script>

<style lang="scss">
page {
	height: 100%;
}
%flex-center {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}
%section {
	display: flex;
	justify-content: space-around;
	align-content: center;
	background: #fff;
	border-radius: 10rpx;
}
.container {
	height: 100%;
	background-color: $page-color-base;
	padding: 15rpx 0rpx;
	font-size: 28rpx;
}
.favorites {
	width: 100%;
	background-color: #ffffff;
	border-radius: 15rpx;
	margin: 0 auto;
	padding: 25rpx 25rpx;
}
.favorites_img {
	width: 80px !important;
	height: 80px;
}
.favorites_img image {
	width: 100%;
	height: 100%;
}
.favorites_list {
	width: 70%;
	padding-left: 20rpx;
}
.icon_del {
	font-size: 27rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #333333;
	text {
		color: #fd3b39;
	}
}
.favorites_name {
	font-size: 35rpx;
	font-family: PingFang SC;
	font-weight: bold;
	color: #333333;
	height: 80rpx;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-box-orient: vertial;
	-webkit-line-clamp: 2;
}
.favorites_peice {
	font-size: 35rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #333333;
	margin-top: 25rpx;
	font-weight: bold;
}
</style>
