my-goods.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view>
  3. <view class="goods">
  4. <view class="goods-img">
  5. <image mode="aspectFit" class="wh-full" :src="item.src"></image>
  6. </view>
  7. <view class="right-info">
  8. <view class="good-title">{{item.goods_name}}</view>
  9. <view class="w-full flex-a">
  10. <view class="g-left">
  11. <view class="spec" @click="popShow">{{item.goods_type}}</view>
  12. <view class="price">{{item.goods_price}}</view>
  13. </view>
  14. <view class="g-right">
  15. <slot></slot>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. name: "my-goods",
  25. data() {
  26. return {
  27. show: false
  28. };
  29. },
  30. props: {
  31. item: {
  32. type: Object,
  33. required: true
  34. }
  35. },
  36. methods: {
  37. popShow() {
  38. this.show = true;
  39. },
  40. close() {
  41. this.show = false;
  42. }
  43. }
  44. }
  45. </script>
  46. <style scoped lang="scss">
  47. .goods {
  48. width: 100%;
  49. display: flex;
  50. align-items: center;
  51. .goods-img {
  52. height: 200rpx;
  53. width: 200rpx;
  54. flex-shrink: 0;
  55. }
  56. .right-info {
  57. width: calc(100% - 200rpx);
  58. box-sizing: border-box;
  59. padding-left: 10rpx;
  60. .good-title {
  61. width: 100%;
  62. text-overflow: ellipsis;
  63. white-space: nowrap;
  64. font-size: $uni-font-size-base;
  65. overflow: hidden;
  66. padding-bottom: 10rpx;
  67. }
  68. .spec {
  69. height: 50rpx;
  70. display: flex;
  71. align-items: center;
  72. width: 200rpx;
  73. border-radius: 25px;
  74. background-color: #EFEFEF;
  75. font-size: $uni-font-size-sm;
  76. margin-bottom: 20rpx;
  77. box-sizing: border-box;
  78. padding: 0 20rpx;
  79. }
  80. }
  81. }
  82. .flex-a {
  83. display: flex;
  84. justify-content: space-between;
  85. }
  86. .my-popup {
  87. width: 100%;
  88. max-height: 800rpx;
  89. overflow: auto;
  90. padding-bottom: 130rpx;
  91. }
  92. </style>