my-goods.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="goods">
  3. <view class="goods-img">
  4. <image mode="aspectFit" class="wh-full" :src="data.src"></image>
  5. </view>
  6. <view class="right-info">
  7. <view class="good-title">{{data.title}}</view>
  8. <view class="w-full flex-a">
  9. <view class="g-left">
  10. <view class="spec">{{data.spec}}</view>
  11. <view class="price">{{data.price}}</view>
  12. </view>
  13. <view class="g-right">
  14. <slot></slot>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. name:"my-goods",
  23. data() {
  24. return {
  25. };
  26. },
  27. props:{
  28. data:{}
  29. }
  30. }
  31. </script>
  32. <style scoped lang="scss">
  33. .goods{
  34. width: 100%;
  35. display: flex;
  36. align-items: center;
  37. .goods-img{
  38. height: 200rpx;
  39. width: 200rpx;
  40. flex-shrink: 0;
  41. }
  42. .right-info{
  43. width: calc(100% - 200rpx);
  44. box-sizing: border-box;
  45. padding-left: 10rpx;
  46. .good-title{
  47. width: 100%;
  48. text-overflow: ellipsis;
  49. white-space: nowrap;
  50. font-size: $uni-font-size-base;
  51. overflow: hidden;
  52. padding-bottom: 10rpx;
  53. }
  54. .spec{
  55. height: 50rpx;
  56. display: flex;
  57. align-items: center;
  58. width: 200rpx;
  59. border-radius: 25px;
  60. background-color: #EFEFEF;
  61. font-size: $uni-font-size-sm;
  62. margin-bottom: 20rpx;
  63. box-sizing: border-box;
  64. padding: 0 20rpx;
  65. }
  66. }
  67. }
  68. .flex-a{
  69. display: flex;
  70. justify-content: space-between;
  71. }
  72. </style>