普兆健康管家前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
2.6 KiB

  1. <template>
  2. <view class="flex package" @click="jumpToProductDetail(data.id)">
  3. <view class="flex flex-column package-info">
  4. <view class="package-info-title">{{ data.name }}</view>
  5. <!-- todo: check key -->
  6. <!-- <view class="package-info-desc">{{ data.desc }}</view> -->
  7. </view>
  8. <view class="package-detail">
  9. <view class="package-detail-item" v-for="item in data.packages" :key="item.id">
  10. <view class="package-detail-item-img">
  11. <image class="img" :src="getCoverImg(item)" mode="aspectFill"></image>
  12. </view>
  13. <view class="package-detail-item-label">{{ item.titile }}</view>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. data: {
  22. type: Object,
  23. default() {
  24. return {}
  25. }
  26. }
  27. },
  28. methods: {
  29. jumpToProductDetail(id) {
  30. this.$utils.navigateTo(`/pages_order/product/productDetail?id=${id}`)
  31. },
  32. getCoverImg(data) {
  33. const { image } = data
  34. return image?.split(',')?.[0] || ''
  35. },
  36. },
  37. }
  38. </script>
  39. <style scoped lang="scss">
  40. .package {
  41. width: 100%;
  42. padding: 8rpx 8rpx 8rpx 16rpx;
  43. box-sizing: border-box;
  44. background: #FAFAFF;
  45. border: 2rpx solid #FFFFFF;
  46. border-radius: 24rpx;
  47. & + & {
  48. margin-top: 32rpx;
  49. }
  50. &-info {
  51. flex: none;
  52. display: inline-flex;
  53. align-items: flex-start;
  54. width: 200rpx;
  55. font-family: PingFang SC;
  56. line-height: 1.4;
  57. &-title {
  58. font-weight: 600;
  59. font-size: 28rpx;
  60. color: #000000;
  61. }
  62. &-desc {
  63. margin-top: 8rpx;
  64. font-weight: 400;
  65. font-size: 24rpx;
  66. color: #8B8B8B;
  67. }
  68. }
  69. &-detail {
  70. flex: 1;
  71. white-space: nowrap;
  72. overflow-x: auto;
  73. padding: 16rpx;
  74. background-image: linear-gradient(#FAFAFF, #F3F3F3);
  75. border-radius: 16rpx;
  76. &-item {
  77. $size: 120rpx;
  78. & + & {
  79. margin-left: 16rpx;
  80. }
  81. display: inline-block;
  82. width: $size;
  83. &-img {
  84. width: $size;
  85. height: $size;
  86. border: 2rpx solid #E6E6E6;
  87. border-radius: 8rpx;
  88. overflow: hidden;
  89. .img {
  90. width: 100%;
  91. height: 100%;
  92. }
  93. }
  94. &-label {
  95. margin-top: 8rpx;
  96. font-family: PingFang SC;
  97. font-weight: 400;
  98. font-size: 24rpx;
  99. line-height: 1;
  100. color: #8B8B8B;
  101. width: 100%;
  102. text-overflow: ellipsis;
  103. white-space: nowrap;
  104. overflow: hidden;
  105. }
  106. }
  107. }
  108. }
  109. </style>