<script setup lang="ts">
import * as R from 'ramda'
import type {Goods} from "@/service/index-data";
import {thumbnailImg} from "@/utils/utils";

const props = defineProps<{
  item: Goods
}>()


const {t} = useI18n()


function navigateTo(url: string) {
  uni.navigateTo({
    url,
  })
}
</script>

<template>
  <view class="w-336rpx bg-#fff rounded-20rpx"
        @click="navigateTo(`/pages-shop/pages/goods-detail/index?id=${item.id}`)"
  >
    <view class="flex">
      <image class="w-336rpx h-336rpx rounded-t-20rpx" :src="thumbnailImg(item.coverImage)"></image>
    </view>
    <view class="p-[18rpx+16rpx+24rpx]">
      <view class="text-26rpx text-primary lh-36rpx font-bold line-clamp-2">{{ item.name }}
      </view>
      <view class="mt-12rpx flex" v-if="item.goodsCategoryVo">
        <view
            class="h-32rpx px-10rpx center text-22rpx text-#999 lh-22rpx font-bold border-custom after:(!border-#D4D4D4 rounded-20rpx)">
          {{ item.goodsCategoryVo?.name }}
        </view>
      </view>
      <view class="mt-18rpx flex items-end justify-between">
        <text class="text-30rpx text-#666 font-bold lh-42rpx">S${{ item.price }}</text>
      </view>
    </view>
  </view>
</template>

<style scoped lang="scss">

</style>
