first-two.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!-- 页面 -->
  2. <template>
  3. <view>
  4. <view class="ss-flex flex-wrap">
  5. <view class="goods-box" v-for="item in pagination?.data" :key="item.id">
  6. <view @click="sheep.$router.go('/pages/goods/index', { id: item.id })">
  7. <view class="goods-img">
  8. <image class="goods-img" :src="sheep.$url.cdn(item.image)" mode="aspectFit"></image>
  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">¥{{ item.price[0] }}</view>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script setup>
  20. import sheep from '@/sheep';
  21. const props = defineProps({
  22. data: {
  23. type: Object,
  24. default: () => ({}),
  25. },
  26. activeMenu: [Number, String],
  27. pagination: Object,
  28. });
  29. </script>
  30. <style lang="scss" scoped>
  31. .goods-box {
  32. width: calc((100% - 20rpx) / 2);
  33. margin-bottom: 20rpx;
  34. .goods-img {
  35. width: 100%;
  36. height: 246rpx;
  37. border-radius: 10rpx 10rpx 0px 0px;
  38. }
  39. .goods-content {
  40. width: 100%;
  41. background: #ffffff;
  42. box-shadow: 0px 0px 20rpx 4rpx rgba(199, 199, 199, 0.22);
  43. padding: 20rpx 0 32rpx 16rpx;
  44. box-sizing: border-box;
  45. border-radius: 0 0 10rpx 10rpx;
  46. .goods-title {
  47. font-size: 26rpx;
  48. font-weight: bold;
  49. color: #333333;
  50. }
  51. .goods-price {
  52. font-size: 24rpx;
  53. font-family: OPPOSANS;
  54. font-weight: 500;
  55. color: #e1212b;
  56. }
  57. }
  58. &:nth-child(2n + 1) {
  59. margin-right: 20rpx;
  60. }
  61. }
  62. </style>