<template>
	<view class="shop-list">
		<view class="item" v-for="item in list" :key="item.shopVo.shopId" @click="jump('/detail/shopDetail/shopDetail',item)">
			<view class="info">
				<view class="shop-name">
					{{item.shopVo.shopName}}
				</view>
				<view class="address">
					{{item.address}}  {{(item.shopVo.distance/1000).toFixed(2)}} km 
				</view>
			</view>
			<image class="icon" src="../../static/shop-desc.png" mode=""></image>
		</view>
	
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		methods: {
			jump(url,item) {
				let shopInfo = {
					shopId:item.shopVo.shopId,
					shopName:item.shopVo.shopName,
					detailContent:item.detailContent,
					logoPath:item.logoPath,
				}
				uni.setStorageSync('shopInfo',JSON.stringify(shopInfo))
				uni.navigateTo({
					url
				})
			},
			
		},
		onLoad() {
			this.list = JSON.parse(uni.getStorageSync('shopList'))
		}
	}
</script>

<style lang="scss" scoped>
.shop-list{
	background: #F9F9F9;
	min-height: 100vh;
	padding: 20rpx 24rpx;
	.item{
		padding: 24rpx;
		background: #fff;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 20rpx;
		.info{
			.shop-name{
				font-size: 28rpx;
				color: #222222;
			}
			.address{
				font-size: 24rpx;
				color: #AAAAAA;
				margin-top: 16rpx;
			}
		}
		.icon{
			width: 48rpx;
			height: 48rpx;
			transform: rotate(-90deg);
		}
	}
}
</style>