<template>
	<view class="near-good" @click="goDetail">
		<image :src="goodItem.CoverImg" mode="aspectFill"></image>
		<view class="good-name">{{goodItem.Name.substring(0,6)+'...'}}</view>
	</view>
</template>

<script>
	export default {
		props: {
			goodItem: {
				type: Object,
				default: null
			},
			goodType: {
				type: Number,
				default: 0
			}
		},
		data() {
			return{
				
			}
		},
		created() {

		},
		methods: {
			//页面跳转
			goDetail() {
				//3 景点
				if(this.goodType==3){
					uni.navigateTo({
						url: "/pages/ticketCoupons/detail?id="+this.goodItem.ID,
					});
				}
				//2 美食
				if(this.goodType==2){
					uni.navigateTo({
						url:"/pages/restaurant/detail?id="+this.goodItem.ID
					});
				}
			}
		}
	}
</script>

<style>
	.near-good {
		margin-right: 20rpx;
		flex-shrink: 0;
	}

	.near-good image {
		width: 200rpx;
		height: 200rpx;
		border-radius: 20rpx;
		margin-bottom: 29rpx;
	}

	.near-good .good-name {
		font-weight: bold;
		color: #1F1F1F;
		font-size: 28rpx;
		text-overflow: ellipsis;
		overflow: hidden;
		white-space: nowrap;
	}
</style>
