index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. <image
  15. :src="`${StaticUrl}/xsb-shui-index.png`"
  16. class="absolute left-0 top-0 h344rpx w344rpx"
  17. />
  18. </view>
  19. <view class="mt20rpx px20rpx">
  20. <view class="line-clamp-2 text-left text-28rpx font-semibold">
  21. <!-- <view v-for="i in 2" :key="i" class="mr5px inline-block">
  22. <wd-tag type="primary">
  23. 新品{{ i }}
  24. </wd-tag>
  25. </view> -->
  26. {{ itemGoods.prodName }}
  27. </view>
  28. <view class="mt12rpx text-22rpx text-#AAAAAA">
  29. 已售{{ itemGoods.soldNum }}
  30. </view>
  31. <view class="mt10rpx flex items-center justify-between">
  32. <view>
  33. <view class="mt20rpx flex items-end text-#FF4D3A font-semibold">
  34. <view class="text-24rpx">
  35. </view>
  36. <view class="text-36rpx line-height-[36rpx]">
  37. {{ itemGoods.channelProdPrice }}
  38. </view>
  39. </view>
  40. </view>
  41. <i class="iconfont text-52rpx text-[var(--them-color)]">&#xe64c;</i>
  42. </view>
  43. </view>
  44. </view>
  45. <view v-if="!itemGoods.spuStock" class="mask absolute left-0 top-0 z-1 h-full w-full flex items-center justify-center">
  46. <view class="h156rpx w156rpx flex items-center justify-center rounded-full bg-[rgba(0,0,0,.6)] text-28rpx text-white">
  47. 商品已售罄
  48. </view>
  49. </view>
  50. <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">
  51. <view class="h156rpx w156rpx flex items-center justify-center rounded-full bg-[rgba(0,0,0,.6)] text-28rpx text-white">
  52. 商品不可售
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <style scoped>
  58. .mask{
  59. background: rgba(255,255,255,0.6);
  60. }
  61. </style>