<template>
    <view class="item" @click="toDetailsPage">
        <image :src="info.goods_image" mode="aspectFill" class="img"></image>
        <view class="info">
            <text class="title u-line-2">{{ info.goods_name }}</text>
            <text class="jianjie u-line-1">{{ info.goods_advword }}</text>
            <text class="price">￥{{ info.goods_price }}</text>
        </view>
    </view>
</template>
<script>
export default {
	name:"item",
	props: {
		info: Object
	},
	methods: {
		toDetailsPage() {
			// this.$u.api.getGoodsDetails({ id: this.info.goods_id }).then(res => {
			// 	if (res.errCode == 0) {
			// 		const goods = {
			// 			goods: res.data,
			// 			type: 1,
			// 		}
			// 		this.$store.commit('setGoodsDetails', goods);
			// 		this.$store.commit('setGoodsId', this.info.goods_id);
			// 		this.$u.route({
			// 			url: 'pageB/sdetails/index',
			// 		})
			// 		// console.log(this.goodsInfo.mobile_body);
			// 	}
			// })
			this.$u.route({
				url: 'pageB/sdetails/index',
				params: {
					id: this.info.goods_id,
					type: 1,
				}
			})
		}
	},
}
</script>
<style lang="scss" scoped>
.item{
    width: 330rpx;
    margin-bottom: 26rpx;
    background-color: #f8f8f8;
    border-radius: 10rpx 10rpx 0rpx 0rpx;
    .img{
		width: 330rpx;
		height: 300rpx;
		background: rgba(245,245,245,1);
		border-radius: 10rpx 10rpx 0rpx 0rpx;
		margin-bottom: 24rpx;
    }
    .info{
		width: 320rpx;
        padding: 0 12rpx 28rpx;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        .title{
			line-height: 34rpx;
            font-size: 30rpx;
            color: #333;
			margin-bottom: 13rpx;
        }
        .jianjie{
            font-size: 26rpx;
            color: #666;
			margin-bottom: 20rpx;
        }
        .price{
            color: #FF3131;
            font-size: 26rpx;
        }
    }
}
</style>