<template>
	<view class="gl-item" @click="$navigateTo('/subPages/shopPage/good/good?id='+item.id)">
		<view class="gl-img">
			<uv-image width="170rpx" height="170rpx" :src="shopImage(item.pic)">
			</uv-image>
		</view>
		<view>
			<view class="gl-name">{{item.name}}</view>
			<view class="gl-descript">{{item.descript}}</view>
			<view class="gl-price">￥{{formatPrice(item.price)}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['item'],
		methods: {
			formatPrice(price) {
				if (!price) return 0;
				return (price / 100).toFixed(2);
			}
		}
	}
</script>

<style lang="scss" scoped>

	.gl-item {
		width: 100%;
		display: flex;
		align-items: center;
	}

	.gl-img {
		width: 170rpx;
		height: 170rpx;
		margin-right: 30rpx;
	}

	.gl-name {
		font-size: 32rpx;
		font-weight: bold;
	}

	.gl-descript {
		font-size: 24rpx;
	}

	.gl-price {
		font-size: 32rpx;
		color: #FA3534;
		margin-top: 20rpx;
	}
</style>