index.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <script setup lang="ts">
  2. import { StaticUrl } from '@/config'
  3. import router from '@/router'
  4. defineProps<{ itemGoods: Api.xsbCategoryProductList }>()
  5. </script>
  6. <template>
  7. <view class="relative overflow-hidden rounded-16rpx bg-white pb16rpx">
  8. <view @click="router.push({ name: 'xsb-goods', params: { id: itemGoods.prodId } })">
  9. <view class="relative h344rpx">
  10. <image
  11. :src="itemGoods.pic"
  12. class="h344rpx w344rpx"
  13. />
  14. </view>
  15. <view class="mt20rpx px20rpx">
  16. <view class="line-clamp-2 text-left text-28rpx font-semibold">
  17. <!-- <view v-for="i in 2" :key="i" class="mr5px inline-block">
  18. <wd-tag type="primary">
  19. 新品{{ i }}
  20. </wd-tag>
  21. </view> -->
  22. {{ itemGoods.prodName }}
  23. </view>
  24. <view class="mt12rpx text-22rpx text-#AAAAAA">
  25. 已售{{ itemGoods.soldNum }}
  26. </view>
  27. <view class="mt10rpx flex items-center justify-between">
  28. <view>
  29. <view class="mt20rpx flex items-end text-#FF4D3A font-semibold">
  30. <view class="text-24rpx">
  31. </view>
  32. <view class="text-36rpx line-height-[36rpx]">
  33. {{ itemGoods.channelProdPrice }}
  34. </view>
  35. </view>
  36. </view>
  37. <image :src="`${StaticUrl}/cart-yes.png`" class="h52rpx w52rpx" />
  38. </view>
  39. </view>
  40. </view>
  41. <view v-if="!itemGoods.spuStock" class="mask absolute left-0 top-0 z-1 h-full w-full flex items-center justify-center">
  42. <view class="h156rpx w156rpx flex items-center justify-center rounded-full bg-[rgba(0,0,0,.6)] text-28rpx text-white">
  43. 商品已售罄
  44. </view>
  45. </view>
  46. <view v-if="!itemGoods.skuList.some((it) => it.saleStatus)" class="mask absolute left-0 top-0 z-1 h-full w-full flex items-center justify-center">
  47. <view class="h156rpx w156rpx flex items-center justify-center rounded-full bg-[rgba(0,0,0,.6)] text-28rpx text-white">
  48. 商品不可售
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <style scoped>
  54. .mask{
  55. background: rgba(255,255,255,0.6);
  56. }
  57. </style>