first-two.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <!-- 分类展示:first-two 风格 -->
  2. <template>
  3. <view>
  4. <view class="ss-flex flex-wrap">
  5. <view class="goods-box" v-for="item in pagination?.list" :key="item.id">
  6. <view @click="sheep.$router.go('/pages/goods/index', { id: item.id,merchantId,shopId})">
  7. <view class="goods-img">
  8. <image class="goods-img" :src="item.picUrl" mode="aspectFit" />
  9. </view>
  10. <view class="goods-content">
  11. <view class="goods-title ss-line-1 ss-m-b-28">{{ item.title }}</view>
  12. <view class="goods-price">¥{{ fen2yuan(item.price) }}</view>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script setup>
  20. import sheep from '@/sheep';
  21. import {
  22. fen2yuan
  23. } from '@/sheep/hooks/useGoods';
  24. const props = defineProps({
  25. pagination: {
  26. type: Object,
  27. },
  28. shopId: {
  29. type: String,
  30. },
  31. merchantId: {
  32. type: String,
  33. },
  34. });
  35. </script>
  36. <style lang="scss" scoped>
  37. .goods-box {
  38. width: calc((100% - 20rpx) / 2);
  39. margin-bottom: 20rpx;
  40. .goods-img {
  41. width: 100%;
  42. height: 246rpx;
  43. border-radius: 10rpx 10rpx 0px 0px;
  44. }
  45. .goods-content {
  46. width: 100%;
  47. background: #ffffff;
  48. box-shadow: 0px 0px 20rpx 4rpx rgba(199, 199, 199, 0.22);
  49. padding: 20rpx 0 32rpx 16rpx;
  50. box-sizing: border-box;
  51. border-radius: 0 0 10rpx 10rpx;
  52. .goods-title {
  53. font-size: 26rpx;
  54. font-weight: bold;
  55. color: #333333;
  56. }
  57. .goods-price {
  58. font-size: 24rpx;
  59. font-family: OPPOSANS;
  60. font-weight: 500;
  61. color: #e1212b;
  62. }
  63. }
  64. &:nth-child(2n + 1) {
  65. margin-right: 20rpx;
  66. }
  67. }
  68. </style>